CHAPTER 3: DATA LINK CONTROL Flow control, Error detection – two dimensional parity checks, Internet checksum, CRC, Error control, Transmission efficiency.

Slides:



Advertisements
Similar presentations
10. Chapter 10 Error Detection and Correction Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Advertisements

11-1 FRAMING The data link layer needs to pack bits into frames, so that each frame is distinguishable from another. Our postal system practices a type.
10.1 Chapter 10 Error Detection and Correction Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Chapter 11 Data Link Control
NETWORKING CONCEPTS. ERROR DETECTION Error occures when a bit is altered between transmission& reception ie. Binary 1 is transmitted but received is binary.
Chapter 10 Error Detection and Correction
Chapter 7 – Data Link Control Protocols
ECOM 4314 Data Communications Fall September, 2010.
The Data Link Layer Chapter 3. Position of the data-link layer.
Error detection and correction
Error Detection and Correction
Error Detection and Correction Rizwan Rehman Centre for Computer Studies Dibrugarh University.
McGraw-Hill©The McGraw-Hill Companies, Inc., 2000 PART III: DATA LINK LAYER ERROR DETECTION AND CORRECTION 7.1 Chapter 10.
11.1 Chapter 11 Data Link Control Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Copyright © NDSL, Chang Gung University. Permission required for reproduction or display. Chapter 10 Error Detection and Correction 長庚大學資訊工程學系 陳仁暉 副教授.
PART III DATA LINK LAYER. Position of the Data-Link Layer.
British Computer Society
10.1 Chapter 10 Error Detection and Correction Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Data Link Layer: Error Detection and Correction
Chapter 10. Error Detection and Correction
Data Communications, Kwangwoon University10-1 Part 3 Data Link Layer Chapter 10 Error Detection and Correction Chapter 11 Data Link Control Chapter 12.
10.1 Chapter 10 Error Detection and Correction Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
McGraw-Hill©The McGraw-Hill Companies, Inc., 2004 Data Link Layer PART III.
Error Detection and Correction
COMPUTER NETWORKS Ms. Mrinmoyee Mukherjee Assistant Professor St. Francis Institute of Technology, Mount Poinsur, S.V.P Road, Borivli (west), Mumbai
Eighth Edition by William Stallings Chapter 7 – Data Link Control Protocols Data Link Control Protocols need layer of logic above Physical to manage exchange.
Lecture 5 Checksum. 10.2CHECKSUM Checksum is an error-detecting technique that can be applied to a message of any length. In the Internet, the checksum.
Error Detection and Correction
Computer Communication & Networks Lecture 9 Datalink Layer: Error Detection Waleed Ejaz
Lecture Focus: Data Communications and Networking  Data Link Layer  Error Control Lecture 19 CSCS 311.
10.1 Chapter 10 Error Detection and Correction Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
10.1 Chapter 10 Error Detection and Correction Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
1 Block Coding Messages are made up of k bits. Transmitted packets have n bits, n > k: k-data bits and r-redundant bits. n = k + r.
10.1 Chapter 10 Error Detection and Correction Data can be corrupted during transmission. Some applications require that errors be detected and.
1 Kyung Hee University Position of the data-link layer.
Error Detection. Data can be corrupted during transmission. Some applications require that errors be detected and corrected. An error-detecting code can.
Chapter 10 Error Detection And Correction Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Data Link Layer. Data Link Layer Topics to Cover Error Detection and Correction Data Link Control and Protocols Multiple Access Local Area Networks Wireless.
Error Detection and Correction
McGraw-Hill©The McGraw-Hill Companies, Inc., 2000 PART III: DATA LINK LAYER ERROR DETECTION AND CORRECTION 7.1 Chapter 10.
Data Communications and Networking
10.1 UNIT - IV Error Detection and Correction Data can be corrupted during transmission. Some applications require that errors be detected and corrected.
Hamming Distance & Hamming Code
10.1 Chapter 10 Error Detection and Correction Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
10.1 Chapter 10 Error Detection and Correction Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Part III: Data Link Layer Error Detection and Correction
NET 221D : COMPUTER NETWORKS FUNDAMENTALS LECTURE 4: DATA LINK LAYER Behrouz A. Forouzan” Data communications and Networking 1.
Data Link Layer 1. 2 Single-bit error 3 Multiple-bit error 4.
11.1 Chapter 11 Data Link Control Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Data Link Layer.
Net 221D : Computer Networks Fundamentals
Data Link Layer.
Part III. Data Link Layer
Error Detection and Correction
Subject Name: COMPUTER NETWORKS-1
DATA COMMUNICATION AND NETWORKINGS
Part III Datalink Layer 10.
Chapter 10 Error Detection And Correction
Chapter 10 Error Detection And Correction
Net 221D : Computer Networks Fundamentals
Chapter 7 Error Detection and Correction
Position of the data-link layer
Error Detection and Correction
Chapter 11 Data Link Control
Error Detection and Correction
Error Detection and Correction
Types of Errors Data transmission suffers unpredictable changes because of interference The interference can change the shape of the signal Single-bit.
Data Link Layer. Position of the data-link layer.
Chapter 10 Error Detection and Correction
Presentation transcript:

CHAPTER 3: DATA LINK CONTROL Flow control, Error detection – two dimensional parity checks, Internet checksum, CRC, Error control, Transmission efficiency of ARQ controls, HDLC, Point to Point controls

Data link control Error correction & detection Error correction & detection Framing Framing Flow & Error control (Protocols) Flow & Error control (Protocols)

ERROR CORRECTION & DETECTION Some issues related, directly or indirectly, to error detection and correction. Types of Errors Redundancy Detection Versus Correction Forward Error Correction Versus Retransmission Coding Modular Arithmetic

In a single-bit error, only 1 bit in the data unit has changed. Type of Errors Single bit error

Least likely type of error. Example: If data rate is 1Mbps than each bit interval is 1/ s. Noise of this duration is very rare.

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

Burst error of length 8

To detect or correct errors, we need to send extra (redundant) bits with data. Redundancy

Methods of Error correction Forward error correction Retransmission

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.

The structure of encoder and decoder

Modulo Arithmetic

BLOCK CODING In block coding, we divide our message into blocks, each of k bits, called datawords. We add r redundant bits to each block to make the length n = k + r. The resulting n-bit blocks are called codewords.

Datawords and codewords in block coding

Process of 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. Note

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

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)

Assume the dataword is 01. The sender creates the codeword The codeword is corrupted during transmission, and 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

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 with and consults the table to find the dataword 01. Example 2 continued

The Hamming distance between two words is the number of differences between corresponding bits. Note

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

The minimum Hamming distance is the smallest Hamming distance between all possible pairs in a set of words. Note

Find the minimum Hamming distance of the coding scheme in Table 1. Example 3 The d min in this case is 2.

Find the minimum Hamming distance of the coding scheme in Table 2. Solution We first find all the Hamming distances. The d min in this case is 3. Example 4

To guarantee the detection of up to s errors in all cases, the minimum Hamming distance in a block code must be d min = s + 1. Note

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

Our second block code scheme (Table 2) has d min = 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

Figure Geometric concept for finding d min in error detection

Geometric concept for finding d min in error correction

To guarantee correction of up to t errors in all cases, the minimum Hamming distance in a block code must be d min = 2t + 1. Note

A code scheme has a Hamming distance d min = 4. What is the error detection and correction capability of this scheme? 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. Error correction codes need to have an odd minimum distance (3, 5, 7,... ). Example 8

LINEAR BLOCK CODES 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. Note

Table 3 Simple parity-check code C(5, 4)

Encoder and decoder for simple parity-check code

Assume the sender sends the dataword 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 The syndrome is 0. The dataword 1011 is created. 2. One single-bit error changes a 1. The received codeword is The syndrome is 1. No dataword is created. 3. One single-bit error changes r 0. The received codeword is The syndrome is 1. No dataword is created. Example 9

4. An error changes r 0 and a second error changes a 3. The received codeword is 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—a 3, a 2, and a 1 —are changed by errors. The received codeword is 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)

A simple parity-check code can detect an odd number of errors. Note

Two-dimensional parity-check code

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.

General design of encoder and decoder of a CRC code

A polynomial to represent a binary word

CRC division using polynomials

The divisor in a cyclic code is normally called the generator polynomial or simply the generator. Note

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

In a cyclic code, those e(x) errors that are divisible by g(x) are not caught. Note

CHECKSUM The checksum is used in the Internet by several protocols although not at the data link layer. It is a error detection technique used for retransmission. Idea One’s Complement Internet Checksum

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

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)

How can we represent the number 21 in one’s complement arithmetic using only four bits? Solution The number 21 in binary is (it needs five bits). We can wrap the leftmost bit and add it to the four rightmost bits. We have ( ) = 0110 or 6 which is wrapped sum. The one’s compliment of it is 1001 or 9. Example using one’s compliment & wrapping of the sum

Sender site: 1. The message is divided into 16-bit words. 2. The value of the checksum word is set to 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

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

INTERNET CHECKSUM EXAMPLE: F F F

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.

FRAMING The data link layer needs to pack bits into frames, so that each frame is distinguishable from another. Our postal system practices a type of framing. The simple act of inserting a letter into an envelope separates one piece of information from another; the envelope serves as the delimiter.

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.

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.

Frame in a character-oriented protocol The Flag composed of protocol dependent Special characters.

What if Flag is the part of information?

Byte stuffing and unstuffing

Byte stuffing is the process of adding 1 extra byte whenever there is a flag or escape character in the text. Note

A frame in a bit-oriented protocol

Bit stuffing and unstuffing

FLOW AND ERROR CONTROL The most important responsibilities of the data link layer are flow control and error control. Collectively, these functions are known as data 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.

PROTOCOLS How the data link layer can combine framing, flow control, and error control to achieve the delivery of data from one node to another. The protocols are normally implemented in software by using one of the common programming languages. Here few protocols are represented in pseudocode version that concentrate mainly on the procedure not on the syntax detail of programming.

NOISELESS CHANNELS An ideal in which no frames are lost, duplicated, or corrupted. Here are two protocols for this type of channel. An ideal channel in which no frames are lost, duplicated, or corrupted. Here are two protocols for this type of channel. Simplest Protocol Stop-and-Wait Protocol

SIMPLEST PROTOCOL No flow and error control Sender assume that the receiver can immediately handle any frame Not used practically

SIMPLEST PROTOCOL: The design of the simplest protocol with no flow or error control

Algorithm Sender-site algorithm for the simplest protocol

Algorithm Receiver-site algorithm for the simplest protocol

FLOW DIAGRAM:

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.

Design of Stop-and-Wait Protocol

Flow diagram

Algorithm Sender-site algorithm for Stop-and-Wait Protocol

Algorithm Receiver-site for Stop-and-Wait Protocol