Vous êtes sur la page 1sur 47

The Data Link Layer

Services provided to network layer Error detection and correction techniques (parity checks, checksumming methods, CRC, Hamming code) Reliable transmission ( stop and wait, sliding window protocol with its variant)

Pintu R Shah MPSTME SVKM's NMIMS

Services Framing

Provided to the Network Layer

Error

Control Flow Control

Pintu R Shah MPSTME SVKM's NMIMS

Provide

layer Dealing with transmission errors Regulating data flow

service interface to the network

Slow receivers not swamped by fast senders

Pintu R Shah MPSTME SVKM's NMIMS

Relationship between packets and frames.


Network layer

Data Link layer

Pintu R Shah MPSTME SVKM's NMIMS

(a) Virtual communication. (b) Actual communication.


Pintu R Shah MPSTME SVKM's NMIMS 6

Pintu R Shah MPSTME SVKM's NMIMS

Unacknowledged connectionless service Acknowledged connectionless service Acknowledged connection oriented service

Pintu R Shah MPSTME SVKM's NMIMS

Pintu R Shah MPSTME SVKM's NMIMS

Character count Flag bytes with byte stuffing Flag bytes with bit stuffing Physical layer coding violations

Pintu R Shah MPSTME SVKM's NMIMS

10

A character stream. (a) Without errors. (b) With one error.

Pintu R Shah MPSTME SVKM's NMIMS

11

(a) A frame delimited by flag bytes. (b) Four examples of byte sequences before and after stuffing.
Pintu R Shah MPSTME SVKM's NMIMS 12

Bit stuffing (a) The original data. (b) The data as they appear on the line. (c) The data as they are stored in receivers memory after destuffing.
Pintu R Shah MPSTME SVKM's NMIMS 13

Types of Errors Hamming distance Error Detection


Parity Checksum CRC
Single bit error Burst error

Error correction
Hamming code

Pintu R Shah MPSTME SVKM's NMIMS

14

Pintu R Shah MPSTME SVKM's NMIMS

15

Pintu R Shah MPSTME SVKM's NMIMS

16

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

1. The Hamming distance d(000, 011) is 2 because 2. The Hamming distance d(10101, 11110) is 3 because

Pintu R Shah MPSTME SVKM's NMIMS

17

To guarantee the detection of up to e errors in all cases, the minimum Hamming distance in a block code must be dmin = e + 1. To guarantee correction of up to e errors in all cases, the minimum Hamming distance in a block code must be dmin = 2e + 1.

Pintu R Shah MPSTME SVKM's NMIMS

18

A code scheme has a Hamming distance dmin = 4. What is the error detection and correction capability of this scheme? Solution This code guarantees the detection of up to three errors 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, . . . ).
Pintu R Shah MPSTME SVKM's NMIMS

19

A simple parity-check code is a single-bit error-detecting code in which n = k + 1 with dmin = 2.

Pintu R Shah MPSTME SVKM's NMIMS

20

Pintu R Shah MPSTME SVKM's NMIMS

21

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

Pintu R Shah MPSTME SVKM's NMIMS

22

Two-dimensional parity-check code

Pintu R Shah MPSTME SVKM's NMIMS

23

Two-dimensional parity-check code

Pintu R Shah MPSTME SVKM's NMIMS

24

Two-dimensional parity-check code

Pintu R Shah MPSTME SVKM's NMIMS

25

Divide the data into segments of n bits Add all segment using ones complement addition to get the sum Complement the sum to get checksum Checksum is sent along with the data At the receiving side, sum is calculated again. If the sum is zero, there is no error.

Pintu R Shah MPSTME SVKM's NMIMS

26

10100101 00100110 01010101 10101010 00100100 Sum is 10011100 Checksum is 01100011

11100010 11001100

Pintu R Shah MPSTME SVKM's NMIMS

27

Calculation of the polynomial code checksum.

Pintu R Shah MPSTME SVKM's NMIMS

28

Pintu R Shah MPSTME SVKM's NMIMS

29

Use of a Hamming code to correct burst errors.

Pintu R Shah MPSTME SVKM's NMIMS

30

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.

Pintu R Shah MPSTME SVKM's NMIMS

31

An

Unrestricted Simplex Protocol A Simplex Stop-and-Wait Protocol A Simplex Protocol for a Noisy Channel

Pintu R Shah MPSTME SVKM's NMIMS

32

Physical layer, DLL and network layer are independent processes that communicate by passing message back and forth. Machine A has a long stream of data to be transmitted to Machine B using reliable connection oriented service.

Pintu R Shah MPSTME SVKM's NMIMS

33

Continued

Some definitions needed in the protocols to follow. These are located in the file protocol.h.
Pintu R Shah MPSTME SVKM's NMIMS 34

Some definitions needed in the protocols to follow.

Pintu R Shah MPSTME SVKM's NMIMS

35

Pintu R Shah MPSTME SVKM's NMIMS

36

Pintu R Shah MPSTME SVKM's NMIMS

37

Pintu R Shah MPSTME SVKM's NMIMS

38

Pintu R Shah MPSTME SVKM's NMIMS

39

Assume that, in a Stop-and-Wait ARQ system, the bandwidth of the line is 1 Mbps, and 1 bit takes 20 ms to make a round trip. What is the bandwidth-delay product? If the system data frames are 1000 bits in length, what is the utilization percentage of the link?

Pintu R Shah MPSTME SVKM's NMIMS

40

BW delay product is
The system can send 20,000 bits during the time it takes for the data to go from the sender to the receiver and then back again. However, the system sends only 1000 bits. We can say that the link utilization is only 1000/20,000, or 5 percent. For this reason, for a link with a high bandwidth or long delay, the use of Stop-and-Wait ARQ wastes the capacity of the link.

Pintu R Shah MPSTME SVKM's NMIMS

41

What is the utilization percentage of the link in Example 1 if we have a protocol that can send up to 15 frames before stopping and worrying about the acknowledgments?

Pintu R Shah MPSTME SVKM's NMIMS

42

The bandwidth-delay product is still 20,000 bits. The system can send up to 15 frames or 15,000 bits during a round trip. This means the utilization is 15,000/20,000, or 75 percent. Of course, if there are damaged frames, the utilization percentage is much less because frames have to be resent.

Pintu R Shah MPSTME SVKM's NMIMS

43

One-Bit Sliding Window Protocol A Protocol Using Go Back N A Protocol Using Selective Repeat

Pintu R Shah MPSTME SVKM's NMIMS

44

A sliding window of size 1, with a 3-bit sequence number. (a) Initially. (b) After the first frame has been sent. (c) After the first frame has been received. (d) After the first acknowledgement has been received.
Pintu R Shah MPSTME SVKM's NMIMS 45

Pipelining and error recovery. Effect on an error when (a) Receivers window size is 1. (b) Receivers window size is large.
Pintu R Shah MPSTME SVKM's NMIMS

46

(a) Initial situation with a window size seven. (b) After seven frames sent and received, but not acknowledged. (c) Initial situation with a window size of four. (d) After four frames sent and received, but not acknowledged.
Pintu R Shah MPSTME SVKM's NMIMS 47

Vous aimerez peut-être aussi