CHAPTER 3: DATA LINK CONTROL Flow control, Error detection – two dimensional parity checks,...
-
Upload
collin-stevens -
Category
Documents
-
view
279 -
download
0
Transcript of CHAPTER 3: DATA LINK CONTROL Flow control, Error detection – two dimensional parity checks,...
![Page 1: CHAPTER 3: DATA LINK CONTROL Flow control, Error detection – two dimensional parity checks, Internet checksum, CRC, Error control, Transmission efficiency.](https://reader036.fdocuments.net/reader036/viewer/2022082215/5697bfdc1a28abf838cb0fe2/html5/thumbnails/1.jpg)
CHAPTER 3: DATA LINK CHAPTER 3: DATA LINK CONTROL CONTROL
Flow control, Error detection – Flow control, Error detection – two dimensional parity checks, two dimensional parity checks, Internet checksum, CRC, Error Internet checksum, CRC, Error control, Transmission efficiency control, Transmission efficiency of ARQ controls, HDLC, Point to of ARQ controls, HDLC, Point to Point controls Point controls
![Page 2: CHAPTER 3: DATA LINK CONTROL Flow control, Error detection – two dimensional parity checks, Internet checksum, CRC, Error control, Transmission efficiency.](https://reader036.fdocuments.net/reader036/viewer/2022082215/5697bfdc1a28abf838cb0fe2/html5/thumbnails/2.jpg)
Data link controlData link control
Error correction & detectionError correction & detection FramingFraming Flow & Error control (Protocols)Flow & Error control (Protocols)
![Page 3: CHAPTER 3: DATA LINK CONTROL Flow control, Error detection – two dimensional parity checks, Internet checksum, CRC, Error control, Transmission efficiency.](https://reader036.fdocuments.net/reader036/viewer/2022082215/5697bfdc1a28abf838cb0fe2/html5/thumbnails/3.jpg)
ERROR CORRECTION & DETECTIONERROR CORRECTION & DETECTION
Some issues related, directly or indirectly, to error Some issues related, directly or indirectly, to error detection and correction.detection and correction.
Types of ErrorsRedundancyDetection Versus CorrectionForward Error Correction Versus RetransmissionCodingModular Arithmetic
![Page 4: CHAPTER 3: DATA LINK CONTROL Flow control, Error detection – two dimensional parity checks, Internet checksum, CRC, Error control, Transmission efficiency.](https://reader036.fdocuments.net/reader036/viewer/2022082215/5697bfdc1a28abf838cb0fe2/html5/thumbnails/4.jpg)
In a single-bit error, only 1 bit in the data unit has changed.
Type of Errors Single bit error
![Page 5: CHAPTER 3: DATA LINK CONTROL Flow control, Error detection – two dimensional parity checks, Internet checksum, CRC, Error control, Transmission efficiency.](https://reader036.fdocuments.net/reader036/viewer/2022082215/5697bfdc1a28abf838cb0fe2/html5/thumbnails/5.jpg)
Single bit error Least likely type of error. Example: If
data rate is 1Mbps than each bit interval is 1/1000000 s. Noise of this duration is very rare.
![Page 6: CHAPTER 3: DATA LINK CONTROL Flow control, Error detection – two dimensional parity checks, Internet checksum, CRC, Error control, Transmission efficiency.](https://reader036.fdocuments.net/reader036/viewer/2022082215/5697bfdc1a28abf838cb0fe2/html5/thumbnails/6.jpg)
A burst error means that 2 or more bits in the data unit have changed.
Burst error
![Page 7: CHAPTER 3: DATA LINK CONTROL Flow control, Error detection – two dimensional parity checks, Internet checksum, CRC, Error control, Transmission efficiency.](https://reader036.fdocuments.net/reader036/viewer/2022082215/5697bfdc1a28abf838cb0fe2/html5/thumbnails/7.jpg)
Burst error of length 8
![Page 8: CHAPTER 3: DATA LINK CONTROL Flow control, Error detection – two dimensional parity checks, Internet checksum, CRC, Error control, Transmission efficiency.](https://reader036.fdocuments.net/reader036/viewer/2022082215/5697bfdc1a28abf838cb0fe2/html5/thumbnails/8.jpg)
To detect or correct errors, we need to send extra (redundant) bits with data.
Redundancy
![Page 9: CHAPTER 3: DATA LINK CONTROL Flow control, Error detection – two dimensional parity checks, Internet checksum, CRC, Error control, Transmission efficiency.](https://reader036.fdocuments.net/reader036/viewer/2022082215/5697bfdc1a28abf838cb0fe2/html5/thumbnails/9.jpg)
Methods of Error correction
Forward error correction Retransmission
![Page 10: CHAPTER 3: DATA LINK CONTROL Flow control, Error detection – two dimensional parity checks, Internet checksum, CRC, Error control, Transmission efficiency.](https://reader036.fdocuments.net/reader036/viewer/2022082215/5697bfdc1a28abf838cb0fe2/html5/thumbnails/10.jpg)
Coding
Detect & correct the errors The sender adds redundant bits
through a process that creates a relationships between two sets of bits to detect and correct errors.
![Page 11: CHAPTER 3: DATA LINK CONTROL Flow control, Error detection – two dimensional parity checks, Internet checksum, CRC, Error control, Transmission efficiency.](https://reader036.fdocuments.net/reader036/viewer/2022082215/5697bfdc1a28abf838cb0fe2/html5/thumbnails/11.jpg)
The structure of encoder and decoder
![Page 12: CHAPTER 3: DATA LINK CONTROL Flow control, Error detection – two dimensional parity checks, Internet checksum, CRC, Error control, Transmission efficiency.](https://reader036.fdocuments.net/reader036/viewer/2022082215/5697bfdc1a28abf838cb0fe2/html5/thumbnails/12.jpg)
Modulo Arithmetic
![Page 13: CHAPTER 3: DATA LINK CONTROL Flow control, Error detection – two dimensional parity checks, Internet checksum, CRC, Error control, Transmission efficiency.](https://reader036.fdocuments.net/reader036/viewer/2022082215/5697bfdc1a28abf838cb0fe2/html5/thumbnails/13.jpg)
BLOCK CODINGBLOCK CODING
In block coding, we divide our message into In block coding, we divide our message into blocks, each of k bits, called blocks, each of k bits, called datawordsdatawords. We add . We add r redundant bits to each block to make the r redundant bits to each block to make the length n = k + r. The resulting n-bit blocks are length n = k + r. The resulting n-bit blocks are called called codewordscodewords..
![Page 14: CHAPTER 3: DATA LINK CONTROL Flow control, Error detection – two dimensional parity checks, Internet checksum, CRC, Error control, Transmission efficiency.](https://reader036.fdocuments.net/reader036/viewer/2022082215/5697bfdc1a28abf838cb0fe2/html5/thumbnails/14.jpg)
Datawords and codewords in block coding
![Page 15: CHAPTER 3: DATA LINK CONTROL Flow control, Error detection – two dimensional parity checks, Internet checksum, CRC, Error control, Transmission efficiency.](https://reader036.fdocuments.net/reader036/viewer/2022082215/5697bfdc1a28abf838cb0fe2/html5/thumbnails/15.jpg)
Process of error detection in block coding
![Page 16: CHAPTER 3: DATA LINK CONTROL Flow control, Error detection – two dimensional parity checks, Internet checksum, CRC, Error control, Transmission efficiency.](https://reader036.fdocuments.net/reader036/viewer/2022082215/5697bfdc1a28abf838cb0fe2/html5/thumbnails/16.jpg)
An error-detecting code can detect only the types of errors for which it is designed; other types of errors may
remain undetected.
Note
![Page 17: CHAPTER 3: DATA LINK CONTROL Flow control, Error detection – two dimensional parity checks, Internet checksum, CRC, Error control, Transmission efficiency.](https://reader036.fdocuments.net/reader036/viewer/2022082215/5697bfdc1a28abf838cb0fe2/html5/thumbnails/17.jpg)
Let us assume that k = 2 and n = 3. Table shows the list of datawords and codewords. Assume the sender encodes the dataword 01 as 011 and sends it to the receiver. Consider the following cases:
1. The receiver receives 011. It is a valid codeword. The receiver extracts the dataword 01 from it.
Example 1
![Page 18: CHAPTER 3: DATA LINK CONTROL Flow control, Error detection – two dimensional parity checks, Internet checksum, CRC, Error control, Transmission efficiency.](https://reader036.fdocuments.net/reader036/viewer/2022082215/5697bfdc1a28abf838cb0fe2/html5/thumbnails/18.jpg)
2. The codeword is corrupted during transmission, and 111 is received. This is not a valid codeword and is discarded.
3. The codeword is corrupted during transmission, and 000 is received. This is a valid codeword. The receiver incorrectly extracts the dataword 00. Two corrupted bits have made the error undetectable.
Example 1 (continued)
![Page 19: CHAPTER 3: DATA LINK CONTROL Flow control, Error detection – two dimensional parity checks, Internet checksum, CRC, Error control, Transmission efficiency.](https://reader036.fdocuments.net/reader036/viewer/2022082215/5697bfdc1a28abf838cb0fe2/html5/thumbnails/19.jpg)
Assume the dataword is 01. The sender creates the codeword 01011. The codeword is corrupted during transmission, and 01001 is received. First, the receiver finds that the received codeword is not in the table. This means an error has occurred. The receiver, assuming that there is only 1 bit corrupted, uses the following strategy to guess the correct dataword.
Example 2
![Page 20: CHAPTER 3: DATA LINK CONTROL Flow control, Error detection – two dimensional parity checks, Internet checksum, CRC, Error control, Transmission efficiency.](https://reader036.fdocuments.net/reader036/viewer/2022082215/5697bfdc1a28abf838cb0fe2/html5/thumbnails/20.jpg)
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.
2. By the same reasoning, the original codeword cannot be the third or fourth one in the table.
3. The original codeword must be the second one in the table because this is the only one that differs from the received codeword by 1 bit. The receiver replaces 01001 with 01011 and consults the table to find the dataword 01.
Example 2 continued
![Page 21: CHAPTER 3: DATA LINK CONTROL Flow control, Error detection – two dimensional parity checks, Internet checksum, CRC, Error control, Transmission efficiency.](https://reader036.fdocuments.net/reader036/viewer/2022082215/5697bfdc1a28abf838cb0fe2/html5/thumbnails/21.jpg)
The Hamming distance between two words is the number of differences
between corresponding bits.
Note
![Page 22: CHAPTER 3: DATA LINK CONTROL Flow control, Error detection – two dimensional parity checks, Internet checksum, CRC, Error control, Transmission efficiency.](https://reader036.fdocuments.net/reader036/viewer/2022082215/5697bfdc1a28abf838cb0fe2/html5/thumbnails/22.jpg)
Let us find the Hamming distance between two pairs of words.
1. The Hamming distance d(000, 011) is 2 because
Example 3
2. The Hamming distance d(10101, 11110) is 3 because
![Page 23: CHAPTER 3: DATA LINK CONTROL Flow control, Error detection – two dimensional parity checks, Internet checksum, CRC, Error control, Transmission efficiency.](https://reader036.fdocuments.net/reader036/viewer/2022082215/5697bfdc1a28abf838cb0fe2/html5/thumbnails/23.jpg)
The minimum Hamming distance is the smallest Hamming distance between all possible pairs in a set of words.
Note
![Page 24: CHAPTER 3: DATA LINK CONTROL Flow control, Error detection – two dimensional parity checks, Internet checksum, CRC, Error control, Transmission efficiency.](https://reader036.fdocuments.net/reader036/viewer/2022082215/5697bfdc1a28abf838cb0fe2/html5/thumbnails/24.jpg)
Find the minimum Hamming distance of the coding scheme in Table 1.
Example 3
The dmin in this case is 2.
![Page 25: CHAPTER 3: DATA LINK CONTROL Flow control, Error detection – two dimensional parity checks, Internet checksum, CRC, Error control, Transmission efficiency.](https://reader036.fdocuments.net/reader036/viewer/2022082215/5697bfdc1a28abf838cb0fe2/html5/thumbnails/25.jpg)
Find the minimum Hamming distance of the coding scheme in Table 2.
SolutionWe first find all the Hamming distances.
The dmin in this case is 3.
Example 4
![Page 26: CHAPTER 3: DATA LINK CONTROL Flow control, Error detection – two dimensional parity checks, Internet checksum, CRC, Error control, Transmission efficiency.](https://reader036.fdocuments.net/reader036/viewer/2022082215/5697bfdc1a28abf838cb0fe2/html5/thumbnails/26.jpg)
To guarantee the detection of up to s errors in all cases, the minimum
Hamming distance in a block code must be dmin = s + 1.
Note
![Page 27: CHAPTER 3: DATA LINK CONTROL Flow control, Error detection – two dimensional parity checks, Internet checksum, CRC, Error control, Transmission efficiency.](https://reader036.fdocuments.net/reader036/viewer/2022082215/5697bfdc1a28abf838cb0fe2/html5/thumbnails/27.jpg)
The minimum Hamming distance for our first code scheme (Table 1) is 2. This code guarantees detection of only a single error. For example, if the third codeword (101) is sent and one error occurs, the received codeword does not match any valid codeword. If two errors occur, however, the received codeword may match a valid codeword and the errors are not detected.
Example 5
![Page 28: CHAPTER 3: DATA LINK CONTROL Flow control, Error detection – two dimensional parity checks, Internet checksum, CRC, Error control, Transmission efficiency.](https://reader036.fdocuments.net/reader036/viewer/2022082215/5697bfdc1a28abf838cb0fe2/html5/thumbnails/28.jpg)
Our second block code scheme (Table 2) has dmin = 3. This code can detect up to two errors. Again, we see that when any of the valid codewords is sent, two errors create a codeword which is not in the table of valid codewords. The receiver cannot be fooled.
Example 6
![Page 29: CHAPTER 3: DATA LINK CONTROL Flow control, Error detection – two dimensional parity checks, Internet checksum, CRC, Error control, Transmission efficiency.](https://reader036.fdocuments.net/reader036/viewer/2022082215/5697bfdc1a28abf838cb0fe2/html5/thumbnails/29.jpg)
Figure Geometric concept for finding dmin in error detection
![Page 30: CHAPTER 3: DATA LINK CONTROL Flow control, Error detection – two dimensional parity checks, Internet checksum, CRC, Error control, Transmission efficiency.](https://reader036.fdocuments.net/reader036/viewer/2022082215/5697bfdc1a28abf838cb0fe2/html5/thumbnails/30.jpg)
Geometric concept for finding dmin in error correction
![Page 31: CHAPTER 3: DATA LINK CONTROL Flow control, Error detection – two dimensional parity checks, Internet checksum, CRC, Error control, Transmission efficiency.](https://reader036.fdocuments.net/reader036/viewer/2022082215/5697bfdc1a28abf838cb0fe2/html5/thumbnails/31.jpg)
To guarantee correction of up to t errors in all cases, the minimum Hamming
distance in a block code must be dmin = 2t + 1.
Note
![Page 32: CHAPTER 3: DATA LINK CONTROL Flow control, Error detection – two dimensional parity checks, Internet checksum, CRC, Error control, Transmission efficiency.](https://reader036.fdocuments.net/reader036/viewer/2022082215/5697bfdc1a28abf838cb0fe2/html5/thumbnails/32.jpg)
A code scheme has a Hamming distance dmin = 4. What is the error detection and correction capability of this scheme?
SolutionThis 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. Error correction codes need to have an odd minimum distance (3, 5, 7, . . . ).
Example 8
![Page 33: CHAPTER 3: DATA LINK CONTROL Flow control, Error detection – two dimensional parity checks, Internet checksum, CRC, Error control, Transmission efficiency.](https://reader036.fdocuments.net/reader036/viewer/2022082215/5697bfdc1a28abf838cb0fe2/html5/thumbnails/33.jpg)
LINEAR BLOCK CODESLINEAR BLOCK CODES
Almost all block codes used today belong to a subset Almost all block codes used today belong to a subset called called linear block codeslinear block codes. A linear block code is a code . A linear block code is a code in which the exclusive OR (addition modulo-2) of two in which the exclusive OR (addition modulo-2) of two valid codewords creates another valid codeword.valid codewords creates another valid codeword.
![Page 34: CHAPTER 3: DATA LINK CONTROL Flow control, Error detection – two dimensional parity checks, Internet checksum, CRC, Error control, Transmission efficiency.](https://reader036.fdocuments.net/reader036/viewer/2022082215/5697bfdc1a28abf838cb0fe2/html5/thumbnails/34.jpg)
A simple parity-check code is a single-bit error-detecting
code in which n = k + 1.
Note
![Page 35: CHAPTER 3: DATA LINK CONTROL Flow control, Error detection – two dimensional parity checks, Internet checksum, CRC, Error control, Transmission efficiency.](https://reader036.fdocuments.net/reader036/viewer/2022082215/5697bfdc1a28abf838cb0fe2/html5/thumbnails/35.jpg)
Table 3 Simple parity-check code C(5, 4)
![Page 36: CHAPTER 3: DATA LINK CONTROL Flow control, Error detection – two dimensional parity checks, Internet checksum, CRC, Error control, Transmission efficiency.](https://reader036.fdocuments.net/reader036/viewer/2022082215/5697bfdc1a28abf838cb0fe2/html5/thumbnails/36.jpg)
Encoder and decoder for simple parity-check code
![Page 37: CHAPTER 3: DATA LINK CONTROL Flow control, Error detection – two dimensional parity checks, Internet checksum, CRC, Error control, Transmission efficiency.](https://reader036.fdocuments.net/reader036/viewer/2022082215/5697bfdc1a28abf838cb0fe2/html5/thumbnails/37.jpg)
Assume the sender sends the dataword 1011. The codeword created from this dataword is 10111, which is sent to the receiver. We examine five cases:
1. No error occurs; the received codeword is 10111. The syndrome is 0. The dataword 1011 is created.2. One single-bit error changes a1 . The received codeword is 10011. The syndrome is 1. No dataword is created.3. One single-bit error changes r0 . The received codeword is 10110. The syndrome is 1. No dataword is created.
Example 9
![Page 38: CHAPTER 3: DATA LINK CONTROL Flow control, Error detection – two dimensional parity checks, Internet checksum, CRC, Error control, Transmission efficiency.](https://reader036.fdocuments.net/reader036/viewer/2022082215/5697bfdc1a28abf838cb0fe2/html5/thumbnails/38.jpg)
4. An error changes r0 and a second error changes a3 . The received codeword is 00110. The syndrome is 0. The dataword 0011 is created at the receiver. Note that here the dataword is wrongly created due to the syndrome value. 5. Three bits—a3, a2, and a1—are changed by errors. The received codeword is 01011. The syndrome is 1. The dataword is not created. This shows that the simple parity check, guaranteed to detect one single error, can also find any odd number of errors.
Example 9 (continued)
![Page 39: CHAPTER 3: DATA LINK CONTROL Flow control, Error detection – two dimensional parity checks, Internet checksum, CRC, Error control, Transmission efficiency.](https://reader036.fdocuments.net/reader036/viewer/2022082215/5697bfdc1a28abf838cb0fe2/html5/thumbnails/39.jpg)
A simple parity-check code can detect an odd number of errors.
Note
![Page 40: CHAPTER 3: DATA LINK CONTROL Flow control, Error detection – two dimensional parity checks, Internet checksum, CRC, Error control, Transmission efficiency.](https://reader036.fdocuments.net/reader036/viewer/2022082215/5697bfdc1a28abf838cb0fe2/html5/thumbnails/40.jpg)
Two-dimensional parity-check code
![Page 41: CHAPTER 3: DATA LINK CONTROL Flow control, Error detection – two dimensional parity checks, Internet checksum, CRC, Error control, Transmission efficiency.](https://reader036.fdocuments.net/reader036/viewer/2022082215/5697bfdc1a28abf838cb0fe2/html5/thumbnails/41.jpg)
Two-dimensional parity-check code
![Page 42: CHAPTER 3: DATA LINK CONTROL Flow control, Error detection – two dimensional parity checks, Internet checksum, CRC, Error control, Transmission efficiency.](https://reader036.fdocuments.net/reader036/viewer/2022082215/5697bfdc1a28abf838cb0fe2/html5/thumbnails/42.jpg)
Two-dimensional parity-check code
![Page 43: CHAPTER 3: DATA LINK CONTROL Flow control, Error detection – two dimensional parity checks, Internet checksum, CRC, Error control, Transmission efficiency.](https://reader036.fdocuments.net/reader036/viewer/2022082215/5697bfdc1a28abf838cb0fe2/html5/thumbnails/43.jpg)
CYCLIC CODESCYCLIC CODES
Cyclic codesCyclic codes are special linear block codes with one are special linear block codes with one extra property. In a cyclic code, if a codeword is extra property. In a cyclic code, if a codeword is cyclically shifted (rotated), the result is another cyclically shifted (rotated), the result is another codeword.codeword.
![Page 44: CHAPTER 3: DATA LINK CONTROL Flow control, Error detection – two dimensional parity checks, Internet checksum, CRC, Error control, Transmission efficiency.](https://reader036.fdocuments.net/reader036/viewer/2022082215/5697bfdc1a28abf838cb0fe2/html5/thumbnails/44.jpg)
General design of encoder and decoder of a CRC code
![Page 45: CHAPTER 3: DATA LINK CONTROL Flow control, Error detection – two dimensional parity checks, Internet checksum, CRC, Error control, Transmission efficiency.](https://reader036.fdocuments.net/reader036/viewer/2022082215/5697bfdc1a28abf838cb0fe2/html5/thumbnails/45.jpg)
A polynomial to represent a binary word
![Page 46: CHAPTER 3: DATA LINK CONTROL Flow control, Error detection – two dimensional parity checks, Internet checksum, CRC, Error control, Transmission efficiency.](https://reader036.fdocuments.net/reader036/viewer/2022082215/5697bfdc1a28abf838cb0fe2/html5/thumbnails/46.jpg)
CRC division using polynomials
![Page 47: CHAPTER 3: DATA LINK CONTROL Flow control, Error detection – two dimensional parity checks, Internet checksum, CRC, Error control, Transmission efficiency.](https://reader036.fdocuments.net/reader036/viewer/2022082215/5697bfdc1a28abf838cb0fe2/html5/thumbnails/47.jpg)
The divisor in a cyclic code is normally called the generator polynomial
or simply the generator.
Note
![Page 48: CHAPTER 3: DATA LINK CONTROL Flow control, Error detection – two dimensional parity checks, Internet checksum, CRC, Error control, Transmission efficiency.](https://reader036.fdocuments.net/reader036/viewer/2022082215/5697bfdc1a28abf838cb0fe2/html5/thumbnails/48.jpg)
In a cyclic code when Received word is divided by Generator polynomial the
remainder is syndrome s(x),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.
Note
![Page 49: CHAPTER 3: DATA LINK CONTROL Flow control, Error detection – two dimensional parity checks, Internet checksum, CRC, Error control, Transmission efficiency.](https://reader036.fdocuments.net/reader036/viewer/2022082215/5697bfdc1a28abf838cb0fe2/html5/thumbnails/49.jpg)
In a cyclic code, those e(x) errors that are divisible by g(x) are not caught.
Note
![Page 50: CHAPTER 3: DATA LINK CONTROL Flow control, Error detection – two dimensional parity checks, Internet checksum, CRC, Error control, Transmission efficiency.](https://reader036.fdocuments.net/reader036/viewer/2022082215/5697bfdc1a28abf838cb0fe2/html5/thumbnails/50.jpg)
CHECKSUMCHECKSUM
The checksum is used in the Internet by several The checksum is used in the Internet by several protocols although not at the data link layer. It is a protocols although not at the data link layer. It is a error detection technique used for retransmission.error detection technique used for retransmission.
IdeaOne’s ComplementInternet Checksum
![Page 51: CHAPTER 3: DATA LINK CONTROL Flow control, Error detection – two dimensional parity checks, Internet checksum, CRC, Error control, Transmission efficiency.](https://reader036.fdocuments.net/reader036/viewer/2022082215/5697bfdc1a28abf838cb0fe2/html5/thumbnails/51.jpg)
Suppose our data is a list of five 4-bit numbers that we want to send to a destination. In addition to sending these numbers, we send the sum of the numbers. For example, if the set of numbers is (7, 11, 12, 0, 6), we send (7, 11, 12, 0, 6, 36), where 36 is the sum of the original numbers. The receiver adds the five numbers and compares the result with the sum. If the two are the same, the receiver assumes no error, accepts the five numbers, and discards the sum. Otherwise, there is an error somewhere and the data are not accepted.
Example for understanding the concept of checksum
![Page 52: CHAPTER 3: DATA LINK CONTROL Flow control, Error detection – two dimensional parity checks, Internet checksum, CRC, Error control, Transmission efficiency.](https://reader036.fdocuments.net/reader036/viewer/2022082215/5697bfdc1a28abf838cb0fe2/html5/thumbnails/52.jpg)
We can make the job of the receiver easier if we send the negative (complement) of the sum, called the checksum. In this case, we send (7, 11, 12, 0, 6, −36). The receiver can add all the numbers received (including the checksum). If the result is 0, it assumes no error; otherwise, there is an error.
Example (If complimented sum is being sent)
![Page 53: CHAPTER 3: DATA LINK CONTROL Flow control, Error detection – two dimensional parity checks, Internet checksum, CRC, Error control, Transmission efficiency.](https://reader036.fdocuments.net/reader036/viewer/2022082215/5697bfdc1a28abf838cb0fe2/html5/thumbnails/53.jpg)
How can we represent the number 21 in one’s complement arithmetic using only four bits?
SolutionThe number 21 in binary is 10101 (it needs five bits). We can wrap the leftmost bit and add it to the four rightmost bits. We have (0101 + 1) = 0110 or 6 which is wrapped sum. The one’s compliment of it is 1001 or 9.
Example using one’s compliment & wrappingof the sum
![Page 54: CHAPTER 3: DATA LINK CONTROL Flow control, Error detection – two dimensional parity checks, Internet checksum, CRC, Error control, Transmission efficiency.](https://reader036.fdocuments.net/reader036/viewer/2022082215/5697bfdc1a28abf838cb0fe2/html5/thumbnails/54.jpg)
1 0 0 1 0 0 0 0
1 1 1 1
![Page 55: CHAPTER 3: DATA LINK CONTROL Flow control, Error detection – two dimensional parity checks, Internet checksum, CRC, Error control, Transmission efficiency.](https://reader036.fdocuments.net/reader036/viewer/2022082215/5697bfdc1a28abf838cb0fe2/html5/thumbnails/55.jpg)
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.4. The sum is complemented and becomes the checksum.5. The checksum is sent with the data.
Internet checksum
![Page 56: CHAPTER 3: DATA LINK CONTROL Flow control, Error detection – two dimensional parity checks, Internet checksum, CRC, Error control, Transmission efficiency.](https://reader036.fdocuments.net/reader036/viewer/2022082215/5697bfdc1a28abf838cb0fe2/html5/thumbnails/56.jpg)
Receiver site:1. The message (including checksum) is divided into 16-bit words.2. All words are added.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.
Internet checksum
![Page 57: CHAPTER 3: DATA LINK CONTROL Flow control, Error detection – two dimensional parity checks, Internet checksum, CRC, Error control, Transmission efficiency.](https://reader036.fdocuments.net/reader036/viewer/2022082215/5697bfdc1a28abf838cb0fe2/html5/thumbnails/57.jpg)
INTERNET CHECKSUM EXAMPLE:
7 2 6 F 7 2 6 F
F F F F
![Page 58: CHAPTER 3: DATA LINK CONTROL Flow control, Error detection – two dimensional parity checks, Internet checksum, CRC, Error control, Transmission efficiency.](https://reader036.fdocuments.net/reader036/viewer/2022082215/5697bfdc1a28abf838cb0fe2/html5/thumbnails/58.jpg)
Performance
Not strong as CRC If the value of one word is
incremented & the value of another word is decremented by the same amount, the two errors can not be detected because sum and checksum will remain same.
![Page 59: CHAPTER 3: DATA LINK CONTROL Flow control, Error detection – two dimensional parity checks, Internet checksum, CRC, Error control, Transmission efficiency.](https://reader036.fdocuments.net/reader036/viewer/2022082215/5697bfdc1a28abf838cb0fe2/html5/thumbnails/59.jpg)
FRAMINGFRAMING
The data link layer needs to pack bits into The data link layer needs to pack bits into framesframes, so , so that each frame is distinguishable from another. Our that each frame is distinguishable from another. Our postal system practices a type of framing. The simple postal system practices a type of framing. The simple act of inserting a letter into an envelope separates one act of inserting a letter into an envelope separates one piece of information from another; the envelope serves piece of information from another; the envelope serves as the delimiter. as the delimiter.
![Page 60: CHAPTER 3: DATA LINK CONTROL Flow control, Error detection – two dimensional parity checks, Internet checksum, CRC, Error control, Transmission efficiency.](https://reader036.fdocuments.net/reader036/viewer/2022082215/5697bfdc1a28abf838cb0fe2/html5/thumbnails/60.jpg)
Why full message can’t be packed in one frame?
Even a single bit error would require the retransmission of the whole message.
When message is divided into small frames, a single bit error effects only that small frame.
![Page 61: CHAPTER 3: DATA LINK CONTROL Flow control, Error detection – two dimensional parity checks, Internet checksum, CRC, Error control, Transmission efficiency.](https://reader036.fdocuments.net/reader036/viewer/2022082215/5697bfdc1a28abf838cb0fe2/html5/thumbnails/61.jpg)
Types of Framing
Fixed size framing: No need for defining the boundaries of the frame.
Variable size framing: End & beginning of the frames is required.
![Page 62: CHAPTER 3: DATA LINK CONTROL Flow control, Error detection – two dimensional parity checks, Internet checksum, CRC, Error control, Transmission efficiency.](https://reader036.fdocuments.net/reader036/viewer/2022082215/5697bfdc1a28abf838cb0fe2/html5/thumbnails/62.jpg)
Frame in a character-oriented protocol
The Flag composed of protocol dependent Special characters.
![Page 63: CHAPTER 3: DATA LINK CONTROL Flow control, Error detection – two dimensional parity checks, Internet checksum, CRC, Error control, Transmission efficiency.](https://reader036.fdocuments.net/reader036/viewer/2022082215/5697bfdc1a28abf838cb0fe2/html5/thumbnails/63.jpg)
What if Flag is the part of What if Flag is the part of information?information?
![Page 64: CHAPTER 3: DATA LINK CONTROL Flow control, Error detection – two dimensional parity checks, Internet checksum, CRC, Error control, Transmission efficiency.](https://reader036.fdocuments.net/reader036/viewer/2022082215/5697bfdc1a28abf838cb0fe2/html5/thumbnails/64.jpg)
Byte stuffing and unstuffing
![Page 65: CHAPTER 3: DATA LINK CONTROL Flow control, Error detection – two dimensional parity checks, Internet checksum, CRC, Error control, Transmission efficiency.](https://reader036.fdocuments.net/reader036/viewer/2022082215/5697bfdc1a28abf838cb0fe2/html5/thumbnails/65.jpg)
Byte stuffing is the process of adding 1 extra byte whenever there is a flag or
escape character in the text.
Note
![Page 66: CHAPTER 3: DATA LINK CONTROL Flow control, Error detection – two dimensional parity checks, Internet checksum, CRC, Error control, Transmission efficiency.](https://reader036.fdocuments.net/reader036/viewer/2022082215/5697bfdc1a28abf838cb0fe2/html5/thumbnails/66.jpg)
A frame in a bit-oriented protocol
![Page 67: CHAPTER 3: DATA LINK CONTROL Flow control, Error detection – two dimensional parity checks, Internet checksum, CRC, Error control, Transmission efficiency.](https://reader036.fdocuments.net/reader036/viewer/2022082215/5697bfdc1a28abf838cb0fe2/html5/thumbnails/67.jpg)
Bit stuffing and unstuffing
![Page 68: CHAPTER 3: DATA LINK CONTROL Flow control, Error detection – two dimensional parity checks, Internet checksum, CRC, Error control, Transmission efficiency.](https://reader036.fdocuments.net/reader036/viewer/2022082215/5697bfdc1a28abf838cb0fe2/html5/thumbnails/68.jpg)
FLOW AND ERROR CONTROLFLOW AND ERROR CONTROL
The most important responsibilities of the data link The most important responsibilities of the data link
layer are layer are flow flow controlcontrol and and error controlerror control. Collectively, . Collectively, these functions are known as these functions are known as data link controldata link control..
Flow control refers to a set of procedures used to restrict the amount of data that the sender can send before waiting for acknowledgment.
Error control in the data link layer is based on automatic repeat request, which is the retransmission of data.
![Page 69: CHAPTER 3: DATA LINK CONTROL Flow control, Error detection – two dimensional parity checks, Internet checksum, CRC, Error control, Transmission efficiency.](https://reader036.fdocuments.net/reader036/viewer/2022082215/5697bfdc1a28abf838cb0fe2/html5/thumbnails/69.jpg)
PROTOCOLSPROTOCOLS
How the data link layer can combine framing, How the data link layer can combine framing, flow control, and error control to achieve the flow control, and error control to achieve the delivery of data from one node to another. delivery of data from one node to another.
The protocols are normally implemented in The protocols are normally implemented in software by using one of the common software by using one of the common programming languages. Here few protocols are programming languages. Here few protocols are represented in pseudocode version that represented in pseudocode version that concentrate mainly on the procedure not on the concentrate mainly on the procedure not on the syntax detail of programming.syntax detail of programming.
![Page 70: CHAPTER 3: DATA LINK CONTROL Flow control, Error detection – two dimensional parity checks, Internet checksum, CRC, Error control, Transmission efficiency.](https://reader036.fdocuments.net/reader036/viewer/2022082215/5697bfdc1a28abf838cb0fe2/html5/thumbnails/70.jpg)
![Page 71: CHAPTER 3: DATA LINK CONTROL Flow control, Error detection – two dimensional parity checks, Internet checksum, CRC, Error control, Transmission efficiency.](https://reader036.fdocuments.net/reader036/viewer/2022082215/5697bfdc1a28abf838cb0fe2/html5/thumbnails/71.jpg)
NOISELESS CHANNELSNOISELESS CHANNELS
An ideal An ideal channel in which no frames are lost, in which no frames are lost, duplicated, or corrupted. Here are two protocols duplicated, or corrupted. Here are two protocols for this type of channel.for this type of channel.
Simplest ProtocolStop-and-Wait Protocol
![Page 72: CHAPTER 3: DATA LINK CONTROL Flow control, Error detection – two dimensional parity checks, Internet checksum, CRC, Error control, Transmission efficiency.](https://reader036.fdocuments.net/reader036/viewer/2022082215/5697bfdc1a28abf838cb0fe2/html5/thumbnails/72.jpg)
SIMPLEST PROTOCOL
No flow and error control Sender assume that the receiver
can immediately handle any frame Not used practically
![Page 73: CHAPTER 3: DATA LINK CONTROL Flow control, Error detection – two dimensional parity checks, Internet checksum, CRC, Error control, Transmission efficiency.](https://reader036.fdocuments.net/reader036/viewer/2022082215/5697bfdc1a28abf838cb0fe2/html5/thumbnails/73.jpg)
SIMPLEST PROTOCOL:The design of the simplest protocol with no flow or error control
![Page 74: CHAPTER 3: DATA LINK CONTROL Flow control, Error detection – two dimensional parity checks, Internet checksum, CRC, Error control, Transmission efficiency.](https://reader036.fdocuments.net/reader036/viewer/2022082215/5697bfdc1a28abf838cb0fe2/html5/thumbnails/74.jpg)
Algorithm Sender-site algorithm for the simplest protocol
![Page 75: CHAPTER 3: DATA LINK CONTROL Flow control, Error detection – two dimensional parity checks, Internet checksum, CRC, Error control, Transmission efficiency.](https://reader036.fdocuments.net/reader036/viewer/2022082215/5697bfdc1a28abf838cb0fe2/html5/thumbnails/75.jpg)
Algorithm Receiver-site algorithm for the simplest protocol
![Page 76: CHAPTER 3: DATA LINK CONTROL Flow control, Error detection – two dimensional parity checks, Internet checksum, CRC, Error control, Transmission efficiency.](https://reader036.fdocuments.net/reader036/viewer/2022082215/5697bfdc1a28abf838cb0fe2/html5/thumbnails/76.jpg)
FLOW DIAGRAM:
![Page 77: CHAPTER 3: DATA LINK CONTROL Flow control, Error detection – two dimensional parity checks, Internet checksum, CRC, Error control, Transmission efficiency.](https://reader036.fdocuments.net/reader036/viewer/2022082215/5697bfdc1a28abf838cb0fe2/html5/thumbnails/77.jpg)
Stop-and-Wait protocol
Sender sends one frame, stops until it receives confirmation from the receiver then sends the next frame.
Required if data frame arrives at the receiver site faster than they can be processed.
![Page 78: CHAPTER 3: DATA LINK CONTROL Flow control, Error detection – two dimensional parity checks, Internet checksum, CRC, Error control, Transmission efficiency.](https://reader036.fdocuments.net/reader036/viewer/2022082215/5697bfdc1a28abf838cb0fe2/html5/thumbnails/78.jpg)
Design of Stop-and-Wait Protocol
![Page 79: CHAPTER 3: DATA LINK CONTROL Flow control, Error detection – two dimensional parity checks, Internet checksum, CRC, Error control, Transmission efficiency.](https://reader036.fdocuments.net/reader036/viewer/2022082215/5697bfdc1a28abf838cb0fe2/html5/thumbnails/79.jpg)
Flow diagram
![Page 80: CHAPTER 3: DATA LINK CONTROL Flow control, Error detection – two dimensional parity checks, Internet checksum, CRC, Error control, Transmission efficiency.](https://reader036.fdocuments.net/reader036/viewer/2022082215/5697bfdc1a28abf838cb0fe2/html5/thumbnails/80.jpg)
Algorithm Sender-site algorithm for Stop-and-Wait Protocol
![Page 81: CHAPTER 3: DATA LINK CONTROL Flow control, Error detection – two dimensional parity checks, Internet checksum, CRC, Error control, Transmission efficiency.](https://reader036.fdocuments.net/reader036/viewer/2022082215/5697bfdc1a28abf838cb0fe2/html5/thumbnails/81.jpg)
Algorithm Receiver-site for Stop-and-Wait Protocol