1 University of Calgary CS 441 Part 3 The Data Link Layer 3.1 Framing & Error Control 3.2 Error & Flow Control.

Slides:



Advertisements
Similar presentations
5-1 Data Link Layer l Objective: to achieve reliable and efficient communication between 2 adjacent machines l Data link layer design issues n services.
Advertisements

The Data Link Layer Chapter 3. Data Link Layer Design Issues Services Provided to the Network Layer Framing Error Control Flow Control.
1 Lecture #12: Data Link Layer. Error Control. C o n t e n t s l Services Provided by DLL l DLL data structures l Error Control Mechanisms –Error correcting.
Error Detection and Correction
Transmission Errors Error Detection and Correction
Chapter 10 Error Detection and Correction
Error Detection and Correction
EEC-484/584 Computer Networks Lecture 7 Wenbing Zhao
EEC-484/584 Computer Networks Lecture 6 Wenbing Zhao
Error Detection and Correction
PART III DATA LINK LAYER. Position of the Data-Link Layer.
Transmission Errors1 Error Detection and Correction.
The Data Link Layer Chapter 3. Position of the data-link layer.
The OSI Reference Model
EEC-484/584 Computer Networks Lecture 13 Wenbing Zhao
EEC-484/584 Computer Networks Lecture 7 Wenbing Zhao (Part of the slides are based on materials supplied by Dr. Louise Moser at UCSB and.
7/2/2015Errors1 Transmission errors are a way of life. In the digital world an error means that a bit value is flipped. An error can be isolated to a single.
Error Detection and Correction
Adapted from Tanenbaum's Slides for Computer Networking, 4e The Data Link Layer Chapter 3.
EEC-484/584 Computer Networks Lecture 7 Wenbing Zhao (Part of the slides are based on Drs. Kurose & Ross ’ s slides for their Computer.
Error Detection and Reliable Transmission EECS 122: Lecture 24 Department of Electrical Engineering and Computer Sciences University of California Berkeley.
EEC-484/584 Computer Networks Lecture 7 Wenbing Zhao
Error Detection and Correction Rizwan Rehman Centre for Computer Studies Dibrugarh University.
Transmission Errors Error Detection and Correction
CSE331: Introduction to Networks and Security Lecture 3 Fall 2002.
Lecture 10: Error Control Coding I Chapter 8 – Coding and Error Control From: Wireless Communications and Networks by William Stallings, Prentice Hall,
Data Link Layer - 1 Dr. Sanjay P. Ahuja, Ph.D. Fidelity National Financial Distinguished Professor of CIS School of Computing, UNF.
1 Data Link Layer Lecture 20 Imran Ahmed University of Management & Technology.
PART III DATA LINK LAYER. Position of the Data-Link Layer.
Part 2: Packet Transmission Packets, frames Local area networks (LANs) Wide area networks (LANs) Hardware addresses Bridges and switches Routing and protocols.
10.1 Chapter 10 Error Detection and Correction Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
CHAPTER 2 HARDWARE BUILDING BLOCK ENCODING FRAMING ERROR DETECTION.
جلسه هشتم شبکه های کامپیوتری به نــــــــــــام خدا.
Lecture 6: Framing and Error Detection-Data Link Layer Functions
Data Link Layer. Data Link Layer Design Issues Services Provided to the Network Layer Framing Error Control Flow Control.
The Data Link Layer Goal –As reliable as possible, efficient communication Point-to-Point –single connection –bits arrive in order sent Not necessarily.
Data and Computer Communications by William Stallings Eighth Edition Digital Data Communications Techniques Digital Data Communications Techniques Click.
ECE453 – Introduction to Computer Networks Lecture 4 – Data Link Layer (I)
Layer Two Data Link Layer Collects bits from layer 1 and organizes into frames Passes bits that make up frames to layer 1 for transmission Concerned with.
McGraw-Hill©The McGraw-Hill Companies, Inc., 2004 Data Link Layer PART III.
Data Communications & Computer Networks, Second Edition1 Chapter 6 Errors, Error Detection, and Error Control.
Computer Science Division
Computer Networks Lecture 2: Data Link Based on slides from D. Choffnes Northeastern U. and P. Gill from StonyBrook University Revised Autumn 2015 by S.
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.
10.1 Chapter 10 Error Detection and Correction Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
1/30/ :20 PM1 Chapter 6 ─ Digital Data Communication Techniques CSE 3213 Fall 2011.
Transmission Errors Error Detection and Correction.
Network Layer4-1 Chapter 5: The Data Link Layer Our goals: r understand principles behind data link layer services: m error detection, correction m sharing.
Data Link Layer 1. 2 Single-bit error 3 Multiple-bit error 4.
Chi-Cheng Lin, Winona State University CS412 Introduction to Computer Networking & Telecommunication Error Correction/Detection.
CS4470 Computer Networking Protocols
Simple Parity Check The simplest form of error detection is the parity check used with ASCII codes, originally on asynchronous modem links Each 7 bit ASCII.
Data Link Layer Objective: to achieve reliable and efficient communication between 2 adjacent machines Data link layer design issues services provided.
Data Link Layer.
Communication Networks: Technology & Protocols
Advanced Computer Networks
CIS 321 Data Communications & Networking
Data Link Layer What does it do?
EEC-484/584 Computer Networks
Data Link Layer Objective: to achieve reliable and efficient communication between 2 adjacent machines Data link layer design issues services provided.
Transmission Errors Error Detection and Correction
Data Link Layer Objective: to achieve reliable and efficient communication between 2 adjacent machines Data link layer design issues services provided.
EEC-484/584 Computer Networks
COMPUTER NETWORKS CS610 Lecture-5 Hammad Khalid Khan.
Error Detection and Correction
Transmission Errors Error Detection and Correction
EECS 122: EE122: Error Detection and Reliable Transmission
Data Link Layer. Position of the data-link layer.
Presentation transcript:

1 University of Calgary CS 441 Part 3 The Data Link Layer 3.1 Framing & Error Control 3.2 Error & Flow Control

2 University of Calgary CS Framing & Error Control Asynchronous Character Transmission Synchronous Frame Transmission Error Detection Hamming Distance Cyclic Redundancy Checks CRC Implementation Forward Error Control Backward Error Control

3 University of Calgary CS 441 Network, Data Link, Physical Layers physical channel Network Layer Data Link Layer Physical Layer Data Link Layer Network Layer virtual paths packets frames bits

4 University of Calgary CS 441 Data Link Layer Requirements Accept Packets from Network Layer on Host A and transfer to Network Layer on Host B Transfer (Packets only) without errors Deliver Packets in the order received Deliver one and only one copy of each Packet If errors are rare this may not be efficient, i.e., the overhead associated with reliable transfer Higher Layers can deal with end to end errors

5 University of Calgary CS 441 Medium Access Control (MAC) Layer Data Link layer Physical layer Data Link Control Medium Access Control (MAC) Physical layer

6 University of Calgary CS 441 Point to Point Establishment - ENQ (enquiry), ACK, NAC, ERP (error procedure) Data Transfer Termination - EOT ENQ ACK frame ACK A B

7 University of Calgary CS 441 Asynchronous Character Transmission data transmission one character at a time otherwise idle sending binary 1, NRZ-L -volts start bit is transition to 0 then 7 bit ASCII followed by parity bit final is a stop bit, a binary 1, for 1, 1.5, or 2 times the normal bit duration receiver can be easily synchronized overhead of 2-3 bits per character, ~2/9 = 22%

8 University of Calgary CS 441 Synchronous Frame Transmission block or frame transmission ~1000 bits character/byte oriented frame is >= 1 synch characters; control characters; data characters; control characters bit oriented frame is 8 bit flag, control field, data, control field, 8 bit flag bit stuffing needed for the latter in HDLC have 48 bits of control & flags which for 1000 bit message gives 4.6% overhead

9 University of Calgary CS 441 Framing Physical Layer transfers bits unreliably Framing enables efficient error control and synchronization on a bunch of bits Could insert number of characters in header Errors again make it very hard to re- synchronize, where is start of next frame if an error? Can deal with by using DLE STX and DLE ETX frame start and stop characters Disadvantage with this method is that its closely tied to 8 bit characters and to ASCII.

10 University of Calgary CS 441 Framing - Character Stuffing frame starts with ASCII characters DLE STX frame ends with ASCII characters DLE ETX +DLE: Data Link Escape +STX: Start of Text +ETX: End of Text problem: ok for ASCII text, but binary data may have sequences matching these codes solution: character stuffing +matches in data to DLE are "escaped" +sender inserts DLE before accidental one +receiver detects two DLE's, removes one

11 University of Calgary CS 441 Framing - bit stuffing Start and end a Frame with a flag byte : Whenever the sender sees five 1s occur in a row in the data it inserts a 0 Whenever the receiver sees five 1s followed by a 0, it deletes the 0 Bit stuffing is completely transparent to the Network Layer Frames can be unambiguously recognized When nothing to send can send flags

12 University of Calgary CS 441 Errors in Physical Layer - Review caused by +impulse noise +thermal noise +crosstalk +attenuation +frequency-dependent nature of -amplitude -propagation speed -phase +microwave interference, etc

13 University of Calgary CS 441 Errors are Bursty advantage: destroys occasional frames, rather than many frames +eg independent errors, with error rate of bits/sec, frame size = 1000bits -average of one error per frame! +eg same error rate, but errors come in bursts of 100 -average error rate of 1-2 frames/100 disadvantage: harder to detect and correct, difficult to model mathematically

14 University of Calgary CS 441 Coding Theory: Dealing with Errors error detection +redundant (additional) information sent in a frame to allow receiver to detect errors error correction +even more redundancy to allow errors to be detected and then corrected codeword: +a frame with m (message) data bits and r (redundant) check bits and n = m + r total bits

15 University of Calgary CS 441 Hamming Distance the bit difference d between two code words, -algorithm: Exclusive OR two code words, count the 1 bits in the result code word code word X-OR'd result, -Hamming distance = 2

16 University of Calgary CS 441 Hamming Distance Hamming distance of complete code: +all 2**m possible data messages are legal +not all 2**n codewords are legal +h.d. of complete code: -find the minimum Hamming Distance between any two code words this minimum Hamming Distance is the Hamming Distance of that complete code

17 University of Calgary CS 441 Significance of Hamming Distance d single-bit errors are required to convert one codeword to into another +if two legal code words differ by 2 bits, then there have to be at least 2 bits in error to accidentaly convert one to the other to detect d errors requires a distance d+1 code +if the Hamming Distance of complete code is 3, all legal words differ by “at least” 3 bits +any legal codeword with only 2 bits in error cannot produce another (different) legal codeword

18 University of Calgary CS 441 Significance of Hamming Distance, Cont’d to correct d errors requires distance 2d+1 code +consider code with 5 bit Hamming Distance, ie all legal codes differ by “at least” 5 bits +if 2 bit errors occur within a codeword -h.d. illegal codeword to original = 2 -h.d. illegal codeword to any other legal codeword >= 3 therefore can recognize original code word

19 University of Calgary CS 441 Example 1: error detection via parity bits add single "parity" bit to data so that +# "1" bits in codeword is even (even parity), or +# "1" bits in codeword is odd (odd parity) -eg 2 bits data, 1 bit odd parity: Hamming Distance = 2, therefore can detect all 1 bit errors

20 University of Calgary CS 441 Example 2: error correction code 4 valid codewords, Hamming Distance = can guarantee to correct 2 errors -2 bit error corrected: > , closest to eg 3 bit error detected but not corrected: > , closest to

21 University of Calgary CS 441 Forward Error Correction corrects by detecting +single bit error in a code word +the error's position in the code word uses theoretical minimum number of check bits required to correct single errors can also be used to detect burst errors forward error correction is much less efficient than detection and retransmission forward error correction is used where retransmission is impractical, eg broadcast, satellite situations, deep space probes

22 University of Calgary CS 441 Minimum check bits to correct single errors m message bits, r check bits, n=m+r 2 legal messages have n illegal words at distance 1 (invert each bit in legal word) thus dedicate n+1 code words to each legal message total number of code words is 2 >=(n+1)2 Hamming’s forward code achieved this limit +number the bits starting with 1 from left +bits that are powers of 2 are check bits +rest (3, 5, 6, 7, 9,...) are message bits +each message bit = sum of powers of 2 +each check bit makes the sum of its appearances in message sums + self = even (or odd) m nm

23 University of Calgary CS 441 Example 3: Hamming forward error correction msg = (3rd=2+1, 7th=4+2+1) 1st = 1+1+self=1+1+0=0 (for even parity) 2nd = 1+1+self=0 4th = 1+self=1 8th = self = 0 code = receiver tests each check bit k (=1,2,4,...) if wrong adds k to counter if counter 0 then word correct else it contains the number of the incorrect bit eg, if 2 & 4 bits wrong, counter = 6, then 6th wrong

24 University of Calgary CS 441 Hamming Forward Burst Error Correction k codewords define k rows in a k by n matrix instead of sending rows, send columns collect the k columns at receiving end and reform the k by n matrix if a burst error of length,=k occurs it will cause at most one error per word, => correctable kr check bits for data blocks of size km enables correcting burst errors of up to k bits

25 University of Calgary CS 441 Cyclic Redundancy Checks (CRC) given m bit message M add R, an r bit frame checksum = frame of m+r = n bits = T R, the r bit checksum, is the remainder of dividing M by G, a constant r+1 bit number thus : +T = 2 r M + R +where R = remainder R of 2 r M/ G +then +T/ G = 2 r M/ G + R / G = Q + R/ G + R / G = Q ie, if no remainder (T/G=Q) then correct m must be greater than r

26 University of Calgary CS 441 Review Modulo 2 Arithmetic examples = = = = * = = / 11 = 11 remainder 0 11 * 11 = = 101

27 University of Calgary CS 441 Example - M = & generator G = 1011 compute R = remainder of (2 r M + 000)/G / 1011 = / 1011 thus T = / 1011 = 11111

28 University of Calgary CS 441 Polynomial Arithmetic 1011 = x 3 + x + 1 = M(x) Generator G(x) = x 5 + x = still use modulo 2 arithmetic G always of the form CRC-16 = X 16 + X 15 + X T(x) = x r M(x) + R(x) TR(x) = T(x) + E(x) where E = error pattern

29 University of Calgary CS 441 CRC Error Detection An error is undetectable IFF E divisible by G TR(x) = T(x) + E(x) TR(x)/G = T(x)/G(x) + E(x)/G(x) = Q + E(X)/G(x) CRC-16=G(x)= X 16 + X 15 + X = all single & double bit errors any odd number of errors if G(x) contains x+1 any burst error of length <= r = % of 17 bit bursts % of 18 bit and longer bursts

30 University of Calgary CS 441 Shift Register Implementation of CRC (0) <= = 2 n M (1) <= left shift 1 bit (5) <= (6) <= (7) <= (15) <= after all 15 shifts have R C4 + C3 C2 C1 C0 + +

31 University of Calgary CS 441 Receiver Implementation of CRC have duplicate logic received bits for M shifted into register this should leave R in shift register as the received R bits are shifted in they will zero out the register if the register isn’t all zeros then an error has occured in TR /= T = 2 n M + R and E(X) /= 0

32 University of Calgary CS 441 Coding Theory view legal code words as points in multidimensional space want to develop complete codes with maximum Hamming Distance, ie, idealy all are further apart than some minimum Hamming distance can detect d errors if minimum Hamming Distance is d+1 can correct d errors if minimum distance is 2d+1 forward error correction imposes this 2d+1 overhead on every message backward error correction incurs overhead to retransmit which should be rare