You are on page 1of 24

20CS2222

COMPUTER NETWORKS AND SECURITY

© 2020-21 KL University – The contents of this presentation are an intellectual and copyrighted property of KL University. ALL RIGHTS RESERVED 1
Error Detection Methods

© 2020-21 KL University – The contents of this presentation are an intellectual and copyrighted property of KL University. ALL RIGHTS RESERVED
2
Detection(cont’d)
• Detection methods
Cyclic Redundancy Check (CRC):
• Cyclic Redundancy Check (CRC) is an error detection method.
• It is based on binary division.
CRC Generator-
• CRC generator is an algebraic polynomial represented as a bit pattern.
• Bit pattern is obtained from the CRC generator using the following rule-

The power of each term gives the position of the bit and the coefficient gives the value of the bit.

Example-
• Consider the CRC generator is x7 + x6 + x4 + x3 + x + 1. The corresponding binary pattern is obtained
as-

4
Steps in Computing CRC:
Step-01: Calculation Of CRC At Sender Side-
At sender side,
• A string of n 0’s is appended to the data unit to be transmitted.
• Here, n is one less than the number of bits in CRC generator.
• Binary division is performed of the resultant string with the CRC generator.
• After division, the remainder so obtained is called as CRC.
• It may be noted that CRC also consists of n bits.

Step-02: Appending CRC To Data Unit-


• At sender side,
• The CRC is obtained after the binary division.
• The string of n 0’s appended to the data unit earlier is replaced by the CRC remainder.

Step-03: Transmission To Receiver-


• The newly formed code word (Original data + CRC) is transmitted to the receiver.
5
Steps in Computing CRC…
Step-04: Checking at Receiver Side-
At receiver side,
• The transmitted code word is received.
• The received code word is divided with the same CRC generator.
• On division, the remainder so obtained is checked.

The following two cases are possible-


Case-01: Remainder = 0
• If the remainder is zero,
• Receiver assumes that no error occurred in the data during the transmission.
• Receiver accepts the data.

Case-02: Remainder ≠ 0
• If the remainder is non-zero,
• Receiver assumes that some error occurred in the data during the transmission.
• Receiver rejects the data and asks the sender for retransmission. 6
CRC Example

A bit stream 11101101 is transmitted using the standard CRC method. The
generator polynomial is x3+1.

1. What is the actual bit string transmitted?

2. Suppose the third bit from the left is inverted during transmission. How will
receiver detect this error?

7
Example-1: Consider the message M=1001 and do the Cyclic Redundancy check for
the above message using the following divisor 1011. Also check for errors on the
received data using CRC.
Sol: Given Dividend = 1001 ( k = 4) and Divisor = 1011 (n-k+1)
given n – k + 1 = 4 , first we need to find n and then calculate
redundant bits
n–k+1=4
n–4+1=4
n=7
if n = 7 then no of redundant bits = n – k = 7 – 4 = 3
so we need to add three 0’s to the data word

© 2016 KL University – The contents of this presentation are an intellectual and copyrighted property of KL University. ALL RIGHTS RESERVED 8
9
10
Example-2: calculate the syndrome for the codeword 1000110 using
generator 1011

© 2016 KL University – The contents of this presentation are an intellectual and copyrighted property of KL University. ALL RIGHTS RESERVED 11
Detection(cont’d)
• Polynomials
• CRC generator(divisor) is most often represented not as a string of 1s and 0s,
but as an algebraic polynomial.
Detection(cont’d)
• A polynomial representing a divisor
Detection(cont’d)
• Standard polynomials
Example-3: The message 1101011011 is to be transmitted using the
generator polynomial X4+ x + 1 to protect it from errors. Find the final
data to be transmitted after performing CRC.

15
Example-4: M(x) = X3 + 1 and G(x) = X3 + x + 1
Sol: Given data word as M(x) = X3 + 1
To obtain code word, multiply M(x) by X3 (highest power of G(x))
so, codeword C(x) = X3 (X3 + 1) = X6 + X3
Then divide C(x) with G(x) to obtain remainder

© 2016 KL University – The contents of this presentation are an intellectual and copyrighted property of KL University. ALL RIGHTS RESERVED 16
17
18
Detection(cont’d)
• Checksum
used by the higher layer protocols
is based on the concept of redundancy
Detection(cont’d)
• Checksum Generator
Detection(cont’d)
• Example ( at a sender)
Original data : 10101001 00111001
10101001
00111001
--------------
11100010 Sum
00011101 Checksum
10101001 00111001 00011101
Detection(cont’d)
• Example ( at a receiver)
Received data : 10101001 00111001 00011101
10101001
00111001
00011101
---------------
11111111  Sum
00000000  Complement
Example-2: original data is 10110011 10101011 01011010 11010101.
perform checksum to detect error.

23
THANK YOU

© 2020-21 KL University – The contents of this presentation are an intellectual and copyrighted property of KL University. ALL RIGHTS RESERVED 24

You might also like