Goals of Today s Lecture. Adaptors Communicating

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

Links. CS125 - mylinks 1 1/22/14

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

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

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

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

Chapter 5 Link Layer and LANs

Data Link Layer: Overview, operations

ECE 4450:427/527 - Computer Networks Spring 2017

Data Link Layer: Multi Access Protocols

CSC 4900 Computer Networks: The Link Layer

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

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

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

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

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

Chapter 5: Link layer

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

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

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

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

Links Reading: Chapter 2

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

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

CSC 401 Data and Computer Communications Networks

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

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. Computer Networking: A Top Down Approach. 6 th edition Jim Kurose, Keith Ross Addison-Wesley March 2012

CSCD 330 Network Programming

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

Chapter 5 Link Layer and LANs

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

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

Multiple Access and Spanning Tree

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

ECE 158A: Lecture 13. Fall 2015

EE 122: Ethernet and

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

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

Chapter V: Link Layer

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

CMPE 150: Introduction to Computer Networks

MULTIPLE ACCESS PROTOCOLS 2. 1

CC451 Computer Networks

Medium Access Control

CSCD 330 Network Programming Fall 2012

Computer Networks Medium Access Control. Mostafa Salehi Fall 2008

Multiple Access Links and Protocols

SC250 Computer Networking I. Link Layer. Prof. Matthias Grossglauser LCA/I&C.

CS 4453 Computer Networks Winter

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

CSMC 417. Computer Networks Prof. Ashok K Agrawala Ashok Agrawala Set 4. September 09 CMSC417 Set 4 1

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

Computer Network Fundamentals Spring Week 3 MAC Layer Andreas Terzis

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

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

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

Master Course Computer Networks IN2097

Module 10 Data Link Layer CS655! 10-1!

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

Random Access. 1. Aloha. 2. Slotted Aloha 3. CSMA 4. CSMA/CD

Chapter V: Link Layer

Medium Access Control

Master Course Computer Networks IN2097

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

Computer Network. Direct Link Networks Reliable Transmission. rev /2/2004 1

Chapter 4 Network Layer

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

transferring datagram from one node data-link layer has responsibility of to adjacent node over a link 5-1 TDTS06 Computer networks

CS 3516: Computer Networks

Chapter 6 The Link Layer and LANs

Multiple Access. Data Communications and Networking

Chapter 5 Link Layer and LANs

Goal of Today s Lecture. EE 122: Designing IP. The Internet Hourglass. Our Story So Far (Context) Our Story So Far (Context), Con t

ECE 4450:427/527 - Computer Networks Spring 2017

Link Layer and LANs. Our Goals. Link Layer

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

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

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

Computer and Network Security

Reminder: Datalink Functions Computer Networking. Datalink Architectures

CS 3640: Introduction to Networks and Their Applications

Redes de Computadores. Medium Access Control

Data Link Layer Overview

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

Data Link Layer Overview

CS 640 Lecture 4: 09/11/2014

Data Link Layer Overview

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

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

Jaringan Komputer. Broadcast Network. Outline. MAC (Medium Access Control) Channel Allocation Problem. Dynamic Channel Allocation

Chapter 5: DataLink Layer

Medium Access Control

Link Layer and Ethernet

EITF25 Internet Techniques and Applications L4: Network Access. Stefan Höst

Data Link Layer Overview

Data Link Networks. Hardware Building Blocks. Nodes & Links. CS565 Data Link Networks 1

Housekeeping. Fall /5 CptS/EE 555 1

Islamic University of Gaza Faculty of Engineering Department of Computer Engineering ECOM 4021: Networks Discussion. Chapter 2.

Transcription:

Goals of Today s Lecture EE 122: Link Layer Ion Stoica TAs: Junda Liu, DK Moon, David Zats http://inst.eecs.berkeley.edu/~ee122/ (Materials with thanks to Vern Paxson, Jennifer Rexford, and colleagues at UC Berkeley) 1 Link-layer services 2 Encoding, framing, error detection, transmission control Error correction and flow control Arbitrating access to a shared medium Channel partitioning Taking turns Random access Carrier sense Collision detection Message, Segment, Packet, and Frame 3 host HTTP TCP packet frame router SONET HTTP message TCP segment packet SONET SONET frame router packet host HTTP TCP frame Adaptors Communicating sending node datagram frame adapter link layer protocol frame adapter receiving node Link layer implemented in adaptor (network card; NIC) card, 802.11 card 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 4 Link-Layer Services Encoding Representing the 0s and 1s Framing Encapsulating packet into frame, adding header, trailer Using MAC addresses rather than 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 mediaflow control (pacing 5 between sender & receiver) 6 Encoding Signals propagate over physical links How do we represent the bits? Physical layer issue Simplify some electrical engineering details Assume two discrete signals, high and low E.g., could correspond to two different voltages Basic approach High for a 1, low for a 0 How hard can it be? Sender & receiver agree: what s high, what s low And: when to read the signal 1

Non-Return to Zero (NRZ) 1 high signal; 0 low signal (Actual signals are of course not so sharp) How does receiver know where one bit stops and another begins? Coordination How do the sender and receiver agree on the running of the clock? Problem: without explicit synchronization, receiver s clock can drift with respect to sender s NRZ (non-return to zero) NRZ Receiver reads the signal on 7 the clock s leading edge Sender begins to transmit signal on clock s falling edge 8 Drift Recovery 9 NRZ Sender s Receiver s can drift Here we slip a bit, reading a 0 on leading edge rather than the correct 1 10 To avoid clock drift, we use the signal itself to coordinate Whenever see a transition (0 1 or 1 0) we know that corresponds to sender clock s trailing edge So pull our clock in phase towards it Problem with NRZ: long strings of 0s or 1s Quite common No transitions from low-to-high, or high-to-low recovery fails and receiver s clock begins to drift Non-Return to Zero Inverted (NRZI) 1 make transition; 0 stay at same level Fixes previous problem for long sequences of 1 s But not for 0 s Manchester Encoding 1 high-to-low transition; 0 low-to-high transition Addresses clock recovery problems But: physical signaling must be twice as fast To support 2 transitions/cycle Efficiency of 50% NRZI (non-return to zero inverted) Manchester 11 (read on falling edge) (read on each 12 rising edge) 2

4-bit/5-bit (100Mb/s ) Goal: address inefficiency of Manchester encoding, while avoiding long periods of no transition Solution: Use 5 bits to encode every sequence of four bits such that No 5 bit code has more than one leading 0 or two trailing 0 s Use NRZI to then encode the 5 bit codes Efficiency is 80% 5 Minute Break 4-bit 5-bit 4-bit 5-bit 13 0000 11110 0001 01001 0010 10100 0011 10101 0100 01010 0101 01011 0110 01110 0111 01111 1000 10010 1001 10011 1010 10110 1011 10111 1100 11010 1101 11011 1110 11100 1111 11101 Questions Before We Proceed? 14 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 content! 53 bytes of data 21! Frame content! 21 bytes of data How can this go wrong? On occasion, the count gets corrupted 58! Frame content! 21! Frame 94! content! Bogus new frame length; 15 16 58 bytes of data misdelivered desynchronization Framing: Sentinels Delineate frame with special pattern Both can be the same, e.g., 01111110 Problem: what if sentinel occurs within frame? Solution: escape the special characters Sender: insert a 0 after five 1s in data portion Receiver: when it sees five 1s makes a decision on next two bits: 17 01111110! Frame content! 01111110! If next bit 0 (this is a stuffed bit), remove it If next bit, look at next bit If 0, this is end of frame (receiver has seen 0111110) If 1 this is an error, discard frame (receiver as seen 01111111) Example 01111110 0111111011111011111001 01111110 Sender: stuff bits 01111110 0111110101111100111110001 01111110 Receiver: identify & remove stuffed bits Five 1s insert a 0 Five 1s and next bit 0 remove it Five 1s, and next two bits 10 end/start frame 01111110 0111111011111011111001 01111110 18 3

-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 19 To avoid long sequences of 0 s or 1 s payload is XORed with special 127-bit pattern w/ many 0-1/1-0 transitions What problem can that lead to? Error Detection Errors are unavoidable Electrical interference, thermal noise, etc. Error detection Transmit extra (redundant) information 20 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) 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 21 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 Error Detection Techniques, con t 22 Internet Checksum Treat data as a sequence of 16-bit words Compute ones-complement sum of all the 16-bit words Intermingles integrity of a large group of data Overhead: 16 bits Power: Catches 1-bit errors, most other errors But not, for example, same bit flipped in two different words Cyclic Redundancy Check (CRC) Family of quite powerful, 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 Point-to-Point vs. Broadcast 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 Multiple Access Algorithm Single shared broadcast channel 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 Optimizes for the common case of only one sender 23 24 4

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 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 Rounds Slots = 0 1 2 3 4 5 0 1 2 3 4 5 FDM cable frequency bands time 25 26 Taking Turns MAC protocols data 27 Polling Master node invites slave nodes to transmit in turn data poll master Concerns: Polling overhead Latency slaves 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 Single point of failure (token) 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 28 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 Key Ideas of Random Access Where it all Started: AlohaNet Carrier sense 29 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 Norm Abramson left Stanford in search of surfing Set up first radio-based data communication system connecting the Hawaiian islands Hub at Alohanet HQ (Univ. Hawaii, Oahu) Other sites spread among the islands Had two radio channels: Random access: sites sent data on this channel Broadcast: only used by hub to rebroadcast incoming data 30 5

Slotted ALOHA Slotted ALOHA 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 No carrier sense If two or more nodes transmit, all nodes detect collision Operation When node obtains fresh frame, transmits in next slot No collision: node can send new frame in next slot Collision: node retransmits frame in each subsequent slot with probability p until success Pros Single active node can continuously transmit at full rate of channel Highly decentralized: only slots in nodes need to be in sync Simple Cons Collisions, wasting slots Idle slots Nodes may be able to detect collision in less than time to transmit packet synchronization 31 32 Efficiency of Slotted Aloha CSMA (Carrier Sense Multiple Access) 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 S is (very approximate analysis!): by a particular node i: S i = p (1-p) (N-1) by exactly one of N nodes S = Prob (only one transmits) = N p (1-p) (N-1) <= 1/e = 0.37 but must have p proportional to 1/N 33 Collisions hurt the efficiency of ALOHA protocol 34 Utilization 1/e 37% CSMA: listen before transmit If channel sensed idle: transmit entire frame If channel sensed busy, defer transmission Human analogy: don t interrupt others! CSMA Collisions CSMA/CD (Collision Detection) 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 35 CSMA/CD: carrier sensing, deferral as in CSMA 36 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 6

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 37 Three Ways to Share the Media Channel partitioning MAC protocols (TDMA, FDMA): 38 Share channel efficiently and fairly at high load Inefficient at low load: delay in channel access, 1/N bandwidth allocated even if only 1 active node! Taking turns protocols 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 Next Lecture + bridges/hubs/switches K&R 5.5, 5.6 39 7