150 likes | 260 Views
Error Detection and Correction. Martin Weiss. Objectives of this Meeting. Describe the major error detection techniques Describe forward error correction. Review of the Last Meeting. Multiplexing Topologies Telephone network. Data Link Layer Issues. Error control Flow control
E N D
Error Detection and Correction Martin Weiss
Objectives of this Meeting • Describe the major error detection techniques • Describe forward error correction
Review of the Last Meeting • Multiplexing • Topologies • Telephone network
Data Link Layer Issues • Error control • Flow control • Local addressing
Error Detection • Parity • Cyclical redundancy check
Vertical and Longitudinal Redundancy Checks Bit 1 Bit 2 Bit n Parity Character 1 b11 b21 bn1 R1 Character 2 b12 b22 bn2 R2 Character m b1m b2m bnm Rm Parity C1 C2 Cn Cn+1 LRC VRC
Error Correction • Automatic Response Request (ARQ) • Transmitter sends a message • Receiver acknowledges • In case of NAK, the transmitter retransmits the message
Forward Error Correction • Redundancy is built into the message • Detects and corrects errors • Example: Hamming Code
Hamming Codes • Developed by R.W. Hamming • Uses multiple parity bits to locate errors in a word • Theory • If n parity bits are used, there are 2n possible combinations • We need to associate each bit position with a combination of parity bits • Thus, we must choose n so that 2n > m (the number of bits in the message)
Hamming Code • Assume an 8 bit message • n > log2m • Choose n = 4 m1 m2 m3 m4 m5 m6 m7 m8 p1 x x x x x x x x x x p2 x x x x p3 x x x x p4
m1 m2 m3 m4 m5 m6 m7 m8 p1 x x x x x x x x x x p2 x x x x p3 x x x x p4 Hamming Code Even Parity Computation Table Transmitted Sequence p1 p2 m1 p3 m2 m3 m4 p4 m5 m6 m7 m8
Hamming Code Error (bit position) Parity Errors <none> <none> p1 p2 p1 & p2 p3 p1 & p3 p2 & p3 p1, p2, & p3 p4 p1 & p4 p2 & p4 p1, p2 & p4 p3 & p4 1 2 3 4 5 6 7 8 9 10 11 12
Hamming Code • Consider the bit stream 10010011 • Parity bits are: • p1=1 • p2=1 • p3=0 • p4=0 • Transmitted bit stream is 111000100011
Hamming Code • If the received bit stream is • 111010100011 • p1 and p3 fail • 101000100011 • p2 fails • 111000100001 • p1, p2, and p4 fail