You are on page 1of 9

Spanning Tree Algorithm- Numerical

Spanning Tree Algorithm


1. Select a root bridge among all the bridges (Bridge ID= 8 bytes).
• root bridge = the lowest bridge ID.
• Bridge ID is 8 bytes long in which 2 bytes (priority) and 6 bytes (MAC)

2. Determine the root port for each bridge except the root bridge
• root port = port with the least-cost path to the root bridge
• In case of ties the root port is one with lowest port ID.

3. Select a designated bridge and port for each LAN


• designated bridge = bridge has least-cost path from the LAN to the root bridge.
• designated port connects the LAN and the designated bridge.
• In case of ties the designated bridge is one with lowest bridge ID

4. All root ports and all designated ports are placed into a “forwarding” state. These are the only
ports that are allowed to forward frames. The other ports are placed into a “blocking” state.
• For the following bridged LAN, assume that LANs 1, 3, and 5 are Gigabit Ethernets
(Cost=15) and the rest are Fast Ethernets (Cost=19). Bridges are labeled with B
followed by their Bridge IDs. Use the LAN costs to determine the least cost path.
a) Write the spanning tree algorithm.
b) Compute and draw the spanning tree and label the root bridge, root ports, and
designated ports.
Solution
Root Bridge
B1
Root Port
B2-P1
B3-P2
B4-P1
B5-P1
B6-P1
B7-P1
Designated Bridges and Ports
L1-B1-P1
L2-B1-P2
L3-B1-P3
L4-B3-P1
L5-B6-P2
L6-B5-P2
Blocked Ports
B2-P2, B4-P2, B5-P3, B7-P2
Given the extended LAN shown below, indicate which ports are not selected by the spanning
tree algorithm. Hint port number is considered to be the cost .
Determine the spanning tree for the switched LAN shown in figure.
• Assume that LANs A, C, E, G and I are Gigabit Ethernets (Cost=15) and
the rest are Fast Ethernets (Cost=19).
• Switch ID is selected based on priority. If the priority is same for the
switches, then MAC address (represented in hexadecimal) of the
switch is to be considered to determine its ID.
• Use the LAN costs to determine the least cost path.
• Numerical values 1, 2, 3, etc. indicate the port number of each switch.

You might also like