1 Error Coding
Transmission process may introduce errors into a message.
Single bit errors versus burst errors
Detection:
Requires a convention that some messages are invalid
Hence requires extra bits
An (n,k) code has codewords of n bits with k data bits and r = (n-k) redundant check bits
Correction
Forward error correction: many related code words map to the same data word
Detect errors and retry transmission
Parity
1-bit error detection with parity
Add an extra bit to a code to ensure an even (odd) number
- f 1s
Every code word has an even (odd) number of 1s
01 11 10 00 Valid code words 010 110 100 000 011 111 101 001 Parity Encoding: White – invalid (error)
Voting
1-bit error correction with voting
Every codeword is transmitted n times
010 110 100 000 011 111 101 001 Voting: White – correct to 1 Blue - correct to 0 1 Valid code words
Basic Concept: Hamming Distance
Hamming distance of two bit strings = number of bit positions in which they differ.
If the valid words of a code have minimum Hamming distance D, then D-1 bit errors can be detected.
If the valid words of a code have minimum Hamming distance D, then [(D-1)/2] bit errors can be corrected.
1 0 1 1 0 1 1 0 1 0 HD=2
Examples
Parity
01 11 10 00 Valid code words 010 110 100 000 011 111 101 001 Parity Encoding: White – invalid (error) 010 110 100 000 011 111 101 001 Voting: White – correct to 1 Blue - correct to 0 1 Valid code words
Voting
Digital Error Detection Techniques
Two-dimensional parity
Detects up to 3-bit errors
Good for burst errors
IP checksum
Simple addition
Simple in software
Used as backup to CRC
Cyclic Redundancy Check (CRC)
Powerful mathematics
Tricky in software, simple in hardware
Used in network adapter