งานนำเสนอกำลังจะดาวน์โหลด โปรดรอ

# Data Link Control Error Detection and Correction

## งานนำเสนอเรื่อง: "Data Link Control Error Detection and Correction"— ใบสำเนางานนำเสนอ:

Data Link Control Error Detection and Correction

Error Detection and Correction
Data can be corrupted during transmission. For reliable communication, errors must be detected and corrected. Single-Bit Error In a single-bit error, only one bit in the data unit has changed. Burst Error A burst error means that 2 or more bits in the data unit have changed.

Error Detection and Correction
Single-Bit Error In a single-bit error, only one bit in the data unit has changed.

Error Detection and Correction
Burst Error A burst error means that 2 or more bits in the data unit have changed.

Error Detection and Correction
Error detection uses the concept of redundancy, which means adding extra bits for detecting errors at the destination. Parity Check Cyclic Redundancy Check (CRC) Checksum

Error Detection and Correction
Redundancy

Error Detection and Correction
Parity Check Two-Dimensional Parity check Even-Parity check Odd-Parity check Even-Parity check concept In parity check, a parity bit is added to every data unit so that the total number of 1s is even (or odd for odd-parity).

Error Detection and Correction
Even-Parity Check Concept

Error Detection and Correction
Example of Even-Parity check Suppose the sender wants to send the word world. In ASCII the five characters are coded as The following shows the actual bits sent

Error Detection and Correction
Example of Even-Parity check – Receive No error Now suppose the word world in the last sample is received by the receiver without being corrupted in transmission. The receiver counts the 1s in each character and comes up with even numbers (6, 6, 4, 4, 4). The data are accepted.

Error Detection and Correction
Example of Even-Parity check – with errors Now suppose the word world in the last sample is corrupted during transmission. The receiver counts the 1s in each character and comes up with even and odd numbers (7, 6, 5, 4, 4). The receiver knows that the data are corrupted, discards them, and asks for retransmission.

Error Detection and Correction
Remark: Simple parity check can detect all single-bit errors. It can detect burst errors only if the total number of errors in each data unit is odd.

Error Detection and Correction
Example of Even-Parity check – more than 1 errors The following shows the actual bits errors

Error Detection and Correction
Two-Dimensional parity

Error Detection and Correction
Two-Dimensional parity – single bit error VRC LRC 1 2 3 4 5 6 Longitudinal Redundancy Check Vertical Redundancy Check

Error Detection and Correction
Two-Dimensional parity – double bit error ข้อมูลเดิม คือ VRC LRC 1 2 3 4 5 6 X พบข้อผิดพลาดจากการตรวจสอบ LRC

Error Detection and Correction
Two-Dimensional parity – double bit error ข้อมูลเดิม คือ VRC LRC 1 2 3 4 5 6 X

Error Detection and Correction
Two-Dimensional parity – can not detect err. VRC LRC 1 2 3 4 5 6

Error Detection and Correction
Cyclic Redundancy Check (CRC) Given a K-Bit Frame The Transmitter Generate an N-Bits sequence - FCS (Frame Check Sequence) K bits N bits FCS K + N bits The resulting frame consisting of k+n bits is Exactly divisible by some predetermined number

Error Detection and Correction
Cyclic Redundancy Check (CRC)

Error Detection and Correction
Cyclic Redundancy Check (CRC) คุณสมบัติตัวหาร (Divisor) ใช้หลักการของ XOR ในการคำนวณ Bit ซ้ายสุดและขวาสุดจะต้องเป็น 1 เสมอ จำนวนบิตจะต้องน้อยกว่าจำนวนบิตของข้อมูล data1 data2 XOR output 1

Error Detection and Correction
Binary division in A CRC generator

Error Detection and Correction
Binary division in CRC Checker

Error Detection and Correction
A polynomial representing a divisor

Error Detection and Correction
Sample of a polynomial representing #1 Data to be send is (10 bits) Divisor is แปลงเป็นโพลีโนเมียลได้ดังนี้ = X9+X7+X3+X2+1 = X5 + X4 + X2 + 1

Error Detection and Correction
Sample of a polynomial representing #2 Data to be send is (6 bits) Divisor is 1101 CRC 3 bits แปลงเป็นโพลีโนเมียลได้ดังนี้ = X5+X2 = X8+X5 1101 = X3 + X2 + 1

Error Detection and Correction
Sample of a polynomial representing #3

Error Detection and Correction
Sample of a polynomial representing #4 Data to be send is (6 bits) Divisor is 1101 CRC 3 bits แปลงเป็นโพลีโนเมียลได้ดังนี้ = X5+X2 = X8+X5 1101 = X3 + X2 + 1 ฉะนั้น CRC ที่ได้ = Remainder of (X8+X5)/(X3 + X2 + 1 ) Remainder = 1 CRC = 001 ดังนั้นข้อมูลทั้งหมดที่จะส่งคือ

Error Detection and Correction
Sample of a polynomial representing #3

Error Detection and Correction
Sample of a polynomial representing #5 ผู้รับตรวจสอบข้อมูลด้วยตัวหารชุดเดียวกัน Data received is (9 bits) Divisor is 1101 = X8 + X5 + 1 1101 = X3 + X2 + 1 การตรวจสอบ = Result of (X8+X5+1)/(X3 + X2 + 1 ) Remainder = 0 เมื่อผลหารลงตัวโดยไม่เหลือเศษ สรุปได้ว่า ข้อมูลที่ส่งมานั้นถูกต้อง

Error Detection and Correction
Standard Cyclic Redundancy Check Polynomials CRC Standard Polynomial Bit String Used CRC-12 X12 + X11 + X3 + X2 + 1 CRC-16 X16 + X15 + X2 + 1 CRC-CCITT X16 + X12 + X5 + 1 CRC-32 X32 + X26 + X23 + X22 + X16 + X12 + X11 + X10 + X8 + X7 + X5 + X4 + X2 + X + 1 ใช้ใน LAN IEEE 802

Error Detection and Correction
Checksum The Sender follows these steps: The unit is divided into k sections, each of n bits. All sections are added using one’s complement to get the sum. The sum is complemented and becomes the checksum. The checksum is sent with the data

Error Detection and Correction
Checksum The Receiver follows these steps: The unit is divided into k sections, each of n bits. All sections are added using one’s complement to get the sum. The sum is complemented. If the result is zero, the data are accepted: otherwise, rejected.

Error Detection and Correction
Checksum

Error Detection and Correction
Sample of Checksum - Sender Suppose the following block of 16 bits is to be sent using a checksum of 8 bits. The numbers are added using one’s complement Sum Checksum The pattern sent is

Error Detection and Correction
Sample of Checksum - Receiver Now suppose the receiver receives the pattern sent is no error. 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. Sum Complement means that the pattern is OK.

Error Detection and Correction
Sample of Checksum – Received with errors Now suppose there is a burst error of length 5 that affects 4 bits. ( ) When the receiver adds the three sections, it gets Partial Sum Carry Sum Complement the pattern is corrupted.

Error Detection and Correction
Sample of Checksum - Sender What is the checksum value for the extended ASCII message “Help!” ? H e l p ! (Sum) (Checksum – one’s complement)

Error Detection and Correction
Sample of Checksum - Receiver H e l p ! (Checksum) (sum) (One’s complement)

Error Detection and Correction
การแก้ไขความผิดเพี้ยนของข้อมูล ประกอบด้วย 2 แนวทางคือ Forward Error Correction แก้ไขแบบไม่ส่งข้อมูลซ้ำ โดยที่ผู้รับสามารถแก้ไขข้อมูลที่ผิดได้เอง Retransmission แก้ไขแบบส่งข้อมูลซ้ำ ผู้ส่งจะทำการส่งข้อมูลที่ถูกต้องมาให้ใหม่ อีกครั้ง

Error Detection and Correction
Forward Error Correction วิธีการแก้ไขข้อมูลแบบไม่ส่งซ้ำที่ได้รับความนิยมอย่างสูงได้แก่ การแก้ไขข้อมูลแบบแฮมมิ่ง (Hamming Code) คิดค้นโดย R.W. Hamming ซึ่งนำวิธีการแบบ Parity มาประยุกต์ให้มีความ เที่ยงตรงสูงขึ้น โดยการเพิ่ม bits ข้อมูลสำหรับควบคุมเข้าไปรวม กับตัวข้อมูล และการแก้ไขข้อมูลจะใช้แบบ Even Parity

Error Detection and Correction
Hamming Code: Data and Redundancy bits Number of Data bits (K) Redundancy bits (R) Total Bits (K+R) 1 2 3 5 6 4 7 9 10 11

Error Detection and Correction
Position of Redundancy bits in Hamming Code:

Error Detection and Correction
Redundancy bits Calculation:

Error Detection and Correction
Sample of Redundancy bits Calculation:

Error Detection and Correction
Error detection using Hamming Code: Normal Case 1 1 1 1

Error Detection and Correction
Error detection using Hamming Code: