Bridges and LAN Switches 5192021 CSECE 438 UIUC
Bridges and LAN Switches 5/19/2021 CS/ECE 438 - UIUC, Fall 2006 1
Ethernet Backoff revisited n n n After N collisions, pick a number k between 0 and 2 N-1 Wait for k*51. 2 us Send frame if no one has started using the channel 5/19/2021 CS/ECE 438 - UIUC, Fall 2006 2
Repeated Collisions n n Suppose A, B, and C each have a frame to send, causing a collision A picks k=0, B and C pick k=1 ¡ n A wins, sends frame After A is done, B and C both try to send again ¡ ¡ 5/19/2021 Collision again Increase collision counter CS/ECE 438 - UIUC, Fall 2006 3
Capture Effect n A and B collide ¡ ¡ n Suppose A has another frame to send ¡ ¡ ¡ n A picks 0, B picks 1 A wins, transmits frame A and B collide again A’s collision counter is 1, pick k from 0, 1 B’s collision counter is 2, pick k from 0, 1, 2, 3 A is likely to win again ¡ 5/19/2021 And keep winning! CS/ECE 438 - UIUC, Fall 2006 4
Bridges: Building Extended LAN’s n Traditional LAN ¡ ¡ ¡ n Shared medium (e. g. , Ethernet) Cheap, easy to administer Supports broadcast traffic Problem ¡ Scale LAN concept n n ¡ n Larger geographic area (> O(1 km)) More hosts (> O(100)) But retain LAN-like functionality Solution ¡ 5/19/2021 bridges CS/ECE 438 - UIUC, Fall 2006 5
Bridges n Problem ¡ LANs have physical limitations n n Ethernet – 1500 m Solution ¡ Connect two or more LANs with a bridge n n ¡ 5/19/2021 Accept and forward Level 2 connection (no extra packet header) A collection of LANs connected by bridges is called an extended LAN CS/ECE 438 - UIUC, Fall 2006 6
Bridges vs. Switches n Switch ¡ ¡ ¡ n Receive frame on input port Translate address to output port Forward frame Bridge ¡ ¡ ¡ Connect shared media All ports bidirectional Repeat subset of traffic n n 5/19/2021 Receive frame on one port Send on all other ports CS/ECE 438 - UIUC, Fall 2006 7
Uses and Limitations of Bridges n Bridges ¡ ¡ extend LAN concept Limited scalability n n ¡ Not heterogeneous n n 5/19/2021 to O(1, 000) hosts not to global networks some use of address, but no translation between frame formats CS/ECE 438 - UIUC, Fall 2006 8
Bridges with Loops n Problem ¡ If there is a loop in the extended LAN, a packet could circulate forever n n Side question: Are loops good or bad? Solution ¡ ¡ 5/19/2021 Select which bridges should actively forward Create a spanning tree to eliminate unnecessary edges Adds robustness Complicates learning/forwarding CS/ECE 438 - UIUC, Fall 2006 9
Example Extended LAN with LOOPS A B B 9 B 7 B 5 C F D K B 2 B 1 J E G H B B 4 I 5/19/2021 CS/ECE 438 - UIUC, Fall 2006 10
Spanning Tree Algorithm n View extended LAN as bipartite graph ¡ ¡ ¡ n LAN’s are graph nodes Bridges are also graph nodes Ports are edges connecting LAN’s to bridges Spanning tree required ¡ ¡ 5/19/2021 Connect all LAN’s Can leave out bridges CS/ECE 438 - UIUC, Fall 2006 11
Defining a Spanning Tree n Basic Rules ¡ ¡ Bridge with the lowest ID is the root For a given bridge n ¡ For a given LAN n n ¡ 5/19/2021 A port in the direction of the root bridge is the root port The bridge closest to the root (or the bridge with the lowest ID to break ties) is the designated bridge for a LAN The corresponding port is the designated port Bridges with no designated ports and ports that are neither a root port nor a designated port are not part of the tree. CS/ECE 438 - UIUC, Fall 2006 12
Spanning Tree Algorithm Root A B 9 D– designated C port R– root port B D D R B 2 D F D R D K B 1 R D J D G R B H D R B 4 D D I 5/19/2021 B 7 B 5 D E D CS/ECE 438 - UIUC, Fall 2006 13
Using a Spanning Tree: Forwarding n Forwarding ¡ Each bridge forwards frames over each LAN for which it is the designated bridge or connected by a root port A B B 7 B 5 C B 2 E F D K B 1 J G H B 4 I 5/19/2021 CS/ECE 438 - UIUC, Fall 2006 14
Finding the Tree by a distributed Algorithm n Bridges run a distributed spanning tree algorithm ¡ n n Select when bridges should actively forward frames Developed by Radia Perlman at DEC Now IEEE 802. 1 specification 5/19/2021 CS/ECE 438 - UIUC, Fall 2006 16
Distributed Spanning Tree Algorithm n Bridges exchange configuration messages ¡ (Y, d, X) n n n Y = root node d = distance to root node X = originating node Each bridge records current best configuration message for each port Initially, each bridge believes it is the root When a bridge discovers it is not the root, stop generating messages 5/19/2021 CS/ECE 438 - UIUC, Fall 2006 17
Distributed Spanning Tree Algorithm n Bridges forward configuration messages ¡ ¡ n Bridge assumes ¡ ¡ n Outward from root bridge i. e. , on all designated ports It is designated bridge for a LAN Until it learns otherwise Steady State ¡ ¡ 5/19/2021 root periodically send configuration messages A timeout is used to restart the algorithm CS/ECE 438 - UIUC, Fall 2006 18
Spanning Tree Algorithm n Example at bridge B 3 1. B 3 receives (B 2, 0, B 2) Since 2 < 3, B 3 accepts B 2 as root A B 3 adds one to the distance advertised by B 2 and sends C (B 2, 1, B 3) B 2 accepts B 1 as root and sends (B 1, 1, B 2) E G B 5 accepts B 1 as root and sends (B 1, 1, B 5) I B 3 accepts B 1 as root and stops forwarding 2. 3. 4. 5. 6. 5/19/2021 CS/ECE 438 - UIUC, Fall 2006 B B 7 B 5 F D K B 1 J H B 4 19
Bridges: Limitations n Does not scale ¡ ¡ n Spanning tree algorithm scales linearly Broadcast does not scale Virtual LANs (VLAN) ¡ ¡ 5/19/2021 An extended LAN that is partitioned into several networks Each network appears separate Limits effect of broadcast Simple to change virtual topology CS/ECE 438 - UIUC, Fall 2006 20
Bridges: Limitations n Does not accommodate heterogeneity ¡ Networks must have the same address format n n e. g. Ethernet-to-Ethernet Caution ¡ Beware of transparency n May break assumptions of the point-to-point protocols ¡ ¡ ¡ n 5/19/2021 Frames may get dropped Variable latency Reordering Bridges happen! CS/ECE 438 - UIUC, Fall 2006 21
Switch n Link layer device ¡ ¡ ¡ n transparent ¡ n stores and forwards Ethernet frames examines frame header and selectively forwards frame based on MAC dest address when frame is to be forwarded on segment, uses CSMA/CD to access segment hosts are unaware of presence of switches plug-and-play, self-learning ¡ 5/19/2021 switches do not need to be configured CS/ECE 438 - UIUC, Fall 2006 22
Forwarding switch 1 2 hub 3 hub • How do determine onto which LAN segment to forward frame? • Looks like a routing problem. . . 5/19/2021 CS/ECE 438 - UIUC, Fall 2006 23
Self learning n n A switch has a switch table entry in switch table: ¡ ¡ n (MAC Address, Interface, Time Stamp) stale entries in table dropped (TTL can be 60 min) switch learns which hosts can be reached through which interfaces ¡ ¡ 5/19/2021 when frame received, switch “learns” location of sender: incoming LAN segment records sender/location pair in switch table CS/ECE 438 - UIUC, Fall 2006 24
Filtering/Forwarding n When switch receives a frame: index switch table using MAC dest address if entry found for destination then { if dest on segment from which frame arrived then drop the frame else forward the frame on interface indicated } else flood forward on all but the interface on which the frame arrived 5/19/2021 CS/ECE 438 - UIUC, Fall 2006 25
Switch example Suppose C sends frame to D 1 I C F D E G H Switch receives frame from C ¡ ¡ n hub hub B n A B E G 3 2 A address interface switch notes in bridge table that C is on interface 1 because D is not in table, switch forwards frame into interfaces 2 and 3 frame received by D 1 1 2 3
Switch example Suppose D replies back with frame to C. address interface switch I B n C D E F G H Switch receives frame from D ¡ ¡ n hub hub A A B E G C notes in bridge table that D is on interface 2 because C is in table, switch forwards frame only to interface 1 frame received by C 1 1 2 3 1
Switch: traffic isolation n switch installation breaks subnet into LAN segments n switch filters packets: ¡ same-LAN-segment frames not usually forwarded onto other LAN segments ¡ segments become separate collision domains switch collision domain hub
Switches: dedicated access A n n n Switch with many interfaces Hosts have direct connection to switch No collisions; full duplex C’ B switch C Switching: A-to-A’ and B-to -B’ simultaneously, no collisions 5/19/2021 CS/ECE 438 - UIUC, Fall 2006 B’ A’ 29
More on Switches n n cut-through switching: frame forwarded from input to output port without first collecting entire frame ¡ slight reduction in latency combinations of shared/dedicated, 10/1000 Mbps interfaces 5/19/2021 CS/ECE 438 - UIUC, Fall 2006 30
Institutional network mail server to external network web server router switch IP subnet hub 5/19/2021 hub CS/ECE 438 - UIUC, Fall 2006 hub 31
Switches vs. Routers n both store-and-forward devices ¡ ¡ n n routers: network layer devices (examine network layer headers) switches are link layer devices routers maintain routing tables, implement routing algorithms switches maintain switch tables, implement filtering, learning algorithms 5/19/2021 CS/ECE 438 - UIUC, Fall 2006 32
Summary comparison Traffic isolation Plug and play Optimal Routing Cutthrough 5/19/2021 Bridges Switches Routers No Yes Yes No No No Yes Yes* No CS/ECE 438 - UIUC, Fall 2006 33
- Slides: 32