Lecture 4: CRC & Reliable Transmission. Lecture 4 Overview. Checksum review. CRC toward a better EDC. Reliable Transmission

Similar documents
CSE 123: Computer Networks Alex C. Snoeren. HW 1 due NOW!

Lecture 7: Flow Control"

Lecture 7: Sliding Windows. CSE 123: Computer Networks Geoff Voelker (guest lecture)

Lecture 6: Reliable Transmission. CSE 123: Computer Networks Alex Snoeren (guest lecture) Alex Sn

Lecture 7: Flow & Media Access Control"

Lecture 5: Flow Control. CSE 123: Computer Networks Alex C. Snoeren

Communications Software. CSE 123b. CSE 123b. Spring Lecture 3: Reliable Communications. Stefan Savage. Some slides couresty David Wetherall

CSE 123: Computer Networks Alex C. Snoeren. HW 1 due Thursday!

Error Detection Codes. Error Detection. Two Dimensional Parity. Internet Checksum Algorithm. Cyclic Redundancy Check.

Chapter 3. The Data Link Layer. Wesam A. Hatamleh

CSCI-1680 Link Layer Reliability Rodrigo Fonseca

CSCI-1680 Link Layer Reliability John Jannotti

CS 640 Introduction to Computer Networks. Role of data link layer. Today s lecture. Lecture16

CSCI-1680 Link Layer I Rodrigo Fonseca

Lecture 5. Homework 2 posted, due September 15. Reminder: Homework 1 due today. Questions? Thursday, September 8 CS 475 Networks - Lecture 5 1

CS 43: Computer Networks. 16: Reliable Data Transfer October 8, 2018

I. INTRODUCTION. each station (i.e., computer, telephone, etc.) directly connected to all other stations

Principles of Reliable Data Transfer

2.4 Error Detection Bit errors in a frame will occur. How do we detect (and then. (or both) frames contains an error. This is inefficient (and not

The Transport Layer Reliability

CSE 461: Framing, Error Detection and Correction

No book chapter for this topic! Slides are posted online as usual Homework: Will be posted online Due 12/6

The Data Link Layer Chapter 3

Announcements. No book chapter for this topic! Slides are posted online as usual Homework: Will be posted online Due 12/6

Networking Link Layer

Computer Networking. Reliable Transport. Reliable Transport. Principles of reliable data transfer. Reliable data transfer. Elements of Procedure

4. Error correction and link control. Contents

CS43: Computer Networks Reliable Data Transfer. Kevin Webb Swarthmore College October 5, 2017

Networked Systems and Services, Fall 2018 Chapter 2. Jussi Kangasharju Markku Kojo Lea Kutvonen

EE 122: Error detection and reliable transmission. Ion Stoica September 16, 2002

CSMC 417. Computer Networks Prof. Ashok K Agrawala Ashok Agrawala. Nov 1,

Reliable Transport : Fundamentals of Computer Networks Bill Nace

High Level View. EE 122: Error detection and reliable transmission. Overview. Error Detection

Telecom Systems Chae Y. Lee. Contents. Flow Control Error Detection/Correction Link Control (Error Control) Link Performance (Utility)

Inst: Chris Davison

Chapter 3. The Data Link Layer

CS422 Computer Networks

DATA LINK LAYER UNIT 7.

The Data Link Layer Chapter 3

Chapter Six. Errors, Error Detection, and Error Control. Data Communications and Computer Networks: A Business User s Approach Seventh Edition

Data Link Layer. Srinidhi Varadarajan

Data Link Technology. Suguru Yamaguchi Nara Institute of Science and Technology Department of Information Science

ECE697AA Lecture 3. Today s lecture

Data Link Control. Surasak Sanguanpong Last updated: 11 July 2000

CRC. Implementation. Error control. Software schemes. Packet errors. Types of packet errors

Links. CS125 - mylinks 1 1/22/14

CSE123A discussion session

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

Reliable Data Transfer

ECE 435 Network Engineering Lecture 10

Chapter 3: Transport Layer Part A

Department of Computer and IT Engineering University of Kurdistan. Data Communication Netwotks (Graduate level) Data Link Layer

Data Link Layer: Overview, operations

Overview. Data Link Technology. Role of the data-link layer. Role of the data-link layer. Function of the physical layer

CS419: Computer Networks. Lecture 10, Part 3: Apr 13, 2005 Transport: TCP performance

CSE/EE 461. Sliding Windows and ARQ. Last Time. This Time. We finished up the Network layer Internetworks (IP) Routing (DV/RIP, LS/OSPF)

Ch. 7 Error Detection and Correction

CS321: Computer Networks Error Detection and Correction

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

CSE 123: Computer Networks

Outline. EEC-484/584 Computer Networks. Data Link Layer Design Issues. Framing. Lecture 6. Wenbing Zhao Review.

CMSC 417. Computer Networks Prof. Ashok K Agrawala Ashok Agrawala. October 11, 2018

The data link layer has a number of specific functions it can carry out. These functions include. Figure 2-1. Relationship between packets and frames.

The GBN sender must respond to three types of events:

CSE123A discussion session

CSCD 330 Network Programming

Basic Reliable Transport Protocols

Chapter 11 Data Link Control 11.1

ERROR AND FLOW CONTROL. Lecture: 10 Instructor Mazhar Hussain

Reliable Transport I: Concepts and TCP Protocol

ELEN Network Fundamentals Lecture 15

16.682: Communication Systems Engineering. Lecture 17. ARQ Protocols

Computer Networks. Shyam Gollakota

Point-to-Point Links. Outline Encoding Framing Error Detection Sliding Window Algorithm. Fall 2004 CS 691 1

The flow of data must not be allowed to overwhelm the receiver

Lecture - 14 Transport Layer IV (Reliability)

STEVEN R. BAGLEY PACKETS

Introduction to Computer Networks. 03 Data Link Layer Introduction

2.1 CHANNEL ALLOCATION 2.2 MULTIPLE ACCESS PROTOCOLS Collision Free Protocols 2.3 FDDI 2.4 DATA LINK LAYER DESIGN ISSUES 2.5 FRAMING & STUFFING

Recap. More TCP. Congestion avoidance. TCP timers. TCP lifeline. Application Presentation Session Transport Network Data Link Physical

UNIT IV -- TRANSPORT LAYER

SRI RAMAKRISHNA INSTITUTE OF TECHNOLOGY DEPARTMENT OF INFORMATION TECHNOLOGY COMPUTER NETWORKS UNIT - II DATA LINK LAYER

Chapter 3: Transport Layer

Protocol Principles. Framing, FCS and ARQ 2005/03/11. (C) Herbert Haas

Data Link Layer (part 2)

COMPUTER NETWORKS UNIT-3

Question. Reliable Transport: The Prequel. Don t parse my words too carefully. Don t be intimidated. Decisions and Their Principles.

Data Link Control Protocols

rdt2.0 has a fatal flaw!

Telematics. 5rd Tutorial - LLC vs. MAC, HDLC, Flow Control, E2E-Arguments

Overview. Internetworking and Reliable Transmission. CSE 561 Lecture 3, Spring David Wetherall. Internetworking. Reliable Transmission

INF Data Communication Data Link Layer

CS457 Transport Protocols. CS 457 Fall 2014

CSC 401 Data and Computer Communications Networks

Reliable Transport II: TCP and Congestion Control

Where we are in the Course

Transport Protocols Reading: Sections 2.5, 5.1, and 5.2. Goals for Todayʼs Lecture. Role of Transport Layer

Lecture 11: Transport Layer Reliable Data Transfer and TCP

TCP over wireless links

Advanced Computer Networks. Rab Nawaz Jadoon DCS. Assistant Professor COMSATS University, Lahore Pakistan. Department of Computer Science

Transcription:

1 Lecture 4: CRC & Reliable Transmission CSE 123: Computer Networks Chris Kanich Quiz 1: Tuesday July 5th Lecture 4: CRC & Reliable Transmission Lecture 4 Overview CRC toward a better EDC Reliable Transmission How do we ensure that a message was received? Automatic Repeat Request (ARQ)» Acknowledgements (ACKs) and timeouts Stop-and-Wait Sliding Window Forward Error Correction 2 Checksum review Sum up all data in frame, Check when receiving Transmit that sum as the EDC Extremely lightweight Easy to compute fast in hardware Fragile: Hamming Distance of 2 Also easy to modify if frame is modified in flight Happens a lot to packets on the Internet IP packets include a 1 s compliment checksum 3

From Sums to Remainders Checksums are easy to compute, but very fragile In particular, burst errors are frequently undetected We d rather have a scheme that smears parity Need to remain easy to implement in hardware So far just shift registers and an XOR gate We ll stick to Modulo-2 arithmetic Multiplication and division are XOR-based as well Let s do some examples 4 Modulo-2 Arithmetic Multiplication Division 110 0000 0 00 101110 110 101110 110 111 110 011 000 110 5 Cyclic Remainder Check Idea is to divide the incoming data, D, rather than add The divisor is called the generator, g We can make a CRC resilient to k-bit burst errors Need a generator of k+1 bits Divide 2 k D by g to get remainder, r Remainder is called frame check sequence Send 2 k D+r Note 2 k D is just D shifted left k bits Remainder must be at most k bits checks that (2 k D+r)/g = 0 6 2

3 CRC: Rooted in Polynomials We re actually doing polynomial arithmetic Each bit is actually a coefficient of corresponding term in a k th - degree polynomial is (1 * X 3 ) + (1 * X 2 ) + (0 * X 1 ) + (1 * X 0 ) Why do we care? Can use the properties of finite fields to analyze effectiveness Says any generator with two terms catches single bit errors 7 CRC Example Encoding x 3 x 2 1 = Generator x 7 x 4 x 3 x = 1000 Message k + 1 bit check sequence g, equivalent to a degree-k polynomial Remainder D mod g 1000000 Message plus k zeros (*2 k ) 1001 1000 1011 1100 1000 101 Result: Transmit message followed by remainder: 1000101 8 CRC in Hardware 1 1 0 1 + + Key observation is only subtract when MSB is one Recall that subtraction is XOR No explicit check for leading one by using as input to XOR Hardware cost very similar to checksum We re only interested in remainder at the end Only need k registers as remainder is only k bits 9

4 CRC Example Decoding x 3 x 2 1 = Generator x 10 x 7 x 6 x 4 x 2 1 = 1000101 Received Message k + 1 bit check sequence g, equivalent to a degree-k polynomial Remainder D mod g 1000101 Received message, no 1001 errors 1000 1011 1100 0 Result: CRC test is passed 10 CRC Example Failure x 3 x 2 1 = Generator x 10 x 7 x 5 x 4 x 2 1 = 1001001 Received Message k + 1 bit check sequence g, equivalent to a degree-k polynomial 1001001 Received message 1000 Two bit errors 1011 0101 Result: CRC test failed Remainder D mod g 11 Common Generators CRC-8 x 8 x 2 x 1 1 CRC-10 x 10 x 9 x 5 x 4 x 1 1 CRC-12 x 12 x 11 x 3 x 2 x 1 1 CRC-16 x 16 x 15 x 2 1 CRC-CCITT x 16 x 12 x 5 1 CRC-32 x 32 x 26 x 23 x 22 x 16 x 12 x 11 x 10 x 8 x 7 x 5 x 4 x 2 x 1 1 12

5 Picking up the Pieces Link layer is lossy We deliberately throw away corrupt frames Infrequent bit errors still lead to occasional frame errors» 10,000+ bits in each frame Things get even harrier if we consider multiple links In a few lectures, we ll start sending frames on long trips Each intermediate stop might lose, corrupt, reorder, etc. Regardless of cause, we ll call loss events drops We want to provide reliable, in-order delivery Can and will do this at multiple layers 13 Moving up the Stack host host HTTP Application Layer HTTP TCP Transport Layer TCP router router I P I P Network Layer I P I P Ethernet interface Ethernet interface SONET SONET interface Link Layer interface Ethernet interface Ethernet interface 14 Simple Idea: ARQ T ime sends acknowledgments (ACKs) times out and retransmits if it doesn t receive them Basic approach is generically referred to as Automatic Repeat Request (ARQ) 15

6 Not So Fast Duplicate! Loss can occur on ACK channel as well cannot distinguish data loss from ACK loss will retransmit the data frame ACK loss or early timeout results in duplication The receiver thinks the retransmission is new data 16 Sequence Numbers Ignored! Sequence numbers solve this problem can simply ignore duplicate data But must still send an ACK! (Why?) Simplest ARQ: Stop-and-wait Only one outstanding frame at a time 17 Stop-and-Wait Performance Lousy performance if xmit 1 pkt << prop. delay How bad? Want to utilize all available bandwidth Need to keep more data in flight How much? Remember the bandwidth-delay product? Also limited by quality of timeout (how long?) 18

7 Pipelined Transmission Ignored! Keep multiple packets in flight Allows sender to make efficient use of the link Sequence numbers ensure receiver can distinguish frames Duplicate acknowledgements signal loss ACK the highest consecutive frame received Ignore (for now) non-sequential frames 19 Go-Back-N Retransmit from point of loss upon duplicate ACK Packets between loss event and retransmission are ignored Also go-back-n if a timeout event occurs ACKs are cumulative Acknowledge current frame and all previous ones 20 Send Window Bound on number of outstanding packets Window opens upon receipt of new ACK Window resets entirely upon a timeout Limits amount of waste Still lots of duplicates We can do better with selective retransmission Go-Back-N Example with window size 3 21

8 Sliding Window Single mechanism that supports: Multiple outstanding packets Reliable delivery In-order delivery Flow control At the core of all modern ARQ protocols Go-Back-N is a special case Receive window size of one 22 Sliding Window : Window Size Last ACK Last Sent Window bounds outstanding unacked data Implies need for buffering at sender Last ACK applies to in-order data What to do on a timeout? Go-Back-N: send all unacknowledged data on timeout Selective Repeat: timer per packet, resend as needed 23 Sliding Window Receive Window : Last Received Largest Accepted buffers too: data may arrive out-of-order or faster than can be consumed flow control ACK choices: Cumulative, Selective (exempt missing frames), Negative 24

9 Deciding When to Retransmit How do you know when a packet has been lost? Ultimately sender uses timers to decide when to retransmit But how long should the timer be? Too long: inefficient (large delays, poor use of bandwidth) Too short: may retransmit unnecessarily (causing extra traffic) Right timer is based on the round-trip time (RTT) Which can vary greatly for reasons well see later 25 Can we shortcut the timeout? Timeout is long in practice If packets are usually in order then out-of-order ACKs imply that a packet was lost Negative ACK» requests missing packet Fast retransmit» When sender receives multiple duplicate acknowledgements resends missing packet 26 Fast retransmit Don t bother waiting Receipt of duplicate acknowledgement (dupack) indicates loss Retransmit immediately Used in TCP Need to be careful if frames can be reordered 27

10 Is ARQ the Only Way? No. We could use redundancy Send additional data to compensate for lost packets Why not use retransmission? Broadcast media with lots of receivers» If each one ACK/NAK then hard to scale Lots of messages Lots of state» Heterogeneous receivers E.g., variable quality wireless reception Highly lossy or very long delay channels (e.g., satellite) 28 Forward Error Correction Use erasure codes to redundantly encode k data frames into m>k encoded frames Why do it at the frame level? E.g., Reed Solomon Codes, Tornado codes Multicast/broadcast encoded frames speculatively A receiver can reconstruct message from any k frames in the set of m encoded frames 29 A Digital Fountain File Transmission 0 hours 1 hour 2 hours 3 hours User 1 User 2 4 hours 5 hours 30

11 For Next Time Read 2.6 in P&D Media Access Now that we can reliably transmit from point A to point B, how do we share the transmission medium nicely? Have a great holiday weekend! 31