Expalin the working mechanism of Checksum.


CHECKSUM
The error detection method used by the higher layer protocols is called checksum. It consists of two arts. They are,
1.     checksum generator
2.     checksum checker
Checksum Generator:
In the sender, the checksum generator subdivides the data unit into equal segments of n bits. These segments are added with each other by using one’s complement arithmetic in such a way that the total is also n bits long. That total is then complemented and appended to the end of the data unit.

Checksum Checker:
The receiver subdivides the data unit as above and adds all segments together and complements the result. If the extended data unit is intact, the total value found by adding the data segments and the checksum field should be zero. Otherwise the packet contains an error and the receiver rejects it.

EXAMPLE
At the sender
Data unit:   10101001 00111001
10101001
00111001
Sum   1100010
Checksum 00011101
At the receiver
1)
Received data: 10101001 00111001 00011101
10101001
00111001
00011101
Sum 11111111
Complement 00000000
It means that the patter is ok.

2)
Received data: 1010111 111001 00011101
10101111
11111001
00011101
Result 11000101
Carry   1
Sum 11000110
Complement 00111001
It means that the patter is corrupted.

0 comments:

Feel free to contact the admin for any suggestions and help.