7.flow and Error Control - Express Learning - Data Communications and Computer Networks
7.flow and Error Control - Express Learning - Data Communications and Computer Networks
PREV NEXT
⏮ ⏭
Unit III - Data Link Layer 8. Media Access Control
🔎
Ans: Flow control and error control are the most important functions of
data link layer. Flow control refers to a set of procedures that allows the
communicating devices having different speed and memory
characteristics to communicate with each other in an efficient manner. It
ensures that a slow receiver is not being flooded by the fast sender. Thus,
flow control restricts the amount of data that can be sent from the sender
before waiting to receive an acknowledgement (ACK) from the receiver.
Each receiver has a block of memory known as buffer for reserving the
incoming data before they can get processed. The flow control mechanism
can be achieved in two ways. First, if the receiver's end buffer begins to fill
up, then the receiver should tell the sender either to stop the transmission
completely or send fewer frames. Second, the receiver must acknowledge
the received frames by sending ACK frame to the sender. For the frames,
which are damaged or lost during transmission, the receiver should send
negative acknowledgement (NACK) to the sender by transmitting NACK
frame. Two basic protocols that can be used to control the flow of data
include stop-and-wait and sliding window protocol.
Mostly, the sender breaks the large block of data into smaller blocks called
frames because sending the message in the larger blocks may increase the
transmission time and errors are more likely to occur. In contrast, when
message is transmitted in smaller frames, errors may be detected earlier
and a smaller amount of data needs to be transmitted. Another reason of
breaking into frames may be the limited buffer size of the receiver due to
which entire large frame cannot be processed at a single time, thus
causing long delays. But the disadvantage of sending small frames for a
single message is that stop-and-wait method cannot be used effectively
because in this protocol only one frame can be sent at a time (either from
sender to receiver or vice versa) which results in underutilization of the
communication link.
Link Utilization
a = tprop/tframe
If a < 1 then tprop< tframe, which implies that the frame is longer enough
such that the leading bits of frame reach the receiver before the entire
frame is transmitted. That is, link is inefficiently utilized. On the other
hand, if a > 1, then tprop > tframe, which implies that the sender has
transmitted the entire frame and the leading bits of that frame have still
not arrived at the receiver. This results in underutilization of the link.
T = nTF
where
tprop + tframe + tproc is the total time taken by the station 1 to send the
frame and getting it processed at the receiver's end and tprop + tack + tproc
is the total time taken by the station 2 to send the ACK frame and getting
it processed by the sender.
Assuming that the processing time is negligible and the ACK frame is very
small as compared to the data frame, we can neglect tproc and tack. Thus, T
can be written as
T = n(2tprop + tframe)
As n*tframe is the time that is actually involved in sending the frames and
rest is considered as overhead, the link utilization (U) may be given as
⇒ U = 1/(1 + 2a)
where L is the length of the frame in bits and R is the data rate of
transmission. Therefore,
options.⇒ a = B/L
Hence, a∝B
At any instant, B can also ask A to stop the flow of frames by sending a
receive-not-ready (RNR) message which acknowledges the former
frames and indicates the sender not to transmit more frames. For
example, an RNR 3 message from B means that it has received all frames
up to number 2 and cannot accept any further frames. Later, B must send
a normal ACK to A to restart the transmission process.
To keep track of the frames to be sent or received, the sender and receiver
maintain a list of sequence numbers called the sender's window and
receiver's window (indicated by the boxes in Figure 7.2), respectively.
The sender's window indicates the sequence numbers of the frames that
the sender can send while the receiver's window indicates the sequence
numbers of the frames that the receiver is expecting to receive. For
example, in Figure 7.2, the initial window of A and B indicates that A can
transmit frames numbered from 0 to 6 without having to wait for any
ACK from B and B can receive frames numbered from 0 to 6 from A,
respectively. As the frames are sent or received at the sender's and
receiver's end respectively, the window size shrinks. For example, after
transmitting frames F0, F1, F2 and F3, the size of A's window shrinks to
three frames and after receiving frames F0, F1, F2 and F3, the size of B's
window shrinks to three frames (Figure 7.2). Similarly, the window size
expands as the ACKs are received or sent by the sender and receiver,
respectively. Therefore, the scheme is named as sliding window flow
control.
Find answers on the fly, or master something new. Subscribe today. See pricing
options.
Figure 7.2 Sliding Window Flow Control
Notice that at A's end in Figure 7.2, the frames between the vertical line
and the box indicate those frames that have been sent but not yet
acknowledged by B. Similarly, at B's end, the frames between the vertical
line and the box indicate those frames which have been received but not
yet acknowledged.
As each sequence number used occupies some field in the frame, the
range of sequence number that can be used gets limited. In general, for a
k
k-bit field, the range of sequence number will be from 0 to 2 - 1 and
k k
frames will be numbered as modulo 2 . That is, after sequence number 2
- 1, the next number again will be 0. For example, for a 3-bit sequence
number, the frames will be numbered sequentially from 0 to 7 and the
3
maximum window size will be 7 (2 – 1). Thus, seven frames can be
accommodated in the sender's window and the receiver can also receive a
maximum of seven frames at a time.
Link Utilization
In sliding window flow control, the link utilization (U) depends on the
window size (N) and propagation delay (a) and is expressed as
Ans: Usually, the link used between the communicating devices is full
duplex and both the sender and receiver need to exchange data. In
addition to data, both sender and receiver send ACK for the received data
to each other. To improve the efficiency in a two-way transmission, a
technique called piggybacking can be employed, which permits an ACK
from either device (sender or receiver) to be assembled with the next
outgoing data frame from that device instead of sending a separate ACK
frame. In case a device has only ACK but no data to send, it needs to use a
separate ACK frame. However, if the device has to send the ACK followed
by data, it can temporarily withhold the ACK and later, include the ACK in
the outgoing data frame.
By temporarily delaying the outgoing ACKs and sending them along with
data frames, piggybacking results in better use of the available channel
bandwidth. Moreover, by using piggybacking technique, less number of
frames needs to be sent which further implies less number of interrupts as
well as less number of buffers required at the receiver's end. ⬆
7. What is meant by lost frame and damaged frame? List the
options.
Ans: A frame that fails to arrive at the destination node due to noise burst
is called lost frame. In this case, the receiver does not know that the
frame has been transmitted by the sender. A damaged frame is the
frame in which some bits have been changed or altered during the
transmission. In case of lost frame, no frame is received by the receiver
while in case of damaged frame, a frame is received but not in the exact
order.
Notice that the ACK will not be received by the sender if the frame has
been lost during the transmission, that is, it has not been received by the
receiver or if the receiver has received the frame free of errors but its ACK
has been lost or delayed during the transmission. In both cases, the
sender needs to retransmit the frame. For this, the sender maintains a
copy of sent data frame in its buffer so that they can be retransmitted
whenever required.
Now, consider the case where the receiver receives the frame with no
errors and therefore, sends an ACK to the sender but the ACK frame is
lost or delayed. In both scenarios, the sender retransmits the same frame
after the time-out. This results in the duplication of frames at the
receiver's end. To identify the duplicate frames, the receiver maintains a
buffer at its end hold those frames for which ACK has been sent.
Link Utilization
U =(1 - p)/(1+2a) ⬆
where
Find answers on thep isfly, or master something new. Subscribe today. See pricing
the probability of receiving a bit in error
options.
a is the propagation delay which is also equal to (tprop*R)/L where tprop, R
and L denotes propagation time, data rate of the link and number of bits
in the frame, respectively.
9. What are the two types of sliding window ARQ error control?
Ans: To provide the efficient utilization of the link, the sliding window
error control technique is adopted. The sliding window ARQ is also
known as continuous ARQ because it allows the sender to send many
frames continuously without waiting for an ACK. There are two
techniques, namely, Go-back-N ARQ and selective-reject ARQ that are
based on the concept of sliding window.
Ans: Go-back-N ARQ is the most commonly used form of error control
that is based on the sliding window flow control. In this technique, the
sender sends the data frames depending on its window size but at the
receiving end window size is always one. That is, the sender can send
many frames without waiting for an ACK from the receiver but the
receiver can receive only one frame at a time. For each frame that is
received without any error, the receiver acknowledges the frames by
sending RR message. However, when it detects error in the frame, it
discards that frame and sends a negative acknowledgment reject (REJ)
to the sender. The receiver continues to discard the further transmitted
frames until the frame in error is received correctly. When the sender
receives an REJ, it retransmits the frame in error plus all the succeeding
frames that it has sent already.
Figure 7.3 shows the mechanism of Go-back-N ARQ where the sender's
window size is seven. That is, the sender can transmit frames F0-F6 to the
receiver without waiting for an ACK.
As shown in Figure 7.4, initially, the sender sends F0, which is received by
the receiver. In response the receiver sends RR1 frame to the sender and
slides its window to F1–F7. By the time the sender receives RR1, it has
transmitted F1 which is either lost or damaged during the transmission.
On receiving RR1, the sender transmits F2 and shrinks its window to F3–
F7. Though F1 and F2 have been transmitted, the sender stores them in
the buffer until they are acknowledged by the receiver. When the receiver
receives F2, it accepts F2 and stores in its buffer. It also comes to know ⬆
that F1 has not arrived. Thus, it sends SREJ1 to the sender to indicate the
retransmission of F1. Now, the receiver cannot send RR frame until it
Link Utilization
⬆
maintained at the receiver's end so that if some frame is not received in
proper order then the receiver can accept the rest incoming frames and
buffer them until that valid frame has been received. When all the data
frames are reached, the receiver arranges all frames in proper sequence
Find answers on theandfly,
sendsor master
them to the next something
upper layer. new. Subscribe today. See pricing
options.
Figure 7.4 shows the selective-reject ARQ mechanism where the window
size of both sender and receiver is seven. That is, the sender can transmit
frames F0-F6 to the receiver without waiting for an acknowledgement
and the receiver can also receive frames F0-F6.
As shown in Figure 7.3, initially, the sender sends F0. As the receiver's
window size is 1, the receiver accepts F0 and replies with RR1 to the
sender and slides its window to F1. By the time the sender receives RR1, it
has transmitted F1 which gets lost in the transmission. At the time the
sender receives RR1, it transmits F2 and slides its window from F3 to F7.
Though F1 and F2 have been transmitted, the sender stores them in the
buffer until they are acknowledged by the receiver. On receiving F2, the
receiver finds that F1 is still not received. Therefore, the receiver discards
F2 and sends REJ1 to the sender. Before the sender receives REJ1, it
transmits F3 which is also discarded by the receiver. When the sender
receives REJ1, it needs to retransmit F1, F2 and F3. First it sends F1,
which is accepted by the receiver and the receiver responds with RR2 to
the sender. This procedure continues until all the frames have been
transmitted.
Lost or Delayed RR
Link Utilization
1. when N ≥ 2a + 1, U = 1 - p and
Ans: The HDLC is the most commonly used data link protocol developed
by ISO. It supports both half-duplex and full-duplex communication lines
and switched or non-switched channels. That is why it has been widely
implemented throughout the world. It is a bit-oriented protocol that is
used to provide communication in point-to-point and multipoint
networks. Further, HDLC protocol implements the ARQ mechanism and
satisfies a variety of applications. In addition, HDLC defines three types of
stations, two types of link configuration and three modes of data transfer
to work in various possible network configurations.
Types of stations
Find answers on the fly, or master something new. Subscribe today. See pricing
Balanced Configuration: This type of configuration
consists of two oroptions.
more combined stations and
supports both full-duplex and half-duplex
transmissions.
Frame Structure
The first bit of the control field specifies the type of the frame. For an I-
frame, this bit is always set to zero. The next three bits comprise N(S)
subfield that defines the sequence number of the frame. As three bits are
defined for sequence number, the frames can be numbered from 0 to 7.
However, if the extended frame format in which the control field is of 16-
bits is used then N(S) field becomes larger. The next single bit after N(S)
is the P/F bit where P stands for poll and F stands for final. If P/F bit is
set to one, it means poll, that is, frame has been sent by a primary station
to a secondary station. On the other hand, if P/F bit is zero, it means final,
that is, frame has been sent by a secondary station to the primary station.
The last three bits in control field comprise the N(R) subfield that defines
an ACK number corresponding to received frame, which has been
piggybacked on the I-frame.
In an S-frame, the first two bits of the control field define the type of the
frame. For an S-frame, these bits are always set to 10. Since an S-frame
carries control information, the next two bits of the control field, called
code, indicate the type of control information being carried in an S-
frame. There can be four possible combinations of two bits and
accordingly, four types of ACKs that an S-frame may carry. These types
are as follows:
The next single bit after code bits is P/F bit having the same purpose as in
I-frame and the last three bits comprise N(R) subfield that defines
positive ACK number or NACK depending on the type of S-frame.
In U-frame, the first two bits specify the type of the frame. For a U-frame,
these bits are always set to 11. The next two bits before the P/F bit and the
last three bits following the P/F bit correspond to the code bits in the
control field. These five code bits together can create up to 32 different
types of U-frames.
17. Describe the services provided by the PPP protocol. Also, list ⬆
some services which PPP does not provide.
In order to keep PPP simple, some services have not been implemented in
PPP. These services are as follows:
Ans: The PPP is a byte-oriented protocol and uses an HDLC like frame
format (Figure 7.8). The description of each field in PPP frame is as
follows:
options.
address. This byte can be omitted upon an agreement
between two parties during negotiation.
Control: It is a one-byte long field that is set to a
constant value of 00000011, which indicates an
unnumbered frame. This implies that PPP does not
use sequence numbers and ACKs and thus, does not
provide reliable transmission. Though PPP does not
provide flow control and error control is also limited to
error detection only, the control field can also be
omitted if both parties agree to do so during
negotiation.
⬆
connection directly switches to network phase.
options.
The frame structure of LCP consists of various subfields, which are
described as follows:
22. Why CRC is always added in trailer and not in the header of
all data link protocols?
Ans: All data link protocols comprise a CRC field that stores the
checksum for error detection and correction. The CRC is calculated over
all the bits that are needed to be transmitted to the destination node and
added to the trailer of the outgoing data stream as soon as the last bit is
transmitted. If CRC is to be attached in the header part of the data stream,
then CRC has to be calculated before the transmission of the frame. This
would result in more overhead as each byte of frame needs to be handled
twice, once for computing CRC and then for transmission. On the other
hand, when CRC is put in the trailer, each byte of frame needs to be
handled only once, resulting in less overhead. That is why CRC is added in
the trailer and not in the header of data link protocols.
3
Bit rate, R = 4 kbps = 4 × 10 s
Let L denotes the size of frame, then transmission time of a frame (tframe)
can be given as
Given U ≥ 50%
⬆
From Eqs (1) and (2), we have
Find answers on the fly, or master something new. Subscribe today. See pricing
options.
Thus, for achieving at least 50% efficiency, the frame size should be at
least 160 bits.
24. If the window size is 15, give the sequence number of frames
in Go-back-N ARQ and selective-repeat ARQ.
m
Ans: In Go-back-N ARQ, the maximum window size is equal to 2 – 1
where m is the number of bits in the frame sequence number and the
m
frame sequence numbers range from 0 to 2 – 1. Here, given that
m
2 – 1 = 15
m
⇒2 = 16
m–1
In selective repeat ARQ, the maximum window size is equal to 2 and
m
the frame sequence numbers range from 0 to 2 – 1. Here, given that
m–1
2 = 15
m
⇒2 = 30
3
Ans: Given, bit rate (R) = 20 kbps = 20 × 10 bps
8
Propagation speed (V) = 2.8 × 10 m/s
tframe = L/R
3
= 4,500/(20 × 10 ) = 0.225 s
a = Rd/VL
3 3 8
= (20 × 10 × 30,000 × 10 ) / (2.8 × 10 × 4500)
= 0.4761
Now, the maximum utilization (with ignoring the fault) can be computed
as
options.
If we consider the fault, the time taken in sending each frame and
receiving its ACK will be increased by 0.25 s. Thus, the total time spent in
sending all the frames (say, n) can be given as
= ((0.512 – 0.326)/0.512)*100
= 36.3%
2. When data and ACK are sent on the same frame, this is
called________.
(a) piggybacking
(b) backpacking
(c) piggypacking
(a) (1 + P)/(1 + a)
(d) (1 – P)/(1 + a)
(c) 7 options.
(d) 8
(a) 4
(b) 7
(c) 8
(d) 14
(a) bit
(b) byte
10. 10. If you connect to the Internet from your home computer,
chances are that you are using:_________.
(a) PPP
(b) NCP
(c) DAP
(d) FTAM
Answers
1. (c)
2. (a)
3. (d)
4. (c)
5. (b)
6. (a)
⬆
7. (b)
8. (a)
Find answers on the fly, or master something new. Subscribe today. See pricing
options.