Presentation is loading. Please wait.

Presentation is loading. Please wait.

EEC-484/584 Computer Networks

Similar presentations


Presentation on theme: "EEC-484/584 Computer Networks"— Presentation transcript:

1 EEC-484/584 Computer Networks
Lecture 12 Wenbing Zhao Cleveland State University

2 Outline Quiz#3 Result Reminder: Initial Draft due 4/26/2010 midnight by Data Link layer Data Link Layer Design Issues Framing Error Detection and Correction DLL Data Link Medium Access Control (MAC) We Cover This SubLayer in this lecture 2/24/2019 2/24/2019 EEC-484/584: Computer Networks

3 EEC-484/584: Computer Networks
EEC584 Quiz#3 Result Average: 81, high: 100, low: 58 Q1-34.8, Q2-17.8, Q3-14.9, Q4-13.5 2/24/2019 2/24/2019 EEC-484/584: Computer Networks

4 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 Note that DLL provides a point-to-point, source-to-destination service to the network layer, even though it use a broadcast technology. The multiaccess control issue is dealt with in the MAC sublayer Some DLL protocol also provides multicast/broadcast service => but not main concern here 2/24/2019 2/24/2019 EEC-484/584: Computer Networks

5 Functions of Data Link Layer
Provide a virtual source-to-destination communication channel to the network layer Dealing with transmission errors Regulating data flow 2/24/2019 2/24/2019 EEC-484/584: Computer Networks

6 Services Provided to Network Layer
(a) Virtual communication (b) Actual communication 2/24/2019 2/24/2019 EEC-484/584: Computer Networks

7 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 2/24/2019 2/24/2019 EEC-484/584: Computer Networks

8 EEC-484/584: Computer Networks
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 2/24/2019 2/24/2019 EEC-484/584: Computer Networks

9 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 of data with 2 bits 1 => 10 0 => 01 Can use 00 or 11 to delimit frames 2/24/2019 2/24/2019 EEC-484/584: Computer Networks

10 Framing Based on Character Count
Use field in header to indicate number of characters in frame Problem: Count might be garbled 2/24/2019 2/24/2019 EEC-484/584: Computer Networks

11 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 2/24/2019 2/24/2019 EEC-484/584: Computer Networks

12 Framing Based on Byte Stuffing
2/24/2019 2/24/2019 EEC-484/584: Computer Networks

13 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 2/24/2019 2/24/2019 EEC-484/584: Computer Networks

14 Framing Based on Bit Stuffing: Example
Original Frame (payload only) Frame after bit stuffing Received Frame after taken stuffed bit out 2/24/2019 2/24/2019 EEC-484/584: Computer Networks

15 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 2/24/2019 EEC-484/584: Computer Networks Wenbing Zhao

16 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 2/24/2019 EEC-484/584: Computer Networks Wenbing Zhao

17 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 2/24/2019 EEC-484/584: Computer Networks Wenbing Zhao

18 Error-Correcting Codes
Complete code Complete list of all legal codewords: 2m 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 2/24/2019 EEC-484/584: Computer Networks Wenbing Zhao 18

19 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! 2/24/2019 EEC-484/584: Computer Networks Wenbing Zhao

20 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 2/24/2019 EEC-484/584: Computer Networks Wenbing Zhao

21 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 2/24/2019 EEC-484/584: Computer Networks Wenbing Zhao

22 EEC-484/584: Computer Networks
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 2/24/2019 EEC-484/584: Computer Networks Wenbing Zhao

23 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 If a burst error occurs, it is equally likely to have single-bit error, double-bit error, etc. If odd number of bits error => can detect error If eve number of bits error => cannot detect error Therefore, the probability of detecting error is 50% 2/24/2019 EEC-484/584: Computer Networks Wenbing Zhao 23

24 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) = bm-1xm-1 + … + b0 E.g.: => M(x) = x7 + x6 + x4 + x3 + x1 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 2/24/2019 EEC-484/584: Computer Networks Wenbing Zhao

25 EEC-484/584: Computer Networks
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 2/24/2019 EEC-484/584: Computer Networks Wenbing Zhao

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

27 EEC-484/584: Computer Networks
Compute CRC Checksum XOR 2/24/2019 EEC-484/584: Computer Networks Wenbing Zhao

28 International Standard Polynomials
CRC-12 G(x) = x12 + x11 + x3 + x2 + x1 + 1 Used for 6-bit characters CRC-16 G(x) = x16 + x15 + x2 + 1 CRC-CCITT G(x) = x16 + x12 + x5 + 1 Used for 8-bit characters CRC-32 G(x) = x32 + x26 + x23 + x22 + x16 + x11 + x10 + x8 + x7 + x5 + x4 + x2 + x1 + 1 Used in IEEE 802 Detects all bursts of length 32 or less and all bursts affecting an odd number of bits No need to remember these generator polynomials 2/24/2019 EEC-484/584: Computer Networks Wenbing Zhao 28

29 EEC-484/584: Computer Networks
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 2/24/2019 2/24/2019 EEC-484/584: Computer Networks

30 EEC-484/584: Computer Networks
Exercise Q2. 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? 2/24/2019 EEC-484/584: Computer Networks Wenbing Zhao

31 EEC-484/584: Computer Networks
Exercise Q3. A bit stream is to be 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. 2/24/2019 EEC-484/584: Computer Networks Wenbing Zhao


Download ppt "EEC-484/584 Computer Networks"

Similar presentations


Ads by Google