Lecture#1_Data Link Control_Part I
Lecture#1_Data Link Control_Part I
Lecture 1: Chapter 11
Data Link Control
Sumaya Kazary
Assistant Professor
Department of Computer Science and Engineering
Dhaka University of Engineering & Technology, Gazipur
Acknowledgement
Thanks to the authors of all the books and online tutorials used in this slide.
Framing
2
➢ This study deals with the algorithms for achieving
reliable &efficient communication.
3
4
11-1 FRAMING
5
11-1 FRAMING
6
7
8
9
10
Note
11
Example : Byte stuffing
12
Figure 11.2 Byte stuffing and unstuffing
Sx
Rx
13
(0x7E)
15
Figure 11.4 Bit stuffing and unstuffing
Sx
Rx
16
11-2 FLOW AND ERROR CONTROL
17
18
19
11-3 PROTOCOLS
➢ Now let us see 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.
➢ To make our discussions language-free, we have
written in pseudocode a version of each protocol that
concentrates mostly on the procedure instead of
delving into the details of language rules.
11.20
Figure 11.5 Taxonomy of protocols discussed in this chapter
Sliding Window
Protocols
11.21
11-4 NOISELESS CHANNELS
11.22
23
Figure 11.6 The design of the simplest protocol with no flow or error control
11.24
Algorithm 11.1 Sender-site algorithm for the simplest protocol
11.25
26
2.
27
Stop-and-wait Protocol
Sender Receiver
Frame
Acknowledgement
Frame
Acknowledgement
Frame
Acknowledgement
28
Problems of Stop-and-wait Protocol
1. Problems Due to lost data !!!
➢Sender waits for ack for an infinite amount of time.
➢Receiver waits for data an infinite amount of time.
Sender Receiver
Frame
29
Problems of Stop-and-wait Protocol
2. Problems due to lost Acknowledgement !!!
➢ Sender waits for an infinite amount of time for ack.
Sender Receiver
Data
Acknowledgement
30
Problems of Stop-and-wait Protocol
3. Problems due to delayed Ack/data !!!
➢ After timeout on sender side, a delayed ack might
be wrongly considered as ack of some other data packet.
Sender Receiver
Data
Acknowledgement
31
Figure 11.8 Design of Stop-and-Wait Protocol
11.32
33
11-5 NOISY CHANNELS
11.34
1. Stop-and-Wait ARQ Overview
◼ Sender waits “reasonable” amount of time for ACK
◼ Thus Sender needs a countdown timer
period
◼ If Frame (or ACK) just delayed (not lost):
◼ retransmission will create duplicate packet
number to be used
◼ Only two numbers are used: 0, 1
Frame 0
Timer Starts
Acknowledgement 1
Frame 1
37
Stop-and-wait ARQ Protocol
Scenario 2:The original frame is lost
Sender Receiver
Frame 0
Timeout
Frame 0
Timer Acknowledgement 1
38
Stop-and-wait ARQ Protocol
Scenario 3:The Ack is lost
Sender Receiver
Frame 0
Timeout
Ack 1
Frame 0
Timer Ack 1
39
Stop-and-wait ARQ Protocol
Scenario 4:The timeout fires too soon
Sender Receiver
Frame 0
Timeout
Ack 1
Frame 0
Timer
Ack 1
40
Figure 11.10 Design of the Stop-and-Wait ARQ Protocol
11.41
Example 11.3
Figure 11.11 shows an example of Stop-and-Wait ARQ. Frame 0 is sent and
acknowledged. Frame 1 is lost and resent after the time-out. The resent frame 1
is acknowledged and the timer stops. Frame 0 is sent and acknowledged, but the
acknowledgment is lost. The sender has no idea if the frame or the
acknowledgment is lost, so after the time-out, it resends frame 0, which is
acknowledged.
11.42
Stop-and-wait operation
sender receiver
first packet bit
transmitted, t = 0
11.44
Q&A