Advanced Computer Networks: Lecture 7. This lecture will cover the following: error detection and correction; digital error detection techniques; cyclic redundancy check (CRC); two-dimensional parity; internet checksum algorithm; topics already covered; detecting transmission errors;...
Trang 1CS716 Advanced Computer Networks
By Dr. Amir Qayyum
Trang 2Lecture No. 7
Trang 5• k bits are derived from the original
message
• Both the sender and receiver know the
algorithm
Trang 611101
11
Valid Codes
Parity encoding:
Trang 8• Every code is copied three times
Remaining bit in a 2erasure plane is not ambiguous
000 100
110010
Trang 9Hamming Distance (1950 Paper)
• Minimum number of bit flips between code words
– 2 flips for parity
– 3 flips for voting
• nbit error detection
– No code word changed into another code word
– Requires Hamming distance of n+1
Trang 10• nbit error correction
– Nbit neighborhood: all code words within n bit flips
– No overlap between nbit
neighborhoods
– Requires Hamming distance of 2n+1
Trang 16• Not used at the link level but provides same sort of functionality as CRC and parity
• Idea:
– Add up all words (16bit integers) that are transmitted– Transmit the result (checksum) of that sum
– Receiver performs the same calculation on received data and compares the result with the received checksum
– If the results do not match, an error is detected
Trang 17Internet Checksum Algorithm
View message as a sequence of 16bit integers; sum using 16bit onescomplement arithmetic; take onescomplement
/* carry occurred, so wrap around */
sum &= 0xFFFF;
sum++;
} }
return ~(sum & 0xFFFF);
}
Trang 18Cyclic Redundancy Check Theory
Trang 19– e.g., C(x) = x3 + x2 + 1
Trang 2100001000
1101
101 Remainder
Trang 2200001101
Trang 231100 1101
1110 1101
111 Incorrect !
Two bits are flipped
Trang 241101 1101
Three bits are flipped
Trang 29Topics Already Covered
• Elements of networks: nodes and links
• Building a packet abstraction on a pointto point link