Presentation is loading. Please wait.

Presentation is loading. Please wait.

Subject Name: COMPUTER NETWORKS-1

Similar presentations


Presentation on theme: "Subject Name: COMPUTER NETWORKS-1"— Presentation transcript:

1 Subject Name: COMPUTER NETWORKS-1
Subject Code:10CS55 Prepared By: Shruthi N, Krishna Sowjanya.k, Santhiya.M Department: CSE

2 Data Link Layer-1:Error Detection and correction

3 Networks must be able to transfer data from one device to another with complete accuracy.
Data can be corrupted during transmission. For reliable communication, errors must be detected and corrected. Error detection and correction are implemented either at the data link layer or the transport layer of the OSI model.

4 Types of Errors

5 Single bit errors Single bit errors are the least likely type of errors in serial data transmission because the noise must have a very short duration which is very rare. However this kind of errors can happen in parallel transmission. Example: If data is sent at 1Mbps then each bit lasts only 1/1,000,000 sec. or 1 μs. For a single-bit error to occur, the noise must have a duration of only 1 μs, which is very rare.

6 Single-bit error

7 Burst error The term burst error means that two or more bits in the data unit have changed from 1 to 0 or from 0 to 1. Burst errors does not necessarily mean that the errors occur in consecutive bits, the length of the burst is measured from the first corrupted bit to the last corrupted bit. Some bits in between may not have been corrupted.

8 Burst error Burst error is most likely to happen in serial transmission since the duration of noise is normally longer than the duration of a bit. The number of bits affected depends on the data rate and duration of noise. Example: If data is sent at rate = 1Kbps then a noise of 1/100 sec can affect 10 bits.(1/100*1000) If same data is sent at rate = 1Mbps then a noise of 1/100 sec can affect 10,000 bits.(1/100*106)

9 Burst error

10 Redundancy To detect or correct errors, redundant bits of data must be added

11 Coding Process of adding redundancy for error detection or correction
Two types: Block codes Divides the data to be sent into a set of blocks Extra information attached to each block Memoryless Convolutional codes Treats data as a series of bits, and computes a code over a continuous series The code computed for a set of bits depends on the current and previous input

12 Block Coding Message is divided into k-bit blocks
Known as datawords r redundant bits are added Blocks become n=k+r bits Known as codewords

13 Error Detection in Block Coding
An error-detecting code can detect only the types of errors for which it is designed Other types of errors may remain undetected. There is no way to detect every possible error

14 Error Correction 14

15 Hamming Distance d(01, 00) = ? d(11, 00) = ? d(010, 100) = ?
Hamming Distance between two words is the number of differences between corresponding bits. d(01, 00) = ? d(11, 00) = ? d(010, 100) = ? d(0011, 1000) = ? How many 8-bit words are n bits away from ?

16 Minimum Hamming Distance
The minimum Hamming distance is the smallest Hamming distance between all possible pairs in a set of words. Find the minimum Hamming Distance of the following codebook 00000 01011 10101 11110

17 Detection Capability of Code
Engineered for Tomorrow Detection Capability of Code To guarantee the detection of up to s-bit errors, the minimum Hamming distance in a block code must be dmin = s + 1

18 Correction Capability of Code
To guarantee the correction of up to t-bit errors, the minimum Hamming distance in a block code must be dmin = 2t + 1

19 Linear Block Codes Almost all block codes used today belong to a subset called linear block codes. A linear block code is a code in which the exclusive OR (addition modulo-2) of two valid codewords creates another valid codeword A simple parity-check code is a single-bit error-detecting code in which n = k + 1 with dmin = 2. Even parity (ensures that a codeword has an even number of 1’s) and odd parity (ensures that there are an odd number of 1’s in the codeword) A simple parity-check code can detect an odd number of errors.

20 Simple parity-check code C(5, 4)
10.

21 Encoder and decoder for simple parity-check code

22 Two Dimensional parity check
The dataword is organized in a table (rows and columns) For each row and each column, 1 parity-check bit is calculated. The whole table is then sent to the receiver, which finds the syndrome for each row and each column. The two-dimensional parity check can detect up to three errors that occur anywhere in the table (arrows point to the locations of the created nonzero syndromes). However, errors affecting 4 bits may not be detected

23 Two-dimensional parity-check code

24 Two-dimensional parity-check code

25 Two-dimensional parity-check code

26 Hamming codes These codes were originally designed with dmin = 3, which means that they can detect up to two errors or correct one single error. Although there are some Hamming codes that can correct more than one error, our discussion focuses on the single-bit error-correcting code. A codeword consists of n bits of which k are data bits and r are check bits. Let m = r, then we have: n = 2m -1 and k = n-m

27 For example if m=3,then n=7 and k-=4
For example if m=3,then n=7 and k-=4.This is hamming code C(7,4) with dmin=3.The data word and codeword for this code is shown.

28 The structure of the encoder and decoder for a Hamming code

29 Figure 10.13 Burst error correction using Hamming code

30 Cyclic codes Cyclic codes are special linear block codes with one extra property. In a cyclic code, if a codeword is cyclically shifted (rotated), the result is another codeword We can create cyclic codes to correct errors. A category of cyclic codes is the cyclic redundancy check(CRC) which is used in LANs and WANs

31 CRC encoder and decoder

32 Division in CRC encoder (Encoder)

33 Division in the CRC decoder for two cases (Decoder)

34 Polynomial Representation
More common representation than binary form Easy to analyze Divisor is commonly called generator polynomial

35 CRC division using polynomials

36 Strength of CRC M(x)xn = Q(x)G(x) + R(x)
Can be analyzed using polynomial M(x) – Original message G(x) – Generator polynomial of degree n R(x) – Generated CRC Transmitted message is M(x)xn – R(x) which is divisible by G(x) M(x)xn = Q(x)G(x) + R(x)

37 Strength of CRC Received message is M(x)xn – R(x) + E(x)
where E(x) represents bit errors Receiver does not detect any error when E(x) is divisible by G(x), which means either: E(x) 0  No error E(x)  0  Undetectable error

38 Strength of CRC If G(x) contains at least two terms, then all single-bit errors can be detected If G(x) cannot divide xt + 1 (0 t < n), then all isolated double errors can be detected If G(x) contains a factor of (x+1), all odd-numbered errors can be detected

39 Properties of Good Polynomial
It should have at least two terms The coefficient of the term x0 should be 1 It should not divide xt + 1, for t between 2 and n − 1 It should have the factor x + 1

40 Standard Polynomials

41 Checksum The checksum is used in the Internet by several protocols although not at the data link layer. Like linear and cyclic codes, the checksum is based on the concept of redundancy. Several protocols still use the checksum for error detection although the tendency is to replace it with a CRC. This means that the CRC is also used in layers other than the data link layer.The concept of the checksum is not difficult.

42 One’s compliment In this arithmetic, we can represent unsigned numbers between 0 and 2n - 1 using only n bits. If the number has more than n bits, the extra leftmost bits need to be added to the n rightmost bits (wrapping). In one's complement arithmetic, a negative number can be represented by inverting all bits (changing a 0 to a 1 and a 1 to a 0). This is the same as subtracting the number from 2n - 1.

43 Internet Checksum Traditionally, the Internet has been using a 16-bit checksum. The sender calculates the checksum by following these steps. The message is divided into 16-bit words. The value of the checksum word is set to O. All words including the checksum are added ushtg one's complement addition. The sum is complemented and becomes the checksum. The checksum is sent with the data. The receiver uses the following steps for error correction The message (including checksum) is divided into 16-bit words. All words are added using one's complement addition. The sum is complemented and becomes the new checksum. If the value of checksum is 0, the message is accepted; otherwise, it is rejected.


Download ppt "Subject Name: COMPUTER NETWORKS-1"

Similar presentations


Ads by Google