0% found this document useful (0 votes)
0 views25 pages

Data Link

The document provides an overview of the Data Link Layer, detailing its responsibilities such as framing, physical addressing, flow control, and error control. It discusses various protocols for both noiseless and noisy channels, including Stop-and-Wait, Go-Back-N, and Selective Repeat ARQ, along with their mechanisms for managing data transmission and error handling. Additionally, it covers HDLC as a bit-oriented protocol for communication, including its frame structure and operational phases.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
0 views25 pages

Data Link

The document provides an overview of the Data Link Layer, detailing its responsibilities such as framing, physical addressing, flow control, and error control. It discusses various protocols for both noiseless and noisy channels, including Stop-and-Wait, Go-Back-N, and Selective Repeat ARQ, along with their mechanisms for managing data transmission and error handling. Additionally, it covers HDLC as a bit-oriented protocol for communication, including its frame structure and operational phases.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 25

13/04/2023

Data Link Layer

Responsible for transmitting frames


from one node to the next

 Duties/services
 Framing
 Physical addressing
 Flow control: hop-to-hop
 Error control: hop-to-hop

2.1

Data Link Layer

from Network to Network

Data Data

Data Link T2 Data H2 T2 Data H2


Layer (frame)

to Physical from Physical

2.2

2
13/04/2023

Data Link Layer

A3, 3B, 82, 9F, ... are physical addresses

Data
9F 3B 82 A3

T2 Data 9F A3
H2

2.3

Framing
 Process of wrapping data with certain info before
sending out

 A frame typically consists of


 Flag: indication for start and end of a frame
 Header: source/destination addresses, as well as other
control information, such as sequence number
 Data from the upper layer
 Trailer: error detection/correction code

4
13/04/2023

Data Link Layer


Data 1.1 5.7

1.1 1.2
97 32 Network 1
Data 1.1 5.7 97 25 25
R1
B1
79 Data 1.1 5.7 79 62 Network 6

6.6 6.3 62
12
R3
R2 5.2
54
88
3.3
Data 1.1 5.7 54 74
Network 5
5.7
Network 3 74
3.8

Flow and error control

Two 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

6
13/04/2023

Taxonomy of data link protocols

Noiseless channels

Let us first assume we have an ideal channel in which


no frames are lost, duplicated, or corrupted.

We introduce the following two protocols for this type


of channel.
Simplest Protocol
Stop-and-Wait Protocol

8
13/04/2023

Simplest protocol with no flow or error control

Timing diagram for the simplest protocol

10
13/04/2023

Stop-and-Wait Mechanism

 Still noiseless channel


 Receiver has limited buffer
 Requires flow control
 Sender sends one frame at a time and wait for
an acknowledgment

11

11

Stop-and-Wait Protocol

12
13/04/2023

Timing diagram of the Stop-and-Wait protocol

Sender Receiver

S=0 R=0
Deliver

S=1 R=1

Deliver
R=0

Time Time

13

13

Noisy Channel

 Realistic
 Error can and will happen
 Require error control
 Three protocols:
 Stop-and-Wait ARQ
 Go-Back-N ARQ
 Selective Repeat ARQ

14

14
13/04/2023

Stop-and-Wait ARQ

 Sender keeps a copy of sent frame until


successful delivery is ensured
 Receiver responds with an ack when it
successfully receives a frame
 Both data and ack frames must be numbered
 When sender does not receive an ack within
certain time, it assumes frame is lost, then
retransmits the same frame.

15

15

Stop-and-Wait ARQ

16

16
13/04/2023

Timing Diagram: Normal Operation

Sender Receiver

S=0 R=0
Deliver

S=1 R=1

Deliver
R=0

Time Time

17

17

Timing Diagram: Lost Frame


Sender Receiver

S=0 R=0
Deliver

S=1 R=1

Timeout

Deliver
R=0

Time Time
18

18
13/04/2023

Timing Diagram: Lost ACK


Sender Receiver

S=0 R=0
Deliver

S=1 R=1

Deliver

Timeout R=0
S=1
Frame 0 expected;
discard

R=0
S=0

Time Time
19

19

Timing Diagram: Delayed ACK


Sender Receiver

S=0 R=0
Deliver

Timeout R=1
Frame 1 expected;
discard
S=1
R=1
Timeout

Deliver
R=0
S=0
20

20
13/04/2023

Bidirectional Transmission

 Data are transferred both ways


 ACK are "piggybacked" with data frames

21

21

Go-Back-N ARQ
 Allows multiple frames to be sent before waiting for
ACK
 These frames must be numbered differently
 Frame numbers are called Sequence numbers
 Frame header contains m bits for the sequence number,
which allows up to 2m different frame numbers
 Frames must be received in the correct order
 If a frame is lost, the lost frame and all of the
following frames must be retransmitted

22

22
13/04/2023

Go-Back-N ARQ: Window


 Frame header contains m bits for sequence number
 That allows up to 2m different frame numbers
• Four variables are used:
• Sf = first frame not acknowledged (outstanding)
• Sn= next frame to send
• SSIZE= send window size
• Rn= next frame expected
• The send window can slide one or more slots when a
valid acknowledgment arrives

23

23

Go-Back N: Send window


 Sending more than one frame at once requires
sender to buffer multiple frames
 Known as "sending window"
 Any of these frames in the window can be lost

Question: in this example, what is the value of m?

24

24
13/04/2023

Go-Back N: Window updates

 Once the first frames in the window is ACKed


 ACKed frames are removed from the buffer
 More frames are transmitted
 Result: The window slides to the right

25

25

Go-Back N: Receiver´s Window operation


 Receiver expects one frame at a time

26

26
13/04/2023

Go-Back-N: Lost ACK

Note: in this example m = 3


27

Go-Back-N: Lost Frame

Note: in this example m = 3


28
13/04/2023

Go-Back-N: Window Sizes

 For m-bit sequence numbers


 Send window size, Ssize : at most 2m-1
 Up to 2m-1 frames can be sent without ACK
 Receive window size: 1
 Frames must be received in order

29

29

Lost ACK: Window Size < 2m

In this example, what is the value of m?


30

30
13/04/2023

 Thinking Corner
 What is a problem if send window is
greater than 2m-1?

31

31

Lost ACK: Window Size = 2m

32

32
13/04/2023

 Thinking Corner
 Stop-and-Wait is a special case of Go-
Back-N.
 What is the send window size in Stop-and-
Wait?

33

33

Selective Repeat ARQ

 Go-Back-N always discards out-of-order


frames
 Losing one frame may result in retransmission
of multiple frames
 Very inefficient in noisy link
 Selective Repeat ARQ allows frames to be
received out of order
 Therefore, receive window > 1

34

34
13/04/2023

Selective Repeat - Send and Receive Windows

 Sender and receiver share window space


equally
 For m-bit sequence numbers
 Send window: up to 2m-1
 Receive window: up to 2m-1

35

35

Selective- Repeat: Send Window


 Sending more than one frame at once requires sender to
buffer multiple frames
 Selective Repeat allows the retransmission of any frame
already sent, but not acknowledged

36

36
13/04/2023

Receive Window

 Selective Repeat ARQ allows frames to be


received out of order
 Therefore, receive window > 1

37

37

Selective-Repeat

38

38
13/04/2023

Selective Repeat: Window Size


The window size is should be at most equal to 2m-1

39

39

Selective Repeat: Window Size


The window size should not be greater than 2m-1

40

40
13/04/2023

HDLC

High-level Data Link Control (HDLC) is a bit-


oriented protocol for communication over point-to-
point and multipoint links. It implements the ARQ
mechanisms.
Configurations and Transfer Modes
Frames
Control Field

11.41
41

Normal response mode

42
13/04/2023

Asynchronous balanced mode

43

HDLC frames
Bit stuffing: avoid a flag in data = 011111010

FLAG = 01111110

44
13/04/2023

Control field format for the different frame types

45

Control Field Code

 S-Frame:
 RR – 00, RNR – 10, REJ – 01, SREJ – 11

 U-Frame:
 SABM – 11 100, UA – 00 110, DISC – 00 010

46
13/04/2023

U-frame control command and response

47

HDLC Operation

 consists of exchange of information, supervisory


and unnumbered frames
 have three phases
 initialization
 by either side, set mode & sequence number
 data transfer
 with flow and error control
 using both I & S-frames (RR, RNR, REJ, SREJ)
 disconnect
 when ready or fault noted

48
13/04/2023

HDLC Operation Example

49

HDLC Operation Example

50

You might also like