140 likes | 435 Views
Chapter 2 : Direct Link Networks. (Continued). So far. Modulation and Encoding Link layer protocols Error Detection -- Parity Check. Next. CRC codes -- what are they ? Retransmissions of packets -- ensuring reliability. Multiple-access -- Ethernet. CRC codes. Cyclic Redundancy Check
E N D
Chapter 2 : Direct Link Networks (Continued)
So far... • Modulation and Encoding • Link layer protocols • Error Detection -- Parity Check.
Next... • CRC codes -- what are they ? • Retransmissions of packets -- ensuring reliability. • Multiple-access -- Ethernet.
CRC codes • Cyclic Redundancy Check • based on theory of finite fields. • Use of Modulo 2 arithmetic. • Can help in detecting errors and in correcting some errors.
Representation • Each (n+1) bit message is represented by a `n’ degree polynomial. • Coefficient of a term = bit in the message. • Example 10011010 is represented as: M(x) = 1x7 + 0x6 + 0x5 + 1x4 +1x3 + 0x2 + 1x1 + 0x0 Think of sender and receiver exchanging polynomials.
Generator Polynomial • Sender and receiver agree upon a divisor polynomial of degree ‘k’ --> level of redundancy. Example : C(x) = x3 + x2 + 1 • Common generator polynomials are tabulated -- coding theory. • Choice of C(x) dictates what types of errors can be detected -- depends on protocol designer.
Modulo-2 rules • A polynomial B(x) is divisible by C(x) if B(x) is of higher degree than C(x). • A polynomial B(x) can also be divisible by C(x) if B(x) is of the same degree as C(x). • Remainder of division = B(x) - C(x). • To perform B(x) - C(x), XOR matching coefficients.
Example • B(x) = x3 + x2 +1, C(x) = x3 + 1 • Division yields a remainder of x2. • Check -- result of the simple rules from previous slide.
Sender Functions • Message M(x) is (n+1) bits long. • Sends (n+1) + k bits --> adding K bits causes a new polynomial P(x). • Requirement : P(x) should be divisible by C(x).
Receiver functions • Receiver divides received polynomial by C(x). • If remainder = 0, receiver believes that there are no errors. • If remainder != 0, receiver believes that there are errors -- recovery possible.
Steps of Operation at Sender • Multiply M(x) by Xk --> add k zeroes at the end of the message or induce a “left” shift -- let this be T(x) • Divide T(x) by C(x); find remainder. • Subtract remainder from T(x) to get P(x) • Note -- P(x) exactly divisible by C(x).
Steps of Operation at Receiver • Consider an error E(x). • Received message = P(x) + E(x). • Divide by C(x). • If E(x) is of smaller degree than C(x), only E(x) remains. • P(x) is perfectly divisible. • So remainder is E(x) -- the error itself!
Example • M(x) = x7 + x4 + x3 + x, C(x) = x3 + x2 + 1 • k = 3 -- first multiple by x3 to get T(x). • Divide by C(x). • Remainder = 101. • Subtract 101 (XOR T(x) and 101) to find P(x).
Common Errors • xi is a common error -- one bit is changed. • Look at the book for more on C(x). • Add error of say 110 and see what happens to remainder at the receiver. • What is E(x) ?