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

Slides:



Advertisements
Similar presentations
EE 4272Spring, 2003 Chapter 7 Data Link Control Objectives: Effective & reliable data communication between two directly connected transmitting-receiving.
Advertisements

Introduction to Information Technologies
CSCI-1680 Link Layer Reliability Based partly on lecture notes by David Mazières, Phil Levis, John Jannotti Rodrigo Fonseca.
Reliability & Channel Coding
Chapter 6 Errors, Error Detection, and Error Control.
Spring 2002CS 4611 Outline Encoding Framing Error Detection Sliding Window Algorithm Point-to-Point Links.
Fundamentals of Computer Networks ECE 478/578 Lecture #4: Error Detection and Correction Instructor: Loukas Lazos Dept of Electrical and Computer Engineering.
1 Chapter Six - Errors, Error Detection, and Error Control Chapter Six.
PART III DATA LINK LAYER. Position of the Data-Link Layer.
CMPE 150- Introduction to Computer Networks 1 CMPE 150 Fall 2005 Lecture 12 Introduction to Computer Networks.
The Data Link Layer Chapter 3. Position of the data-link layer.
1 Outline Encoding Framing Error Detection Sliding Window Algorithm Point-to-Point Links.
1 ITC242 – Introduction to Data Communications Week 10 Topic 16 Data link control.
Spring 2004 EE4272 Direct Link Networks (I) Hardware Building Blocks (nodes & links) 5 Issues before Exchanging Packets  Encoding  Framing  Error Detection.
Chapter 2 : Direct Link Networks (Continued). So far... Modulation and Encoding Link layer protocols Error Detection -- Parity Check.
Spring 2003CS 4611 Outline Encoding Framing Error Detection Sliding Window Algorithm Point-to-Point Links.
Error Detection and Reliable Transmission EECS 122: Lecture 24 Department of Electrical Engineering and Computer Sciences University of California Berkeley.
Networking. Protocol Stack Generally speaking, sending an message is equivalent to copying a file from sender to receiver.
18-Aug-154/598N: Computer Networks Overview Direct link networks –Error detection - Section 2.4 –Reliable transmission - Section 2.5.
CSCI-1680 Link Layer Based partly on lecture notes by David Mazières, Phil Levis, John Jannotti Rodrigo Fonseca.
William Stallings Data and Computer Communications 7th Edition
ECE 4450:427/527 - Computer Networks Spring 2015 Dr. Nghi Tran Department of Electrical & Computer Engineering Lecture 5.3: Reliable Transmission Dr. Nghi.
1 Data Link Layer Lecture 20 Imran Ahmed University of Management & Technology.
PART III DATA LINK LAYER. Position of the Data-Link Layer.
Error Coding Transmission process may introduce errors into a message.  Single bit errors versus burst errors Detection:  Requires a convention that.
10.1 Chapter 10 Error Detection and Correction Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
ICOM 6115©Manuel Rodriguez-Martinez ICOM 6115 – Computer Networks and the WWW Manuel Rodriguez-Martinez, Ph.D. Lecture 14.
Data Link Layer: Error Detection and Correction
Lecture 6: Framing and Error Detection-Data Link Layer Functions
Lecture 3-2: Coding and Error Control (Cont.) ECE
McGraw-Hill©The McGraw-Hill Companies, Inc., 2004 Data Link Layer PART III.
1 Chapter Six - Errors, Error Detection, and Error Control Chapter Six.
Data Link and Flow Control Networks and Protocols Prepared by: TGK First Prepared on: Last Modified on: Quality checked by: Copyright 2009 Asia Pacific.
Link Layer Dr. Mozafar Bag-Mohammadi Ilam University.
Computer Science Division
T. S. Eugene Ngeugeneng at cs.rice.edu Rice University1 COMP/ELEC 429 Introduction to Computer Networks Lecture 12: Reliability Slides used with permissions.
Spring 2001CS 5851 Outline Building Blocks Shannon’s Theorem Encoding 11. Physical Layer.
Computer Communication & Networks Lecture 9 Datalink Layer: Error Detection Waleed Ejaz
CHAPTER 3: DATA LINK CONTROL Flow control, Error detection – two dimensional parity checks, Internet checksum, CRC, Error control, Transmission efficiency.
Error Detection.
CSCI-1680 Link Layer Reliability Based partly on lecture notes by David Mazières, Phil Levis, Rodrigo Fonseca John Jannotti.
Error Detection and Correction
McGraw-Hill©The McGraw-Hill Companies, Inc., 2000 PART III: DATA LINK LAYER ERROR DETECTION AND CORRECTION 7.1 Chapter 10.
Transport Layer: Sliding Window Reliability
Transmission Errors Error Detection and Correction.
1 Direct Link Networks: Reliable Transmission Sections 2.5.
T. S. Eugene Ngeugeneng at cs.rice.edu Rice University1 COMP/ELEC 429/556 Introduction to Computer Networks Reliability Some slides used with permissions.
CSE331: Introduction to Networks and Security Lecture 4 Fall 2002.
Computer Networking Lecture 16 – Reliable Transport.
Powerpoint Templates Computer Communication & Network Week # 10.
Coding and Error Control
Reliable Transmission
Data Link Layer Flow Control.
Introduction to Information Technologies
ERROR DETECTION AND CORRECTION
Data Link Layer.
Part III. Data Link Layer
Data Link Layer What does it do?
Introduction of Transport Protocols
COMP/ELEC 429/556 Introduction to Computer Networks
CSCI-1680 Link Layer Reliability
Reliable transmission
Point-to-Point Links Outline Encoding Framing Error Detection
Introduction to Information Technologies
Error Detection Neil Tang 9/26/2008
COMPUTER NETWORKS CS610 Lecture-5 Hammad Khalid Khan.
The Transport Layer Reliability
Error detection: Outline
EECS 122: EE122: Error Detection and Reliable Transmission
Data Link Layer. Position of the data-link layer.
Presentation transcript:

EE 122: Error detection and reliable transmission Ion Stoica September 16, 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

Overview  Error detection  Reliable transmission

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)

Two-dimensional Parity  Add one extra bit to a 7-bit code such that the number of 1’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

How Many Errors Can you Detect?  All 1-bit errors  Example: error bit odd number of 1’s

How Many Errors Can you Detect?  All 2-bit errors  Example: error bits odd number of 1’s on column

How Many Errors Can you Detect?  All 3-bit errors  Example: error bits odd number of 1’s on column

How Many Errors Can you Detect?  Most 4-bit errors  Example of 4-bit error that is not detected: error bits How many errors can you correct?

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 1-bit errors  Example: Internet checksum -Use 1’s complement addition

1’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: ; assume 8-bit representation 15 =  -15 = = = 1

Cyclic Redundancy Check (CRC)  Represent a (n+1)-bit message by an n-degree polynomial M(x) -E.g.,  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

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  C(x) = x 3 + x 1 + x 0  B(x) - C(x) = x 7 + x 5 + x 2 + x 1 

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 , assume C(x) = 101 -k = 2, M(x)*x K  Compute R(x) -T(x) = M(x)*x k - R(x)  xor 1 = ) R(x)

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+1)  Detect all burst of errors smaller than k bits

Overview  Error detection  Reliable transmission

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

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 + one- way latency from receiver to sender

Automatic Repeat Request (ARQ) Algorithms  Use two basic techniques: -Acknowledgements (ACKs) -Timeouts  Two examples: -Stop-and-go -Sliding window

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 Time SenderReceiver frame ACK

What Can Go Wrong? SenderReceiver frame ACK Timeout Frame lost  resent it on Timeout SenderReceiver frame ACK Timeout ACK lost  resent packet Need a mechanisms to detect duplicate packet SenderReceiver frame ACK Timeout ACK delayed  resent packet Need a bit to differentiate between ACK for current and previous packet

Stop-and-Go Disadvantage  May lead to inefficient link utilization  Example: assume -One-way propagation = 15 ms -Bandwidth = 100 Mbps -Packet size = 1000 bytes  transmit = (8*1000)/10 8 = 0.08ms -Neglect queue delay  Latency = approx. 15 ms; RTT = 30 ms Propagation = 15 ms Bandwidth = 100 Mbps

Stop-and-Go Disadvantage (cont’d)  Send a message every 30 ms  Throughput = (8*1000)/0.03 = Mbps  Thus, the protocol uses less than 0.3% of the link capacity! Sender Receiver frame ACK 30 ms

Solution  Don’t wait for the ACK of the previous packet before sending the next one!

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) seq. numbers LAR LFS Acknowledged packetsPackets not acknowledged yet

Example  Assume SWS = 3 SenderReceiver frame 1 1 frame 2 frame ACK frame ACK 2 frame Note: usually ACK contains the sequence number of the first packet in sequence expected by receiver

Sliding Window Protocol: Receiver  Receiver maintains a window of sequence numbers -RWS (receiver window size) – maximum number of out- of-sequence packets that can received -LFR (last frame received) – last frame received in sequence -LAF (last acceptable frame) -LAF – LFR <= RWS

Sliding Window Protocol: Receiver  Let seqNum be the sequence number of arriving packet  If (seqNum = LAF) -Discard packet  Else -Accept packet -ACK largest sequence number seqNumToAck, such that all packets with sequence numbers <= seqNumToAck were received seq. numbers LFR LAF Packets in sequencePackets out-of-sequence

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-of- order packets can be stored at the receiver

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