DATA COMMUNICATIONS &
NETWORKING
LECTURE-
21
Course Instructor : Sehrish Rafiq
Department Of Computer Science
University Of Peshawar
LECTURE OVERVIEW
 CRC
 Performance of CRC
 Checksum
 Performance of Checksum
ERROR DETECTION METHODS
CYCLIC REDUNDANCY CHECK
 The third and the most powerful technique is CRC.
 CRC is based on binary division.
 In CRC a sequence of redundant bits called the CRC
or CRC remainder is appended to the end of a data
unit.
 So that the resulting data unit becomes exactly
divisible by a second, predetermined binary number.
 At the destination, the incoming data unit is divided
by the same number.
CYCLIC REDUNDANCY CHECK
 If at this step there is no remainder the data unit
is assumed to be intact and is accepted.
 A remainder indicates that the data unit has
been damaged in transit and therefore must be
rejected.
REDUNDANCY BITS
 The redundancy bits used by CRC are derived by
dividing the data unit by a predetermined
divisor,the remainder is the CRC.
 To be valid, a CRC must have two qualities.
 It must have exactly one less bit than the divisor.
 Appending it to the end of the data string must
make the resulting bit sequence exactly divisible
by the divisor.
CRC GENERATOR & CHECKER
BINARY DIVISION IN A CRC
GENERATOR
BINARY DIVISION IN CRC
CHECKER
HOW IT WORKS???
 At the Transmitter:
 Step 1: A string of n 0’s is appended to the data
unit.
 The number n is 1 less than the number of bits in the
predetermined divisor which is n+1 bits.
 Step 2: The newly elongated data unit is divided
by the divisor using a process called binary
division.
 The remainder resulting from this division is the CRC.
 Step 3: The CRC derived in step 2 replaces the
appended 0’s at the end of the data unit.
HOW IT WORKS???
 At the receiver:
 The data unit arrives at the receiver data first
followed by the CRC.
 Step 1: The receiver treats the whole string as a
unit and divides it by the same divisor that was
used to find the CRC remainder.
 Result:
 If the string arrives without error ,the CRC checker yields
a remainder of 0 and the data unit passes.
 If the string has been changed in transit ,the division
yields a non zero remainder and the string passes.
THE CRC DIVISOR
 The divisor in the CRC generator is most often
represented not as a string of 1’s and 0’s but as
an algebraic polynomial.
 A polynomial should be selected to have at least
the following properties:
 It should not be divisible by x.
 It should be divisible by x+1.
 E.g.
A POLYNOMIAL
REPRESENTING A DIVISOR
STANDARD POLYNOMIALS
Name Polynomial Application
CRC-8CRC-8 x8
+ x2
+ x + 1 ATM header
CRC-10CRC-10 x10
+ x9
+ x5
+ x4
+ x2
+ 1 ATM AAL
ITU-16ITU-16 x16
+ x12
+ x5
+ 1 HDLC
ITU-32ITU-32
x32
+ x26
+ x23
+ x22
+ x16
+ x12
+ x11
+ x10
+ x8
+ x7
+ x5
+ x4
+ x2
+ x + 1
LANs
PERFORMANCE OF CRC
 CRC can detect all burst errors that effect an
odd number of bits.
 CRC can detect all burst errors of length less
than or equal to the degree of polynomial.
 CRC can detect with a very high probability
,burst errors of length greater than the degree of
polynomial.
CHECKSUM
 The checksum is also based on the concept of
redundancy.
CHECKSUM GENERATOR
 The sender follows these steps:
 Step 1: The unit is divided in to k sections, each
of n bits.
 Step 2: All sections are added using one’s
complement to get the sum in such a way that
the total is also n bits long.
 Step 3: The sum is then complemented and
becomes the checksum.
 Step 4: The checksum is sent with the data.
CHECKSUM CHECKER
 The sender follows these steps:
 Step 1: The unit is divided in to k sections, each
of n bits.
 Step 2: All sections are added using one’s
complement to get the sum in such a way that
the total is also n bits long.

 Step 3: The sum is then complemented.
 Step 4: If the result is zero, the data are
accepted, otherwise they are rejected.
CHECKSUM
DATA UNIT AND CHECKSUM
Example 1Example 1
Suppose the following block of 16 bits is to be sent using a
checksum of 8 bits.
10101001 00111001
The numbers are added using one’s complement
10101001
00111001
------------
Sum 11100010
Checksum 00011101
The pattern sent is 10101001 00111001 00011101
EXAMPLE 1 CONTINUED…
Now suppose the receiver receives the pattern sent and there is no
error.
10101001 00111001 00011101
When the receiver adds the three sections, it will get all 1s, which,
after complementing, is all 0s and shows that there is no error.
10101001
00111001
00011101
Sum 11111111
Complement 00000000 means that the pattern is OK.
EXAMPLE 1 CONTINUED…
Now suppose there is a burst error of length 5 that affects 4
bits.
10101111 11111001 00011101
When the receiver adds the three sections, it gets
10101111
11111001
00011101
Partial Sum 1 11000101
Carry 1
Sum 11000110
Complement 00111001 the pattern is corrupted.
PERFORMANCE OF CHECKSUM
 The checksum detects all errors involving an odd
number of bits as well as most errors involving
an even number of bits.
 However if one or more bits of a segment are
damaged and the corresponding bit or bits of
opposite value in a second segment are also
damaged,the sums of those columns will not
change and the receiver will not detect a
problem.
 Checksum retains all carriers, so although two 0s
becoming 1 would not alter the value of their own
column,it would change the value of the next
higher column.
THANKS!!!

Lecture 21

  • 1.
    DATA COMMUNICATIONS & NETWORKING LECTURE- 21 CourseInstructor : Sehrish Rafiq Department Of Computer Science University Of Peshawar
  • 2.
    LECTURE OVERVIEW  CRC Performance of CRC  Checksum  Performance of Checksum
  • 3.
  • 4.
    CYCLIC REDUNDANCY CHECK The third and the most powerful technique is CRC.  CRC is based on binary division.  In CRC a sequence of redundant bits called the CRC or CRC remainder is appended to the end of a data unit.  So that the resulting data unit becomes exactly divisible by a second, predetermined binary number.  At the destination, the incoming data unit is divided by the same number.
  • 5.
    CYCLIC REDUNDANCY CHECK If at this step there is no remainder the data unit is assumed to be intact and is accepted.  A remainder indicates that the data unit has been damaged in transit and therefore must be rejected.
  • 6.
    REDUNDANCY BITS  Theredundancy bits used by CRC are derived by dividing the data unit by a predetermined divisor,the remainder is the CRC.  To be valid, a CRC must have two qualities.  It must have exactly one less bit than the divisor.  Appending it to the end of the data string must make the resulting bit sequence exactly divisible by the divisor.
  • 7.
  • 8.
    BINARY DIVISION INA CRC GENERATOR
  • 9.
    BINARY DIVISION INCRC CHECKER
  • 10.
    HOW IT WORKS??? At the Transmitter:  Step 1: A string of n 0’s is appended to the data unit.  The number n is 1 less than the number of bits in the predetermined divisor which is n+1 bits.  Step 2: The newly elongated data unit is divided by the divisor using a process called binary division.  The remainder resulting from this division is the CRC.  Step 3: The CRC derived in step 2 replaces the appended 0’s at the end of the data unit.
  • 11.
    HOW IT WORKS??? At the receiver:  The data unit arrives at the receiver data first followed by the CRC.  Step 1: The receiver treats the whole string as a unit and divides it by the same divisor that was used to find the CRC remainder.  Result:  If the string arrives without error ,the CRC checker yields a remainder of 0 and the data unit passes.  If the string has been changed in transit ,the division yields a non zero remainder and the string passes.
  • 12.
    THE CRC DIVISOR The divisor in the CRC generator is most often represented not as a string of 1’s and 0’s but as an algebraic polynomial.  A polynomial should be selected to have at least the following properties:  It should not be divisible by x.  It should be divisible by x+1.  E.g.
  • 13.
  • 14.
    STANDARD POLYNOMIALS Name PolynomialApplication CRC-8CRC-8 x8 + x2 + x + 1 ATM header CRC-10CRC-10 x10 + x9 + x5 + x4 + x2 + 1 ATM AAL ITU-16ITU-16 x16 + x12 + x5 + 1 HDLC ITU-32ITU-32 x32 + x26 + x23 + x22 + x16 + x12 + x11 + x10 + x8 + x7 + x5 + x4 + x2 + x + 1 LANs
  • 15.
    PERFORMANCE OF CRC CRC can detect all burst errors that effect an odd number of bits.  CRC can detect all burst errors of length less than or equal to the degree of polynomial.  CRC can detect with a very high probability ,burst errors of length greater than the degree of polynomial.
  • 16.
    CHECKSUM  The checksumis also based on the concept of redundancy.
  • 17.
    CHECKSUM GENERATOR  Thesender follows these steps:  Step 1: The unit is divided in to k sections, each of n bits.  Step 2: All sections are added using one’s complement to get the sum in such a way that the total is also n bits long.  Step 3: The sum is then complemented and becomes the checksum.  Step 4: The checksum is sent with the data.
  • 18.
    CHECKSUM CHECKER  Thesender follows these steps:  Step 1: The unit is divided in to k sections, each of n bits.  Step 2: All sections are added using one’s complement to get the sum in such a way that the total is also n bits long.   Step 3: The sum is then complemented.  Step 4: If the result is zero, the data are accepted, otherwise they are rejected.
  • 19.
  • 20.
    DATA UNIT ANDCHECKSUM
  • 21.
    Example 1Example 1 Supposethe following block of 16 bits is to be sent using a checksum of 8 bits. 10101001 00111001 The numbers are added using one’s complement 10101001 00111001 ------------ Sum 11100010 Checksum 00011101 The pattern sent is 10101001 00111001 00011101
  • 22.
    EXAMPLE 1 CONTINUED… Nowsuppose the receiver receives the pattern sent and there is no error. 10101001 00111001 00011101 When the receiver adds the three sections, it will get all 1s, which, after complementing, is all 0s and shows that there is no error. 10101001 00111001 00011101 Sum 11111111 Complement 00000000 means that the pattern is OK.
  • 23.
    EXAMPLE 1 CONTINUED… Nowsuppose there is a burst error of length 5 that affects 4 bits. 10101111 11111001 00011101 When the receiver adds the three sections, it gets 10101111 11111001 00011101 Partial Sum 1 11000101 Carry 1 Sum 11000110 Complement 00111001 the pattern is corrupted.
  • 24.
    PERFORMANCE OF CHECKSUM The checksum detects all errors involving an odd number of bits as well as most errors involving an even number of bits.  However if one or more bits of a segment are damaged and the corresponding bit or bits of opposite value in a second segment are also damaged,the sums of those columns will not change and the receiver will not detect a problem.  Checksum retains all carriers, so although two 0s becoming 1 would not alter the value of their own column,it would change the value of the next higher column.
  • 25.