Beruflich Dokumente
Kultur Dokumente
PART III
11/04/33
Chapters
Chapter 10 Error Detection and Correction
Chapter 11 Data Link Control and Protocols
Chapter 12 Multiple Access
Chapter 13 Wired LANs: Ethernet
Chapter 15 Connecting LANs, Backbone networks
and virtual LANs
Dr. Gihan NAGUIB
Chapter 10
Error Detection
and
Correction
Dr. Gihan NAGUIB
11/04/33
Note::
Note
Network must be able to transfer data from
one device to another with acceptable
accuracy.
Data can be corrupted during transmission.
Types of Error
Single-Bit Error
Burst Error
11/04/33
Single-bit error
STX (Start of text)
LF (Line feed)
Burst error
A burst error means that 2 or more bits in the data unit have changed
Burst error does not necessarily mean that the errors occur in consecutive
bits
Most
Number of bits affected depends on the data rate and noise duration
If the data is sent at 1 kbps, a noise of 1/100 s can affect 10 bits.
If the data is sent at 1 Mbps, a noise of 1/100 s can affect 10000
Dr. Gihan NAGUIB
bits.
8
11/04/33
ERROR DETECTION
Error detection uses the concept of redundancy, which
means adding extra bits for detecting errors at the
destination.
ERROR DETECTION
Error can be detected by using block coding:
Dived the message into blocks, each of k bits, called datawords.
Add r redundant bits to each block to make the length
n = k + r.
The resulting n bits blocks are called codewords
10
11/04/33
11
1. Parity Check
The most common and least expensive
Simple or Two Dimensional
12
11/04/33
1. Parity Check
1.1 simple parity check
13
Example 1
Suppose the sender wants to send the word world. In ASCII
the five characters are coded as
1110111 1101111 1110010 1101100 1100100
14
11/04/33
Example 2
Now suppose the word world in Example 1 is received by
the receiver without being corrupted in transmission.
11101110 11011110 11100100 11011000
11001001
The receiver counts the 1s in each character and comes up
with even numbers:
(6, 6, 4, 4, 4). The data are accepted.
15
Example 3
Now suppose the word world in Example 1 is corrupted
during transmission.
16
11/04/33
1110111011: 8 ones
1100011011: 6 ones
The number of 1s in the data unit is still even
17
Note::
Note
18
11/04/33
19
Note::
Note
10
20
11/04/33
Example 4
Suppose the following block is sent:
10101001 00111001 11011101 11100111 10101010
However, it is hit by a burst noise of length 8, and some
bits are corrupted.
21
Example 4
At Sender:
1
0
1
1
0
0
1
1
1
1
0
1
0
1
1
0
1
1
1
0
0
0
1
1
At receiver:
0
0
0
1
1
1
1
1
1 0 1010 1 0
1
1
1
1
0
0
1
1
1
0
0
1
0
0
1
0
0
1
1
0
0
0
1
1
1
0
0
1
1
1
1
1
1010101 0
1 0 1110 1 0
11
22
11/04/33
Two-dimensional Performance
Increases the likelihood of detecting burst errors.
A redundancy of n-bits can detect a burst error of n bits
A burst error of more than n bits is also detected with a
very high probability
One pattern of errors still elusive:
If 2 bits in one data unit are damaged and two bits in
exactly the same position in anther data unite are also
damaged. The error will not be detected.
23
Two-dimensional Performance
12
24
11/04/33
25
13
26
11/04/33
27
14
28
11/04/33
29
30
Example
15
11/04/33
31
A polynomial
The divisor in CRC generator is most often represented
not as string of 1s and 0s, but as an algebraic polynomial.
The polynomial is used for two reasons: it is Short and
Can be used to prove the concept mathematically
A polynomial should be selected to have the following :
1. It should not be divisible by x.( i.e the coefficient of
term X0 should be 1)
16
32
11/04/33
Note that:
the degree of a polynomial is 1 less that the number of bits in the pattern.
The bit pattern in this case has 7 bit
Dr. Gihan NAGUIB
33
17
34
11/04/33
Example 5
We cannot choose:
X (binary 10) or
X2 + X (binary 110) because both are divisible by x.
We can choose
X + 1 (binary 11) because it is not divisible by x, but is divisible
by x + 1.
X2 + 1 (binary 101) because it is divisible by x + 1 (binary
division).
35
Standard polynomials
Name
Polynomial
Application
CRC--8
CRC
x8 + x2 + x + 1
ATM header
CRC--10
CRC
x10 + x9 + x5 + x4 + x 2 + 1
ATM AAL
ITU--16
ITU
x16 + x12 + x5 + 1
HDLC
ITU--32
ITU
LANs
18
36
11/04/33
CRC Performance
CRC is very effective error detection method:
1. CRC Can detect all burst errors that affect an odd
number of bits.
2.
37
Example 6
The CRC-12
x12 + x11 + x3 + x + 1
which has a degree of 12, will detect
1. all burst errors affecting an odd number of bits,
2. will detect all burst errors with a length less
than or equal to 12, and
3. will detect, 99.97 percent of the time, burst
errors with a length of 12 or more.
Dr. Gihan NAGUIB
19
38
11/04/33
3. Checksum
Like parity checks and CRC, the checksum based on redundancy
39
1.
2.
3.
4.
20
40
11/04/33
Example 7
Suppose the following block of 16 bits is to be sent using a checksum
of 8 bits.
10101001 00111001
The numbers are added using ones complement
10101001
00111001
-----------11100010
Sum
Checksum
00011101
41
Example 8
Now suppose the receiver receives the pattern sent in Example 7 and
there is no error.
10101001 00111001 00011101
When the receiver adds the three sections, it will get all 1s, which,
after complementing, is all 0s and shows that there is no error.
10101001
00111001
00011101
Sum
Complement
Dr. Gihan NAGUIB
21
1111111 1
00000000 means that the pattern is OK.
Behrouz A. Forouzan Data communication and Networking
42
11/04/33
Example 9
Now suppose there is a burst error of length 5 that affects 4 bits.
10101111 11111001 00011101
When the receiver adds the three sections, it gets
10101111
11111001
00011101
Partial Sum
1 11000101
Carry
Sum
11000110
Complement
00111001
43
Performance of checksum
Almost detects all errors involving odd
numbers of bits or even.
if one or more bits of a segment are damaged and
the corresponding bit or bits of opposite value in a
second segment are also damaged,
then the sum of columns will not change. Receiver
22
44
11/04/33
Error Correction
1. Retransmission:
when error is discovered, the receiver can have the
sender retransmit the data unit
45
23
46
11/04/33
47
2r >= m + r + 1
2r = number of states
m + r indicates the location of an error in
each m + r positions
1 indicates no error
The value of r can be determined by plugging in
the value of m
Eg. m=7 , the smallest r that can satisfy this is 4
24
48
11/04/33
Number of
redundancy bits
r
Total
bits
m+r
10
11
49
Hamming code
Positions of redundancy bits:
The key to the Hamming Code is the use of extra parity bits to
allow the identification of a single error
25
50
11/04/33
(data) Decimal no
Binary
0011
0101
0110
0111
1001
10
1010
11
1011
51
Position 1( r1): check 1 bit, skip 1 bit, check 1 bit, skip 1 bit, etc.
(1, 3, 5, 7, 9, 11, 13, 15,...)
Position 2 (r2): check 2 bits, skip 2 bits, check 2 bits, skip 2 bits, etc.
(2, 3, 6, 7, 10, 11, 14, 15,...)
Position 4 (r4): check 4 bits, skip 4 bits, etc
26
52
11/04/33
53
27
54
11/04/33
55
28
56
11/04/33
29
57