1 EE 122: Ethernet Ion Stoica TAs: Junda Liu, DK Moon, David Zats (Materials with thanks to Vern Paxson, Jennifer.

Slides:



Advertisements
Similar presentations
Interconnection: Switching and Bridging
Advertisements

Interconnection: Switching and Bridging CS 4251: Computer Networking II Nick Feamster Fall 2008.
University of Calgary – CPSC 441.  We need to break down big networks to sub-LANs  Limited amount of supportable traffic: on single LAN, all stations.
Ethernet “dominant” LAN technology: cheap $20 for 100Mbs!
Review r Error Detection: CRC r Multiple access protocols m Slotted ALOHA m CSMA/CD r Homework 3 out r Project 3 out, link state only. Some slides are.
5: DataLink Layer5-1 Mac Addressing, Ethernet, and Interconnections.
Fundamentals of Computer Networks ECE 478/578 Lecture #13: Packet Switching (2) Instructor: Loukas Lazos Dept of Electrical and Computer Engineering University.
CPSC 441 TUTORIAL TA: FANG WANG HUBS, SWITCHES AND BRIDGES Parts of the slides contents are courtesy of the following people: Jim Kurose, Keith Ross:
5/31/05CS118/Spring051 twisted pair hub 10BaseT, 100BaseT, hub r T= Twisted pair (copper wire) r Nodes connected to a hub, 100m max distance r Hub: physical.
1 Fall 2005 Extending LANs Qutaibah Malluhi CSE Department Qatar University Repeaters, Hubs, Bridges, Fiber Modems, and Switches.
1 Computer Networks Internetworking Devices. 2 Repeaters Hubs Bridges –Learning algorithms –Problem of closed loops Switches Routers.
5: DataLink Layer5-1 MAC Addresses and ARP r 32-bit IP address: m network-layer address m used to get datagram to destination IP subnet r MAC (or LAN or.
1 Version 3 Module 8 Ethernet Switching. 2 Version 3 Ethernet Switching Ethernet is a shared media –One node can transmit data at a time More nodes increases.
CSCI 4550/8556 Computer Networks Comer, Chapter 11: Extending LANs: Fiber Modems, Repeaters, Bridges and Switches.
COS 461: Computer Networks
Local Area Networks: Ethernet, Switching COS 461: Computer Networks Spring 2011 Mike Freedman
EE 122: Ethernet and Ion Stoica September 18, 2002 (* this talk is based in part on the on-line slides of J. Kurose & K. Rose)
MAC Addresses and ARP 32-bit IP address: –network-layer address –used to get datagram to destination IP subnet MAC (or LAN or physical or Ethernet) address:
EEC-484/584 Computer Networks Lecture 13 Wenbing Zhao
5-1 Data Link Layer r Today, we will study the data link layer… r This is the last layer in the network protocol stack we will study in this class…
1 Interconnecting LAN segments Repeaters Hubs Bridges Switches.
16 – CSMA/CD - ARP Network Layer4-1. 5: DataLink Layer5-2 CSMA (Carrier Sense Multiple Access) CSMA: listen before transmit: If channel sensed idle: transmit.
Review r Error Detection: CRC r Multiple access protocols m Slotted ALOHA m CSMA/CD r LAN addresses and ARP r Ethernet Some slides are in courtesy of J.
Switched Ethernet. Announcements HW3 will be pushed out 2-3 days – Both release and due dates – Will post on piazza when we release Get started on project#3!
Introduction 1 Lecture 25 Link Layer (Ethernet, Switch) slides are modified from J. Kurose & K. Ross University of Nevada – Reno Computer Science & Engineering.
DataLink Layer1 Ethernet Technologies: 10Base2 10: 10Mbps; 2: 200 meters (actual is 185m) max distance between any two nodes without repeaters thin coaxial.
Layer 2 Switch  Layer 2 Switching is hardware based.  Uses the host's Media Access Control (MAC) address.  Uses Application Specific Integrated Circuits.
Connecting LANs, Backbone Networks, and Virtual LANs
Semester 1 Module 8 Ethernet Switching Andres, Wen-Yuan Liao Department of Computer Science and Engineering De Lin Institute of Technology
1 Token Passing: IEEE802.5 standard  4 Mbps  maximum token holding time: 10 ms, limiting packet length  packet (token, data) format:  SD, ED mark start,
Introduction1-1 Data Communications and Computer Networks Chapter 5 CS 3830 Lecture 26 Omar Meqdadi Department of Computer Science and Software Engineering.
5: DataLink Layer5-1 LAN technologies Data link layer so far: m services, error detection/correction, multiple access Next: LAN technologies m addressing.
Links Mike Freedman COS 461: Computer Networks Lectures: MW 10-10:50am in CS 104
Lecture 17 Ethernet r Widely deployed because: m First LAN technology m Simpler and less expensive than token LANs and ATM m Kept up with the speed race:
Introduction1-1 Data Communications and Computer Networks Chapter 5 CS 3830 Lecture 27 Omar Meqdadi Department of Computer Science and Software Engineering.
5: DataLink Layer5-1 Ethernet “dominant” wired LAN technology: r cheap $20 for 100Mbs! r first widely used LAN technology r Simpler, cheaper than token.
1 Computer Communication & Networks Lecture 13 Datalink Layer: Local Area Network Waleed Ejaz
Token Passing: IEEE802.5 standard  4 Mbps  maximum token holding time: 10 ms, limiting packet length  packet (token, data) format:  SD, ED mark start,
5: DataLink Layer5a-1 Chapter 5: The Data Link Layer Last time: r multiple access protocols and LANs r link layer addressing, ARP r specific link layer.
Module 8: Ethernet Switching
Link Layer: MAC Ilam University Dr. Mozafar Bag-Mohammadi.
Review: –Ethernet What is the MAC protocol in Ethernet? –CSMA/CD –Binary exponential backoff Is there any relationship between the minimum frame size and.
Data Link Layer Moving Frames. Link Layer Protocols: ethernet, wireless, Token Ring and PPP Has node-to-node job of moving network layer.
5: DataLink Layer5-1 Link Layer r 5.1 Introduction and services r 5.2 Error detection and correction r 5.3Multiple access protocols r 5.4 Link-Layer Addressing.
Chi-Cheng Lin, Winona State University CS 313 Introduction to Computer Networking & Telecommunication Local Area Networks.
Cisco 3 - Switching Perrine. J Page 16/4/2016 Chapter 4 Switches The performance of shared-medium Ethernet is affected by several factors: data frame broadcast.
Sem1 - Module 8 Ethernet Switching. Shared media environments Shared media environment: –Occurs when multiple hosts have access to the same medium. –For.
McGraw-Hill©The McGraw-Hill Companies, Inc., 2004 Connecting Devices CORPORATE INSTITUTE OF SCIENCE & TECHNOLOGY, BHOPAL Department of Electronics and.
Chapter 11 Extending LANs 1. Distance limitations of LANs 2. Connecting multiple LANs together 3. Repeaters 4. Bridges 5. Filtering frame 6. Bridged network.
5: DataLink Layer5-1 Chapter 5 Link Layer and LANs Computer Networking: A Top Down Approach Featuring the Internet, 3 rd edition. Jim Kurose, Keith Ross.
Lecture 11: Switches Reading: Section 3.2 ? CMSC 23300/33300 Computer Networks
Bridges and LAN Switches
EE 122: Lecture 6 Ion Stoica September 13, 2001 (* this talk is based in part on the on-line slides of J. Kurose & K. Rose)
CCNA3 Module 4 Brierley Module 4. CCNA3 Module 4 Brierley Topics LAN congestion and its effect on network performance Advantages of LAN segmentation in.
1 Multiple Access: Ethernet Section Point-to-Point vs. Broadcast Media Point-to-point –PPP for dial-up access –Point-to-point link between Ethernet.
Computer Communication and Networking Lecture # 4 by Zainab Malik 1.
5: DataLink Layer5-1 Hubs Hubs are essentially physical-layer repeaters: m bits coming from one link go out all other links m at the same rate m no frame.
Links Mike Freedman COS 461: Computer Networks Lectures: MW 10-10:50am in Architecture N101
Lec # 25 Computer Network Muhammad Waseem Iqbal. Learn about the Internetworking Devices – Repeaters – Hubs – Switches – Bridges – Routers.
5-1 Last time □ Multiple access protocols ♦ Channel partitioning MAC protocols TDMA, FDMA ♦ Random access MAC protocols Slotted Aloha, Pure Aloha, CSMA,
Link Layer 5.1 Introduction and services
Chapter 4 Data Link Layer Switching
CS 457 – Lecture 8 Switching and Forwarding
CS 457 – Lecture 6 Ethernet Spring 2012.
LAN switching and Bridges
Data Link Issues Relates to Lab 2.
Links Jennifer Rexford COS 461: Computer Networks
CS4470 Computer Networking Protocols
18: Ethernet, Hubs, Bridges, Switches
LAN Addresses and ARP IP address: drives the packet to destination network LAN (or MAC or Physical) address: drives the packet to the destination node’s.
Presentation transcript:

1 EE 122: Ethernet Ion Stoica TAs: Junda Liu, DK Moon, David Zats (Materials with thanks to Vern Paxson, Jennifer Rexford, and colleagues at UC Berkeley)

2 Goals of Today’s Lecture MAC (Media Access Control) protocols, esp. CSMA/CD Carrier Sense Multiple Access / Collision Detection Ethernet: single segment Frame structure Length/timing constraints due to Collision Detection Ethernet: spanning multiple segments Repeaters and hubs Bridges and switches Self-learning (plug-and-play) Spanning trees (time permitting)

3 Three Ways to Share the Media Channel partitioning MAC protocols (TDMA, FDMA): Share channel efficiently and fairly at high load Inefficient at low load (where load = # senders): 1/N bandwidth allocated even if only 1 active node! “Taking turns” protocols (discussed in Section) Eliminates empty slots without causing collisions Overhead in acquiring the token Vulnerable to failures (e.g., failed node or lost token) Random access MAC protocols Efficient at low load: single node can fully utilize channel High load: collision overhead

4 Key Ideas of Random Access Carrier sense Listen before speaking, and don’t interrupt Checking if someone else is already sending data … and waiting till the other node is done Collision detection If someone else starts talking at the same time, stop Realizing when two nodes are transmitting at once …by detecting that the data on the wire is garbled Randomness Don’t start talking again right away Waiting for a random time before trying again

5 CSMA Collisions Collisions can still occur: propagation delay means two nodes may not hear each other’s transmission in time. At time t 1, D still hasn’t heard B’s signal sent at the earlier time t 0, so D goes ahead and transmits: failure of carrier sense. Collision: entire packet transmission time wasted

6 CSMA/CD (Collision Detection) CSMA/CD: carrier sensing, deferral as in CSMA Collisions detected within short time Colliding transmissions aborted, reducing wastage Collision detection Easy in wired LANs: measure signal strengths, compare transmitted, received signals Difficult in wireless LANs Reception shut off while transmitting Even if on, might not be able to hear the other sender, even though the receiver can Leads to use of collision avoidance instead

7 CSMA/CD Collision Detection Both B and D can tell that collision occurred. This lets them (1) know that they need to resend the frame, and (2) recognize that there’s contention and adopt a strategy for dealing with it. Note: for this to work, we need restrictions on minimum frame size and maximum distance

8 Ethernet: CSMA/CD Protocol Carrier sense: wait for link to be idle Collision detection: listen while transmitting No collision: transmission is complete Collision: abort transmission & send jam signal Random access: exponential back-off After collision, wait a random time before trying again After m th collision, choose K randomly from {0, …, 2 m - 1} … and wait for K*512 bit times before trying again The wired LAN technology Hugely successful: 3/10/100/1000/10000 Mbps

9 Minimum Packet Size Why enforce a minimum packet size? Give a host enough time to detect collisions In Ethernet, minimum packet size = 64 bytes (two 6-byte addresses, 2-byte type, 4-byte CRC, and 46 bytes of data) If host has less than 46 bytes to send, the adaptor pads (adds) bytes to make it 46 bytes What is the relationship between minimum packet size and the length of the LAN?

10 Minimum Packet Size (more) propagation delay (d) a) Time = t; Host 1 starts to send frame Host 1Host 2 propagation delay (d) Host 1Host 2 b) Time = t + d; Host 2 starts to send a frame, just before it hears from host 1’s frame propagation delay (d) Host 1Host 2 c) Time = t + 2*d; Host 1 hears Host 2’s frame  detects collision LAN length = (min_frame_size)*(light_speed)/(2*bandwidth) = = (8*64b)*(2.5*10 8 mps)/(2*10 7 bps) = 6400m approx What about 100 mbps? 1 gbps? 10 gbps?

11 Limits on CSMA/CD Network Length Latency depends on physical length of link Time to propagate a packet from one end to the other Suppose A sends a packet at time t And B sees an idle line at a time just before t+d … so B happily starts transmitting a packet B detects a collision, and sends jamming signal But A can’t see collision until t+2d latency d A B

12 Limits on CSMA/CD Network Length A needs to wait for time 2d to detect collision So, A should keep transmitting during this period … and keep an eye out for a possible collision Imposes restrictions. E.g., for 10 Mbps Ethernet: Maximum length of the wire: 2,500 meters Minimum length of a frame: 512 bits (64 bytes) 512 bits = 51.2  sec (at 10 Mbit/sec) For light in vacuum, 51.2  sec ≈ 15,000 meters vs. 5,000 meters “round trip” to wait for collision latency d A B

13 Ethernet Frame Structure Sending adapter encapsulates packet in frame Preamble: synchronization Seven bytes with pattern , followed by one byte with pattern Used to synchronize receiver & sender Type: indicates the higher layer protocol Usually IP (but also Novell IPX, AppleTalk, …) CRC: cyclic redundancy check Receiver checks & simply drops frames with errors

14 Ethernet Frame Structure (Continued) Addresses: 48-bit source and destination MAC addresses Receiver’s adaptor passes frame to network-level protocol If destination address matches the adaptor’s Or the destination address is the broadcast address (ff:ff:ff:ff:ff:ff) Or the destination address is a multicast group receiver belongs to Or the adaptor is in promiscuous mode Addresses are globally unique Assigned by NIC vendors (top three octets specify vendor)  During any given week, > 500 vendor codes seen at LBNL Data: Maximum: 1,500 bytes Minimum: 46 bytes (+14 bytes header + 4 byte trailer = 512 bits)

15 Ethernet, con’t Connectionless No handshaking between sending and receiving adapter Unreliable Receiving adapter doesn’t send ACKs or NACKs Packets passed to network layer can have gaps Gaps will be filled if application is using TCP Otherwise, application will see the gaps 2,700 page IEEE standardization Note, “classical” Ethernet has no length field … … instead, sender pauses 9.2  sec when done shoehorns in a length field

16 Benefits of Ethernet Easy to administer and maintain Inexpensive Increasingly higher speed Evolved from shared media to switches And from electrical signaling to also optical Changes everything except the frame format A good general lesson for evolving the Internet: The right interface (service model) can often accommodate unanticipated changes

17 Shuttling Data at Different Layers Different devices switch different things Physical layer: electrical signals (repeaters and hubs) Link layer: frames (bridges and switches) Network layer: packets (routers) Application gateway Transport gateway Router Bridge, switch Repeater, hub Frame header Packet header TCP header User data

18 Physical Layer: Repeaters Distance limitation in local-area networks Electrical signal becomes weaker as it travels Imposes a limit on the length of a LAN In addition to limit imposed by collision detection Repeaters join LANs together Analog electronic device Continuously monitors electrical signals on each LAN Transmits an amplified copy

19 Physical Layer: Hubs Joins multiple input lines electrically Do not necessarily amplify the signal Very similar to repeaters Also operates at the physical layer hub

20 Limitations of Repeaters and Hubs One large collision domain Every bit is sent everywhere So, aggregate throughput is limited E.g., three departments each get 10 Mbps independently … and then if connect via a hub must share 10 Mbps Cannot support multiple LAN technologies Repeaters/hubs do not buffer or interpret frames So, can’t interconnect between different rates or formats E.g., no mixing 10 Mbps Ethernet & 100 Mbps Ethernet Limitations on maximum nodes and distances Does not circumvent limitations of shared media E.g., still cannot go beyond 2500 meters on Ethernet

21 5 Minute Break Questions Before We Proceed?

22 Link Layer: Switches / Bridges Connect two or more LANs at the link layer Extracts destination address from the frame Looks up the destination in a table Forwards the frame to the appropriate LAN segment Or point-to-point link, for higher-speed Ethernet Each segment is its own collision domain hub switch/bridge collision domain

23 Switches & Concurrent Comunication Host A can talk to C, while B talks to D switch A B C D If host has (dedicated) point-to-point link to switch: –Full duplex: each connection can send in both directions oAt the same time (otherwise, “half duplex”) –Completely avoids collisions oNo need for carrier sense, collision detection, and so on

24 Advantages Over Hubs & Repeaters Only forwards frames as needed Filters frames to avoid unnecessary load on segments Sends frames only to segments that need to see them Extends the geographic span of the network Separate collision domains allow longer distances Improves privacy by limiting scope of frames Hosts can “snoop” the traffic traversing their segment … but not all the rest of the traffic If needed, applies carrier sense & collision detection Does not transmit when the link is busy Applies exponential back-off after a collision Joins segments using different technologies

25 Disadvantages Over Hubs & Repeaters Higher cost More complicated devices that cost more money Delay in forwarding frames Bridge/switch must receive and parse the frame … and perform a look-up to decide where to forward Introduces store-and-forward delay Can ameliorate using cut-through switching  Start forwarding after only header received Need to learn where to forward frames Bridge/switch needs to construct a forwarding table Ideally, without intervention from network administrators Solution: self-learning

26 Motivation For Self Learning Large benefit if switch/bridge forward frames only on segments that need them Allows concurrent use of other links Switch table Maps destination MAC address to outgoing interface Goal: construct the switch table automatically switch A B C D

27 Self Learning: Building the Table When a frame arrives Inspect source MAC address Associate address with the incoming interface Store mapping in the switch table Use time-to-live field to eventually forget the mapping Soft state A B C D Switch just learned how to reach A.

28 Self Learning: Handling Misses When frame arrives with unfamiliar destination Forward the frame out all of the interfaces (“flooding”) … except for the one where the frame arrived Hopefully, this case won’t happen very often When destination replies, switch learns that node, too A B C D When in doubt, shout!

29 Switch Filtering / Forwarding When switch receives a frame: index the switch table using MAC dest address if entry found for destination { if dest on segment from which frame arrived then drop frame else forward frame on interface indicated } else flood forward on all but the interface on which the frame arrived Problems?

30 Flooding Can Lead to Loops Switches sometimes need to broadcast frames Upon receiving a frame with an unfamiliar destination Upon receiving a frame sent to the broadcast address Implemented by flooding Flooding can lead to forwarding loops E.g., if the network contains a cycle of switches Either accidentally, or by design for higher reliability “Broadcast storm”

31 Solution: Spanning Trees Ensure the forwarding topology has no loops Avoid using some of the links when flooding … to prevent loop from forming Spanning tree (K&R pp ) Sub-graph that covers all vertices but contains no cycles Links not in the spanning tree do not forward frames

32 Constructing a Spanning Tree Need a distributed algorithm Switches cooperate to build the spanning tree … and adapt automatically when failures occur Key ingredients of the algorithm Switches need to elect a root The switch w/ smallest identifier (MAC addr) Each switch determines if its interface is on the shortest path from the root Excludes it from the tree if not Messages (Y, d, X) From node X Proposing Y as the root And the distance is d root One hop Three hops

33 Steps in Spanning Tree Algorithm Initially, each switch proposes itself as the root Switch sends a message out every interface … proposing itself as the root with distance 0 Example: switch X announces (X, 0, X) Switches update their view of the root Upon receiving message (Y, d, Z) from Z, check Y’s id If new id smaller, start viewing that switch as root Switches compute their distance from the root Add 1 to the distance received from a neighbor Identify interfaces not on shortest path to the root … and exclude them from the spanning tree If root or shortest distance to it changed, flood updated message (Y, d+1, X)

34 Example From Switch #4’s Viewpoint Switch #4 thinks it is the root Sends (4, 0, 4) message to 2 and 7 Then, switch #4 hears from #2 Receives (2, 0, 2) message from 2 … and thinks that #2 is the root And realizes it is just one hop away Then, switch #4 hears from #7 Receives (2, 1, 7) from 7 And realizes this is a longer path So, prefers its own one-hop path And removes 4-7 link from the tree

35 Example From Switch #4’s Viewpoint Switch #2 hears about switch #1 Switch 2 hears (1, 1, 3) from 3 Switch 2 starts treating 1 as root And sends (1, 2, 2) to neighbors Switch #4 hears from switch #2 Switch 4 starts treating 1 as root And sends (1, 3, 4) to neighbors Switch #4 hears from switch #7 Switch 4 receives (1, 3, 7) from 7 And realizes this is a longer path So, prefers its own three-hop path And removes 4-7 Iink from the tree

36 Robust Spanning Tree Algorithm Algorithm must react to failures Failure of the root node Need to elect a new root, with the next lowest identifier Failure of other switches and links Need to recompute the spanning tree Root switch continues sending messages Periodically reannouncing itself as the root (1, 0, 1) Other switches continue forwarding messages Detecting failures through timeout (soft state) Switch waits to hear from others Eventually times out and claims to be the root

37 Moving From Switches to Routers Advantages of switches over routers Plug-and-play Fast filtering and forwarding of frames Disadvantages of switches over routers Topology restricted to a spanning tree Large networks require large ARP tables Broadcast storms can cause the network to collapse Can’t accommodate non-Ethernet segments (why not?)

38 Comparing Hubs, Switches & Routers hubs switches routers traffic isolation no yes plug & play yes no optimized routing no yes cut-through yes yes * no *

39 Summary Ethernet as an exemplar of link-layer technology Simplest form, single segment: Carrier sense, collision detection, and random access Extended to span multiple segments: Hubs & repeaters: physical-layer interconnects Bridges / switches: link-layer interconnects Key ideas in switches Self learning of the switch table Spanning trees