Socket Programming - Tel Aviv University
Download
Report
Transcript Socket Programming - Tel Aviv University
Introduction to Computer Networks
Spanning Tree
1
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
Port 1
Port 5
B91
Port 2
Port 4
Port 3
81
0
81
41
1
41
19
12
315 3
125 3
41
41
12
13
90
1
111 2
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
Port 1
B5
Port 2
Port 6
Port 4
Port 5
Port 3
1
2
3
4
5
6
B1,
B1,
B1,
B1,
B1,
B1,
11,
B7,Bridge
2
Root
B1
12,
B2, 1
Cost
12
12,
B5,Port
5
Root
1
11,
B17, 5 on Ports 3
Designated
12,
B5, 3 Ports
Blocked
2,4,5,6
12, B4, 3
6
Network Analysis
D
1D
2D
2
3D
R
D
2
2
B3
R
2
R
1
B32
B48
3
D
1D
B15
B11
R
1
3
D1
R
2
1
B76
3
D
R
D
B12
1
B14
2
4
D
2
D
1
D
3
7
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
1D
2D
2
3D
R
D
2
2
B3
R
2
R
1
B32
B48
3
D
1D
B15
B11
R
1
3
D1
D
R2
1
B76
3
D
R
D
1
R
B14
D2
4
D
2
B12
D
1
D
3
10