Methods of Error Detection
Data can be corrupted on the way. These are the checks that spot it.
This byte uses even parity. What must the parity bit be?
//Parity check
One bit of every byte is reserved as the parity bit. With EVEN parity the total number of 1s must be even; with ODD parity it must be odd. The sender sets the bit, the receiver counts — if the count is wrong, an error happened.
Even parity, data 0110100 (three 1s)
parity bit must make it even -> 1
sent as: 1 0110100 (four 1s)
If the receiver counts an odd number of 1s,
the data was corrupted.//Why parity alone is weak
Parity only spots an ODD number of flipped bits. If two bits flip, the count is still even and the error slips through. It also cannot tell you WHICH bit is wrong. A parity block check fixes both by running parity across rows and columns — where the failing row and failing column cross is the wrong bit.
//Checksum, echo check, check digit
Checksum: a value is calculated from the data, sent with it, recalculated on arrival and compared. Echo check: the receiver sends the data back and the sender compares — simple, but it doubles the traffic and cannot tell which copy got corrupted. Check digit: an extra digit calculated from the others, used on barcodes and ISBNs to catch typing mistakes.
//ARQ
The receiver checks each packet and sends back a positive acknowledgement if it is fine, or a request to resend if not. If the sender hears nothing before a timeout, it resends anyway. It keeps resending until acknowledged or a limit is reached.
CHECK YOURSELF
1.Why can a single parity check MISS an error?
2.Which check can identify exactly WHICH bit is wrong?