08 Learning Bridges & Spanning Tree Algorithm
08 Learning Bridges & Spanning Tree Algorithm
Unit -2
Learning Bridges & Spanning Tree Algorithm
Just Above the Data Link Layer
Application
• Bridging
Presentation • How do we connect LANs?
Session • Function:
Transport • Route packets between LANs
Repeater
Tee Connector
4
C C
Learning Bridges & Spanning Tree Algorithm
Bridging the LANs
Hub
Hub
Bridge Hub
Inputs Outputs
Switch
Fabric
Makes
Memory routing
buffer
•decisions
Bridges have memory buffers to queue packets
• Bridge is intelligent, only forwards packets to the correct
output 6
3. • Complete transparency
Spanning Tree Algorithm (to handle loops)
• “Plug-and-play,” self-configuring
• No hardware of software changes on hosts/hubs
• Should not impact existing LAN operations
Hub
7
Learning Bridges & Spanning Tree Algorithm
Frame Forwarding Tables
8
Learning Bridges & Spanning Tree Algorithm
Frame Forwarding in Action
Port 1
Port 4 Port 2
Port 3
• Assume a frame arrives on port 1
• If the destination MAC address is in the forwarding table,
send the frame on the correct output port
• If the destination MAC isn’t in the forwarding table, 9
Port 1 Port 2
10
Hub 00:00:00:00:00:BB
Learning Bridges & Spanning Tree Algorithm
Complicated Learning Example
Bridge 1 Bridge 2
AA 1 AA 1
CC 2 CC 1
EE 2 EE 2
• <Src=AA, Dest=FF>
• <Src=CC, Dest=AA> Port 1 Port 2 Port 1 Port 2
• <Src=EE, Dest=CC>
Hub Hub Hub
11
AA BB CC DD EE FF
Learning Bridges & Spanning Tree Algorithm
The Danger of Loops
• <Src=AA, Dest=DD> CC DD
• This continues to infinity
• How do we stop this?
12
AA BB
Learning Bridges & Spanning Tree Algorithm
Spanning Tree Definition
• A subset of edges in a graph that:
• Span all nodes
• Do not create any cycles
1 2 3 4 6 2
5 3
4 1
6 7 13 7
Learning Bridges & Spanning Tree Algorithm
802.1 Spanning Tree Approach
14
Learning Bridges & Spanning Tree Algorithm
Definitions
• Bridge ID (BID) = <Random Number>
• Root Bridge: bridge with the lowest BID in the tree
• Path Cost: cost (in hops) from a transmitting bridge to the
root
• Each port on a bridge has a unique Port ID
• Root Port: port that forwards to the root on each bridge
• Designated Bridge: the bridge on a LAN that provides the
minimal cost path to the root
• The designated bridge on each LAN is unique
15
Learning Bridges & Spanning Tree Algorithm
Determining the Root
16
Learning Bridges & Spanning Tree Algorithm
Comparing BPDUs
BPDU1 BPDU2
R1 Cost1 B1 R2 Cost2 B2
17
Learning Bridges & Spanning Tree Algorithm
Spanning Tree Construction
0: 0/0 12:
12:12/0
0/1 3: 0/2
3/0
27: 27/0
27: 0/1 41: 3/1
41:41/0
0/2
3/2
9: 0/3
9/0 68: 3/2
9/1
68:68/0
0/3
18
Learning Bridges & Spanning Tree Algorithm
Bridges vs. Switches
19
Learning Bridges & Spanning Tree Algorithm
Switching the Internet
• Capabilities of switches:
• Network-wide routing based on MAC addresses
• Learn routes to new hosts automatically
• Resolve loops
NO
20
Learning Bridges & Spanning Tree Algorithm
Limitations of MAC Routing
• Inefficient
• Flooding packets to locate unknown hosts
• Poor Performance
• Spanning tree does not balance load
• Hot spots