Interconnection: Switching and Bridging CS 4251: Computer Networking II Nick Feamster Fall 2008.
Presentation on theme: "Interconnection: Switching and Bridging"— Presentation transcript:
1Interconnection: Switching and Bridging CS 4251: Computer Networking II Nick Feamster Spring 2008
2In This Lecture How hosts find each other on a subnet Address Resolution Protocol (ARP)BroadcastInterconnecting subnetsSwitches: Forwarding and filteringSelf-learning bridgesSpanning tree protocolsSwitches vs. HubsSwtiches vs. RoutersCan Ethernet scale to a million nodes?VLANsOther alternatives
3Bootstrapping: Networks of Interfaces LAN/Physical/MAC addressFlat structureUnique to physical interface (no two alike)…how?datagramlink layer protocolreceiversenderframeframeadapteradapterFrames can be sent to a specific MAC address or to the broadcast MAC addressWhat are the advantages to separating network layer from MAC layer?
4ARP: IP Addresses to MAC addresses Query is IP address, response is MAC addressQuery is sent to LAN’s broadcast MAC addressEach host or router has an ARP tableChecks IP address of query against its IP addressReplies with ARP address if there is a matchPotential problems with this approach?Caching on hosts is really importantTry arp –a to see an ARP table
5Life of a Packet: On a Subnet Packet destined for outgoing IP address arrivesat network interfacePacket must be encapsulated into a frame with the destination MAC addressFrame is sent on LAN segment to all hostsHosts check destination MAC address against MAC address that was destination IP address of the packet
7Interconnecting LANs with Hubs All packets seen everywhereLots of flooding, chances for collisionCan’t interconnect LANs with heterogeneous media (e.g., Ethernets of different speeds)hubhubhubhub
8Problems with Hubs: No Isolation ScalabilityLatencyAvoiding collisions requires backoffPossible for a single host to hog the mediumFailuresOne misconfigured device can cause problems for every other device on the LAN
9Improving on Hubs: Switches Link-layerStores and forwards Ethernet framesExamines frame header and selectively forwards frame based on MAC dest addressWhen frame is to be forwarded on segment, uses CSMA/CD to access segmentTransparentHosts are unaware of presence of switchesPlug-and-play, self-learningSwitches do not need to be configured
10Switch: Traffic Isolation Switch breaks subnet into LAN segmentsSwitch filters packetsSame-LAN-segment frames not usually forwarded onto other LAN segmentsSegments become separate collision domainsswitchcollision domainhubhubhubcollision domaincollision domain
11Filtering and Forwarding Occurs through switch tableSuppose a packet arrives destined for node with MAC address x from interface AIf MAC address not in table, flood (act like a hub)If MAC address maps to A, do nothing (packet destined for same LAN segment)If MAC address maps to another interface, forwardHow does this table get configured?LAN ALAN BLAN CABC
12Advantages vs. Hubs Better scaling Better privacy Heterogeneity Separate collision domains allow longer distancesBetter privacyHosts can “snoop” the traffic traversing their segment… but not all the rest of the trafficHeterogeneityJoins segments using different technologies
13Disadvantages vs. Hubs Delay in forwarding frames Bridge/switch must receive and parse the frame… and perform a look-up to decide where to forwardStoring and forwarding the packet introduces delaySolution: cut-through switchingNeed to learn where to forward framesBridge/switch needs to construct a forwarding tableIdeally, without intervention from network administratorsSolution: self-learning
14Motivation For Self-Learning Switches forward frames selectivelyForward frames only on segments that need themSwitch tableMaps destination MAC address to outgoing interfaceGoal: construct the switch table automaticallyBACswitchD
15(Self)-Learning Bridges Switch is initially emptyFor each incoming frame, storeThe incoming interface from which the frame arrivedThe time at which that frame arrivedDelete the entry if no frames with a particular source address arrive within a certain timeBSwitch learns how to reach A.ACD
16Cut-Through Switching Buffering a frame takes timeSuppose L is the length of the frameAnd R is the transmission rate of the linksThen, receiving the frame takes L/R time unitsBuffering delay can be a high fraction of total delay, especially over short distancesABswitches
17Cut-Through Switching Start transmitting as soon as possibleInspect the frame header and do the look-upIf outgoing link is idle, start forwarding the frameOverlapping transmissionsTransmit the head of the packet via the outgoing link… while still receiving the tail via the incoming linkAnalogy: different folks crossing different intersectionsABswitches
18Limitations on Topology Switches sometimes need to broadcast framesUnfamiliar destination: Act like a hubSending to broadcastFlooding can lead to forwarding loops and broadcast stormsE.g., if the network contains a cycle of switchesEither accidentally, or by design for higher reliabilityWorse yet, packets can be duplicated and proliferated!
19Solution: Spanning Trees Ensure the topology has no loopsAvoid using some of the links when flooding… to avoid forming a loopSpanning treeSub-graph that covers all vertices but contains no cyclesLinks not in the spanning tree do not forward frames
20Constructing a Spanning Tree Elect a rootThe switch with the smallest identifierEach switch identifies if its interface is on the shortest path from the rootAnd it exclude from the tree if notAlso exclude from tree if same distance, but higher identifierMessage Format: (Y, d, X)From node XClaiming Y as rootDistance is drootOne hopThree hops
21Steps in Spanning Tree Algorithm Initially, every switch announces itself as the rootExample: switch X announces (X, 0, X)Switches update their view of the rootUpon receiving a message, check the root idIf the new id is smaller, start viewing that switch as rootSwitches compute their distance from the rootAdd 1 to the distance received from a neighborIdentify interfaces not on a shortest path to the root and exclude those ports from the spanning tree
22Example From Switch #4’s Viewpoint Switch #4 thinks it is the rootSends (4, 0, 4) message to 2 and 7Switch #4 hears from #2Receives (2, 0, 2) message from 2… and thinks that #2 is the rootAnd realizes it is just one hop awaySwitch #4 hears from #7Receives (2, 1, 7) from 7And realizes this is a longer pathSo, prefers its own one-hop pathAnd removes 4-7 link from the tree1352467
23Robust Spanning Tree Algorithm Algorithm must react to failuresFailure of the root nodeNeed to elect a new root, with the next lowest identifierFailure of other switches and linksNeed to recompute the spanning treeRoot switch continues sending messagesPeriodically reannouncing itself as the root (1, 0, 1)Other switches continue forwarding messagesDetecting failures through timeoutSwitch waits to hear from othersEventually times out and claims to be the root
24Extension: Virtual LANs Partition a single switched LAN into several virtual onesSwitched LANs do not scale well to large networksSpanning tree algorithm has linear scaling behaviorSome frames are broadcastGroup users/hosts based on organizational structure, rather than physical locationImprove privacy and isolationExploit localityAvoid physical rewiringMore in Lec. 12 (Plus, Network Layers as Link Layers)
25Switches vs. Routers Switches Switches are automatically configuring Forwarding tends to be quite fast, since packets only need to be processed through layer 2RoutersRouter-level topologies are not restricted to a spanning treeCan even have multipath routing
26Scaling Ethernet Main limitation: Broadcast Spanning tree protocol messagesARP queriesHigh-level proposal: Distributed directory serviceEach switch implements a directory serviceHosts register at each bridgeDirectory is replicatedQueries answered locally…are there other ways to do this?