Ethernet. EE 122: Intro to Communication Networks. Fall 2007 (WF 4-5:30 in Cory 277) Vern Paxson TAs: Lisa Fowler, Daniel Killebrew & Jorge Ortiz

Similar documents
ECE 158A: Lecture 13. Fall 2015

Announcements. Ethernet. Goals of Today s Lecture. Three Ways to Share the Media. Random Access Protocols. Key Ideas of Random Access

Links Reading: Chapter 2. Goals of Todayʼs Lecture. Message, Segment, Packet, and Frame

Message, Segment, Packet, and Frame Link-layer services Encoding, framing, error detection, transmission control Error correction and flow control

Switching and Forwarding Reading: Chapter 3 1/30/14 1

Your Future?! Links and LANs! Regrading of Homework! Other Announcements! Goals of Todayʼs Lecture! Link-Layer Services!

Goals of Today s Lecture. Adaptors Communicating

Communication Networks

Multiple Access and Spanning Tree

Professor Yashar Ganjali Department of Computer Science University of Toronto.

Data Link Layer. Our goals: understand principles behind data link layer services: instantiation and implementation of various link layer technologies

L2 Addressing and data plane. Benjamin Baron

Links. CS125 - mylinks 1 1/22/14

Review. Error Detection: CRC Multiple access protocols. LAN addresses and ARP Ethernet. Slotted ALOHA CSMA/CD

Medium Access Protocols

Principles behind data link layer services

Principles behind data link layer services:

Principles behind data link layer services:

Summary of MAC protocols

Announcements. IP Forwarding & Transport Protocols. Goals of Today s Lecture. Are 32-bit Addresses Enough? Summary of IP Addressing.

High Level View. EE 122: Ethernet and Random Access protocols. Medium Access Protocols

Computer Networks Principles LAN - Ethernet

Computer Networks. Today. Principles of datalink layer services Multiple access links Adresavimas, ARP LANs Wireless LANs VU MIF CS 1/48 2/48

EE 122: Ethernet and

Lecture 5 The Data Link Layer. Antonio Cianfrani DIET Department Networking Group netlab.uniroma1.it

CSC 4900 Computer Networks: Link Layer (2)

Topics. Link Layer Services (more) Link Layer Services LECTURE 5 MULTIPLE ACCESS AND LOCAL AREA NETWORKS. flow control: error detection:

Lecture 6 The Data Link Layer. Antonio Cianfrani DIET Department Networking Group netlab.uniroma1.it

Reminder: Datalink Functions Computer Networking. Datalink Architectures

Chapter 5 Link Layer and LANs

CS 43: Computer Networks Switches and LANs. Kevin Webb Swarthmore College December 5, 2017

CSC 4900 Computer Networks: The Link Layer

CS 43: Computer Networks. 27: Media Access Contd. December 3, 2018

Links Reading: Chapter 2

Computer Network Fundamentals Spring Week 3 MAC Layer Andreas Terzis

The Link Layer II: Ethernet

Master Course Computer Networks IN2097

Chapter 5 Link Layer and LANs

Lecture 9: Bridging. CSE 123: Computer Networks Alex C. Snoeren

Link Layer and Ethernet

Addressing and Switching in the Link Layer

Data Link Layer: Multi Access Protocols

CMPE 150/L : Introduction to Computer Networks. Chen Qian Computer Engineering UCSC Baskin Engineering Lecture 18

The Link Layer and LANs. Chapter 6: Link layer and LANs

Link Layer and Ethernet

CMPE 150/L : Introduction to Computer Networks. Chen Qian Computer Engineering UCSC Baskin Engineering Lecture 16

Some portions courtesy Srini Seshan or David Wetherall

CSCI-1680 Link Layer Wrap-Up Rodrigo Fonseca

Lecture 6. Data Link Layer (cont d) Data Link Layer 1-1

CS 455/555 Intro to Networks and Communications. Link Layer

CSCI-1680 Link Layer Wrap-Up Rodrigo Fonseca

A primer on modern LANs

1-1. Switching Networks (Fall 2010) EE 586 Communication and. November 8, Lecture 30

Getting Connected (Chapter 2 Part 4) Networking CS 3470, Section 1 Sarah Diesburg

Chapter 5 Link Layer and LANs

EE 122: Introduction To Communication Networks. Some Questions & Answers

Chapter 5: Link layer

Link Layer and LANs. Our Goals. Link Layer

CSCI-1680 Link Layer Wrap-Up Rodrigo Fonseca

Adaptors Communicating. Link Layer: Introduction. Parity Checking. Error Detection. Multiple Access Links and Protocols

CS 43: Computer Networks Media Access. Kevin Webb Swarthmore College November 30, 2017

Growth. Individual departments in a university buy LANs for their own machines and eventually want to interconnect with other campus LANs.

Networking Acronym Smorgasbord: , DVMRP, CBT, WFQ

CCM 4300 Lecture 6 Computer Networks, Wireless and Mobile Communications. Dr Shahedur Rahman. Room: T115

The Link Layer and LANs: Ethernet and Swiches

ECE 4450:427/527 - Computer Networks Spring 2017

Link Layer and LANs 안상현서울시립대학교컴퓨터 통계학과.

Chapter V: Link Layer

CHAPTER 7 MAC LAYER PROTOCOLS. Dr. Bhargavi Goswami Associate Professor & Head Department of Computer Science Garden City College

CS 455/555 Intro to Networks and Communications. Link Layer Addressing, Ethernet, and a Day in the Life of a Web Request

Goals for Today s Class. EE 122: Networks & Protocols. What Global (non-digital) Communication Network Do You Use Every Day?

Computer Networks Medium Access Control. Mostafa Salehi Fall 2008

ECSE 414 Fall 2014 Final Exam Solutions

CCM 4300 Lecture 5 Computer Networks, Wireless and Mobile Communications. Dr Shahedur Rahman. Room: T115

Links. COS 461: Computer Networks Spring Mike Freedman h?p://

CSE 123A Computer Networks

Redes de Computadores. Medium Access Control

TCP Service Model. Announcements. TCP: Reliable, In-Order Delivery. Today s Lecture. TCP Support for Reliable Delivery. TCP Header

CSMA/CD (Collision Detection)

Chapter 5: DataLink Layer

Principles behind data link layer services:

Data Link Layer: Overview, operations

Lecture 9 The Data Link Layer part II. Antonio Cianfrani DIET Department Networking Group netlab.uniroma1.it

Lecture 9: Bridging & Switching"

Outline. Introduction to Networked Embedded Systems - Embedded systems Networked embedded systems Embedded Internet - Network properties

Master Course Computer Networks IN2097

Lecture 4b. Local Area Networks and Bridges

King Fahd University of Petroleum and Minerals College of Computer Sciences and Engineering Department of Computer Engineering

Adaptors Communicating. Link Layer: Introduction. Parity Checking. Error Detection. Multiple Access Links and Protocols

EE 122: IP Forwarding and Transport Protocols

CS 3516: Advanced Computer Networks

Chapter 5 Link Layer. Computer Networking: A Top Down Approach. 6 th edition Jim Kurose, Keith Ross Addison-Wesley March 2012

Link layer: introduction

Lecture 8 Link Layer: functionality, error detection, media access algorithm

CMPE 150: Introduction to Computer Networks

CS 3640: Introduction to Networks and Their Applications

Chapter 12 Multiple Access 12.1

Goal and Outline. Computer Networking. What Do We Need? Today s Story Lecture 3: Packet Switched Networks Peter Steenkiste

CSCI-1680 Link Layer Wrap-Up Rodrigo Fonseca

RMIT University. Data Communication and Net-Centric Computing COSC 1111/2061/1110. Lecture 8. Medium Access Control Methods & LAN

Transcription:

Ethernet EE 122: Intro to Communication Networks Fall 2007 (WF 4-5:30 in Cory 277) Vern Paxson TAs: Lisa Fowler, Daniel Killebrew & Jorge Ortiz http://inst.eecs.berkeley.edu/~ee122/ Materials with thanks to Jennifer Rexford, Ion Stoica, and colleagues at Princeton and UC Berkeley 1 Announcements Solutions for Homework #1 are now out. Pick up your graded homeworks in Section, or swing by Jorge s office hours Phase 2 of Project #1 is now out. No lecture next Wednesday, Oct 10 And I won t have office hours that day Midterm Friday Oct 12 Closed book, no gadgets You can have one 8.5x11 sheet of notes (both sides) I will have extra office hours that day, 1-2:30 And by appointment on Monday Oct 8 2 1

Goals of Today s Lecture MAC (Media Access Control) protocols, esp. CSMA/CD o 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): o 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 2

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 Random Access Protocols When node has packet to send Transmit at full channel data rate No a priori coordination among nodes Two or more transmitting nodes collision Data lost Random access MAC protocol specifies (1) how to detect collisions, (2) how to recover from collisions Examples ALOHA and Slotted ALOHA (discussed in Section) CSMA, CSMA/CD (Ethernet), CSMA/CA (wireless) o CSMA = Carrier Sense Multiple Access 6 3

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 7 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 o Reception shut off while transmitting o Even if on, might not be able to hear the other sender, even though the receiver can o Leads to use of collision avoidance instead 8 4

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 9 Limits on CSMA/CD Network Length A latency d B 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 10 5

Limits on CSMA/CD Network Length A latency d B 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) o 512 bits = 51.2 µsec (at 10 Mbit/sec) o For light in vacuum, 51.2 µsec 15,000 meters vs. 5,000 meters round trip to wait for collision 11 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 12 6

Ethernet Frame Structure Sending adapter encapsulates packet in frame Preamble: synchronization Seven bytes with pattern 10101010, followed by one byte with pattern 10101011 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 13 Ethernet Frame Structure (Continued) Addresses: 48-bit source and destination MAC addresses Receiver s adaptor passes frame to network-level protocol o If destination address matches the adaptor s o Or the destination address is the broadcast address (ff:ff:ff:ff:ff:ff) o Or the destination address is a multicast group receiver belongs to o Or the adaptor is in promiscuous mode Addresses are globally unique o 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) 14 7

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 802.3 standardization http://standards.ieee.org/getieee802/802.3.html Note, classical Ethernet has no length field instead, sender pauses 9.2 µsec when done 802.3 shoehorns in a length field 15 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: o The right interface (service model) can often accommodate unanticipated changes 16 8

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 Frame header Packet header TCP header User data Repeater, hub 17 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 o 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 Repeater 18 9

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 hub hub hub 19 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 20 10

5 Minute Break Questions Before We Proceed? 21 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 o Or point-to-point link, for higher-speed Ethernet Each segment is its own collision domain switch/bridge collision domain hub collision domain collision domain 22 11

Switches & Concurrent Comunication Host A can talk to C, while B talks to D B A C switch D If host has (dedicated) point-to-point link to switch: Full duplex: each connection can send in both directions o At the same time (otherwise, half duplex ) Completely avoids collisions o No need for carrier sense, collision detection, and so on 23 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 24 12

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 o 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 25 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 B A C switch D 26 13

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 o Soft state Switch just learned how to reach A. B A C D 27 Self Learning: Handling Misses When frame arrives with unfamiliar destination Forward the frame out all of the interfaces ( flooding ) o except for the one where the frame arrived Hopefully, this case won t happen very often When destination replies, switch learns that node, too When in doubt, shout! B A C D 28 14

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 Problems? forward on all but the interface on which the frame arrived 29 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 o Either accidentally, or by design for higher reliability Broadcast storm 30 15

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. 406-408) Sub-graph that covers all vertices but contains no cycles Links not in the spanning tree do not forward frames 31 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 o The switch w/ smallest identifier (MAC addr) Each switch determines if its interface is on the shortest path from the root o Excludes it from the tree if not Messages (Y, d, X) One hop o From node X o Proposing Y as the root o And the distance is d root Three hops 32 16

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) 33 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 4 3 7 2 1 5 6 34 17

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 1 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 4 3 7 2 5 6 35 Robust Spanning Tree Algorithm Algorithm must react to failures Failure of the root node o Need to elect a new root, with the next lowest identifier Failure of other switches and links o 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 36 18

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?) 37 Comparing Hubs, Switches & Routers traffic isolation hubs switches routers no yes yes plug & play yes yes no optimized routing no no yes cut-through yes yes * no * 38 19

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 Next time: midterm review 39 20