CSE 461 – LAN Switches

David Wetherall [email protected]

How to combine links into a simple network •

Topics: – –

Switch internals “Plug and play” LANs (switched Ethernet)

Application Transport



Later: –

Building more sophisticated networks with routers

djw // CSE 461, Spring 2011

Network Link Physical

2

T Terminology i l • 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 g generic term for a low-level interconnection device djw // CSE 461, Spring 2011

3

Th can all They ll llook k th the same …

djw // CSE 461, Spring 2011

4

S it check, Sanity h k switch/bridge it h/b id Trans/App

Trans/App

IP Ethernet Physical

IP Ethernet Physical

A

Eth Phy

Eth Phy

B

C

• What source and destination Ethernet / IP addresses are seen on eachh wire? i ? djw // CSE 461, Spring 2011

5

S it check, Sanity h k router t Trans/App IP Ethernet Physical

A

Trans/App IP

IP

Eth Phy

Eth Phy

B

IP Ethernet Physical

C

• What source and destination Ethernet / IP addresses are seen on eachh wire? i ? djw // CSE 461, Spring 2011

6

Wh t’ in What’s i a “Switch” “S it h” (H (Hub b or Switch)? S it h)?

• Ports here are both input p and output p – 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

C Crossbar b (inside (i id switch) it h) • On/off setting of intersection points control connections from inputs to outputs

djw // CSE 461, Spring 2011

8

H b vs. Switch Hub S it h • 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 p device? djw // CSE 461, Spring 2011

9

LAN Switches/Bridges S it h /B 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 D i d to bbe “plug “ l andd play” l ” with i h two algorithms: l ih – 1. Backward learning – 2. Spanning p g tree computation p djw // CSE 461, Spring 2011

10

Cl Classic i Eth Ethernett – shared h d LANs LAN

djw // CSE 461, Spring 2011

11

M d Modern Ethernet Eth t – switched it h d

Just multi-port p bridges g and many y two host LANs ((can be full duplex) p ) djw // CSE 461, Spring 2011

12

B k Backward dL Learning i Algorithm Al ith •

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 W k for f a single i l switch it h as well ll as a collection ll ti

djw // CSE 461, Spring 2011

13

Is redundancy yg good or bad?

• Seems useful ((backup, p, more capacity) p y) • But causes a potential problem – forwarding loops • Solution is the spanning tree algorithm djw // CSE 461, Spring 2011

14

S Spanning i Tree T Algorithm Al ith • •

Goal is to turn some bridge ports off to break loops Approach is to compute spanning tree –



Distributed algorithm, 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’t aren t on “best” best paths

djw // CSE 461, Spring 2011

15

R di Perlman Radia P l says …

From: “An Algorithm for Distributed Computation of a Spanning Tree in an Extended LAN”, R P R. Perlman, l SIGCOMM 1985. 1985

djw // CSE 461, Spring 2011

16

S Spanning i tree t example l

djw // CSE 461, Spring 2011

17

Al Algorithm ith details d t il •

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, y, each bridge g thinks it is the root – Sends configuration messages on all ports



Later, bridges send only “best” configs – Add 1 to distance distance, send configs where still “best” best (designated bridge) – Turn off forwarding on ports except those that send/receive “best”

djw // CSE 461, Spring 2011

18

Some Design g Aspects p • • • • •

All bridges g to run the same algorithm g 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, l ith we converge to t a globally l b ll consistent i t t state. t t This is Thi i a common design d i pattern tt ffor network t k protocols t l that adapts to failures. Learn it. Live it. Love it.

djw // CSE 461, Spring 2011

19

P Perspective ti on Bridges/Switches B id /S it h •

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 forwardingg ppaths Size of bridge forwarding tables grows with number of hosts Broadcast traffic flows freely over whole extended LAN Spanning p g tree algorithm g limits reconfiguration g speed p Poor solution for connecting LANs of different kinds

We can do better by changing hosts too. too Next up: IP and routing. routing

djw // CSE 461, Spring 2011

20