CSE 461 LAN Switches David Wetherall djw@cs.washington.edu
How to combine links into a simple network Topics: Switch internals Plug and play LANs (switched Ethernet) Application Transport Network Building more sophisticated networks with Link routers Physical Later: djw // CSE 461, Spring 2011 2
Terminology Hub A physical layer interconnection device, a repeater Switch A link layer interconnection device, e.g. Ethernet LAN switch Bridge is the old-fashioned name for a LAN switch Router Interconnection device that works at the network (IP) layer Gateway Generic term for a high-level interconnection device Switch Also generic term for a low-level interconnection device djw // CSE 461, Spring 2011 3
They can all look the same djw // CSE 461, Spring 2011 4
Sanity check, switch/bridge id Trans/App Trans/App IP IP Ethernet Eth Eth Ethernet Physical Phy Phy Physical A B C What source and destination Ethernet / IP addresses are seen on each wire? djw // CSE 461, Spring 2011 5
Sanity check, router Trans/App Trans/App IP IP IP IP Ethernet Eth Eth Ethernet Physical Phy Phy Physical A B C What source and destination Ethernet / IP addresses are seen on each wire? djw // CSE 461, Spring 2011 6
What s in a Switch (Hub or Switch)? Ports here are both input and output Alternatively might see input ports on left, output on right. Hub connects input to all output lines Switch sends input to only the indicated output (address) djw // CSE 461, Spring 2011 7
Crossbar (inside id switch) On/off setting of intersection points control connections from inputs to outputs djw // CSE 461, Spring 2011 8
Hub vs. Switch Assume N ports, each running at R Mbps What is the total capacity (performance)? For a hub? For a switch? Which is full duplex (separate input/output wires) A hub or a switch? Which protects from eavesdropping more (secure)? A hub, or a switch? Which is the simplest device? djw // CSE 461, Spring 2011 9
LAN Switches/Bridges id When one switch isn t enough, we can combine them by wiring multiple switches together Key problem is which knowing which output port to use for a given input message Link layer operation implies that MAC address is used Designed to be plug and play with ihtwo algorithms: 1. Backward learning 2. Spanning tree computation djw // CSE 461, Spring 2011 10
Classic Ethernet t shared LANs djw // CSE 461, Spring 2011 11
Modern Ethernet t switched Just multi-port bridges and many two host LANs (can be full duplex) djw // CSE 461, Spring 2011 12
Backward Learning Algorithm To optimize overall performance: Don t forward A B or D G between switches, do for A D and D C But how does the switch know? Forward using destination address; broadcast if you don t know Learn who is where by observing source addresses and prune Works for a single switch as well as a collection djw // CSE 461, Spring 2011 13
Is redundancy ygood or bad? Seems useful (backup, more capacity) But causes a potential problem forwarding loops Solution is the spanning tree algorithm djw // CSE 461, Spring 2011 14
Spanning Tree Algorithm Goal is to turn some bridge ports off to break loops Approach is to compute spanning tree Distributed algorithm, robust against failures Outline: 1. Elect a root node of the tree (lowest address) 2. Grow tree as shortest distances from the root (using lowest address to break distance ties) All done by bridges sending periodic configuration messages over ports for which they are the best path Then turn off ports that aren ton best paths djw // CSE 461, Spring 2011 15
Radia Perlman says From: An Algorithm for Distributed Computation of a Spanning Tree in an Extended LAN, R. Perlman, SIGCOMM 1985. djw // CSE 461, Spring 2011 16
Spanning tree example djw // CSE 461, Spring 2011 17
Algorithm details Each bridge sends periodic messages to others containing: Its address, address of the root bridge, and distance (in hops) to root Each bridge receives messages, updates best config. Smaller root address is better, then shorter distance To break ties, bridge with smaller address is better Initially, each bridge thinks it is the root Sends configuration messages on all ports Later, bridges send only best configs Add 1 to distance, send configs where still best (designated bridge) Turn off forwarding on ports except those that send/receive best djw // CSE 461, Spring 2011 18
Some Design Aspects All bridges to run the same algorithm Bridges start with no information and operate in parallel Bridges send periodic messages about their own state State that isn t refreshed is soon deleted (soft-state) If we all have the same inputs and are running the same algorithm, we converge to a globally ll consistent t state. t This is a common design pattern for network protocols that adapts to failures. Learn it. Live it. Love it. djw // CSE 461, Spring 2011 19
Perspective on Bridges/Switches it LAN switches form an effective small-scale network Designed to work transparently with no host changes Plug and play for real! But they don t scale well to large networks Little control over forwarding gpaths Size of bridge forwarding tables grows with number of hosts Broadcast traffic flows freely over whole extended LAN Spanning tree algorithm limits reconfiguration speed Poor solution for connecting LANs of different kinds We can do better by changing hosts too. Next up: IP and routing. djw // CSE 461, Spring 2011 20