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

Similar documents
Goals of Today s Lecture. Adaptors Communicating

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

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

Links. CS125 - mylinks 1 1/22/14

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

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

Multiple Access and Spanning Tree

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

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

CSC 4900 Computer Networks: The Link Layer

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

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

Chapter 5 Link Layer and LANs

Links Reading: Chapter 2

ECE 4450:427/527 - Computer Networks Spring 2017

Data Link Layer: Multi Access Protocols

Data Link Layer: Overview, operations

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

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

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

ECE 158A: Lecture 13. Fall 2015

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

EE 122: Ethernet and

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

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

Chapter 5: Link layer

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

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

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

CSC 401 Data and Computer Communications Networks

Link layer, LANs: outline. Chapter 5-1 Link Layer. Link layer: introduction. Link layer services

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

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

Chapter V: Link Layer

Lecture 19. Principles behind data link layer services Framing Multiple access protocols

Chapter 5 Link Layer and LANs

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

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

Computer Networks Medium Access Control. Mostafa Salehi Fall 2008

Link Layer and Ethernet

Module 10 Data Link Layer CS655! 10-1!

Link Layer and Ethernet

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

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

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

CS 3640: Introduction to Networks and Their Applications

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

Reminder: Datalink Functions Computer Networking. Datalink Architectures

Master Course Computer Networks IN2097

CSCD 330 Network Programming

Chapter 5 Link Layer and LANs

Project 3a is out! Goal: implement a basic network firewall. l We give you the VM & framework. l You implement the firewall logic.

MULTIPLE ACCESS PROTOCOLS 2. 1

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

Computer Network Fundamentals Spring Week 3 MAC Layer Andreas Terzis

Medium Access Control

Computer and Network Security

Chapter 6: Link layer and LANs. Link layer, LANs: outline. Link layer: introduction. Link layer: context. Link layer services (more)

Multiple Access Links and Protocols

Chapter V: Link Layer

The Link Layer II: Ethernet

Link Layer and LANs. Our Goals. Link Layer

CS 716: Introduction to communication networks. - 9 th class; 19 th Aug Instructor: Sridhar Iyer IIT Bombay

CC451 Computer Networks

Master Course Computer Networks IN2097

Physical Layer. Medium Access Links and Protocols. Point-to-Point protocols. Modems: Signaling. Modems Signaling. Srinidhi Varadarajan

Link Layer: Retransmissions

CIS 551 / TCOM 401 Computer and Network Security. Spring 2007 Lecture 7

CMPE 150: Introduction to Computer Networks

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

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

CSE 461: Multiple Access. Homework: Chapter 2, problems 1, 8, 12, 18, 23, 24, 35, 43, 46, and 58

Medium Access Protocols

CSE 461: Multiple Access Networks. This Lecture

Chapter 5: DataLink Layer

CS162 Operating Systems and Systems Programming Lecture 21. Networking. April 8, 2010 Ion Stoica

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

Broadcast Links, Addressing and Media Access Control. Link Layer B. Link and Physical Layers. MAC Addresses

Data Link Layer -2- Network Access

Data Link Layer -2- Network Access

CSCD 330 Network Programming Fall 2012

Module 4 Data Link Layer CS655! 4-1!

CSMA/CD (Collision Detection)

COMP/ELEC 429/556 Introduction to Computer Networks

CS 3516: Computer Networks

Chapter 12 Multiple Access 12.1

Link Layer and LANs. CMPS 4750/6750: Computer Networks

Redes de Computadores. Medium Access Control

Summary of MAC protocols

CS 640 Lecture 4: 09/11/2014

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

CMPE 257: Wireless and Mobile Networking

CS 3640: Introduction to Networks and Their Applications

CS 4453 Computer Networks Winter

Medium Access Control

Medium Access Control

Housekeeping. Fall /5 CptS/EE 555 1

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

Chapter 6 Medium Access Control Protocols and Local Area Networks

Data Link Layer, Part 5. Medium Access Control

Transcription:

Your Future?! Who is planning to go to grad school (in CS)? Links and LANs! Who is interested in research possibilities? EE 122: Intro to Communication Networks Fall 2010 (MW 4-5:30 in 101 Barker) Scott Shenker TAs: Sameer Agarwal, Sara Alspaugh, Igor Ganichev, Prayag Narula http://inst.eecs.berkeley.edu/~ee122/ Materials with thanks to Jennifer Rexford, Ion Stoica, Vern Paxson and other colleagues at Princeton and UC Berkeley 1 2 Regrading of Homework! Requests for regrading must be made within one week of when the work was returned. To ask for a regrade, attach a page that specifies: The problem(s) you want to be regraded For each of these problems specify clearly why do you think the problem was misgraded Without this page, your work will not be regraded. Your entire homework may be regraded Score could decrease, stay the same, or increase Other Announcements! Won t finish topic (links/lans) today It is your responsibility to slow me down Ask questions, yawn loudly, snore, whatever it takes! Will continue into next Monday s lecture. 3 4 Goals of Todayʼs Lecture! Link-layer services Arbitrating access to a shared medium Random Access MAC (Media Access Control) : single segment : spanning multiple segments [Monday] Spanning trees [Monday] Link-Layer Services! 5 6

Message, Segment, Packet, and Frame! host host HTTP message HTTP HTTP Today We Focus on Link-Layer! SONET SONET frame SONET frame frame TCP router TCP segment router TCP What functions these technologies provide IP IP packet IP IP packet IP IP packet IP How they implement those functions SONET SONET frame SONET frame frame 7 8 Adaptor-to-Adaptor Communication! sending node datagram frame adaptor link layer protocol frame adaptor receiving node Link layer implemented in adaptor (network card; NIC) card, 802.11 card (why?) Sending side: Encapsulates datagram in a frame Determines local addressing, adds error checking, controls transmission Receiving side Recognizes arrival, looks for errors, possibly acknowledges Extracts datagram and passes to receiving node 9 Link-Layer Services! Encoding Representing the 0s and 1s Framing Encapsulating packet into frame, adding header, trailer Using MAC addresses rather than IP addresses Error detection Errors caused by signal attenuation, noise Receiver detects presence, may ask for repeat (ARQ) Resolving contention Deciding who gets to transmit when multiple senders want to use a shared media Flow control (pacing between sender & receiver) 10 Framing! Specify how blocks of data are transmitted between two nodes connected on the same physical media Service provided by the data link layer Implemented by the network adaptor Challenges Decide when a frame starts & ends How hard can that be? Simple Approach to Framing: Counting! Sender: begin frame with byte(s) giving length Receiver: extract this length and count 53! Frame contents! 21! Frame contents! 53 bytes of data 21 bytes of data How can this go wrong? On occasion, the count gets corrupted 58! Frame contents! 21! Frame 94! contents! 11 58 bytes of data misdelivered Bogus new frame length; desynchronization 12

Desynchronization! Once framing is desynchronized, stays that way Need a method to resynchronize But once we have that method, why use counting? Sounds like E2E-like argument. Framing: Sentinels! Delineate frame with special pattern e.g., 01111110!start, 01111111!end 01111110! Frame contents! 01111111! Problem: what if sentinel occurs within frame? Solution: escape the special characters E.g., sender always inserts a 0 after five 1s receiver always removes a 0 appearing after five 1s Similar to escaping special characters in C programs 13 14 When Receiver Sees Five 1s! 01111110! Frame content! 01111111! Example! 01111110 0111111011111011111001 01111111 If next bit 0, remove it, and begin counting again Because this must be stuffed bit Can t be at beginning/end of frame Sender: Five 1s! insert a 0 01111110 0111110101111100111110001 01111111 If next bit 1, then: If following bit is 0, this is start of frame o receiver has seen 01111110 If following bit is 1, this is end of frame o receiver has seen 01111111 15 Start frame Receiver: Five 1s and next bit 0! remove it End frame 01111110 0111111011111011111001 01111111 16 Sentinels and Synchronization! Can Sentinels ever get desynchronized? No! Every analysis of start/end is independent Clock-Based Framing (SONET)! SONET (Synchronous Optical NETwork) SONET endpoints maintain clock synchronization Frames have fixed size (e.g., 125 µsec) No ambiguity about start & stop of frame But may be wasteful NRZ encoding To avoid long sequences of 0 s or 1 s payload is XOR-ed with special 127-bit pattern w/ many 0-1/1-0 transitions 17 18

Error Detection! Errors are unavoidable Electrical interference, thermal noise, etc. Error detection Transmit extra (redundant) information Use redundant information to detect errors Extreme case: send two copies of the data Trade-off: accuracy vs. overhead Techniques for detecting errors Parity checking Checksum Cyclic Redundancy Check (CRC) 19 Error Detection: Parity! Add an extra bit to a 7-bit code Odd parity: ensure an odd number of 1s E.g., 0101011 becomes 01010111 Even parity: ensure an even number of 1s E.g., 0101011 becomes 01010110 Overhead: 1/7 th Power: Detects all 1-bit errors But: can t detect an even number of bit errors in a word Can use more bits to gain more power 20 Error Detection: Internet Checksum! Treat data as a sequence of 16-bit words Compute ones-complement sum of all 16-bit words Intermingles integrity of a large group of data Overhead: 16 bits Power: Catches 1-bit errors, most other errors But not, e.g., same bit flipped in two different words Error Detection: CRC! Family of powerful and principled algorithms Detects wide range of bit corruption patterns seen in practice Used by most modern link layers See K&R Section 5.2.3 Why do links use CRC but IP uses checksum? 21 22 Point-to-Point vs. Broadcast Media! Arbitrating Access in Shared Media! Point-to-point: dedicated pairwise communication Long-distance fiber link Point-to-point link between switch and host Broadcast: shared wire or medium Traditional 802.11 wireless LAN 23 24

Multiple Access Algorithm! Single shared broadcast channel Must avoid having multiple nodes speaking at once Otherwise, collisions lead to garbled data Multiple access mechanism Distributed algorithm for sharing the channel Algorithm determines which node can transmit Classes of techniques Channel partitioning: divide channel into pieces Taking turns: scheme for trading off who gets to transmit Random access: allow collisions, and then recover o Optimizes for the common case of only one sender Channel Partitioning: TDMA! TDMA: Time Division Multiple Access Access to channel in "rounds" Each station gets fixed length slot in each round Time-slot length is packet transmission time Unused slots go idle Example: 6-station LAN with slots 0, 3, and 4 Rounds Slots = 0 1 2 3 4 5 0 1 2 3 4 5 25 26 Channel Partitioning: FDMA! FDMA: Frequency Division Multiple Access Channel spectrum divided into frequency bands Each station assigned fixed frequency band Unused transmission time in frequency bands go idle Example: 6-station LAN, 1,3,4 have pkt, frequency bands 2,5,6 idle FDM cable frequency bands time 27 Taking Turns MAC protocols! slaves data Polling Master node invites slave nodes to transmit in turn data poll master Concerns: Polling overhead Latency Single point of failure (master) Token passing Control token passed from one node to next sequentially Node must have token to send Concerns: Token overhead Latency At mercy of any node 28 Why Did Beat Token Ring?! Performance? No! Latency? No! Cost (i.e., simplicity)? Yes! Reliability? Yes! 5 Minute Break! Questions Before We Proceed? 29 30

Random Access MAC Protocols! 31 Random Access MAC 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: How to detect collisions How to recover from collisions Examples ALOHA and Slotted ALOHA CSMA, CSMA/CD, CSMA/CA (wireless, covered later) 32 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 33 Where it all Started: AlohaNet! Norm Abramson left Stanford to surf Set up first data communication system for Hawaiian islands Hub at U. Hawaii, Oahu Had two radio channels: Random access: o Sites sending data Broadcast: o Hub rebroadcasting data 34 Slotted ALOHA! Slot-by-Slot Example! Assumptions All frames same size Time divided into equal slots (time to transmit a frame) Nodes are synchronized Nodes begin to transmit frames only at start of slots If two or more nodes transmit, all nodes detect collision Operation When node gets fresh data, transmits in next slot No collision: success! Collision: node retransmits frame in each subsequent slot with probability p until success 35 36

Efficiency of Slotted Aloha! What is the maximum fraction of successful transmissions? Suppose N stations have packets to send Each transmits in slot with probability p Probability of successful transmission is roughly: by a particular node i: S i = p (1-p) (N-1) by exactly one of N nodes: S= N p (1-p) (N-1) Limiting behavior: For fixed p, S! 0 as N increases But if p = 1/N, then S! 1/e = 0.37 as N increases Max efficiency is only slightly greater than 1/3! 37 Pros and Cons of Slotted Aloha! Pros Single active node can continuously transmit at full rate of channel Highly decentralized: only need slot synchronization Simple Cons Wasted slots: Idle Collisions Nodes should detect collision in less than time to transmit packet Clock synchronization 38 Improving on Slotted Aloha! Fewer wasted slots Need to decrease collisions and empty slots Don t waste full slots on collisions Need to decrease time to detect collisions Avoid need for synchronization Synchronization is hard to achieve CSMA (Carrier Sense Multiple Access)! CSMA: listen before transmit If channel sensed idle: transmit entire frame If channel sensed busy, defer transmission Human analogy: don t interrupt others! 39 40 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 Do we still needs slots? 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: Compare transmitted, received signals Collision detection 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 (later) Would slots hurt or help? 41 42

CSMA/CD Collision Detection! Both B and D can tell that collision occurred. Limits on CSMA/CD Network Length! A! B! latency d! 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 43 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 44 Limits on CSMA/CD Network Length! A! B! latency d! Performance of CSMA/CD! Time wasted in collisions Proportional to d 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 : 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 45 Time spend transmitting Proportional to packet length p Efficiency ~ 1/(1+5d/p) For large packets, small distances, E ~ 1 Note that as bandwidth increases, p decreases That is why high-speed LANs are all switched 46 Game Theory?! What happens when one node has CD and the other doesn t? When do we see this in real life? (Single Segment)! 47 48

: 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: binary 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 49 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 50 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) 51, 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 has no length field instead, sender pauses 9.2 µsec when done 802.3 shoehorns in a length field 52 Benefits of! Easy to administer and maintain Inexpensive Increasingly higher speed Evolvable Evolution of! From shared media to switches Why? From electrical signaling to also optical Changed everything except the frame format Lesson The right can accommodate many changes Implementation is hidden behind 53 54

BEB: Reality vs Theory! In reality, binary exponential backoff (BEB) Performs well Is irrelevant (why?) In theory, a very interesting algorithm Stability of algorithm for finite N only proved in 1985 All backoff algorithms unstable for infinite N (1985) o Poisson model: infinite user pool, all with infinitesimal demand Sums to finite load" MAC Channel Capture in BEB! Two hosts, each with infinite packets to send With BEB, there is a finite chance that the first one to have a successful transmission will never relinquish the channel The other host will never send a packet 55 56 Different Backoff Functions! Exponential: Channel capture Efficiency less than 1 Next Lecture! Finish up Links and LANs : spanning multiple segments Spanning trees Superlinear polynomial: Channel capture Efficiency is 1 (for any finite N) Sublinear polynomial: No channel capture Efficiency is less than 1 (and goes to zero for large N) Remember: HW #2 due Project 1A due Requests for regrades due 57 58