15-441 Computer Networking Lecture 8 – Switching and Bridging Peter Steenkiste Departments of Computer Science and Electrical and Computer Engineering 15-441 Networking, Spring 2008 http://www.cs.cmu.edu/~dga/15-441/S08 1 Scale yak yak… What breaks when we keep adding people to the same wire? 2 2 Scale yak yak… What breaks when we keep adding people to the same wire? Only solution: split up the people onto multiple wires » But how can they talk to each other? 3 3 Problem: How to Connect LANs? yak yak… When should these boxes forward packets between wires? How do you specify a destination? How does your packet find its way? 4 4 Outline Bridging Internetworks » Methods for packet forwarding 5 5 Building Larger LANs: Bridges Extend reach of a single shared medium Connect two or more “segments” by copying data frames between them » Only copy data when needed key difference from repeaters/hubs » Reduce collision domain compared with single LAN » Separate segments can send at once much greater bandwidth Challenge: learning which packets to copy across links LAN 1 LAN 2 6 6 Transparent Bridges Design goals: » Self-configuring without hardware or software changes » Bridge do not impact the operation of the individual LANs Three parts to making bridges transparent: 1) Forwarding frames 2) Learning addresses/host locations 3) Spanning tree algorithm 7 7 Frame Forwarding Bridge 2 MAC Address A21032C9A591 99A323C90842 8711C98900AA 301B2369011C 695519001190 Port Age 1 2 2 36 2 3 16 3 A machine with MAC Address lies in the direction of number port of the bridge For every packet, the bridge “looks up” the entry for the packets destination MAC address and forwards the packet on that port. 01 15 11 1 » Other packets are broadcast – why? Timer is used to flush old 8 entries 8 Learning Bridges Manually filling in bridge tables? » Time consuming, error-prone Keep track of source address of packets arriving on every link, showing what segment hosts are on » Fill in the forwarding table based on this information host host host host host host host host Bridge host host host host 9 9 Spanning Tree Bridges More complex topologies can provide redundancy. » But can also create loops. What is the problem with loops? Solution: spanning tree host host host Bridge host host host host host host Bridge host host host 10 10 Ethernet Switches Bridges make it possible to increase LAN capacity. » Packets are no longer broadcasted - they are only forwarded on selected links » Adds a switching flavor to the broadcast LAN Ethernet switch is a special case of a bridge: each bridge port is connected to a single host. » Can make the link full duplex (really simple protocol!) » Simplifies the protocol and hardware used (only two stations on the link) – no longer full CSMA/CD » Can have different port speeds on the same switch – Unlike in a hub, packets can be stored – An alternative is to use cut through switching 16 16 Ethernet Evolution Ethernet or 802.3 Early Implementations WAN B/R LAN Conc.. A Local Area Network • MAC addressing, non-routable • BUS or Logical Bus topology • Collision Domain, CSMA/CD • Bridges and Repeaters for distance/capacity extension • 1-10Mbps: coax, twisted pair (10BaseT) Current Implementations CSMA - Carrier Sense Multiple Access • Switched solution • Little use for collision domains HUB • 80% of traffic leaves the LAN Switch • Servers, routers 10 x station speed • 10/100/1000 Mbps, 10gig coming: Copper, Fiber • 95% of new LANs are Ethernet Router Ethernet • Server WAN CD - Collision Detection 17 17 Ethernet in a campus network Server farm Server Today: x 10 Server Server Gigabit Ethernet links Switch/router Server Ethernet switch 100 Mbps links Hub 10 Mbps links Department A Gigabit Ethernet links Ethernet switch 100 Mbps links Server Switch/router Ethernet switch 100 Mbps links Server Hub Hub 10 Mbps links 10 Mbps links Department C Department B 18 18 Problem: Bridging Weaknesses Doesn’t handle incompatible LAN technologies » Is interoperable within 802.* standard How well does it scale? 19 19 Outline Bridging Internetworks » Methods for packet forwarding 20 20 What is an Internetwork? Multiple incompatible LANs can be physically connected by layer 3 switches called routers The connected networks are called an internetwork » The “Internet” is one (very big & successful) example of an internetwork host host ... host host host ... LAN 1 host LAN 2 router WAN router WAN router LAN 1 and LAN 2 might be completely different, totally incompatible LANs (e.g., Ethernet and ATM) 21 21 Logical Structure of Internet host router router host router router router router » Ad hoc interconnection of networks – No particular topology – Vastly different router & link capacities » Send packets from source to destination by hopping through networks – Router connect one network to another – Different paths to destination may exist 22 22 Internet Protocol (IP) Hour Glass Model » Create abstraction layer that hides underlying technology from network application software Network applications SMTP HTTP RTP... TCP UDP… » Make as minimal as possible » Allows range of current & future technologies email WWW phone... IP ethernet PPP… CSMA async sonet... Network technology copper fiber radio... » Can support many different types of applications 23 23 Problem: Internetwork Design host host ... host host host ... LAN 1 LAN 2 router host WAN router WAN router How do I designate a distant host? » Addressing / naming How do I send information to a distant host? » What gets sent? » What route should it take? Must support: » Heterogeneity LAN technologies » Scalability ensure ability to grow to worldwide scale 24 24 Getting to a Destination How do you get driving directions? Intersectionsrouters Roadslinks/networks Roads change slowly 25 25 Forwarding Packets Table of virtual circuits »Connection routed through network to set up state »Packets forwarded using connection state Source routing »Packet carries path Table of global addresses (IP) »Routers keep next hop for destination »Packets carry destination address 26 26 Simplified Virtual Circuits Example Packet Sender 5 5 2 1 R1 4 3 2 1 R2 4 conn 5 4 3 5 conn 5 3 2 1 R3 4 3 Receiver 5 conn 5 3 28 28 Virtual Circuits Advantages » Efficient lookup (simple table lookup) » Can reserve bandwidth at connection setup » Easier for hardware implementations Disadvantages » Still need to route connection setup request » More complex failure recovery – must recreate connection state Typical use fast router implementations » ATM – combined with fix sized cells » MPLS – tag switching for IP networks 29 29 Source Routing Example Packet R2, R3, R R1, R2, R3, R 2 Sender 1 R1 4 2 3 1 R2 3 4 R3, R 2 1 R3 4 3 Receiver R 31 31 Source Routing Advantages »Switches can be very simple and fast Disadvantages »Variable (unbounded) header size »Sources must know or discover topology (e.g., failures) Typical uses »Ad-hoc networks (DSR) »Machine room networks (Myrinet) 32 32 Global Address Example Packet R Sender R 2 1 R1 4 R3 3 2 1 R2 3 R4 4 R 2 1 R3 4 R3 3 Receiver R 34 34 Global Addresses Advantages »Stateless – simple error recovery Disadvantages »Every switch knows about every destination – Potentially large tables »All packets to destination take same route »Need routing protocol to fill table 35 35 Comparison Source Routing Global Addresses Virtual Circuits Header Size Worst OK – Large address Best Router Table Size None Number of hosts (prefixes) Number of circuits Forward Overhead Best Prefix matching (Worst) Pretty Good Setup Overhead None None Connection Setup Tell all routers Tell all routers and Tear down circuit and re-route Error Recovery Tell all hosts 36 36