0% found this document useful (0 votes)
50 views10 pages

5 Error Detection

The document discusses error detection and correction techniques used in computer networks and data transmission. It provides examples of where errors may occur during data transmission, such as between computers in a network or from signals sent from a Mars probe. It then describes several error detection techniques like parity checks, checksums, and Hamming codes. Hamming codes introduce redundancy to allow error correction by encoding data using more bits. The strength of different techniques depends on the number of errors they can detect or correct. Forward error correction transmits redundant data to allow errors to be corrected at the receiving end.
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
50 views10 pages

5 Error Detection

The document discusses error detection and correction techniques used in computer networks and data transmission. It provides examples of where errors may occur during data transmission, such as between computers in a network or from signals sent from a Mars probe. It then describes several error detection techniques like parity checks, checksums, and Hamming codes. Hamming codes introduce redundancy to allow error correction by encoding data using more bits. The strength of different techniques depends on the number of errors they can detect or correct. Forward error correction transmits redundant data to allow errors to be corrected at the receiving end.
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 10

Error detection/correction

in computer networks

Examples:
 computers in a network sharing data
 data moving between primary and secondary memory
 two computers linked via a modem
 signals sent from Mars probe

Why do we get errors?


 transmission impairments — signal gets
attenuated, overwhelmed by noise

103-3

Objectives
How does noise affect data transmission?

What kind of error detection/correction schemes are there?


 parity checks
• vertical redundancy (VRC)
• longitudinal redundancy (LRC)
 checksum
 ISBN
 UPC
 Hamming codes
• Hamming distance
• sparse code property
What are their strengths and weaknesses?
 what kind of errors can be handled?
What is “forward” error correction?
 and what is the alternative? 103-4

1
Effect of noise on a digital signal
Data transmitted 0 1 0 1 1 0 0 1 1 0 0 1 0 1 0

Signal

Noise

Signal + noise

Sampling instants ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑

Received 0 1 0 1 1 0 1 1 1 0 0 1 0 0 0
103-5

Error detection vs correction

Error detection
 introduce redundancy into the data stream
 e.g. send everything twice!

Error correction by coding (“forward”)


 introduce enough redundancy to allow correction
 e.g. send everything three times!

Error correction by protocol


 first detect errors
 then request retransmission

103-6

2
Parity check
7-bit ASCII codes (128 codes, see Appendix H)
→ 8-bit ASCII

parity bit: odd parity or even parity (convention)

ASCII A 1000001
(65)

odd parity 11000001

even parity 01000001

bit error 01001001 parity error


(A → Q )

VRC: Vertical redundancy checking 103-7

Error correction with LRC


VRC (parity bit) detects single-bit errors
Add LRC: Longitudinal redundancy checking
LRC+VRC corrects all 1-bit errors
detects all 1-bit, 2-bit, 3-bit errors (not 4-bit)
VRC

A (65) 0 1 0 0 0 0 0 1
B (66) 0 1 0 0 0 0 1 0
C (67) 1 1 0 0 0 0 1 1
D (68) 0 1 0 0 0 1 0 0
LRC 1 0 0 0 0 1 0 0
1 1 0 0 0 0 0 1
1 1 0 0 0 0 1 0
even parity: always the same either way 0 1 0 0 0 0 1 1
1 1 0 0 0 1 0 0
(not so with odd parity) ? 1 1 1 1 0 1 1 103-8

3
Checksum
Block of characters
Add up their values
Divide by 256, take remainder (one byte)
Append to block

1. A 0 1 0 0 0 0 0 1
2. A 0 1 0 0 0 0 0 1
3. A 0 1 0 0 0 0 0 1
129
… … byte
block
128. A 0 1 0 0 0 0 0 1
checksum 1 0 0 0 0 0 0 0

128 × 65 = 8320 = 256×32 + 128


103-9

ISBN

Why do 10% of books have ISBNs ending in X?

Bronson: ISBN 0-534-36801-8

×10 ×9 ×8 ×7 ×6 ×5 ×4 ×3 ×2 179
remainder on division by 11 3
if 0, then 0
else subtract from 11 8
if the result is 10, use X

Checksum: vulnerable to byte swap


This is a “positional checksum” 103-10

4
UPC — Universal Product Code
product check  module width of 7
left digits right digits
SBSB BS B S
type digit  alternating bar 0 3211 321 1
1 2221 222 1
and space 2 2122 212 2
 width 1, 2, 3, 4 3 1411 141 1
4 1132 113 2
 20 possible codes 5 1231 123 1
6 1114 111 4
7 1312 131 2
8 1213 121 3
9 3112 311 2

0 1 2 3 4 5 6 7 8 9 0 5
guard bars 103-11

UPC checksum

0 1 2 3 4 5 6 7 8 9 0 5

odd sum 20 even sum 25


×3

85 10 – (85 % 10) = 5

103-12

5
Hamming codes
Error correction: transmit everything 3 times!

Two “messages”: 100 101


code send
A 0 000 000 001
B 1 111
110 111

010 011

103-13

Better Hamming codes


A 000
B 111

2-letter 3-bit correct all


alphabet codes 1-bit errors ×3
(1 bit)

A 00000
B 11100
C ?
D ?

4-letter 5-bit correct all


alphabet codes 1-bit errors × 2.5
(2 bits)
103-14

6
Better Hamming codes

Alphabet Codes Redundancy


2 letters (1 bit) 3 bits ×3 A 000
B 111

4 letters (2 bits) 5 bits × 2.5 A 00000


B 11100
C ?
D ?

16 letters (4 bits) 7 bits × 1.75

256 letters (8 bits) 12 bits × 1.5

These codes all correct single-bit errors 103-15

Mariner: Mars reconnaissance vehicles


In July and August 1969 two space probes—Mariner 6 and Mariner
7—flew by Mars to gather data and return images of Earth’s neighbouring
planet. Their five-month voyages provided a wealth of new information
about Mars, 60 million miles away. The data came in the form of 140
television images taken at distances from 1.1 million down to 93,000
miles as the craft approached the planet and another 58 high-resolution
pictures taken as close to the surface as 2,100 miles. In addition the
Mariners made infrared and ultraviolet measurements and were aimed to
pass behind the planet to determine how radio signals from the craft
would be affected by the planet’s atmosphere.
Because Mars rotated more than five times while being photographed,
virtually every feature seen through earth-based telescopes was recorded
and can be studied in pictures providing a resolution as much as 10 times
better than that obtainable from the earth. For about 10 percent of the
planet the new pictures provide a resolution about 100 times better than
pictures from the earth, and for selected areas within this 10 percent the
close-ups have a resolution about 1,000 times better.

103-16

7
Mariner: Mars reconnaissance vehicles

01011010010110100101101001011010

in utes
e ral m
sev

01001010000101100111101101111010

5 bit pixels 0 white 32 bit codes


1 Transmit 6 copies of each 5-bit pixel
2 6 × 5 = 30 bits
grey

30
31 black Majority vote
⇒ Can only correct 2 errors!
103-17

Code used by Mariner can correct


all errors
0
up to 7 bits
1
2

5
every pair of
rows differs in
exactly 16
places
… (“Hamming
distance”)

30
31
5
01011010010110100101101001011010 103-18

8
Error correction using protocol
To correct errors, detect and retransmit
Sender: 1. Compute error check (LRC, checksum)
2. Append to data block
3. Send block of data (“packet”)
4. Wait
Receiver: 1. Receive the packet
2. Check for errors 00000010
3. If no error, send ACK (ASCII 6)
else send NAK (ASCII 21) 00010101

Sender: 1. If receive NAK, resend the packet


2. If receive ACK, send next packet
3. If receive anything else, ignore it

 What if NAK gets corrupted or lost? (time out and re-send)


 or ACK? (number packets)
 or sender and receiver lose sync? (number ACKs)
 or lockstep sync causes too much delay? (several un-ACKd packets)
103-19
 or you need a bidirectional channel? (ha!—study computer science)

Richard Hamming
Born: 11 Feb 1915 in Chicago, Illinois, USA
Died: 7 Jan 1998 in Monterey, California, USA
Richard Hamming earned the Ph.D. at the
University of Illinois in 1942, then joined the
Manhattan Project in New Mexico. There, he
learned how to operate the Project’s computers
and helped physicists complete calculations
necessary for the design of the atomic bomb. After
the war, Hamming joined other young
mathematicians at Bell Telephone Laboratories. He
continued his work with computers. Frustrated by
the unreliability of early machines, he devised a
method for the detection and correction of errors
in digital data.
After leaving Bell Labs, he built a second career as a teacher and author of
textbooks at the Naval Postgraduate School. He spoke highly of his students. He
believed that invention and discovery would quickly outdate the factual content
of his courses and so gave priority to helping his students learn how to learn. He
liked to quote Louis Pasteur, saying that luck favors the prepared mind.
Richard Hamming died on January 7, 1998 at the age of 82 years. He is survived
by Wanda, his wife of 55 years who also contributed to the Manhattan Project at
Los Alamos, New Mexico. 103-20

9
Questions
1. What’s “forward error correction”? What is the other kind of error
correction?
2. What’s the difference between even parity and odd parity?
3. What’s the difference between vertical redundancy checking and
longitudinal redundancy checking?
4. If you use a vertical redundancy check together with a longitudinal
redundancy check, how many bit errors can be corrected? How
many can be detected?
5. How do you compute the checksum of a message?
6. Devise a 3-bit code for a 2-letter alphabet that corrects all 1-bit
errors.
7. Devise a 5-bit code for a 4-letter alphabet that corrects all 1-bit
errors.
8. What is the basic idea of error correction by protocol?
9. What’s an ACK? What’s a NACK?
10. Why do error correction protocols usually number the packets?

103-21

10

You might also like