Data Link Control (DLC)
Data Link Control (DLC)
Data Link Control (DLC)
Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
11-1 DLC SERVICES
11.2
111.11.2 Flow and Error Control
11.3
Figure 111.5: Flow control at the data link layer
11.4
11-2 DATA-LINK LAYER PROTOCOLS
11.5
Figure 111.6: FSMs
11.6
111.2.1 Simple Protocol
11.7
Figure 111.7: Simple protocol
11.8
Figure 111.8: FSM for the simple protocol
11.9
Example 111.2
Figure 111.9 shows an example of communication using
this protocol. It is very simple. The sender sends frames one
after another without even thinking about the receiver.
11.10
Figure 111.9: Flow diagram for Example 111.2
11.11
111.2.2 Stop-and-Wait Protocol
11.12
Figure 111.10: Stop-and-wait Protocol
11.13
Figure 111.11: FSM for the stop-and-wait protocol
11.14
Example 111.3
Figure 111.12 shows an example. The first frame is sent and
acknowledged. The second frame is sent, but lost. After
time-out, it is resent. The third frame is sent and
acknowledged, but the acknowledgment is lost. The frame is
resent. However, there is a problem with this scheme. The
network layer at the receiver site receives two copies of the
third packet, which is not right. In the next section, we will
see how we can correct this problem using sequence
numbers and acknowledgment numbers.
11.15
Figure 111.12: Flow diagram for Example 111.3
11.16
Example 111.4
Figure 111.13 shows how adding sequence numbers and
acknowledgment numbers can prevent duplicates. The first
frame is sent and acknowledged. The second frame is sent,
but lost. After time-out, it is resent. The third frame is sent
and acknowledged, but the acknowledgment is lost. The
frame is resent.
11.17
Figure 111.13: Flow diagram for Example 111.4
11.18
111.2.3 Piggybacking
11.19
Sliding window protocol
Sliding window protocols apply Pipelining :
Go-Back-N ARQ
Selective Repeat ARQ
Sliding window protocols improve the efficiency
multiple frames should be in transition while
waiting for ACK. Let more than one frame to be
outstanding.
Outstanding frames: frames sent but not
acknowledged
We can send up to W frames and keep a copy of
these frames(outstanding) until the ACKs arrive.
This procedures requires additional feature to be
added :sliding window
Figure 23.13: Sliding window in linear format
23.21
23-2 TRANSPORT-LAYER PROTOCOLS
23.23
Figure 23.23: Go-Back-N protocol
23.24
Figure 23.24: Send window for Go-Back-N
23.25
Figure 23.25: Sliding the send window
Sliding direction
23.26
Figure 23.26: Receive window for Go-Back-N
23.27
Figure 23.27: FSMs for the Go-Back-N protocol
23.28
Figure 23.28: Send window size for Go-Back-N
23.29
Example 23.7
Figure 23.29 shows an example of Go-Back-N. This is an
example of a case where the forward channel is reliable, but
the reverse is not. No data packets are lost, but some ACKs
are delayed and one is lost. The example also shows how
cumulative acknowledgments can help if acknowledgments
are delayed or lost.
23.30
Figure 23.29: Flow diagram for Example 3.7
23.31
Example 23.8
Figure 23.30 shows what happens when a packet is lost.
Packets 0, 1, 2, and 3 are sent. However, packet 1 is lost.
The receiver receives packets 2 and 3, but they are discarded
because they are received out of order (packet 1 is
expected). When the receiver receives packets 2 and 3, it
sends ACK1 to show that it expects to receive packet 23.
However, these ACKs are not useful for the sender because
the ackNo is equal to Sf, not greater that Sf . So the sender
discards them. When the time-out occurs, the sender resends
packets 1, 2, and 3, which are acknowledged.
23.32
Figure 23.30: Flow diagram for Example 3.8
23.33
23.2.4 Selective-Repeat Protocol
23.34
Figure 23.31: Outline of Selective-Repeat
23.35
Figure 23.32: Send window for Selective-Repeat protocol
23.36
Figure 23.33: Receive window for Selective-Repeat protocol
23.37
Example 23.9
Assume a sender sends 6 packets: packets 0, 1, 2, 3, 4, and
5. The sender receives an ACK with ackNo = 3. What is the
interpretation if the system is using GBN or SR?
Solution
If the system is using GBN, it means that packets 0, 1, and 2
have been received uncorrupted and the receiver is
expecting packet 3. If the system is using SR, it means that
packet 3 has been received uncorrupted; the ACK does not
say anything about other packets.
23.38
Figure 23.34: FSMs for SR protocol
23.39
Example 23.10
This example is similar to Example 23.8 (Figure 23.30) in
which packet 1 is lost. We show how Selective-Repeat
behaves in this case. Figure 3.35 shows the situation.
23.40
Example 23.10 (continued)
At the receiver site we need to distinguish between the
acceptance of a packet and its delivery to the application
layer. At the second arrival, packet 2 arrives and is stored
and marked (shaded slot), but it cannot be delivered because
packet 1 is missing. At the next arrival, packet 3 arrives and
is marked and stored, but still none of the packets can be
delivered. Only at the last arrival, when finally a copy of
packet 1 arrives, can packets 1, 2, and 3 be delivered to the
application layer. There are two conditions for the delivery
of packets to the application layer: First, a set of consecutive
packets must have arrived. Second, the set starts from the
beginning of the window.
23.41
Figure 23.35: Flow diagram for Example 3.10
23.42
Figure 23.36: Selective-Repeat, window size
23.43