100 likes | 211 Views
Introduction to Computer Networks. Spanning Tree. Forming a Spanning Tree. Bridges transmit special messages (called configuration message) to each other. A bridge will be elected as the root bridge .
E N D
Introduction to Computer Networks Spanning Tree
Forming a Spanning Tree • Bridges transmit special messages (called configuration message) to each other. • A bridge will be elected as the root bridge. • Every bridge calculates the distance of the shortest path from itself to the root bridge. • For each LAN, select a designated bridge among the bridges residing on the LAN. • For each bridge, choose a port (root port) that lead to the root bridge. • Ports to be included in a spanning tree are the root ports and the ports on which self has been elected as designated bridge. 2
Forming a Spanning Tree • A configuration message is transmitted by a bridge onto a port. • Received by all the other bridges on the LAN attached to the port. • It is not forwarded outside the LAN. • Contents: • Root ID: ID of the bridge assumed to be the root. • Bridge ID: ID of the bridge transmitting this configuration message. • Cost: Cost of the shortest path from the transmitting bridge to the root bridge. • Port ID: ID of the port from which the configuration message is transmitted. 3
Forming a Spanning Tree - Rules • Comparing 2 configuration messages: C1 & C2 • C1 is better than C2 if the root ID in C1 is lower than that in C2. • If the root IDs are equal • C1 is better than C2 if the cost in C1 is lower than that in C2. • If the root ID and cost are equal • C1 is better than C2 if its transmitting ID is lower than that in C2. • If the root ID, cost, and transmitting IDs are equal • C1 is better than C2 if its port ID is lower than that in C2. 4
Forming a Spanning Tree - Example 41 41 41 41 13 12 12 19 125 315 111 90 2 3 1 3 81 0 81 1 B91 Port 1 Port 5 Port 2 Port 4 Port 3 • Best known root – 41 (Root ID) • Cost – 12+1 = 13 (Lowest cost) • Root Port - 4 (Transmitting ID) • Designated Bridge on Ports 1 (root bridge) & 2 (cost) • Blocked Ports 3 & 5 (already connected to root) 5
Spanning Tree - Example B5 Port 1 Port 6 Port 5 Port 2 Port 4 Port 3 • B1, 11, B7, 2 • B1, 12, B2, 1 • B1, 12, B5, 5 • B1, 11, B17, 5 • B1, 12, B5, 3 • B1, 12, B4, 3 Root Bridge Cost Root Port Designated on Ports Blocked Ports B1 12 1 3 2,4,5,6 6
Network Analysis D 1 D D 1 1 D B15 2 B11 B3 R 2 2 D R 3 D R 1 R 2 2 B32 2 B48 R 3 D B12 D 3 1 D 1 R B14 2 D 1 D 1 B76 3 2 3 D 4 7 D
Cache & Topology Changes • Bridges learn and cache the location of hosts. • A host may move / disappear • Important for a bridge to “forget” host locations • Unless frequently reassured that information is correct. • Done by timing out entries not been recently verified. • Timeout • Too long - traffic may not be delivered to the host at the new place. • Too short - wastes a lot of network bandwidth • Solution • A long value (e.g., 15 seconds) - used in the usual case, to reduce wasted network bandwidth. • A shorter value (e.g., forward delay) - used following a reconfiguration of the spanning tree algorithm 8
Cache & Topology Changes • A bridge that detects a topology change will send a message to its parent. • This message will in turn be forwarded to the root bridge. • The root bridge set the topology change flag bit in its configuration messages • Sent (every hello time) downstream the spanning tree. • For a period that is forward delay + max age. • The bridges that receive this type of messages use the shorter timeout value for their caches • Until the flag is no longer set. 9
Network Analysis – Topology Change D R 1 2 3 D D 1 D D B15 1 1 D 2 B11 B3 2 R 2 D R 3 R 2 B32 2 B48 R B12 D R 3 1 D D 1 R B14 2 D 1 D 1 B76 3 D 2 3 D 4 10 D