Switching and Forwarding Bridges and LAN Switches Cell Switching Switching Hardware

Spring 2019 © CS 438 Staff, University of Illinois 1 Where are We?

n Directly connected networks ¡ Point-to-point connectivity n Limitations ¡ Number of hosts ¡ Geographic area n Next Goal ¡ Communication between hosts that are not directly connected

Spring 2019 © CS 438 Staff, University of Illinois 2 Next Topic: Switching n Motivation ¡ Why not just one direct link network? n Basic approach ¡ How can we extend the direct link abstraction? n Challenges ¡ What problems must we address? n Examples ¡ Where are these issues addressed in real networks? n Details of the switch ¡ What are the goals in design? How are these goals typically addressed?

Spring 2019 © CS 438 Staff, University of Illinois 3 After Switching n Heterogeneity ¡ Switching allows multiple physical networks ¡ But assumes one switching strategy n Scale ¡ Direct link networks: O(100) hosts ¡ Packet-switched networks: O(100,000) hosts n Beyond the basics ¡ Quality of service ¡ Congestion and performance analysis ¡ Network trends and their importance

Spring 2019 © CS 438 Staff, University of Illinois 4 How can many hosts communicate? n Best: use one direct link network n Naïve approach: full mesh n Problem: doesn't scale

Spring 2019 © CS 438 Staff, University of Illinois 5 How can many hosts communicate?

n Slightly better solution: shared media n But, how to deal with larger networks (more hosts, larger geographic area)? n How to deal with heterogeneous media? (different physical/MAC technologies?

Spring 2019 © CS 438 Staff, University of Illinois 6 Real Solution: Switching

n Most basic function: allow communication between arbitrary endpoints

¡ Provide illusion of one (reliable) physical network ¡ On demand rather than connecting all pairs in advance

¡ Share infrastructure across users (statistical multiplexing)

Spring 2019 © CS 438 Staff, University of Illinois 7 Real Solution: Switching

Telephone operator at Aberdeen proving grounds, ~1940 Telephone exchange in 1893

Spring 2019 © CS 438 Staff, University of Illinois 8 Real Solution: Switching

n Computer networks: more critical benefits

¡ Translates between different link technologies, allowing heterogeneity

¡ Isolates different physical networks to improve scalability and modularity

Spring 2019 © CS 438 Staff, University of Illinois 9 Switches

n Build network from stars

Spring 2019 © CS 438 Staff, University of Illinois 10 Challenges

New York Which way should they go? Boston

first challenge: forwarding

Spring 2019 © CS 438 Staff, University of Illinois 11 Challenges

bookstore host (books.com)

coffee shop (chat server) host second challenge: How do we maintain routing forwarding information?

Spring 2019 © CS 438 Staff, University of Illinois 12 Challenges

New York Who goes first?

Boston

third challenge: contention

Spring 2019 © CS 438 Staff, University of Illinois 13 Challenges n Efficient forwarding ¡ Switch with several output ports ¡ Decide which output port to use n Routing in dynamic network ¡ Need information for forwarding ¡ Construct and maintain the information n Handling contention ¡ Multiple packets destined for one output port ¡ Decide which packet goes first ¡ Decide what to do with others

Spring 2019 © CS 438 Staff, University of Illinois 14 Network Layers and Switches

Application Application Host Presentation Presentation

Session Session

Transport Switch Transport

Network Network Network

Data Link Data Link Data Link

Physical Physical Physical

Spring 2019 © CS 438 Staff, University of Illinois 15 Network Layers and Switches

switch between different physical layers

Switch Switch

Network Network

Data Link A Data Link B

Physical A Physical B

Spring 2019 © CS 438 Staff, University of Illinois 16 Switching task: Translate betw. lower-layer technologies

Router

Network

Data Link A Data Link B

Physical A Physical B

Ethernet802.11 IP TCP interface #1 data interface #2 Header header header( 802.11) (wired ethernet)

Spring 2019 © CS 438 Staff, University of Illinois 17 Switching and Forwarding n Switch

¡ A switch forwards packets from input ports to output ports n Port selection is based on the destination address in the packet header ¡ Advantages n Can build networks that cover large geographic areas n Can build networks that support large numbers of hosts n Can add new hosts without affecting the performance of existing hosts T3 T3 Input T1 Switch T1 Output Ports STS-1 STS-1 Ports

Spring 2019 © CS 438 Staff, University of Illinois 18 /switch Architecture

Update 12.0.0.0/8 Protocol daemon

RIB 12.0.0.0/8 à IF 1

FIB 12.0.0.0/8 à IF 1

IF 1 IF 3 12.10.2.3 Data packet IF 2 IF 4 Spring 2019 Interconnection© CS 438 Staff, University network of Illinois 19 Switching and Forwarding n Forwarding ¡ The task of specifying an appropriate output port for a packet n Datagram n Virtual Circuit Switching n Source Routing ¡ Each packet contains enough information for a switch to determine the correct output port ¡ Later n Building forwarding tables – routing.

Packet Header

Output Port Specification

Spring 2019 © CS 438 Staff, University of Illinois 20 Forwarding

n Packet switching

¡ Data traffic divided into packets n Each packet contains its own header (with address) n Packets sent separately through the network

¡ Destination reconstructs the message ¡ Example: sending a letter through the postal system n Circuit switching ¡ Source first establishes a connection to the destination n Each router on the path may reserve bandwidth ¡ Source sends data over the connection n No destination address, since routers know the path ¡ Source tears down connection when done ¡ Example: making a phone call on the telephone network

Spring 2019 © CS 438 Staff, University of Illinois 21 Forwarding with Datagrams Destination is E, so I should forward out E DATA interface #2 Host Host A B

0 0 0 Host 3 a 1 3 b 1 3 g 1 Host G C 2 2 2

0 Host D Host 3 d 1 Host F E Destination is E, so I should 2 Destination is E, forward out so I should interface #1 forward out Spring 2019 © CS 438 Staff, University of Illinois interface #1 22 Forwarding with Datagrams

n Connectionless ¡ Each packet travels independently n Switch ¡ Translates global address to output port ¡ Maintains table of translations n Used in traditional data networks ¡ i.e.,

Spring 2019 © CS 438 Staff, University of Illinois 23 Forwarding Table

Each switch maintains as Table bs Table gs Table ds Table

a forwarding table that A 0 A 3 A 3 A 0 translates a host name B 1 B 0 B 3 B 0 to an output port C 1 C 1 C 1 C 0

A B D 1 D 1 D 2 D 0 0 0 0 3 1 3 1 3 1 G a b g C E 1 E 2 E 3 E 1 2 2 2 0 F 1 F 2 F 3 F 3 3 1 D F d E G 3 G 3 G 3 G 0 2

Spring 2019 © CS 438 Staff, University of Illinois 24 Forwarding Table

Each switch maintains as Table bs Table gs Table ds Table

a forwarding table that A 0 A 3 A 3 A 0 translates a host name B 1 B 0 B 3 B 0 to an output port C 1 C 1 C 1 C 0 E DATA A B D 1 D 1 D 2 D 0 0 0 0 3 1 3 1 3 1 G a b g C E 1 E 2 E 3 E 1 2 2 2 0 F 1 F 2 F 3 F 3 3 1 D F d E G 3 G 3 G 3 G 0 2

Spring 2019 © CS 438 Staff, University of Illinois 25 Forwarding with Datagrams

A ® E A B A sends: E DATA 0 0 0 3 1 3 1 3 1 G a b g C C ® F 2 2 2 C sends: F DATA 0 3 1 D F d E B ® E 2 B sends: E DATA F ® G What happens to the F sends: G DATA last packet? A ® H A sends: H DATA

Spring 2019 © CS 438 Staff, University of Illinois 26 Forwarding with Datagrams n Analogous to following signs n Advantages ¡ Can send packets immediately

¡ All necessary information in packet header

¡ Can route around failures dynamically n Disadvantages

¡ Header requires full unique address

¡ Might not be possible to deliver packet ¡ Successive packets may not follow the same route

¡ Global address to path translations requires significant storage Spring 2019 © CS 438 Staff, University of Illinois 27 Forwarding

n Packet switching

¡ Data traffic divided into packets n Each packet contains its own header (with address) n Packets sent separately through the network

¡ Destination reconstructs the message ¡ Example: sending a letter through the postal system n Circuit switching ¡ Source first establishes a connection to the destination n Each router on the path may reserve bandwidth ¡ Source sends data over the connection n No destination address, since routers know the path ¡ Source tears down connection when done ¡ Example: making a phone call on the telephone network

Spring 2019 © CS 438 Staff, University of Illinois 28 Forwarding with Circuit Switching Data from Circuit establishment interface #3 Only for A Þ E should be sent to interface #2 Host Host A B

0 0 0 Host 3 a 1 3 b 1 3 g 1 Host G C 2 2 2

0 Host D Host 3 d 1 Host F E Data from interface #0 2 Data from should be sent to interface #0 interface #1 should be sent to Spring 2019 © CS 438 Staff, University of Illinois interface #1 29 Forwarding with Virtual Circuits n Connection oriented ¡ Requires explicit setup and teardown ¡ Packets follow established route n Why support connections in a network? ¡ Useful for service notions ¡ Important for telephony

Spring 2019 © CS 438 Staff, University of Illinois 30 Virtual Circuits: The Circuit n Logical circuit between source and destination

¡ Packets from different VCs multiplex on a link

¡ Used in ATM, MPLS, Intserv

Link #14 Link #7 Link #8

Spring 2019 © CS 438 Staff, University of Illinois 31 Virtual Circuits: The Circuit

n Identified by Virtual Circuit Identifier (VCI)

¡ Source setup: establish path for each VC

¡ Switch: mapping VCI to outgoing link ¡ Packet: fixed-length label in packet header

1:7 1:14 2:7 2:8

VC ID 1 Link #14 Link #7 VC ID 2 Link #8

Spring 2019 © CS 438 Staff, University of Illinois 32 Forwarding with Virtual Circuits

Virtual circuit 12 DATA establishment 12:2 Host Host A B

0 0 0 Host 3 a 1 3 b 1 3 g 1 Host G C 2 2 2

0 Host D 12:1 Host 3 d 1 Host F E 2 12:1 Spring 2019 © CS 438 Staff, University of Illinois 33 Virtual Circuits: Label Swapping

n Problem: using VCI along the whole path

¡ Each virtual circuit consumes a unique ID

¡ Starts to use up all of the ID space in the network

1:7 1:14 2:7 2:8

VC ID 1 Link #14 Link #7 VC ID 2 Link #8

Spring 2019 © CS 438 Staff, University of Illinois 34 Virtual Circuits: Label Swapping

n Solution: Label swapping / label switching (used, e.g., in MPLS)

¡ Map the VCI to a new value at each hop n Table has old ID, next link, and new ID

¡ Allows reuse of IDs at different links

1:7:20 20:14:78 2:7:53 53:8:42

VC ID 1 Link #14 Link #7 VC ID 2 Link #8

Spring 2019 © CS 438 Staff, University of Illinois 35 Forwarding with Virtual Circuits n Set up ¡ A virtual circuit identifier (VCI) is assigned to the circuit for each link it traverses ¡ VCI is locally significant ¡ uniquely identifies VC ¡ Set up is the job of a signaling protocol n Switched Virtual Circuits (SVC) n Or static permanent configuration (less common): Permanent Virtual Circuits (PVC) n Switch ¡ Maintains a translation table from to

Spring 2019 © CS 438 Staff, University of Illinois 36 Forwarding with Virtual Circuits n A simple example setup protocol ¡ Each host and switch maintains per-link local variable for VCI assignment ¡ When setup frame leaves host/switch n Assign outgoing VCI n Increment assignment counter ¡ Port and circuit id combination is unique ¡ Switches maintain translation table from n incoming port/VCI pair to n outgoing port/VCI pair

Spring 2019 © CS 438 Staff, University of Illinois 37 Forwarding with Virtual Circuits

n Assumptions ¡ Circuits are simplex n On a duplex link, the same VCI can be used for two circuits, one in each direction ¡ The same VCI can be used on different ports of the same switch ¡ At setup, the lowest available VCI is used

Spring 2019 © CS 438 Staff, University of Illinois 38 Setting up Virtual Circuit AàE Port VCI Port VCI Valid IN IN OUT OUT ? Port VCI Port VCI Valid 0 0 1 0 no IN IN OUT OUT ?

Host Host 3 0 2 0 no Setup msg A B Dst=E, VCI=0 0 0 0 0 Host 3 a 1 3 0 b 1 3 g 1 Host G C 0 0 2 2 2

0 Host D Host 3 0 d 1 Host F 0 E 2 Port VCI Port VCI Valid IN IN OUT OUT ? Spring 2019 © CS 438 Staff, University of Illinois 39 0 0 1 0 no Setting up Virtual Circuit AàE Port VCI Port VCI Valid IN IN OUT OUT ? Port VCI Port VCI Valid yes 0 0 1 0 no IN IN OUT OUT ? yes Host Host 3 0 2 0 no A B

0 0 0 0 Host 3 a 1 3 0 b 1 3 g 1 Host G C 0 0 2 2 2

0 Host D Host 3 0 d 1 Host F 0 E 2 ACK msg Port VCI Port VCI Valid VCI=0 IN IN OUT OUT ? Spring 2019 © CS 438 Staff, University of Illinois 40 0 0 1 0 yesno Port VCI Port VCI Valid IN INSettingOUT OUT up? Virtual Circuit GàC Port VCI Port VCI Valid 0 0 1 0 yes IN IN OUT OUT ? 3 0 1 1 noyes 3 0 2 0 yes yes Host Host 3 1 1 0 no A B ACK msg 0 0 0 VCI=0 0 Host 3 0 a 1 1 3 0 b 0 1 3 0 g 0 1 Host G C 0 10 Setup msg 2 2 2 Dst=C, VCI 0 Host D Host 3 0 d 1 Host F 0 E 2 Port VCI Port VCI Valid Port VCI Port VCI Valid IN IN OUT OUT ? IN IN OUT OUT ? Spring 2019 © CS 438 Staff, University of Illinois 41yes 0 0 1 0 yes 3 0 1 0 no Forwarding with Virtual Circuits

Host Host A 0 B 0 1 0 0 0 0 0 a b g Host 3 1 0 3 1 3 1 Host G 1 C 2 2 2 2 0 1 0 Set up circuits: 0 Host 0 D A ® E Host 3 d 1 Host C ® F F E 2 G ® E

Spring 2019 © CS 438 Staff, University of Illinois 42 Forwarding with Virtual Circuits

Table entries after A®E A B connection is set 0 0 0 3 1 3 1 3 1 G a b g C 2 2 2 Port VCI Port VCI 0 IN IN OUT OUT 3 1 D d F d E A®E 0 0 1 0 2

Port VCI Port VCI Port VCI Port VCI a IN IN OUT OUT b IN IN OUT OUT 0 0 1 0 3 0 2 0

Spring 2019 © CS 438 Staff, University of Illinois 43 Forwarding with Virtual Circuits

Table entries after A®E, C®F, G®E connection is set

Port VCI Port VCI Port VCI Port VCI a IN IN OUT OUT d IN IN OUT OUT 0 0 1 0 0 0 1 0

3 0 1 1 0 1 3 0

0 2 1 1 Port VCI Port VCI b IN IN OUT OUT 1 0 2 1 Port VCI Port VCI 3 0 2 0 g IN IN OUT OUT 3 1 2 2 1 0 3 0

Spring 2019 © CS 438 Staff, University of Illinois 44 Forwarding with Virtual Circuits n Analogous to a game of following a sequence of clues n Advantages ¡ Header (for a data packet) requires only virtual circuit ID n Connection request contains global address ¡ Can reserve resources at setup time n Disadvantages ¡ Typically must wait one RTT for setup ¡ Cannot dynamically avoid failures, must reestablish connection ¡ Global address path information still necessary for connection setup

Spring 2019 © CS 438 Staff, University of Illinois 45 Similarities between virtual circuits and datagrams n Data divided into packets n Store-and-forward transmission n Packets multiplexed onto links

Spring 2019 © CS 438 Staff, University of Illinois 46 Differences between virtual circuits and datagrams n Forwarding lookup n Router state

¡ IP: longest prefix match ¡ IP: no per-circuit state,

¡ VC: circuit ID easier failure recovery ¡ VC: routers know about connections n Connection setup

¡ IP: send packets on- demand n Quality of service

¡ VC: set up circuit in ¡ IP: no reservations, no advance guarantees ¡ VC: reserved bandwidth, soft QoS guarantees

Spring 2019 © CS 438 Staff, University of Illinois 47 Circuit switching vs. Datagram switching

Advantages Disadvantages

1. Wasted bandwidth 1. Guaranteed bandwidth 2. Blocked connections 2. Simple Abstraction 3. No communication until 3. Simple forwarding channel set up

Circuits 4. Low per-packet overhead 4. Routers need per- connection state

1. Better stat. multiplexing 1. Unpredictable performance 2. Offers okay service to 2. Lost, out of order packets everyone 3. More complex forwarding 3. No set-up delay (prefix matching) 4. Routers only store 4. Packet header overhead aggregated routes Datagrams

Spring 2019 © CS 438 Staff, University of Illinois 48 Forwarding with Source Routing

n Packet header specifies directions ¡ One direction per switch n Absolute ¡ Port name ¡ Next switch name n Relative ¡ Turn clockwise 3 ports ¡ Switches may delete or rotate directions within packet headers

Spring 2019 © CS 438 Staff, University of Illinois 49 Forwarding with Source Routing

A ® E A B 1 2 1 DATA 0 0 0 A sends: 3 1 3 1 3 1 G a b g C C ® F 2 2 2 3 2 3 DATA 0 C sends: 3 1 D F d E B ® E 2 B sends: 2 1 DATA F ® G What happens to F sends: 0 2 3 DATA the last packet? A ® H A sends: 1 1 2 1 DATA

Spring 2019 © CS 438 Staff, University of Illinois 50 Forwarding with Source Routing

n Analogous to following directions n Advantages ¡ Simple switches ¡ Fast and cheap n Disadvantages ¡ Hosts must know entire topology ¡ Changes must propagate to all hosts ¡ Headers might get large

Spring 2019 © CS 438 Staff, University of Illinois 51 Forwarding Performance n General purpose work station

¡ Direct memory access (DMA)

¡ Supports multiple network interface cards (NICs)

Processor

Cache Memory

Memory Bus Input/Output (MBUS) Bus (I/O BUS)

NETWOR K NIC 1 NIC 2

Spring 2019 © CS 438 Staff, University of Illinois 52 Forwarding Performance

n Switching process ¡ Packet arrives on NIC 1 ¡ NIC 1 DMAs packet into memory ¡ CPU looks at header, decides to send Processor out on NIC 2 ¡ NIC 2 DMAs packet into NIC Cache Memory memory ¡ Packet leaves via NIC 2 Memory Bus Input/Output What are the (MBUS) Bus (I/O BUS) potential

NETWOR bottlenecks? K NIC 1 NIC 2

Spring 2019 © CS 438 Staff, University of Illinois 53 Forwarding Performance n Potential Bottlenecks ¡ I/O bus bandwidth ¡ Memory bus bandwidth ¡ Processor computing power n Example ¡ Workstation – switches 100,000 pps ¡ Average packet size = 64 bytes ¡ Throughput n = pps x (BitsPerPacket) n = 100 x 103 x 64 x 8 n = 51.2 x 106

Spring 2019 © CS 438 Staff, University of Illinois 54 Bridges and LAN Switches

Spring 2019 © CS 438 Staff, University of Illinois 55 Bridges: Building Extended LANs n Traditional LAN n Problem ¡ Shared medium (e.g., ¡ Scale Ethernet) n Larger geographic area ¡ Cheap, easy to administer (> O(1 km)) n More hosts (> O(100)) ¡ Supports broadcast traffic ¡ Retain LAN-like functionality

Spring 2019 © CS 438 Staff, University of Illinois 56 Bridges: Building Extended LANs

n Traditional LAN n Problem ¡ Shared medium (e.g., ¡ Scale Ethernet) n Larger geographic area ¡ Cheap, easy to administer (> O(1 km)) n More hosts (> O(100)) ¡ Supports broadcast traffic ¡ Retain LAN-like functionality switch/bridge Solution: bridges hub

collision collision domain domain Spring 2019 collision domain © CS 438 Staff, University of Illinois 57 Bridges (LAN Switches) n Connect two or more LANs at the link layer (traditionally)

¡ Extract destination address from the frame ¡ Look up the destination in a table ¡ Forward the frame to the appropriate LAN segment n Or point-to-point link, for higher-speed Ethernet n Each segment is its own collision domain n A collection of LANs connected by bridges is called an extended LAN

Spring 2019 © CS 438 Staff, University of Illinois 58 Bridges vs. Switches n Switch ¡ Receive frame on input port ¡ Translate address to output port ¡ Forward frame n Bridge ¡ Connect shared media ¡ All ports bidirectional ¡ Repeat subset of traffic n Receive frame on one port n Send on all other ports

Spring 2019 © CS 438 Staff, University of Illinois 59 Uses and Limitations of Bridges n Bridges ¡ Extend LAN concept ¡ Limited scalability n to O(1,000) hosts n not to global networks ¡ Not heterogeneous n some use of address, but n no translation between frame formats n Bridge outline ¡ Learning bridges ¡ Spanning tree algorithm ¡ Broadcast and multicast

Spring 2019 © CS 438 Staff, University of Illinois 60 Learning Bridges

n Problem

¡ Which LANs should a frame be forwarded on? n Trivial algorithm

¡ Forward all frames on all (other) LANs ¡ Potentially heavy traffic and processing overhead n Optimize by using address information ¡ Learn which hosts live on which LAN ¡ Maintain forwarding table ¡ Only forward when necessary ¡ Reduces bridge workload

Spring 2019 © CS 438 Staff, University of Illinois 61 Learning Bridges

n Bridge learns table entries based on source address

¡ When receive frame from A on port 1 add A to list of hosts on port 1 ¡ Time out entries to allow movement of hosts n Table is an optimization, meaning it helps performance but is not mandatory n Always forward broadcast frames Host Port A 1 Port 1 A B C Bridge B 1 Port 2 C 1 X 2 X Y Z Y 2 Z 2 Spring 2019 © CS 438 Staff, University of Illinois 62 Learning Bridges: Misses n What about frames with unfamiliar destinations? ¡ Forward the frame on all interfaces (flooding) ¡ … except for source interface n Hopefully, this case wont happen very often n When destination replies, ¡ Switch learns that node, too

Host Port A 1 Port 1 A B C Bridge B 1 Port 2 C 1 X 2 X Y Z Y 2 Z 2 Spring 2019 © CS 438 Staff, University of Illinois 63 Learning Bridges n Examples ¡ Frame for A received on port 1: do nothing ¡ Frame for C received on port 2: forward to port 1 ¡ Frame for S received on port 2: forward to port 1

Port 1

A B C Bridge Port 2

X Y Z

Spring 2019 © CS 438 Staff, University of Illinois 64 Learning Bridges: Forwarding

n Simple algorithm index switch table using MAC dest address if entry found for destination if dest on segment from which frame arrived drop frame else forward frame on interface indicated else flood forward on all but the interface Problems? on which the frame arrived

Spring 2019 © CS 438 Staff, University of Illinois 65 Learning Bridges n Problem: Loops ¡ If there is a loop in the extended LAN, a packet could circulate forever n Side question: Are loops good or bad?

Spring 2019 © CS 438 Staff, University of Illinois 66 Learning Bridges

n Solution: Spanning Tree ¡ Select which bridges should actively forward ¡ Create a spanning tree to eliminate unnecessary edges ¡ Adds robustness

¡ Complicates learning/forwarding

Spring 2019 © CS 438 Staff, University of Illinois 67 Learning Bridges n Spanning tree

¡ Sub-graph that covers all vertices but has no cycles

¡ Links not in the spanning tree do not forward frames

Spring 2019 © CS 438 Staff, University of Illinois 68 Example Extended LAN with LOOPS

A B

B9 B5 B7

C D F K B2 B1 J E G H

B8 B4

I

Spring 2019 © CS 438 Staff, University of Illinois 69 Spanning Tree Algorithm n View extended LAN as bipartite graph ¡ LANs are graph nodes ¡ Bridges are also graph nodes ¡ Ports are edges connecting LANs to bridges n Spanning tree required ¡ Connect all LANs ¡ Can leave out bridges

Spring 2019 © CS 438 Staff, University of Illinois 70 Defining a Spanning Tree n Basic Rules ¡ Bridge with the lowest ID is the root ¡ For a given bridge n A port in the direction of the root bridge is the root port ¡ For a given LAN n The bridge closest to the root (or the bridge with the lowest ID to break ties) is the designated bridge for a LAN n 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

Spring 2019 © CS 438 Staff, University of Illinois 71 Spanning Tree Algorithm

A B Root D D D B9 B5 B7 D – designated R R C D F port D D D K B2 R – B1 root port R D J E D D G H R R D B8 B4

D I

Spring 2019 © CS 438 Staff, University of Illinois 72 Using a Spanning Tree: Forwarding n Forwarding ¡ Each bridge forwards frames A B over each LAN for which it is the B5 B7 designated bridge or connected by a root C D F K port B2 B1 n Suppressing E J ¡ A bridge does not G H forward a frame over B4 a port if it knows that the destination is not I on the other side of the port

Spring 2019 © CS 438 Staff, University of Illinois 73 Using a Spanning Tree: Broadcast and Multicast n Forward all broadcast/ multicast frames n Learn when there A B are no group B5 B7 members C D F downstream K B2 B1 ¡ Have each member of group E J G send a frame G H with multicast B4 address G in it to a bridge I

Spring 2019 © CS 438 Staff, University of Illinois 75 Finding the Tree by a distributed Algorithm n Bridges run a distributed spanning tree algorithm ¡ Select when bridges should actively forward frames n Developed by Radia Perlman at DEC n Now IEEE 802.1 specification

Spring 2019 © CS 438 Staff, University of Illinois 76 Algo-rhyme I think that I shall never see A graph more lovely than a tree. A tree whose crucial property Is loop-free connectivity A tree which must be sure to span, So packets can reach every LAN. First the Root must be selected. By ID it is elected. Least-cost paths from Root are traced. In the tree these paths are placed. A mesh is made by folks like me. Then bridges find a spanning tree. – Radia Perlman Spring 2019 © CS 438 Staff, University of Illinois 77 Distributed Spanning Tree Algorithm

n Bridges exchange configuration messages ¡ (Y,d,X) n Y = root node n d = distance to root node n X = originating node n Each bridge records current best configuration message for each port n Initially, each bridge believes it is the root n When a bridge discovers it is not the root, stop generating messages

Spring 2019 © CS 438 Staff, University of Illinois 78 Distributed Spanning Tree Algorithm n Bridges forward configuration messages ¡ Outward from root bridge ¡ i.e., on all designated ports n Bridge assumes ¡ It is designated bridge for a LAN ¡ Until it learns otherwise n Steady State ¡ root periodically sends configuration messages ¡ A timeout is used to restart the algorithm

Spring 2019 © CS 438 Staff, University of Illinois 79 Spanning Tree Algorithm n Example at bridge B3 1. B9 receives (B2, 0, B2) 2. Since 2 < 9, B9 accepts B2 as root A B 3. B9 adds 1 to the distance B9 B5 B7 advertised by B2 and sends (B2, 1, B9) C D F B2 K 4. B2 accepts B1 as root and B1 sends (B1, 1, B2) E J G H 5. B5 accepts B1 as root and B8 B4 sends (B1, 1, B5) 6. B9 accepts B1 as root and I stops forwarding

Spring 2019 © CS 438 Staff, University of Illinois 80 Robust Spanning Tree Algorithm n Algorithm must react to failures

¡ Failure of the root node n Must elect new root, with the next lowest identifier

¡ Failure of other switches and links n Need to recompute some part of the spanning tree n Root switch continues sending messages

¡ Periodically re-announcing itself as the root (1, 0, 1)

¡ Other switches continue forwarding messages n Detecting failures through timeout (soft state) ¡ Switch waits to hear from others

¡ Eventually times out and claims to be the root

Spring 2019 © CS 438 Staff, University of Illinois 81 Bridges: Limitations n Does not scale ¡ Spanning tree algorithm scales linearly ¡ Broadcast does not scale n Virtual LANs (VLAN) ¡ An extended LAN that is partitioned into several networks ¡ Each network appears separate ¡ Limits effect of broadcast ¡ Simple to change virtual topology

Spring 2019 © CS 438 Staff, University of Illinois 82 Bridges: Limitations n Does not accommodate heterogeneity ¡ Networks must have the same address format n e.g. Ethernet-to-Ethernet n Caution ¡ Beware of transparency n May break assumptions of the point-to-point protocols ¡ Frames may get dropped ¡ Variable latency ¡ Reordering n Bridges happen!

Spring 2019 © CS 438 Staff, University of Illinois 83 Bridging: how good is it? n Advantages of bridges over routers

¡ Plug-and-play n Routers could be too in principle, but typically are not

¡ Fast filtering and forwarding of frames n Disadvantages of switches over routers

¡ Topology restricted to a spanning tree n Long paths, congestion ¡ Large networks require large tables

¡ Broadcast storms can cause the network to collapse

¡ Cant accommodate non-Ethernet segments (why?)

Spring 2019 © CS 438 Staff, University of Illinois 84