bridges. Spanning tree

Introduction to Computer
Networks
CMPE 150
Fall 2005
Lecture 19
CMPE 150- Introduction to Computer Networks
1
Announcements
• Homework 3 due today.
• Lab this week:
– Layer 2.
– Ethernet.
• Holiday this Friday (11.11).
• Monday, 11.14 class meets in E2 room 506.
CMPE 150- Introduction to Computer Networks
2
Today
• Data layer switching.
CMPE 150- Introduction to Computer Networks
3
LAN Interconnection
•
•
•
•
Extend range of LAN.
Support more users.
Security and robustness.
Heterogeneity.
Switch
Hub
CMPE 150- Introduction to Computer Networks
4
LAN Interconnection: Example
• Multiple LANs connected by a backbone.
CMPE 150- Introduction to Computer Networks
5
Bridges
• Connect LANs.
• Operate at the DLL.
– Route based on DLL addresses.
• Routers route based on layer 3 addresses.
• Distinction between bridges, switches, and
routers gets fuzzier as technology advances.
CMPE 150- Introduction to Computer Networks
6
Repeaters and Bridges
• Repeaters:
– Extend scope of LANs.
– Serve as amplifiers.
– No storage/routing capabilities.
• Bridges:
– Also extend scope of LANs.
– Routing/storage capabilities.
CMPE 150- Introduction to Computer Networks
7
More on Bridges
• Have multiple interfaces, 1 per LAN.
• Use destination address to forward unicast
frames; if destination is on the same LAN,
drops frame; otherwise forwards it.
• Forward all broadcast frames.
• Have storage and routing capability.
CMPE 150- Introduction to Computer Networks
8
More on Bridges
• No additional encapsulation.
• But they may have to do header conversion if
interconnecting different LANs (e.g., 802.3 to
802.4 frame).
• May interconnect more than 2 LANs.
• LANs may be interconnected by more than 1
bridge.
CMPE 150- Introduction to Computer Networks
9
Interconnecting Different LANs
CMPE 150- Introduction to Computer Networks
10
Bridges from 802.x to 802.y
• Operation of a LAN bridge from 802.11 to 802.3.
CMPE 150- Introduction to Computer Networks
11
Interconnecting Different LANs
• Conversion between different frame formats.
– E.g., different frame lengths.
• Speed mismatch.
– Buffering.
• Security.
– Different security services provided by
different DLLs/MACs.
• QoS?
CMPE 150- Introduction to Computer Networks
12
Routing
• Determining where to send frame so that it
reaches the destination.
• Routing by learning: adaptive or backward
learning.
CMPE 150- Introduction to Computer Networks
13
Routing with Bridges
• Bridge decides to relay frame based on
destination MAC address.
• If only 2 LANs, decision is simple.
• If more complex topologies, routing is needed,
i.e., frame may traverse more than 1 bridge.
CMPE 150- Introduction to Computer Networks
14
Routing with Bridges
LAN A
1
LAN B
4
5
8
CMPE 150- Introduction to Computer Networks
B
Frames for
5->8.
Frames for
1->4
15
Routing with Bridges (Cont’d)
• Listens to all frames on LAN A and accepts those
addressed to stations on LAN B.
• Retransmits frames onto B.
• Does the same for B-to-A traffic.
CMPE 150- Introduction to Computer Networks
16
Transparent Bridges
• Plug them in and they work!
• How do they work?
– Promiscuous mode operation.
– Upon receiving frame, decide whether to
forward it or not.
– Routing table mapping destination addresses
to outgoing interface.
CMPE 150- Introduction to Computer Networks
17
Local Internetworking
Example: 4 LANs and 2 bridges.
A LAN1
B LAN1
C LAN2
…
. In promiscuous mode, bridge accepts every incoming frame.
. Decides to forward or discard frame.
.
CMPE 150- Introduction to Computer Networks
18
Backward Learning
• Routing algorithm used by transparent
bridges.
• When a bridge starts, its routing table is
empty.
– So, it floods: every incoming frame is
forwarded in all outgoing interfaces, except the
one the frame was received.
– In promiscuous mode, bridge sees all frames.
– They look at the frame’s source and
“remember” which LAN it came from.
– Entries are timestamped and expire after a
certain interval.
• Allows for topology changes.
CMPE 150- Introduction to Computer Networks
19
Backward Learning (Cont’d)
• If source LAN = destination LAN, discard
frame.
• If source LAN <>destination LAN, forward
frame.
– If destination LAN unknown, flood frame.
CMPE 150- Introduction to Computer Networks
20
Loops
• Sometimes, more than 1 bridge interconnect
2 LANs.
• Topology loops are introduced.
CMPE 150- Introduction to Computer Networks
21
Loops: Example
• Alternate routes: loops.
• Example:
–
–
–
–
1
2
LAN A
LAN A, bridge 101,
LAN B, bridge 104,
LAN E, bridge 107,
LAN A.
101
LAN B
107
103
104
E
4
CMPE 150- Introduction to Computer Networks
5
22
Loop: Problems
B
LAN 1
B1
B2
LAN 2
A
1. Station A sends frame to B; bridges B1 and B2 don’t know B.
2. B1 copies frame onto LAN1; B2 does the same.
3. B2 sees B1’s frame to unknown destination and copies it onto LAN 2.
4. B1 sees B2’s frame and does the same.
5. This can go on forever.
CMPE 150- Introduction to Computer Networks
23
Loop Resolution
• Goal: remove “extra” paths by removing “extra”
bridges.
• Spanning tree:
– Given graph G(V,E), there exists a tree that spans all
nodes where there is only one path between any pair of
nodes, i.e., NO loops.
– LANs are represented by nodes and bridges by edges.
CMPE 150- Introduction to Computer Networks
24
Definitions (1)
• Bridge ID: unique number (e.g., MAC address
+ integer) assigned to each bridge.
• Root: bridge with smallest ID.
• Cost: associated with each interface; specifies
cost of transmitting frame through that interface.
• Root port: interface to minimum-cost path to
root.
CMPE 150- Introduction to Computer Networks
25
Definitions (2)
• Root path cost: cost of path to root bridge.
• Designated bridge: on any LAN, bridge closest
to root, i.e., the one with minimum root path
cost.
CMPE 150- Introduction to Computer Networks
26
Spanning Tree Algorithm (1)
1. Determine root bridge.
2. Determine root port on all bridges.
3. Determine designated bridges.
CMPE 150- Introduction to Computer Networks
27
Spanning Tree Algorithm (2)
• Initially all bridges assume they are the
root and broadcast message with its ID,
root path cost.
• Eventually, lowest-ID bridge will be known
to everyone and will become root.
• Root bridge periodically broadcasts it’s the
root.
CMPE 150- Introduction to Computer Networks
28
Spanning Tree Algorithm (3)
• Directly connected bridges update their cost to
root and broadcast message on other LANs
they are attached.
• This is propagated throughout network.
• On any (non-directly connected) LAN, bridge
closest to root becomes designated bridge.
CMPE 150- Introduction to Computer Networks
29
Spanning Tree: Example
LAN 2
LAN 2
10
10
B3
10
B1
10
5
LAN 3
5
B4
5
LAN 5
5
B5
5
LAN 1
10
5
B2
LAN 4
CMPE 150- Introduction to Computer Networks
10
10
B3
10
B1
10
5
LAN 3
5
B4
5
LAN 5
5
B5
5
LAN 1
10
5
B2
LAN 4
30
Spanning Tree: Example
B1
. Only designated bridges
on each LAN allowed to
forward frames.
LAN 2
LAN 1
B4
B3
. Bridges continue
exchanging info to react
to topology changes.
B5
LAN 5
B2
LAN 3
LAN 4
CMPE 150- Introduction to Computer Networks
31
Remote Bridges
• Remote bridges can be used to interconnect distant
32
LANs.
CMPE 150- Introduction to Computer Networks