Data Link Control
Data Link Control
11.1 Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
11-1 FRAMING
frame trailer.
11.2
Packets and Frames
11.7
Figure 11.2 Byte stuffing and unstuffing
11.8
Note
11.9
Figure 11.3 A frame in a bit-oriented protocol
11.10
Note
11.11
Figure 11.4 Bit stuffing and unstuffing
11.12
11-2 FLOW AND ERROR CONTROL
11.13
Note
11.14
Note
11.15
11-3 PROTOCOLS
11.16
Flow control refers to a set of procedures used to
restrict the amount of data that the sender can
send before waiting for acknowledgment.
11.17
11-4 NOISELESS CHANNELS
11.19
Stop-and-Wait Protocol
If data frames arrive at the receiver site faster than they
can be processed, the frames must be stored until their
use.
In Stop-and-Wait Protocol the sender sends one frame,
stops until it receives confirmation from the receiver and
then sends the next frame.
This simple flow control will break down if ACK gets lost or
errors occur sender may wait for ACK that never arrives
Sending two frames in the protocol involves the sender in
four events and the receiver in two events.
Figure 11.8 Design of Stop-and-Wait Protocol
11.21
Figure 11.9 Flow diagram for Example 11.2
11.22
11-5 NOISY CHANNELS
Noiseless channels are nonexistent.
Stop-and-Wait Automatic Repeat Request
Go-Back-N Automatic Repeat Request
Selective Repeat Automatic Repeat Request
Stop-and-Wait Automatic Repeat Request
1)Error correction in Stop-and-Wait ARQ is done by keeping a
copy of the sent frame and retransmitting of the frame when
the timer expires.
2)In Stop-and-Wait ARQ, we use sequence numbers to
number the frames. The sequence numbers are based on
modulo-2 arithmetic.
3)In Stop-and-Wait ARQ, the acknowledgment number always
announces in modulo-2 arithmetic the sequence number of
the next frame expected.
11.23
Figure 11.10 Design of the Stop-and-Wait ARQ Protocol
11.24
Example 11.3
11.25
Figure 11.11 Flow diagram for Example 11.3
11.26
The sender needs to wait for the ACK after every frame it
transmits. This is a source of inefficiency, and is particularly
bad when the propagation delay is much longer than the
transmission delay.
11.27
Performance
One important issue in networking is the performance of the
network—how good is it?
In networking, we use the term bandwidth in two contexts.
11.28
A link may have a bandwidth of B bps, but we can only
send T bps through this link with T always less than B.
In other words, the bandwidth is a potential
measurement of a link; the throughput is an actual
measurement of how fast we can send data.
Latency (Delay)
The latency or delay defines how long it takes for an
11.29
Propagation Time
Propagation time measures the time required for a bit to
travel from the source to the destination.
Propagation time = Distance / Propagation speed
Transmission Time
Time between the first bit leaving the sender and the last
bit arriving at the receiver. The first bit leaves earlier and
arrives earlier; the last bit leaves later and arrives later.
The time required for transmission of a message depends
on the size of the message and the bandwidth of the
channel.
Transmission Delay = Message size/bandwidth bps
Bandwidth-Delay Product
The bandwidth-delay product defines the number of bits that
can fill the link.
11.31
Example 11.4
Solution
The bandwidth-delay product is
11.32
Example 11.4 (continued)
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.
11.33
Example 11.5
Solution
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
11.34
Disadvantage of Stop-and-Wait
• This is not a good use of transmission
medium.
• To improve efficiency, multiple frames
should be in transition while waiting for
ACK.
• Two protocol use the above concept,
– Go-Back-N ARQ
– Selective Repeat ARQ
Go-Back-N Automatic Repeat Request
In the Go-Back-N Protocol, the sequence numbers are
modulo 2m, where m is the size of the sequence number
field in bits.
The send window can slide one or more slots when a
valid acknowledgment arrives.
11.37
Figure 11.13 Receive window for Go-Back-N ARQ
11.38
Figure 11.14 Design of Go-Back-N ARQ
11.39
Figure 11.15 Window size for Go-Back-N ARQ
11.40
Acknowledgement
Receiver sends positive ACK if a frame arrived safe and in order.
If the frames are damaged/out of order, receiver is silent and
discard all subsequent frames until it receives the one it is
expecting.
The silence of the receiver causes the timer of the
unacknowledged frame to expire.
Then the sender resends all frames, beginning with the one with
the expired timer.
For example, suppose the sender has sent frame 6, but the
timer for frame 3 expires (i.e. frame 3 has not been
acknowledged), then the sender goes back and sends frames 3,
4, 5, 6 again. Thus it is called Go-Back-N-ARQ
The receiver does not have to acknowledge each frame
received, it can send one cumulative ACK for several frames.
Go-Back-N ARQ, normal operation
• The sender keeps track of the outstanding frames and updates the variables and windows as the
ACKs arrive.
Go-Back-N ARQ, lost frame
• Frame 2 is lost
receives frame 3, it
discards frame 3 as it is
expecting frame 2
(according to window).
to 2)
Example 11.6
Figure 11.16 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 frames 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. After initialization,
there are seven sender events. Request events are
triggered by data from the network layer; arrival events
are triggered by acknowledgments from the physical
layer. There is no time-out event here because all
outstanding frames are acknowledged before the timer
expires. Note that although ACK 2 is lost, ACK 3 serves
as both ACK 2 and ACK 3.
11.44
Figure 11.16 Flow diagram for Example 11.6
11.45
Example 11.7
11.47
Figure 11.17 Flow diagram for Example 11.7
11.48
Figure 11.18 Send window for Selective Repeat ARQ
11.49
Piggybacking
Stop-and-Wait discussed so far was
‘unidirectional’ in ‘bidirectional’ communications,
both parties send & acknowledge data, i.e. both
parties implement flow control
piggybacking method: outstanding ACKs are
placed in the header of information frames
piggybacking can save bandwidth since the
overhead from a data frame and an ACK frame
(addresses, CRC, etc) can be combined into just
one frame
11.50
Figure 11.19 Receive window for Selective Repeat ARQ
11.51
Figure 11.20 Design of Selective Repeat ARQ
11.52
Note
11.53
Figure 11.22 Delivery of data in Selective Repeat ARQ
11.54
Example 11.8
11.57
Example 11.8 (continued)
The next point is about the ACKs. Notice that only two
ACKs are sent here. The first one acknowledges only the
first frame; the second one acknowledges three frames. In
Selective Repeat, ACKs are sent when data are delivered to
the network layer. If the data belonging to n frames are
delivered in one shot, only one ACK is sent for all of them.
11.58
Figure 11.23 Flow diagram for Example 11.8
11.59
Selective Repeat ARQ, sender and receiver windows
• Go-Back-N ARQ simplifies the process at the receiver site. Receiver only keeps
track of only one variable, and there is no need to buffer out-of-order frames, they
• In Selective Repeat ARQ, only the damaged frame is resent. More bandwidth
11.61