EEC-484/584 Computer Networks Lecture 12 Wenbing Zhao Cleveland State University wenbing@ieee.org 12/2/2018
Outline Quiz#3 Result New grading policy Project Data Link layer Error Detection and Correction DLL Data Link Medium Access Control (MAC) We Cover This SubLayer in this lecture 12/2/2018 12/2/2018 EEC-484/584: Computer Networks
EEC-484/584: Computer Networks EEC484 Quiz#3 Result Average: 65, high: 80, low: 44 Q1-26.7, Q2-9.7, Q3-13, Q4-8.5, Q5-7.2 12/2/2018 12/2/2018 EEC-484/584: Computer Networks Wenbing Zhao
EEC-484/584: Computer Networks EEC584 Quiz#3 Result Average: 82.2, high: 96, low: 66 Q1-36.6, Q2-12.9, Q3-14.9, Q4-9.6, Q5-8.1 12/2/2018 12/2/2018 EEC-484/584: Computer Networks
New Grading Policy Considering the lower average scores on the first three quizzes, I decided to grade on a curve in the following way: If the average is below 80, then your new score = your current score + (80 – average) Else, no adjustment is done This is done on a per quiz basis EEC484 and EEC584 are curved separately 12/2/2018
EEC484 Project Walk-through See demo 12/2/2018
EEC584 Project Walk-through Searching for literature: ACM digital library and Google scholar Example wiki pages http://flyingtiger.pbwiki.com/Open-Shortest-Path-Tree http://dutkoeec584-dns.pbwiki.com/BIND http://macprotocol.pbwiki.com/ http://bryanandsteve.pbwiki.com/ http://samarth.pbwiki.com/Routing-Algorithms Example peer review Turnitin.com account You must submit a turnitin.com report 12/2/2018
Functions of Data Link Layer Provide a virtual source-to-destination communication channel to the network layer Dealing with transmission errors Regulating data flow 12/2/2018 EEC-484/584: Computer Networks
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 12/2/2018 EEC-484/584: Computer Networks Wenbing 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 12/2/2018 EEC-484/584: Computer Networks Wenbing 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 12/2/2018 EEC-484/584: Computer Networks Wenbing Zhao
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 12/2/2018 EEC-484/584: Computer Networks Wenbing Zhao 12
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! 12/2/2018 EEC-484/584: Computer Networks Wenbing 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 12/2/2018 EEC-484/584: Computer Networks Wenbing Zhao
Error-Correcting Codes: Example Consider a code with only four valid codewords 0000000000, 0000011111, 1111100000, 1111111111 This code has a distance 5 can correct double errors If 0000000111 arrives, receiver knows the original must have been 0000011111 However, if triple error changes 0000000000 to 0000000111, the error will not be corrected properly 12/2/2018 EEC-484/584: Computer Networks Wenbing Zhao
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 1011010 With even parity 10110100 With odd parity 10110101 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 12/2/2018 EEC-484/584: Computer Networks Wenbing 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 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% 12/2/2018 EEC-484/584: Computer Networks Wenbing Zhao 17
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.: 11011010 => 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 12/2/2018 EEC-484/584: Computer Networks Wenbing Zhao
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 12/2/2018 EEC-484/584: Computer Networks Wenbing 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: 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) 12/2/2018 EEC-484/584: Computer Networks Wenbing Zhao
EEC-484/584: Computer Networks Compute CRC Checksum XOR 12/2/2018 EEC-484/584: Computer Networks Wenbing Zhao
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 12/2/2018 EEC-484/584: Computer Networks Wenbing Zhao 22
EEC-484/584: Computer Networks Exercise Q1. 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? 12/2/2018 EEC-484/584: Computer Networks Wenbing Zhao
EEC-484/584: Computer Networks Exercise Q2. A bit stream 10011101 is to be transmitted using the standard CRC method described in the text. The generator polynomial is x3 + 1. 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. 12/2/2018 EEC-484/584: Computer Networks Wenbing Zhao