# Errors

Document Sample

```					         Data Communications
Roosevelt University
Roger Clery

Chapter 6:
Errors, Error Detection, and Error
Control
ERROR
Any unwanted signal
Any rem val or attenuati of a signal   on

Any unwanted chhaangee in a signal

Richard W. Hamming

Data Communications                             2
Objectives

After reading this chapter, you should be able to:
•Identify the different types of noise commonly
found in computer networks
•Specify the different error-prevention techniques,
and be able to apply an error-prevention technique to
a type of noise
•Compare the different error-detection techniques in
terms of efficiency and efficacy

Data Communications                                       3
Objectives (continued)

•Perform simple parity and longitudinal parity
calculations, and enumerate their strengths and
weaknesses
•Cite the advantages of cyclic redundancy checksum,
and specify what types of errors cyclic redundancy
checksum will detect
•Differentiate between the three basic forms of error
control, and describe the circumstances under which
each may be used
Data Communications                                       4
Objectives (continued)

•Follow an example of Stop-and-wait ARQ, Go-
back-N ARQ, and Selective-reject ARQ

Data Communications                              5
Introduction

•Noise is always present
•If a communications line experiences too much noise
•Signal will be lost or corrupted
•Communication systems should check for
transmission errors
•Once an error is detected, a system may perform
some action
•Some systems perform no error control, but simply
let the data in error be discarded
Data Communications                                    6
Noise and Errors – White Noise

•Also known as thermal or Gaussian noise

•Relatively constant

•Can be reduced

•If white noise gets to strong
•Can completely disrupt signal

Data Communications                           7
White Noise (continued)

Data Communications                    8
Real Noise

Data Communications                9
Impulse Noise

•One of the most disruptive forms of noise
•Random spikes of power
•Can destroy one or more bits of information

•Difficult to remove from an analog signal
•May be hard to distinguish from original signal

•Impulse noise can damage more bits if the bits are
closer together (transmitted at a faster rate)

Data Communications                                       10
Impulse Noise (continued)

Data Communications                      11
Impulse Noise (continued)

Data Communications                      12
Crosstalk

•Unwanted coupling between two different signal
paths
•For example, hearing another conversation while talking
on the telephone

•Relatively constant

•Can be reduced with proper measures

Data Communications                                               13
Crosstalk (continued)

Data Communications                  14
Echo

•The reflective feedback of a transmitted signal as
the signal moves through a medium
•Most often occurs on coaxial cable
•If echo bad enough, it could interfere with original
signal
•Relatively constant
•Can be significantly reduced

Data Communications                                      15
Echo (continued)

Data Communications             16
Jitter

•The result of small timing irregularities during
transmission of digital signals

•Occurs when a digital signal is repeated over and
over

•If serious enough, jitter forces systems to slow
down their transmission

•Steps can be taken to reduce jitter

Data Communications                                    17
Jitter (continued)

Data Communications               18
Real Jitter

Data Communications                 19
Delay Distortion and Attenuation

•Delay Distortion - occurs because the velocity of
propagation of a signal through a medium varies with the
frequency of the signal

•Can be reduced

•Attenuation - the continuous loss of a signal’s strength as
it travels through a medium

Data Communications                                             20
Error Prevention

•To prevent errors from happening, several
techniques may be applied:
•Proper shielding of cables to reduce interference
•Telephone line conditioning or equalization
•Replacing older media and equipment with new, possibly
digital components
•Proper use of digital repeaters and analog amplifiers
•Observe the stated capacities of the media

Data Communications                                              21
Error Prevention (continued)

Data Communications                         22
Error Detection

•Despite best prevention techniques, errors may still
occur
•To detect an error, error detection code has to be
•Let’s examine two basic techniques for detecting
errors:
•Parity checking
•Cyclic redundancy checksum
Data Communications                                       23
Parity Checks

•Simple parity - If performing even parity, add a parity bit
such that an even number of 1s is maintained

•If performing odd parity, add a parity bit such that an odd
number of 1s is maintained

•For example, send 1001010 using even parity

•For example, send 1001011 using even parity

Data Communications                                                   24
Parity Checks (continued)

•What happens if the character 10010101 is sent and
the first two 0s accidentally become two 1s?

•Thus, the following character is received: 11110101

•Will there be a parity error?

•Problem: Simple parity only detects odd numbers of bits in
error

Data Communications                                             25
Longitudinal Parity

•Longitudinal parity
•Adds parity bit to each character
•Then adds row of parity bits after a block of characters

•Row of parity bits is actually a parity bit for each
“column” of characters
•Row parity bits plus column parity bits add a great
amount of redundancy to a block of characters

Data Communications                                                26
Longitudinal Parity (continued)

Data Communications                            27
Longitudinal Parity (continued)

Data Communications                            28
Parity Checks (continued)

•Both simple parity and longitudinal parity do not
catch all errors
•Simple parity only catches odd numbers of bit
errors
•Longitudinal parity is better at catching errors
•But requires too many check bits added to a block of data

•We need a better error detection method
Data Communications                                                 29
Cyclic Redundancy Checksum (CRC)

•CRC error detection method treats packet of data to
be transmitted as a large polynomial

•Transmitter
•Using polynomial arithmetic, divides polynomial by a
given generating polynomial

•Remainder is “attached” to the end of message

Data Communications                                           30
Cyclic Redundancy Checksum
(continued)

•Message (with the remainder) is transmitted to the
•Receiver divides the message and remainder by
same generating polynomial
•If a remainder not equal to zero results  error
during transmission
•If a remainder of zero results  error during
transmission
Data Communications                                     31
Cyclic Redundancy Checksum
(continued)

Data Communications                       32
Error Control

• Once an error is detected, what is the receiver
going to do?
1. Do nothing
2. Return an error message to the transmitter
3. Fix the error with no further help from the
transmitter

Data Communications                                   33
Error Control (continued)

• Do nothing
• Seems like a strange way to control errors
•    Some newer systems such as frame relay perform this
type of error control

• Return a message has three basic formats:
1. Stop-and-wait ARQ
2. Go-back-N ARQ
3. Selective-reject ARQ

Data Communications                                               34
Stop-and-wait ARQ

•Simplest error control protocol
•A transmitter sends a frame then stops and waits for
an acknowledgment
•If a positive acknowledgment (ACK) is received,
the next frame is sent
•If a negative acknowledgment (NAK) is received,
the same frame is transmitted again

Data Communications                                       35
Stop-and-wait ARQ (continued)

Data Communications                          36
Go-back-N ARQ

•Go-back-N ARQ and selective reject are more
efficient protocols
•They assume that multiple frames are in transmission at
one time (sliding window)
•A sliding window protocol allows transmitter to
send up to the window size frames before receiving
any acknowledgments
•When a receiver does acknowledge receipt, the
returned pack contains the number of the frame
expected next
Data Communications                                               37
Sliding Window Protocol

Data Communications                    38
Go-back-N ARQ (continued)

•Using the go-back-N ARQ protocol, if a
transmitter to go back to the Nth frame and
retransmit it
•After the Nth frame is retransmitted, the
sender resends all subsequent frames

Data Communications                                  39
Selective-reject ARQ

•Most efficient error control protocol

transmitter to resend ONLY the frame that was in
error

•Subsequent frames following the Nth frame are not
retransmitted

Data Communications                                     40
Selective-reject ARQ (continued)

Data Communications                             41
Selective-reject ARQ (continued)

Data Communications                             42
Selective-reject ARQ (continued)

Data Communications                             43
Selective-reject ARQ (continued)

Data Communications                             44
Correct the Error

•For a receiver to correct the error with no further
help from the transmitter requires a large amount of
redundant information accompanying original data
•This redundant information allows the receiver to
determine the error and make corrections
•This type of error control is often called forward
error correction

Data Communications                                      45
Error Detection in Action

•Asynchronous transfer mode (ATM) incorporates
many types of error detection and error control
•ATM inserts a CRC into the data frame (the cell),
which checks only the header and not the data
•This CRC is also powerful enough to perform
simple error correction on the header
•A second layer of ATM applies a CRC to the data,
with varying degrees of error control

Data Communications                                    46
Summary

•Noise in computer networks
•Error-prevention techniques
•Simple parity and longitudinal parity calculations
•Cyclic redundancy checksum
•Three forms of error control
•Stop-and-wait ARQ, Go-back-N ARQ and
Selective-reject ARQ
Data Communications                                     47
Error                  Error
Correction             Detection
Coding                 Coding
= FEC                - used
Taxonomy of Coding
- no feedback          in ARQ
channel              as in TCP/IP
- quality paid       - feedback channel
by redundant         - retransmissions
bits                 - quality paid by delay

Cryptography          Source          Error Control        Line Coding
(Ciphering)           Coding          Coding

- Secrecy/ Security    - Makes bits    - Strives to    - for baseband
- Encryption (DES)     equal           utilize           communications
probable        channel         - RX synchronization
capacity by     - Spectral shaping
Compression
extra bits      - error detection
Coding
- Redundancy removal:
- Destructive (jpeg, mpeg)            FEC: Forward Error Correction
ARQ: Automatic Repeat Request
- Non-destructive (zip)               DES: Data Encryption Standard
Data Communications                                                                                   48
Block Interleaving
destroy large number of consecutive bits. This is harmful for
channel coding
• Interleaving distributes burst errors along data stream
• A problem of interleaving is
introduced extra delay
• Example below shows block
interleaving:

power
1000111
Block deinterleaving :
0101110                                     time
0011001                   Reception after

Data Communications                                                          49
Detect Error On Credit Card

Data Communications           50
Formula for detecting error

Let d2, d4, d6, d8, d10, d12, d14, d16 be all the even
values in the credit card number.
Let d1, d3, d5, d7, d9, d11, d13, d15 be all the odd
values in the credit card number.
Let n be the number of all the odd digits which have a
value that exceeds four
Credit card has an error if the following is true:
(d1 + d3 + d5 + d7 + d9 + d11 + d13 + d15) x 2 + n +
(d2 + d4 + d6 + d8 + d10 + d12 + d14 + d16)
0 mod(10)
Data Communications                                          51
Detect Error On Credit Card

n=3

d1

d2   d3   …   d15   d16

Data Communications                             52
Now the test
(4 + 4 + 8 + 1 + 3 + 5 + 7 + 9) = 41
(5 + 2 + 1 + 0 + 3 + 4 + 6 + 8) x 2 + 3 = 61
41 + 61 = 102 mod (10) = 2

3
Data Communications                            53
Credit Card Summary

The test performed on the credit card number is called a
parity check equation. The last digit is a function of the
other digits in the credit card. This is how credit card
numbers are generated by Visa and Mastercard. They
use the parity check equation to find the value of the
16th digit.

“This method allows computers to detect 100% of
single-position errors and about 98% of other common
errors” (For All Practical Purposes p. 354).
Data Communications                                          54
The purpose of error correcting codes

A message can become distorted through a
wide range of unpredictable errors.

•     Humans
•     Equipment failure
•     Lighting interference
•     Scratches in a magnetic tape
Data Communications                      55
Encoding

Naïve approach
Hamming codes

Data Communications   56
Why error-correcting code?

To add redundancy to a message so
the original message can be recovered
if it has been garbled.

e.g. message = 10
code = 1010101010

Data Communications                        57
Send a message

Message          Encoder   Channel   Decoder   Message

10             101010    noise    001010      10

Data Communications                                      58
Take Naïve approach

Append the same message multiple times.
Then take the value with the highest
average.

Message:= 1001
Encode:=     1001100110011001
Channel:= 1001100100011001
Decode: = a1 = Average(1,1,0,1) = 1
a2 = Average(0,0,0,0) = 0 ... (a1,a2,a3,a4)
Message:= 1001

Data Communications                                            59
Hamming [7,4] Code

The seven is the number of digits that make the code.
E.g. 0100101
The four is the number of information digits in the code.
E.g. 0100101

Data Communications                                         60
Diagram of Hamming Code
Using Odd Parity

Data Communications                      61
Hamming Code with Data
P1 protects D1, D2 and D3

Data Communications                               62
Practice Hamming #1

Data Communications                         63
Practice Hamming #1

Data Communications                         64
Practice Hamming #2

Data Communications                         65
Practice Hamming #2

Data Communications                         66
Remember !

• Hamming Code finds errors
• Hamming Code lets you fix errors without
retransmission
• Hamming code has lots of overhead so
only use when retransmission is difficult
(It’s only 0.57142857142857…… efficient)

Data Communications                       67
Hamming [7,4] Encoding

Encoded with a generator matrix. All codes can be formed
from row operations on matrix. The code generator matrix
for this presentation is the following:

Data Communications                                        68
Hamming [7,4] Codes

1000011
0100101
0010110
0001111               Codes
1100110
1010101
1001100
0110011               Possible codes
0101010
0011001
1101001
1001010
1111111
0111100
0011001
0000000

Data Communications                    69
Minimum Weight Theorem

Definitions
Proof of Theorem

Data Communications      70
Definitions

The weight of a code is the number of nonzero
components it contains.
e.g. wt(0010110) = 3

The minimum weight of Hamming codes is the weight of
the smallest nonzero vector in the code.

e.g.                        d(G)= 3

Data Communications                                    71
Definitions

The distance between two codes u and v is the number of
positions which differ
e.g.     u=(1,0,0,0,0,1,1)
v=(0,1,0,0,1,0,1)
dist(u,v) = 4

Another definition of distance is wt(u – v) = dist(u,v).

Data Communications                                        72
END 6
Data Communications   73

```
DOCUMENT INFO
Shared By:
Categories:
Tags:
Stats:
 views: 27 posted: 11/16/2011 language: English pages: 73
How are you planning on using Docstoc?