Today, we pick a network with switches and see step by step how the final tree is formed. Steps will be
- Selecting Root Bridge in the network
- Selecting Root Port for every switch
- Selecting Designated Port for every segment/link
- Selecting Alternate Ports
- Forwarding/Blocking/Tree
Topology
Selecting Root Bridge
We select the Root Bridge that has least (priority.mac address) value. As default priority is 32769 for all switches. Now the switch with least mac address, i.e. Switch A having 0001.439C.7B5E is selected as Root Bridge.
Selecting Root Ports in Every Switch
One of its connected port will be elected as Root Port in a switch. The selecting process will be:
- Lowest Root path cost
- Lowest Sender Bridge ID
- Lowest Sender Port Priority Value
- Lowest port priority value within the switch
Cost of traversing a link depends on the type of physical link used:
- Fast Ethernet 100Mbps costs 19
- Gigabit Ethernet 1000Mbps costs 4
When calculating the cost, we calculate both at the start and the end. Start of the link incurs zero cost. At the end of the link the cost depends on the physical link.
Root Port of Switch B
We can reach Switch B from Root Bridge through
- A.Fa0/1 - B.Fa0/1
- A.Fa0/2 - C.Fa0/2 - C.Ga0/1 - B.Ga0/1
- A.Fa0/3 - C.Fa0/3 - C.Ga0/1 - B.Ga0/1
- A.Fa0/2 - C.Fa0/2 - C.Fa0/4 - D.Fa0/4 - D.Fa0/3 - B.Fa0/3
- A.Fa0/3 - C.Fa0/3 - C.Fa0/4 - D.Fa0/4 - D.Fa0/3 - B.Fa0/3
Have a look at the diagram, we will traverse the path "A.Fa0/3 - C.Fa0/3 - C.Ga0/1 - B.Ga0/1". From A.Fa0/3, as the distance is not covered yet, path cost will be 0. When it reaches C.Fa0/3, as it travelled through fast ethernet link, the cost is 19. At CGa0/1, as it only changed the port within the switch, no additional cost will be incurred. So, at Ga0/1, cost remains unchanged at 19. When reaching B.Ga0/1, we would have crossed a Gigabit Ethernet Link that costs '4'. So, the adding 4 to the cost, the root path cost at B.Ga0/1 will be 23.
Similary, we mark the costs at all the links and choose B.Fa0/1 as Root Port for switch B.
Root Port of Switch C
Root Port of Switch D
Selecting Designated Port for every link/segment
Every link here has 2 points. There may be cases where a hub will be in between and segment will comprise of more than 2 points. Selection process
- Lowest Root path cost
- Lowest Bridge ID
- Lowest Port Priority Value
Here is the diagram with all the root path cost calculated for all segments/links. For every link, we selected Designated port with least root path cost. One exception, B.Ga0/1 - C.Ga0/1 has equal root path cost. As Bridge ID of switch B is lesser, B.Ga0/1 gets chosen as Designated port. Also, observe that all the ports of Root Bridge will be selected as Designated Ports.
Selecting Alternate Port
Any port that is not Root or Designated will become Alternate Port.
Forwarding/Blocking/Tree
All Alternate Ports will be blocked. All Root Ports and Designated Ports will be in forwarding State.
For a link to be active, both ends has to be in forwarding state. If we trace that, final tree will be the result.
Remember, Blocking ports only mean that switch will not pass any data towards that, but BPDUs will be sent and received. This is because if there is any change in topology then the calculation will happen again, and may be one of the blocking ports comes to forward state or vice-versa.
In Cisco Packet Tracer, we make the setup observe the interface and role columns. It will match with the tree diagram.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 | switch-A#show spanning-tree VLAN0001 Spanning tree enabled protocol ieee Root ID Priority 32769 Address 0001.439C.7B5E This bridge is the root Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec Bridge ID Priority 32769 (priority 32768 sys-id-ext 1) Address 0001.439C.7B5E Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec Aging Time 20 Interface Role Sts Cost Prio.Nbr Type ---------------- ---- --- --------- -------- -------------------------------- Fa0/3 Desg FWD 19 128.3 P2p Fa0/1 Desg FWD 19 128.1 P2p Fa0/2 Desg FWD 19 128.2 P2p switch-B#show spanning-tree VLAN0001 Spanning tree enabled protocol ieee Root ID Priority 32769 Address 0001.439C.7B5E Cost 19 Port 1(FastEthernet0/1) Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec Bridge ID Priority 32769 (priority 32768 sys-id-ext 1) Address 000B.BE33.284A Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec Aging Time 20 Interface Role Sts Cost Prio.Nbr Type ---------------- ---- --- --------- -------- -------------------------------- Fa0/3 Desg FWD 19 128.3 P2p Fa0/1 Root FWD 19 128.1 P2p Gi0/1 Desg FWD 4 128.25 P2p switch-C#show spanning-tree VLAN0001 Spanning tree enabled protocol ieee Root ID Priority 32769 Address 0001.439C.7B5E Cost 19 Port 2(FastEthernet0/2) Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec Bridge ID Priority 32769 (priority 32768 sys-id-ext 1) Address 00D0.58CE.8C09 Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec Aging Time 20 Interface Role Sts Cost Prio.Nbr Type ---------------- ---- --- --------- -------- -------------------------------- Fa0/4 Desg FWD 19 128.4 P2p Fa0/2 Root FWD 19 128.2 P2p Fa0/3 Altn BLK 19 128.3 P2p Gi0/1 Altn BLK 4 128.25 P2p switch-D#show spanning-tree VLAN0001 Spanning tree enabled protocol ieee Root ID Priority 32769 Address 0001.439C.7B5E Cost 38 Port 3(FastEthernet0/3) Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec Bridge ID Priority 32769 (priority 32768 sys-id-ext 1) Address 0001.C717.DA66 Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec Aging Time 20 Interface Role Sts Cost Prio.Nbr Type ---------------- ---- --- --------- -------- -------------------------------- Fa0/3 Root FWD 19 128.3 P2p Fa0/4 Altn BLK 19 128.4 P2p |
No comments:
Post a Comment