Checksum Networking
Checksum Networking
Error detection is a technique that is used to check if any error occurred in the data during the
transmission.
Checksum-
Checksum is an error detection method.
Step-01:
At sender side,
If m bit checksum is used, the data unit to be transmitted is divided into segments of m bits.
All the m bit segments are added.
The result of the sum is then complemented using 1’s complement arithmetic.
The value so obtained is called as checksum.
Step-02:
The data along with the checksum value is transmitted to the receiver.
Step-03:
At receiver side,
If m bit checksum is being used, the received data unit is divided into segments of m bits.
All the m bit segments are added along with the checksum value.
The value so obtained is complemented and the result is checked.
Receiver assumes that no error occurred in the data during the transmission.
Receiver accepts the data.
Case-02: Result ≠ 0
Receiver assumes that error occurred in the data during the transmission.
Receiver discards the data and asks the sender for retransmission.
Checksum Example-
10011001111000100010010010000100
Step-01:
At sender side,
Now, all the segments are added and the result is obtained as-
Step-02:
The data along with the checksum value is transmitted to the receiver.
Step-03:
At receiver side,
Important Notes-
Note-01:
Consider while adding the m bit segments, the result obtained consists of more than m bits.
Then, wrap around the extra bits and add to the result so that checksum value consists of m bits.
Note-02:
While calculating the checksum, if checksum value is needed, then assume it to be zero.
After calculating the checksum value, substitute the checksum value in the checksum field.
This will be required during checksum calculation of IP Header, TCP Header and UDP Header.
Note-03:
The checksum is used in the internet by several protocols although not at the data link layer.
Problem-
1. 1010101000011111
2. 1011111000100101
3. 1101010000011110
4. 1101010000111111
Solution-
When sender transmits data to the receiver, the data might get scrambled by noise or data might get
corrupted during the transmission.
Error detection is a technique that is used to check if any error occurred in the data during the
transmission.
In this technique,
One extra bit called as parity bit is sent along with the original data bits.
Parity bit helps to check if any error occurred in the data during the transmission.
Steps Involved-
Error detection using single parity check involves the following steps-
Step-01:
At sender side,
Step-02:
The newly formed code word (Original data + parity bit) is transmitted to the receiver.
Step-03:
At receiver side,
If total number of 1’s is even and even parity is used, then receiver assumes that no error occurred.
If total number of 1’s is even and odd parity is used, then receiver assumes that error occurred.
If total number of 1’s is odd and odd parity is used, then receiver assumes that no error occurred.
If total number of 1’s is odd and even parity is used, then receiver assumes that error occurred.
Then,
At Sender Side-
After receiving the code word, total number of 1’s in the code word is counted.
Consider receiver receives the correct code word = 10010011.
Even parity is used and total number of 1’s is even.
So, receiver assumes that no error occurred in the data during the transmission.
Advantage-
This technique is guaranteed to detect an odd number of bit errors (one, three, five and so on).
If odd number of bits flip during transmission, then receiver can detect by counting the number of
1’s.
Checksum
Limitation-
This technique can not detect an even number of bit errors (two, four, six and so on).
If even number of bits flip during transmission, then receiver can not catch the error.
EXAMPLE
Consider the data unit to be transmitted is 10010001 and even parity is used.
Then, code word transmitted to the receiver = 100100011
Consider during transmission, code word modifies as 101100111. (2 bits flip)
On receiving the modified code word, receiver finds the number of 1’s is even and even parity is
used.
So, receiver assumes that no error occurred in the data during transmission though the data is
corrupted.
Error detection is a technique that is used to check if any error occurred in the data during the
transmission.
CRC Generator-
The power of each term gives the position of the bit and the coefficient gives the value of the bit.
Example-
Thus, for the given CRC generator, the corresponding binary pattern is 11011011.
The algebraic polynomial chosen as a CRC generator should have at least the following properties-
Rule-01:
Rule-02:
It should be divisible by x+1.
This condition guarantees that all the burst errors affecting an odd number of bits are detected.
Important Notes-
Steps Involved-
At sender side,
At sender side,
The newly formed code word (Original data + CRC) is transmitted to the receiver.
At receiver side,
Case-01: Remainder = 0
Receiver assumes that no error occurred in the data during the transmission.
Receiver accepts the data.
Case-02: Remainder ≠ 0
Receiver assumes that some error occurred in the data during the transmission.
Receiver rejects the data and asks the sender for retransmission.
Problem-01:
A bit stream 1101011011 is transmitted using the standard CRC method. The generator polynomial is
x4+x+1. What is the actual bit string transmitted?
Solution-
Now,
Problem-02:
A bit stream 10011101 is transmitted using the standard CRC method. The generator
polynomial is x3+1.
Part-01:
Part-02:
According to the question,
Now,
From here,