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

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

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

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

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

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

CSCI-1680 Link Layer Reliability Rodrigo Fonseca

CSCI-1680 Link Layer Reliability John Jannotti

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

Networking Link Layer

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

Data Link Layer. Srinidhi Varadarajan

CSCI-1680 Link Layer I Rodrigo Fonseca

CSE 461: Framing, Error Detection and Correction

CPE 448/548 Exam #1 (100 pts) February 14, Name Class: 448

Problem Statement. Physical and Data Link Layer Overview. Five Tasks Encoding. Make two computers talk to each other

The Transport Layer Reliability

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

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

CPE 548 Exam #1 (50 pts) February 17, 2016

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

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

L5: Building Direct Link Networks III. Hui Chen, Ph.D. Dept. of Engineering & Computer Science Virginia State University Petersburg, VA 23806

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

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

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

Direct Link Communication I: Basic Techniques. Data Transmission. ignore carrier frequency, coding etc.

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

CSE 123: Computer Networks

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

Links. CS125 - mylinks 1 1/22/14

PART III. Data Link Layer MGH T MGH C I 204

Administrivia. FEC vs. ARQ. Reliable Transmission FEC. Last time: Framing Error detection. FEC provides constant throughput and predictable delay

Data Link Layer: Overview, operations

CS321: Computer Networks Error Detection and Correction

UNIT I FUNDAMENTALS & LINK LAYER

CSE123A discussion session

CS422 Computer Networks

Direct Link Communication I: Basic Techniques. Data Transmission. ignore carrier frequency, coding etc.

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

Chapter 10 Error Detection and Correction. Copyright The McGraw-Hill Companies, Inc. Permission required for reproduction or display.

DATA LINK LAYER UNIT 7.

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

Direct Link Networks (II)

Transport Layer Marcos Vieira

Chapter 10 Error Detection and Correction 10.1

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.

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

The Data Link Layer Chapter 3

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

Ch. 7 Error Detection and Correction

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

Introduction to Computer Networks. 03 Data Link Layer Introduction

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

Flow Control, and Congestion Control

CSE 123: Computer Networks

Inst: Chris Davison

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

Lecture 5: Data Link Layer Basics

CS254 Network Technologies. Lecture 2: Network Models & Error Detection and Correction. Dr Nikos Antonopoulos

Reliable Transmission

CS 3640: Introduction to Networks and Their Applications

Computer Networks. Shyam Gollakota

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

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

4. Error correction and link control. Contents

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

Transport Layer (TCP/UDP)

TYPES OF ERRORS. Data can be corrupted during transmission. Some applications require that errors be detected and corrected.

Lecture 7: Flow Control"

COMPUTER NETWORKS UNIT-3

Data Link Control Protocols

CSEP 561 Error detection & correction. David Wetherall

ISO/OSI Reference Model. Data Link Layer. 7. Application. 6. Presentation. 5. Session. 4. Transport. 3. Network. 2. Data Link. 1.

Computer Networks. Homework #4: No Grading

TCP. Sliding Windows, Flow Control, and Congestion Control. Networks : TCP Sliding Windows 1

Communication Networks. Part I

Data Link Layer (part 2)

Computer Networking : Principles, Protocols and Practice

CS/ECE 438: Communication Networks for Computers Spring 2018 Midterm Examination Online

CompSci 356: Computer Network Architectures. Lecture 4: Link layer: Encoding, Framing, and Error Detection Ref. Chap 2.2, 2.3,2.4

Page 1. Goals for Today" Discussion" Example: Reliable File Transfer" CS162 Operating Systems and Systems Programming Lecture 11

EE 122 Fall st Midterm. Professor: Lai Stoica

INF Data Communication Data Link Layer

End-to-End Protocols. End-to-End Protocols

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

Data Link Layer (1) Networked Systems 3 Lecture 6

Data link layer functions. 2 Computer Networks Data Communications. Framing (1) Framing (2) Parity Checking (1) Error Detection

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

Reliable Byte-Stream (TCP)

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

Flow Control, and Congestion Control

EITF25 Internet Techniques and Applications L3: Data Link layer. Stefan Höst

Copyright 2010, Elsevier Inc. All rights Reserved

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

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

Lecture 2 Error Detection & Correction. Types of Errors Detection Correction

STEVEN R. BAGLEY PACKETS

Chapter 11 Data Link Control 11.1

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

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

Transcription:

EE 22: Error detection and reliable transmission Ion Stoica September 6, 2002

High Level View Goal: transmit correct information Problem: bits can get corrupted - Electrical interference, thermal noise Solution - Detect errors - Recover from errors Correct errors Retransmission istoica@cs.berkeley.edu 2

Overview Error detection Reliable transmission istoica@cs.berkeley.edu 3

Error Detection Problem: detect bit errors in packets (frames) Solution: add redundancy bits to each packet Goals: - Reduce overhead, i.e., reduce the number of redundancy bits - Increase the number and the type of bit error patterns that can be detected Examples: - Two-dimensional parity - Checksum - Cyclic Redundancy Check (CRC) istoica@cs.berkeley.edu 4

Two-dimensional Parity Add one extra bit to a 7-bit code such that the number of s in the resulting 8 bits is even (for even parity, and odd for odd parity) Add a parity byte for the packet Example: five 7-bit character packet, even parity 0000 000 0000 00 000 0 0 0000 istoica@cs.berkeley.edu 5

How Many Errors Can you Detect? All -bit errors Example: 0000 000 0 error bit 00000 00 odd number of s 000 0 0000 istoica@cs.berkeley.edu 6

How Many Errors Can you Detect? All 2-bit errors Example: error bits 0000 000 0000 00 000 0 0 0000 odd number of s on column istoica@cs.berkeley.edu 7

How Many Errors Can you Detect? All 3-bit errors Example: error bits 0000 000 0000 000 000 0 0 0000 odd number of s on column istoica@cs.berkeley.edu 8

How Many Errors Can you Detect? Most 4-bit errors Example of 4-bit error that is not detected: error bits 0000 000 0000 0000 000 0 0 0000 How many errors can you correct? istoica@cs.berkeley.edu 9

Checksum Sender: add all words of a packet and append the result (checksum) to the packet Receiver: add all words of a packet and compare the result with the checksum Can detect all -bit errors Example: Internet checksum - Use s complement addition istoica@cs.berkeley.edu 0

s Complement Revisited Negative number x is x with all bits inverted When two numbers are added, the carry-on is added to the result Example: -5 + 6; assume 8-bit representation 5 = 0000-5 = 0000 + 6 = 0000000 00000000 + -5+6 = 0000000 istoica@cs.berkeley.edu

Cyclic Redundancy Check (CRC) Represent a (n+)-bit message by an n-degree polynomial M(x) - E.g., 000 M(x) = x 7 + x 5 + x 3 + x 2 + x 0 Choose a divisor k-degree polynomial C(x) Compute reminder R(x) of M(x)*x k / C(x), and then compute T(x) = M(x)*x k - R(x) - T(x) is divisible by C(x) - First n coefficients of T(x) represent M(x) Sender: - Compute and send T(x), i.e., the coefficients of T(x) Receiver: - Let T (x) be the (n+k)-degree polynomial generated from the received message - If C(x) divides T (x) no errors; otherwise errors istoica@cs.berkeley.edu 2

Some Polynomial Arithmetic Modulo 2 Properties If C(x) divides B(x), then degree(b(x)) >= degree(c(x)) Subtracting C(x) from B(x) reduces to perform an XOR on each pair of matching coefficients of C(x) and B(x) - E.g.: B(x) = x 7 + x 5 + x 3 + x 2 + x 0 000 C(x) = x 3 + x + x 0 00000 B(x) - C(x) = x 7 + x 5 + x 2 + x 0000 istoica@cs.berkeley.edu 3

Computing T(x) Compute the reminder R(x) of M(x)*x k / C(x) T(x) = M(x)*x k - R(x) Example: send packet 0, assume C(x) = 0 - k = 2, M(x)*x K 000 - Compute R(x) 0) 000 0 0 0 0 00 0 R(x) - T(x) = M(x)*x k - R(x) 000 xor = 00 istoica@cs.berkeley.edu 4

CRC Properties Detect all single-bit errors if coefficients of x k and x 0 of C(x) are one Detect all double-bit errors, if C(x) has a factor with at least three terms Detect all number of odd errors, if C(x) contains factor (x+) Detect all burst of errors smaller than k bits istoica@cs.berkeley.edu 5

Overview Error detection Reliable transmission istoica@cs.berkeley.edu 6

Reliable Transmission Problem: obtain correct information once errors are detected Solutions: - Use error correction codes (can you give an example of error detection code that can also correct errors?) - Use retransmission (we ll do this in details) Algorithmic challenges: - Achieve high link utilization, and low overhead istoica@cs.berkeley.edu 7

Latency, Bandwidth, Round-Trip Time Latency = propagation + transmit + queue - Propagation: time it takes the signal to propagate along the link - Transmit: time it takes to transmit the packet = (packet_size)/(link_bandwidth) - Queue: time for which the packet waits into the adapter at the sender before being transmitted Note: next we ll assume short packets, i.e, transmit term can be neglected! Round-Trip Time (RTT) = time it takes to a packet to travel from sender to destination and back - RTT = one-way latency from sender to receiver + oneway latency from receiver to sender istoica@cs.berkeley.edu 8

Automatic Repeat Request (ARQ) Algorithms Use two basic techniques: - Acknowledgements (ACKs) - Timeouts Two examples: - Stop-and-go - Sliding window istoica@cs.berkeley.edu 9

Stop-and-Go Receiver: send an acknowledge (ACK) back to the sender upon receiving a packet (frame) Sender: excepting first packet, send a packet only upon receiving the ACK for the previous packet Sender frame Receiver Time ACK frame ACK istoica@cs.berkeley.edu 20

What Can Go Wrong? der Receiver Sender Receiver Sender Receiv frame frame frame Timeout ACK Timeout ACK frame frame frame ACK ACK ACK Frame lost on Timeout resent it ACK lost resent packet Need a mechanisms to detect duplicate packet ACK delayed resent packe Need a bit to differentiate between ACK for current and previous packet istoica@cs.berkeley.edu 2

Stop-and-Go Disadvantage May lead to inefficient link utilization Example: assume - One-way propagation = 5 ms - Bandwidth = 00 Mbps - Packet size = 000 bytes transmit = (8*000)/0 8 = 0.08ms - Neglect queue delay Latency = approx. 5 ms; RTT = 30 ms Propagation = 5 ms Bandwidth = 00 Mbps istoica@cs.berkeley.edu 22

Stop-and-Go Disadvantage (cont d) Send a message every 30 ms Throughput = (8*000)/0.03 = 0.2666 Mbps Thus, the protocol uses less than 0.3% of the link capacity! Sender frame Receiver ACK frame 30 ms 30 ms ACK istoica@cs.berkeley.edu 23

Solution Don t wait for the ACK of the previous packet before sending the next one! istoica@cs.berkeley.edu 24

Sliding Window Protocol: Sender Each packet has a sequence number - Assume infinite sequence numbers for simplicity Sender maintains a window of sequence numbers - SWS (sender window size) maximum number of packets that can be sent without receiving an ACK - LAR (last ACK received) - LFS (last frame sent) Acknowledged packets Packets not acknowledged yet LAR LFS seq. numbers istoica@cs.berkeley.edu 25

Example Assume SWS = 3 Sender Receiver frame 2 3 2 3 2 3 4 ACK ACK 2 frame 2 frame 3 frame 4 2 3 4 5 frame 5 Note: usually ACK contains the sequence number of the first packet in sequence expected by receiver istoica@cs.berkeley.edu 26

Sliding Window Protocol: Receiver Receiver maintains a window of sequence numbers - RWS (receiver window size) maximum number of outof-sequence packets that can received - LFR (last frame received) last frame received in sequence - LAF (last acceptable frame) - LAF LFR <= RWS istoica@cs.berkeley.edu 27

Sliding Window Protocol: Receiver Let seqnum be the sequence number of arriving packet If (seqnum <= LFR) or (seqnum >= LAF) - Discard packet Else - Accept packet - ACK largest sequence number seqnumtoack, such that all packets with sequence numbers <= seqnumtoack were received Packets in sequence Packets out-of-sequence LFR LAF seq. numbers istoica@cs.berkeley.edu 28

Properties of ARQ Protocols Reliability Increase link utilization (only for sliding window protocols) Flow control: a sender cannot send at a rate greater than the rate at which the receiver can consume the packets Packet order - In the case the Sliding Window Protocol the size of receiver window (RWS) specifies how many out-oforder packets can be stored at the receiver istoica@cs.berkeley.edu 29

Summary There are two steps required to transmit frames (packets) reliable - Detect when packets experience errors or are lost (we ll talk more about packet loss in the context of TCP) Two-dimensional parity Checksum Cyclic Redundancy Check (CRC) - Use packet retransmission to recover from errors Stop-and-go Sliding window protocol istoica@cs.berkeley.edu 30