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.

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

Introduction to Information Technologies
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
EEC-484/584 Computer Networks
Error Detection and Correction
EEC-484/584 Computer Networks Lecture 7 Wenbing Zhao
EEC-484/584 Computer Networks Lecture 6 Wenbing Zhao
EEC-484/584 Computer Networks Lecture 12 Wenbing Zhao Cleveland State University
Error Detection and Correction
PART III DATA LINK LAYER. Position of the Data-Link Layer.
EEC-484/584 Computer Networks Lecture 8 Wenbing Zhao (Part of the slides are based on materials supplied by Dr. Louise Moser at UCSB and.
Transmission Errors1 Error Detection and Correction.
The Data Link Layer Chapter 3. Position of the data-link layer.
The OSI Reference Model
CMPE 150- Introduction to Computer Networks 1 CMPE 150 Fall 2005 Lecture 11 Introduction to Computer Networks.
EEC-484/584 Computer Networks
EEC-484/584 Computer Networks Lecture 13 Wenbing Zhao
EEC-484/584 Computer Networks Lecture 7 Wenbing Zhao
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.
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
Transmission Errors Error Detection and Correction
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.
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
Data Link Layer. Data Link Layer Design Issues Services Provided to the Network Layer Framing Error Control Flow Control.
Data Link Layer : Services, Framing, Error Detection and Correction2.
The Data Link Layer Goal –As reliable as possible, efficient communication Point-to-Point –single connection –bits arrive in order sent Not necessarily.
The Data Link Layer. Functions of the Data Link Layer Provide service interface to the network layer Dealing with transmission errors Error detection.
Chapter 3 The Data Link Layer (60 % practical part)
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)
McGraw-Hill©The McGraw-Hill Companies, Inc., 2004 Data Link Layer PART III.
Error Detection and Correction
COMPUTER NETWORKS Ms. Mrinmoyee Mukherjee Assistant Professor St. Francis Institute of Technology, Mount Poinsur, S.V.P Road, Borivli (west), Mumbai
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.
Transmission Errors Error Detection and Correction.
10.1 Chapter 10 Error Detection and Correction Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
10.1 Chapter 10 Error Detection and Correction Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
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.
Chi-Cheng Lin, Winona State University CS412 Introduction to Computer Networking & Telecommunication Error Correction/Detection.
The Data Link Layer Chapter 3. Data Link Layer Design Issues Services Provided to the Network Layer Framing Error Control Flow Control.
1 University of Calgary CS 441 Part 3 The Data Link Layer 3.1 Framing & Error Control 3.2 Error & Flow Control.
CS4470 Computer Networking Protocols
Data Link Layer Objective: to achieve reliable and efficient communication between 2 adjacent machines Data link layer design issues services provided.
Data Link Layer.
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
Transmission Errors Error Detection and Correction
UNIT-II The Data Link Layer.
EECS 122: EE122: Error Detection and Reliable Transmission
Data Link Layer. Position of the data-link layer.
Presentation transcript:

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 Prentice-Hall)

2 Spring Semester 2007EEC-484/584: Computer NetworksWenbing Zhao Quiz1 Result High 100, low 57, average 83, medium 88 Average of Q1 – 25, Q2 – 24, Q3 – 18, Q4 - 15

3 Spring Semester 2007EEC-484/584: Computer NetworksWenbing Zhao Outline Data Link layer –Data Link Layer Design Issues –Framing –Error Detection and Correction DLL Data Link Medium Access Control (MAC) We Study This SubLayer in This Lecture

4 Spring Semester 2007EEC-484/584: Computer NetworksWenbing Zhao Data Link Layer Design Issues Services Provided to the Network Layer –Point-to-point, source-to-destination Framing –Physical bit stream divided up into frames Error Control –Acknowledgements (acks), retransmission, duplicate suppression Flow Control –Throttle sender so sends no faster than receiver can receive them

5 Spring Semester 2007EEC-484/584: Computer NetworksWenbing Zhao Functions of Data Link Layer Provide a virtual source-to-destination communication channel to the network layer Dealing with transmission errors Regulating data flow

6 Spring Semester 2007EEC-484/584: Computer NetworksWenbing Zhao Services Provided to Network Layer (a) Virtual communication (b) Actual communication

7 Spring Semester 2007EEC-484/584: Computer NetworksWenbing Zhao Placement of Data Link Protocol

8 Spring Semester 2007EEC-484/584: Computer NetworksWenbing Zhao Types of Services Provided to Network Layer Unacked connectionless –Ok if low error rate, real time applications Acked connectionless Unacked connection-oriented Acked connection-oriented

9 Spring Semester 2007EEC-484/584: Computer NetworksWenbing Zhao Framing DL layer divides physical bit stream into frames Checksum computed by source included in frame Checksum recomputed by destination and checked against checksum included in the frame –Discard/recover bad frame, notify source

10 Spring Semester 2007EEC-484/584: Computer NetworksWenbing Zhao How Does DL Layer Form Frames? Insert time gaps between frames: too risky Character count Flag bytes with byte stuffing Starting and ending flags, with bit stuffing Physical layer coding violations –Example: encode 1 bit with 2 bits 1 => 10 0 => 01 Can use 00 or 11 to delimit frames

11 Spring Semester 2007EEC-484/584: Computer NetworksWenbing Zhao Framing Based on Character Count Use field in header to indicate number of characters in frame Count might be garbled, not used by itself

12 Spring Semester 2007EEC-484/584: Computer NetworksWenbing Zhao Framing Based on Byte Stuffing Each frame starts and ends with a special flag byte –Problem: flag byte might appear in data –Solution: Source inserts ESC (DL escape) before each flag byte; ESC before each ESC Destination removes inserted ESC bytes Disadvantage: depends on 8-bits characters in ASCII

13 Spring Semester 2007EEC-484/584: Computer NetworksWenbing Zhao Framing Based on Byte Stuffing

14 Spring Semester 2007EEC-484/584: Computer NetworksWenbing Zhao Framing Based on Bit Stuffing Each frame begins and ends with special bit patterns, (in fact, a flag byte) When source ’ s data contains 11111, stuff 0 When destination receives , deletes 0 Advantages: –Allows arbitrary number of bits per frame –Allows arbitrary number of bits per character

15 Spring Semester 2007EEC-484/584: Computer NetworksWenbing Zhao Framing Based on Bit Stuffing: Example Original Frame (payload only) Frame after bit stuffing Received Frame after taken stuffed bit out

16 Spring Semester 2007EEC-484/584: Computer NetworksWenbing Zhao Exercise Q1. The following character encoding is used in a data link protocol: A: ; B: ; FLAG: ; ESC: Show the bit sequence transmitted (in binary) for the four- character frame: A B ESC FLAG when each of the following framing methods are used: (a) Character count. (b) Flag bytes with byte stuffing. (c) Starting and ending flag bytes, with bit stuffing

17 Spring Semester 2007EEC-484/584: Computer NetworksWenbing Zhao Exercise Q2. The following data fragment occurs in the middle of a data stream for which the byte- stuffing algorithm described in the text is used: A B ESC C ESC FLAG FLAG D. What is the output after stuffing?

18 Spring Semester 2007EEC-484/584: Computer NetworksWenbing Zhao Exercise Q3. A bit string, , needs to be transmitted at the data link layer. What is the string actually transmitted after bit stuffing?

19 Spring Semester 2007EEC-484/584: Computer NetworksWenbing Zhao Exercise Q4. One of your classmates, Scrooge, has pointed out that it is wasteful to end each frame with a flag byte and then begin the next one with a second flag byte. One flag byte could do the job as well, and a byte saved is a byte earned. Do you agree?

20 Spring Semester 2007EEC-484/584: Computer NetworksWenbing Zhao Error Detection and Correction Causes of errors –Transmission errors on phone lines due to thermal noise –Data transmission errors due to impulse noise –Signals are separated, distorted, recombined –Crosstalk between physically adjacent wires –Compression and decompression –Receiver out of synch with sender Errors usually occur in bursts

21 Spring Semester 2007EEC-484/584: Computer NetworksWenbing Zhao Error-Correcting Codes n-bit codeword – an n-bit unit containing data and check bits –m bits of data, r bits redundant/check bits (n = m+r) How to measure the differences between two codewords (num of different bits) –Using exclusive OR and counting number of 1 bits in the result

22 Spring Semester 2007EEC-484/584: Computer NetworksWenbing Zhao Error-Correcting Codes Hamming distance – number of bit positions in which two codewords differ If two codewords are a Hamming distance d apart, it will require d single-bit errors to convert one into the other

23 Spring Semester 2007EEC-484/584: Computer NetworksWenbing Zhao Error-Correcting Codes Complete code –Complete list of all legal codewords: 2 m possible data messages –Recall that there are m bits of data Hamming distance of the complete code –Find two codewords whose Hamming distance is minimum

24 Spring Semester 2007EEC-484/584: Computer NetworksWenbing Zhao Error-Detection Codes A distance d+1 code can detect up to d errors, why? –If there are d+1 errors, one valid codeword might be turned into another valid codeword –≤ d errors will change a valid codeword into an illegal codeword  can be detected!

25 Spring Semester 2007EEC-484/584: Computer NetworksWenbing Zhao Error-Correcting Codes To correct d errors, need a distance 2d+1 code –Legal codewords are so far part that even with d changes, original codeword is still closer than any other codeword, so it can be uniquely determined

26 Spring Semester 2007EEC-484/584: Computer NetworksWenbing Zhao Error-Correcting Codes: Example Consider a code with only four valid codewords – , , , This code has a distance 5  can correct double errors –If arrives, receiver knows the original must have been –However, if triple error changes to , the error will not be corrected properly

27 Spring Semester 2007EEC-484/584: Computer NetworksWenbing Zhao Parity Bit Parity bit – a single bit is appended to the data Parity bit is chosen so that number of 1 bits in the codeword is even or odd Example: Given –With even parity  –With odd parity  A code with a single parity bit has a distance 2 –Since any single-bit error produces a codeword with wrong parity  can be used to detect single bit errors

28 Spring Semester 2007EEC-484/584: Computer NetworksWenbing Zhao Error-Detecting Codes If a single parity bit is appended to a block, error detecting probability is only 0.5 if burst error occurs (why?) This can be improved by treating a block as a matrix, n bits wide and k bits high, –A parity bit is computed for each column and affixed to the matrix as the last row –The matrix is transmitted one row at a time –Probability of accepting bad block is 2 -n

29 Spring Semester 2007EEC-484/584: Computer NetworksWenbing Zhao Error-Detecting Codes: CRC Polynomial code, also known as CRC (Cyclic Redundant Code) Treat bit string as polynomial with 0 and 1 coefficients m-bit frame: M(x) = b m-1 x m-1 + … + b 0 E.g.: => M(x) = x 7 + x 6 + x 4 + x 3 + x 1 Use modulo 2 arithmetic –No carries or borrows: XOR The degree of a polynomial is the maximum of the degrees of all terms in the polynomial

30 Spring Semester 2007EEC-484/584: Computer NetworksWenbing Zhao Cyclic Redundant Code Sender and receiver agree on generator polynomial G(x) (High & low order bits must be 1) For a frame with m bits corresponding to M(x), m > deg G(x) = r Append checksum to end of frame so polynomial T(x) corresponding to checksummed frame is divisible by G(x) When receiver gets checksummed frame, divides T(x) by G(x) If remainder R(x) != 0, then transmission error

31 Spring Semester 2007EEC-484/584: Computer NetworksWenbing Zhao Algorithm to Compute CRC Checksum Let m = deg M(x), r = deg G(x) Append r 0 bits to lower-order end of frame: x r M(x) Divide bit string corresponding to x r M(x) by bit string corresponding to G(x) Subtract remainder R(x) from bit string corresponding to x r M(x), result is checksummed frame. Let T(x) be its polynomial –x r M(x) = Q(x)G(x) + R(x) –x r M(x) – R(x) = Q(x)G(x) = T(x)

32 Spring Semester 2007EEC-484/584: Computer NetworksWenbing Zhao Compute CRC Checksum XOR

33 Spring Semester 2007EEC-484/584: Computer NetworksWenbing Zhao International Standard Polynomials CRC-12 G(x) = x 12 + x 11 + x 3 + x 2 + x –Used for 6-bit characters CRC-16 G(x) = x 16 + x 15 + x CRC-CCITTG(x) = x 16 + x 12 + x –Used for 8-bit characters CRC-32G(x) = x 32 + x 26 + x 23 + x 22 + x 16 + x 11 + x 10 + x 8 + x 7 + x 5 + x 4 + x 2 + x –Used in IEEE 802 –Detects all bursts of length 32 or less and all bursts affecting an odd number of bits

34 Spring Semester 2007EEC-484/584: Computer NetworksWenbing Zhao Exercise Q5. To provide more reliability than a single parity bit can give, an error-detecting coding scheme uses one parity bit for checking all the odd-numbered bits and a second parity bit for all the even-numbered bits. What is the Hamming distance of this code?

35 Spring Semester 2007EEC-484/584: Computer NetworksWenbing Zhao Exercise Q6. A bit stream is transmitted using the standard CRC method described in the text. The generator polynomial is x Show the actual bit string transmitted. Suppose the third bit from the left is inverted during transmission. Show that this error is detected at the receiver's end.