chapter5 data link layer in data communications and networking.ppt
1. Chapter 5 Dr. Ali Al-Hamdi 1
Chapter 5
Error Detection and
Correction
Part III: Data-Link Layer
2. Chapter 5 Dr. Ali Al-Hamdi 2
Net. criterion related to error occurrence, data form types
applications and error manipulation?
Error manipulation in data-link layer and in other layers
when frames corrupted between 2 nodes?
Chapter topics include:
Errors types, redundancy concept, error detection & correction,
Block coding discussion and introduction to Hamming distance,
Cyclic coding discussion, from different perspectives,
Checksum discussion,
Forward error discussion.
Lead-in
3. Chapter 5 Dr. Ali Al-Hamdi 3
5.1.1 Types of Errors
Errors causes
Which type is dominant? Why? Examples?
5.1 Introduction
4. Chapter 5 Dr. Ali Al-Hamdi 4
5.1.2 Redundancy
Definition and goal
Task of sender and receiver related to redundant bits
5.1.3 Detection vs. Correction
Which is more difficult? Why? Examples
5.1.4 Coding
At the sender, and at the receiver
Categories of coding schemes
Schemes complexity
5.1 Introduction
5. Chapter 5 Dr. Ali Al-Hamdi 5
5.2 Block Coding
5.2.1 Concept
Message division into blocks, each of (k) bits, called
datawords.
Redundant bits (r) addition to each block to result
codewords, each of (n) bits, n= k + r.
Since n > k, the number of possible codewords > the
number of possible datawords.
Since the block coding process is one-to-one, 2k
codewords are used and 2n
− 2k
codewords are not.
6. Chapter 5 Dr. Ali Al-Hamdi 6
5.2 Block Coding
5.2.1 Concept
While used codewords are called valid codewords,
unused codewords are called invalid or illegal
codewords.
Invalid codewords represent a trick in error detection at
the receiver if a codeworde was corrupted during
transmission.
How this problem can be solved?
7. Chapter 5 Dr. Ali Al-Hamdi 7
5.2 Block Coding
5.2.2 Error Detection
2 Conditions permitting the receiver to detect errors
Receiver has a list of valid codewords
Original codeword has changed to an invalid or valid ones
Problem with 2nd
condition?
ED process
8. Chapter 5 Dr. Ali Al-Hamdi 8
5.2.2 Error Detection
Example (1): consider table 10.1 and assume the sender codes
dataword 01 as 011, specify the transmission situation and the
receiver decision if it receives the following cases: 011, 111,
000?
5.2 Block Coding
9. Chapter 5 Dr. Ali Al-Hamdi 9
5.2.2 Error Detection
Hamming Distance
Definition
Condition
Why important?
For example: if the codeword 00000 is sent and 01101 is
received, HD ?
Logic operator used?
Example (2)
5.2 Block Coding
10. Chapter 5 Dr. Ali Al-Hamdi 10
5.2.2 Error Detection
Minimum Hamming Distance for Error Detection
Definition
Concept
5.2 Block Coding
11. Chapter 5 Dr. Ali Al-Hamdi 11
5.2.2 Error Detection
Minimum Hamming Distance for Error Detection
Example (3): in table 10.1, what type of error can be detected
if a codeword is corrupted, and what is the value of dmin?
Example (4)
if dmin=4, s?
5.2 Block Coding
12. Chapter 5 Dr. Ali Al-Hamdi 12
5.2.2 Error Detection
Types: linear and nonlinear, dominant one, why?
Linear Block Codes
Required knowledge?
Definition (based on table 10.1)?
Example (5): table 10.1 is LBC?
5.2 Block Coding
13. Chapter 5 Dr. Ali Al-Hamdi 13
5.2.2 Error Detection
Linear Block Codes
Minimum Hamming Distance for LBC?
Example (6): in table 10.1.
dmin in general and in table (10.1)=? And type of error?
5.2 Block Coding
15. Chapter 5 Dr. Ali Al-Hamdi 15
5.2.2 Error Detection
Linear Block Codes
Parity-check: encoder & Decoder
Structure
Operation
5.2 Block Coding
16. Chapter 5 Dr. Ali Al-Hamdi 16
5.2.2 Error Detection
Linear Block Codes: Partity-check encoder & Decoder
Example (7): assume the sender sends codeword 10111 ,
specify the transmission situation and the receiver decision if
it receives the following cases: 10111, 10011, 10110, 00110,
01011?
5.2 Block Coding
18. Chapter 5 Dr. Ali Al-Hamdi 18
5.3 Cyclic Codes
4.3.2 Cyclic Redundancy Check (CRC)
Structure
Operation
19. Chapter 5 Dr. Ali Al-Hamdi 19
5.3 Cyclic Codes
4.3.2 Cyclic Redundancy Check (CRC)
Division in encoder
20. Chapter 5 Dr. Ali Al-Hamdi 20
5.3 Cyclic Codes
4.3.2 Cyclic Redundancy Check (CRC)
Division in decoder
Divisor selection?
21. Chapter 5 Dr. Ali Al-Hamdi 21
5.3.3 Polynomials
Concept
Benefit?
5.3 Cyclic Codes
22. Chapter 5 Dr. Ali Al-Hamdi 22
5.3.3 Polynomials
Degree of polynomial
Adding and Subtraction Polynomials
Multiplying or Division Terms or
Multiplying Two Polynomials
Dividing One Polynomial By Another
Shifting
5.3 Cyclic Codes
23. Chapter 5 Dr. Ali Al-Hamdi 23
5.3.4 Cyclic Code Encoder Using Polynomials
4.1.4 Coding
5.3 Cyclic Codes
24. Chapter 5 Dr. Ali Al-Hamdi 24
5.3.5 Cyclic Code Analysis
5.3 Cyclic Codes
25. Chapter 5 Dr. Ali Al-Hamdi 25
5.3.5 Cyclic Code Analysis
Single-Bit Error
5.3 Cyclic Codes
26. Chapter 5 Dr. Ali Al-Hamdi 26
5.3.5 Cyclic Code Analysis
Two Isolated Single-Bit Errors
5.3 Cyclic Codes
27. Chapter 5 Dr. Ali Al-Hamdi 27
5.3.5 Cyclic Code Analysis
Two Isolated Single-Bit Errors
5.3 Cyclic Codes
28. Chapter 5 Dr. Ali Al-Hamdi 28
5.3.5 Cyclic Code Analysis
Odd Numbers of Errors
Burst Errors
5.3 Cyclic Codes
29. Chapter 5 Dr. Ali Al-Hamdi 29
5.3.5 Cyclic Code Analysis
Burst Errors
Summary
5.3 Cyclic Codes
30. Chapter 5 Dr. Ali Al-Hamdi 30
5.3.5 Cyclic Code Analysis
Standard Polynomials
5.3 Cyclic Codes
31. Chapter 5 Dr. Ali Al-Hamdi 31
5.3.6 Advantages of Cyclic Codes
Can detect all types of errors with high performance
Simple to implement is S/W and H/W
So, they are used in many networks
5.6.7 Other Cyclic Codes
Reed Solomon code for error detection and correction
5.3 Cyclic Codes
32. Chapter 5 Dr. Ali Al-Hamdi 32
5.4.1 Generalities
Definition
Used in layers
Operation
5.4 Checksum
33. Chapter 5 Dr. Ali Al-Hamdi 33
5.4.2 Concept
Example (10.11):
At the sender: message to be sent is of 4-bit numbers=(7, 11, 12, 0, 6).
With sum message=(7, 11, 12, 0, 6, 36)
At receiver: numbers are added and compare with the sum. If the two are
the same, the numbers are accepted, and discards the sum. Otherwise,
there is an error somewhere and the message is not accepted.
Drawback?
Solution: One’s Complement Addition
Reducing number of bits of sum using
Example (10.12) =(7, 11, 12, 0, 6, 6)
5.4 Checksum
34. Chapter 5 Dr. Ali Al-Hamdi 34
5.4.2 Concept
Solution: One’s Complement Addition
At sender: add the number in one’s complement to get the sum then
complement to get the checksum. Example (10.13) =(7, 11, 12, 0, 6, 9)
At receiver: if there is no error (7, 11, 12, 0, 6, 9) is received and add
them in one’s complement to get 15 which is complemented to get 0 .
5.4 Checksum
35. Chapter 5 Dr. Ali Al-Hamdi 35
5.4.2 Concept
Internet Checksum
5.4 Checksum
36. Chapter 5 Dr. Ali Al-Hamdi 36
5.4.2 Concept
Algorithm
Performance
Small (16-bit) to large size error
Not strong as CRC
Not weighted
5.4 Checksum
37. Chapter 5 Dr. Ali Al-Hamdi 37
5.4.3 Other Approaches to Checksum
Fetcher checksum
Devised to weight each data item according to its position.
Two algorithms are proposed: 8-bit and 16-bit.
The 1st
calculates on 8-bit data items and creates a 16-bit checksum.
The 2nd
calculates on 16-bit data items and creates a 32-bit checksum.
The algorithm uses two accumulators: L and R.
The first adds data items together; the second adds a weight to the
calculation.
16-bit Fletcher checksum is similar to the 8-bit Fletcher checksum, but it
is calculated over 16-bit data items and creates a 32-bit checksum.
5.4 Checksum
38. Chapter 5 Dr. Ali Al-Hamdi 38
5.4.3 Other Approaches to Checksum
Fetcher checksum
Algorithm example
5.4 Checksum
39. Chapter 5 Dr. Ali Al-Hamdi 39
5.4.3 Other Approaches to Checksum
Adler checksum
32-bit checksum
It is similar to the 16-bit Fletcher with three differences:
Calculation is done on single bytes instead of 2 bytes at a time.
The modulus is a prime number (65,521) instead of 65,536.
L is initialized to 1 instead of 0.
5.4 Checksum
40. Chapter 5 Dr. Ali Al-Hamdi 40
5.4.3 Other Approaches to Checksum
Adler checksum
Algorithm
5.4 Checksum
41. Chapter 5 Dr. Ali Al-Hamdi 41
Usefulness of packet retransmission in RT multimedia?
5.5.1 Using Hamming Distance
More distance is needed, dmin= 2t + 1 to correct t errors
This means a lot of redundant bits need to be sent with the data.
Example: famous BCH code
5.5 Forward Error Correction
42. Chapter 5 Dr. Ali Al-Hamdi 42
5.5 Forward Error Correction
5.5.2 Using XOR
Recreating any of data items using exclusive-ORing all of the
items, replacing the one to be created by the result of the previous
operation (R).
This means dividing a packet into N chunks, create the exclusive
OR of all the chunks and send N + 1 chunks.
If any chunk is lost or corrupted, it can be created at the receiver.
Value of N depends on the # of lost chunks during transmission.
Example: if N = 4, 25 % extra data to correct the data if only one
chunk is lost.
43. Chapter 5 Dr. Ali Al-Hamdi 43
5.5.3 Chunk Interleaving
Concept: missing one packet
5.5 Forward Error Correction
44. Chapter 5 Dr. Ali Al-Hamdi 44
5.5.4 Combining Hamming Distance &
Interleaving
First n-bit packets are created that can correct t-bit errors.
Then m rows interleaved and send the bits column by column.
In this way, burst errors up to m × t-bit errors can be corrected
automatically.
5.5 Forward Error Correction
45. Chapter 5 Dr. Ali Al-Hamdi 45
5.5.5 Compounding High-and low-resolution
packets
5.5 Forward Error Correction