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

Similar documents
Goals of Today s Lecture. Adaptors Communicating

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

CSC 4900 Computer Networks: The Link Layer

Data Link Layer: Multi Access Protocols

ECE 4450:427/527 - Computer Networks Spring 2017

Data Link Layer: Overview, operations

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

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

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

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

Chapter 5: Link layer

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

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

Links Reading: Chapter 2

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

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

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

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

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

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

CSC 401 Data and Computer Communications Networks

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

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

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

CMPE 150: Introduction to Computer Networks

Chapter 5 Link Layer and LANs

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

CSCD 330 Network Programming

Chapter V: Link Layer

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

CC451 Computer Networks

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

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

EE 122: Ethernet and

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

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

MULTIPLE ACCESS PROTOCOLS 2. 1

CS 3516: Computer Networks

Multiple Access and Spanning Tree

Multiple Access Links and Protocols

Module 10 Data Link Layer CS655! 10-1!

CSCD 330 Network Programming Fall 2012

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

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

Medium Access Control

CS 4453 Computer Networks Winter

Computer Networks Medium Access Control. Mostafa Salehi Fall 2008

Chapter 4 Network Layer

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

Chapter V: Link Layer

Master Course Computer Networks IN2097

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

CS 3640: Introduction to Networks and Their Applications

CS 640 Lecture 4: 09/11/2014

Chapter 6 The Link Layer and LANs

Master Course Computer Networks IN2097

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

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

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

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

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

ECE 158A: Lecture 13. Fall 2015

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

Redes de Computadores. Medium Access Control

Computer Network Fundamentals Spring Week 3 MAC Layer Andreas Terzis

Chapter 5 Link Layer and LANs

Multiple Access. Data Communications and Networking

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

Computer and Network Security

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

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

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

Link Layer and Ethernet

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

Data Link Layer Overview

Medium Access Control

ECE 4450:427/527 - Computer Networks Spring 2017

Reminder: Datalink Functions Computer Networking. Datalink Architectures

Multiple Access Protocols

Data Link Layer Overview

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

Housekeeping. Fall /5 CptS/EE 555 1

Data Link Layer Overview

Link Layer and LANs. Our Goals. Link Layer

Link Layer and Ethernet

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

Medium Access Control

Data Link Layer Overview

Chapter 5: DataLink Layer

Module 4 Data Link Layer CS655! 4-1!

CS 3640: Introduction to Networks and Their Applications

Network Performance: Queuing

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

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

Transcription:

Links 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/ Announcements Homework #2 out, due Tuesday Oct 9 11PM MUST be turned in by deadline o Turn in via hardcopy to drop box in 240 Cory No late homeworks accepted! because we want to send out the solutions the next day so you have time to absorb them for the Midterm on Friday Oct 12 Note for the midterm: material covered only in section is in scope! I will be away Oct 9-11 So won t have office hours on Weds Oct 10 No lecture, Weds Oct 10 I will have extra office hours Friday Oct 12, 12:30-2:30PM Materials with thanks to Jennifer Rexford, Ion Stoica, and colleagues at Princeton and UC Berkeley 1 2 Goals of Today s Lecture Message, Segment, Packet, and Frame Link-layer services Encoding, framing, error detection, transmission control Error correction and flow control Arbitrating access to a shared medium Channel partitioning Taking turns Random access o Carrier sense o Collision detection host HTTP TCP packet router SONET HTTP message TCP segment packet SONET router packet host HTTP TCP 3 frame SONET frame frame 4 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 5 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 media Flow control (pacing between sender & receiver) 6 1

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? o Sender & receiver agree: what s high, what s low o And: when to read the signal 7 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? NRZ (non-return to zero) Receiver reads the signal on the clock s leading edge Sender begins to transmit signal on clock s falling edge 8 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 Drift NRZ Sender s NRZ 9 Receiver s can drift Here we slip a bit, reading a 0 on leading edge rather than the correct 1 10 Recovery 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 11 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 NRZI (non-return to zero inverted) (read on falling edge) 12 2

Manchester Encoding 4-bit/5-bit (100Mb/s ) 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% 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 o 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% 4-bit 5-bit 4-bit 5-bit Manchester (read on each rising edge) 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 14 Framing 5 Minute Break 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 Questions Before We Proceed? Challenges Decide when a frame starts & ends How hard can that be? 15 16 Simple Approach to Framing: Counting Sender: begin frame with byte(s) giving length Receiver: extract this length and count Framing: Sentinels Delineate frame with special pattern e.g., 01111110 start, 01111111 end 53 Frame contents 21 Frame contents 01111110 Frame contents 01111111 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 Bogus new frame length; 58 bytes of data misdelivered desynchronization 17 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 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 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 What problem can that lead to? 19 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) 20 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 Error Detection Techniques, con t 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: o Catches 1-bit errors, most other errors o But not, for example, same bit flipped in two different words Cyclic Redundancy Check (CRC) Family of quite powerful, principled algorithms o Detects wide range of bit corruption patterns seen in practice Used by most modern link layers Can use more bits to gain more power 21 See K&R Section 5.2.3 22 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 o 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 Rounds Slots = 0 1 2 3 4 5 0 1 2 3 4 5 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 25 26 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 Single point of failure (token) 27 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: How to detect collisions How to recover from collisions Examples ALOHA and Slotted ALOHA CSMA, CSMA/CD, CSMA/CA 28 Key Ideas of Random Access Slotted ALOHA 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 29 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 30 5

Slotted ALOHA CSMA (Carrier Sense Multiple Access) Collisions hurt the efficiency of ALOHA protocol In presence of contention, can show that asymptotically channel useful 1/e 37% of the time 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 CSMA: listen before transmit If channel sensed idle: transmit entire frame If channel sensed busy, defer transmission Human analogy: don t interrupt others! synchronization 31 32 CSMA Collisions Collisions can still occur: propagation delay means two nodes may not hear each other s transmission in time. CSMA/CD (Collision Detection) CSMA/CD: carrier sensing, deferral as in CSMA Collisions detected within short time Colliding transmissions aborted, reducing wastage 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 33 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 34 CSMA/CD Collision Detection Three Ways to Share the Media 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 35 Channel partitioning MAC protocols (TDMA, FDMA): 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 36 6

Next Lecture + bridges/hubs/switches K&R 5.5, 5.6 37 7