Module 3 - DLC-Part1 - Till Checksum
Module 3 - DLC-Part1 - Till Checksum
10.1 Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Note
&
10.2
Data Link Layer
Data Link Control
Node – Node communication
Framing
Flow Control
Error Control
Software Implemented Protocols
Smooth and Reliable Transmission of Frames bet Nodes
Medium Access Control
Resolving access to shared media
Nodes connected to use common link (multipoint/broadcast)
Coordinated access to the link
3 categories of Protocols (Random Access, Controlled
Access, Channelization protocols)
2.3
Error Detection
and
Correction
10.4
Note
10.5
10-1 INTRODUCTION
10.6
10.7
When bits flow from one point to another,
Subject to interference (unpredictable changes)
- Can change the shape of signal
Note
10.8
Figure 10.1 Single-bit error
10.9
Note
10.10
Figure 10.2 Burst error of length 8
10.11
Note
10.12
Detection & Correction
Error Detection
YES/NO Answer
Single Bit/ Burst??
Error Correction
How many bits corrupted?
Position of corrupted bits?
No of Errors & Size of Message
8 bit data Unit
correct 1 bit error?
Correct 2 bit errors ? – 28 possibilities
1000 bits – 10 errors?
2.13
Forward Error Correction vs
Retransmission
FEC
Receiver guess message by using redundant bits
Works when no of errors is small
Retransmission
Receiver detects error occurrence
Asks sender to retransmit message
Resending repeated until receiver is OK!
2.14
Note
10.15
Figure 10.3 The structure of encoder and decoder
10.16
Note
10.17
Figure 10.4 XORing of two single bits or two words
10.18
10-2 BLOCK CODING
10.19
Figure 10.5 Datawords and codewords in block coding
10.20
Example 10.1
k = 4 and n = 5.
10.21
Figure 10.6 Process of error detection in block coding
10.22
Note
10.23
Table 10.1 A code for error detection
10.24
Example 10.2
10.25
Example 10.2 (continued)
10.26
Figure 10.7 Structure of encoder and decoder in error correction
10.27
Table 10.2 A code for error correction (Example 10.3)
10.28
Example 10.3
Let us add more redundant bits to see if the receiver can
correct an error without knowing what was actually sent.
We add 3 redundant bits to the 2-bit dataword to make
5-bit codewords. Table shows the datawords and
codewords.
01001
10.30
Example 10.3 (continued)
1. Comparing the received codeword with the first
codeword in the table (01001 versus 00000), the
receiver decides that the first codeword is not the one
that was sent because there are two different bits.
Note
10.32
Example 10.4
10.33
Note
10.34
Table 10.1 A code for error detection
10.35
Example 10.5
10.36
Table 10.2 A code for error correction (Example 10.3)
10.37
Example 10.6
Solution
We first find all the Hamming distances.
10.38
Note
10.39
Example 10.7
10.40
Table 10.2 A code for error correction (Example 10.3)
10.41
Example 10.8
10.42
10-3 LINEAR BLOCK CODES
10.43
Note
10.44
Table 10.1 A code for error detection
10.45
Example 10.10
10.47
Example 10.11
10.48
10-4 CYCLIC CODES
10.49
Table 10.6 A CRC code with C(7, 4)
10.50
Dataword – k bits
Codeword – n bits
10.52
Table 10.6 A CRC code with C(7, 4)
10.53
Dataword – 1001
Agreed upon Divisor = 1011
10.54
Figure 10.15 Division in CRC encoder
10.55
Received Codeword – 1000
Agreed upon Divisor = 1101
10.56
Figure 10.16 Division in the CRC decoder for two cases
10.57
Figure 10.21 A polynomial to represent a binary word
10.58
Dataword – 1001
Agreed upon Divisor = 1011
Shifting the polynomial to left
- multiplying each term by xm
10.59
Figure 10.22 CRC division using polynomials
10.60
Note
10.61
Dataword – d(x)
Codeword – c(x)
Generator – g(x)
Syndrome – s(x)
Error – e(x)
10.62
10.63
Note
In a cyclic code,
If s(x) ≠ 0, one or more bits is corrupted.
If s(x) = 0, either
a. No bit is corrupted. or
b. Some bits are corrupted, but the
decoder failed to detect them.
10.64
Note
g(x) to detect?
10.66
How to catch Single-bit Error?
g(x) to detect?
e(x) = xi (i = position)
10.67
Note
10.68
Example 10.15
Which of the following g(x) values guarantees
that a single-bit error is caught? For each case,
what is the error that cannot be caught?
a. x + 1 b. x3 c. 1
Example 10.15
Which of the following g(x) values guarantees
that a single-bit error is caught? For each case,
what is the error that cannot be caught?
a. x + 1 b. x3 c. 1
Figure 10.23 Representation of two isolated single-bit errors using polynomials
10.71
Figure 10.23 Representation of two isolated single-bit errors using polynomials
10.72
Note
10.73
Example 10.16
b. x4 + 1
c. x7 + x6 + 1
d. x15 + x14 + 1
10.74
Example 10.16
10.76
Burst Error
How to represent?
10.77
10.78
10.79
Burst Error
10.80
3 cases
If j-i < r
If j-i = r
If j-i > r
Ex : x14+x3+1 , r=14
A burst error of length 15 can slip undetected
with probability of (1/2)14-1 or 1 in 10,000
10.83
Burst Error of Length r+1
Error Polynomial will be of degree r
G(x) will completely divide e(x) only if e(x)
match G(x) term by term
10.84
Burst Error of Length > r+1
10.85
Note
10.86
Example 10.17
b. x18 + x7 + x + 1
c.x32 + x23 + x7 + 1
10.87
Example 10.17
Solution
a. This generator can detect all burst errors with a length
less than or equal to 6 bits; 3 out of 100 burst errors
with length 7 will slip by; 16 out of 1000 burst errors of
length 8 or more will slip by.
10.88
Example 10.17 (continued)
10.89
Note
10.90
Table 10.7 Standard polynomials
10.91
10-5 CHECKSUM
10.92
Example 10.18
10.94
Example 10.22
10.96
Example 10.22 (continued)
10.98
McGraw-Hill ©The McGraw-Hill Companies, Inc., 2000
Note
Sender site:
1. The message is divided into 16-bit words.
2. The value of the checksum word is set to 0.
3. All words including the checksum are
added using one’s complement addition.
4. The sum is complemented and becomes the
checksum.
5. The checksum is sent with the data.
10.99
Note
Receiver site:
1. The message (including checksum) is
divided into 16-bit words.
2. All words are added using one’s
complement addition.
3. The sum is complemented and becomes the
new checksum.
4. If the value of checksum is 0, the message
is accepted; otherwise, it is rejected.
10.100
Example 10.23
FFFF
10.103
10.104
Figure 10.8 Geometric concept for finding dmin in error detection
sent
10.105
Figure 10.9 Geometric concept for finding dmin in error correction
Each valid code word has its own territory. Rx need to decide
Valid code word
If receiver code word belongs to territory, original code word is one at center.
Overlapping circles?
10.106
Note
10.107
Example 10.9
Solution
This code guarantees the detection of up to three errors
(s = 3), but it can correct up to one error. In other words,
if this code is used for error correction, part of its capability
is wasted.
10.109
Table 10.3 Simple parity-check code C(5, 4)
10.110
Figure 10.10 Encoder and decoder for simple parity-check code
1 bit Syndrome
10.111
Example 10.12
10.113
Note
10.114
Note
10.116
Figure 10.12 The structure of the encoder and decoder for a Hamming code
10.117
3 bit syndrome – eight patterns
Lack of error/ error in 1 of 7 bits
q0 is in error – s0 is affected
b2 in error – s0 & s1 affected
10.118
Example 10.13
10.120
Figure 10.11 Two-dimensional parity-check code
Worst cases
10.122
Figure 10.11 Two-dimensional parity-check code
Guarantee?
10.123
Split Burst error between several codewords, 1 error for each
Figure 10.13 Burst error correction using Hamming code
Only 1 bit in each code
Is corrupted
10.124