Download as pdf or txt
Download as pdf or txt
You are on page 1of 20

Assignment

On
Flow & Error Control

Course Title: Data Communication


Course Code: ECE 3251

SUBMITTED TO
Dr. Md. Abdul Awal
Associate Professor
Electronics and Communication Engineering Discipline
Khulna University
Khulna

SUBMITTED BY
Taohidul Islam (140202)
MD. Sazid Hossain (140233)
Md. Abid Shahriar (150210)
Md. Siamul Haq (150226)
Redoun Islam (160201)
Sheikh Sohel Moon (160202)
Mesbah Ur Rahman (160218)
Naeema Binthe Ashraf (160231)

Date of Submission: August 07, 2020


INDEX

Student Question Page


Information
1. How the receiver becomes
overwhelmed and how to prevent it 3-4
Taohidul Islam while data transmission?
(140202) 2. Describe the working principle of
Stop and Wait flow Control.

3. Advantages and Disadvantages of


MD. Sazid Stop-and-wait flow control. 5-7
Hossain 4. Factors Affecting Efficiency of Stop-
(140233) wand-Wait flow control.

5. Describe the Working Principle of


Md. Abid Shahriar Sliding Window flow Control. 8-9
(150210) 6. Show that, if k = 1, Stop-and-wait
flow has no duplicate frame but
piggybacking system has.

7. if k = 5, propagation time = 400ms


and transmission time = 2ms, what will
be the link utilization for sliding
Md. Siamul Haq window flow control? 10-11
(150226) 8. Describe a Stop and wait ARQ
scenario where lost frame event
occurs.
1|P ag e
9. Advantages and disadvantages of
Redoun Islam Stop-and-Wait ARQ.
(160201) 10. Describe a Stop and wait ARQ 12-13
scenario where lost ACK event occurs.

11. Draw a Go-Back-N ARQ scenario of


Sheikh Sohel 6 frames transmission where lost or
Moon damaged frame event occurs. 14-15
(160202) 12. With k-bit sequence number why
the window size is limited to 2^k - 1 in
Go-Back-N ARQ

13. Describe the Working Principle of


Mesbah Ur Selective Repeat ARQ.
Rahman 14. Difference between Go-Back-N 16-17
(160218) ARQ and Selective Repeat ARQ.

15. Why the window size should not be


Naeema Binthe more than the possible sequence
Ashraf number in selective repeat ARQ? 18-19
(160231) 16. Draw a Go-Back-N ARQ scenario
where Lost ACK event occurs.

2|P ag e
1. How the receiver becomes overwhelmed and how to prevent it while data
transmission?
Answer: In data transmission, when sender sends a data and receiver receives
that data, the data is temporary stored in buffer. The receiver has to do some
processing before it can pass on to next higher-level software or store it in a
permanent memory.

As, Higher end machines can perform high speed processing and lower ends
perform those in lower speed. So, when a sender sends data in a high speed to a
slow receiver, the receiver will overflow and will lost data because of the limited
memory or storage.

To prevent this scenario, the sender must send data in a limited speed and also in
a very controlled way to the receiver will have some time to receive data and
process it and store it. That controlled way is known as Flow control. That means
the receiver will send some acknowledgement before the sender sends more
data. By using that kind of coordination, overwhelming can be overcome and data
communication will take place successfully without any loss of information.

3|P ag e
2. Describe the Working Principle of Stop and Wait flow Control.
Answer:
Working principle of Stop and Wait flow control:
a) Sender sends a single frame at a time.
b) Sender waits to receive acknowledgment (ACK) before sending another
c) Receiver sends acknowledgment (ACK) as receives a frame
d) Sender Repeats from (a) when ACK is received.

Figure: Stop and Wait Flow Control

4|P ag e
3. Advantages and Disadvantages of Stop-and-wait flow control.

Answer:

The Advantages of Stop-and-wait flow control:


a) it is very simple to implement
b) the incoming packet from receiver is always an acknowledgement.

The disadvantages of Stop-and-wait flow control:


a) the transmission process extremely slow.
b) does not use the bandwidth entirely as each single packet and
acknowledgement uses the entire time to traverse the link.
c) if the frame gets lost sender will keep waiting for the acknowledgement
for infinite time and also Receiver will keep waiting for the data packet for
infinite time.
d) if acknowledgement gets lost Sender will keep waiting for the
acknowledgement for infinite time and also Receiver will keep waiting for
another data packet for infinite time.

5|P ag e
4. Factors Affecting Efficiency of Stop-wand-Wait flow control.

Answer:

For Stop-and-wait flow control, the link utilization is

1
U=
1 + 2𝑎

𝑃𝑟𝑜𝑝𝑎𝑔𝑎𝑡𝑖𝑜𝑛 𝑇𝑖𝑚𝑒
Where, a = propagation delay =
𝑇𝑟𝑎𝑛𝑠𝑚𝑖𝑠𝑠𝑖𝑜𝑛 𝑇𝑖𝑚𝑒
So, the link utilization can be written as

1
U= 𝑃𝑟𝑜𝑝𝑎𝑔𝑎𝑡𝑖𝑜𝑛 𝑇𝑖𝑚𝑒
1+2×
𝑇𝑟𝑎𝑛𝑠𝑚𝑖𝑠𝑠𝑖𝑜𝑛 𝑇𝑖𝑚𝑒

The Propagation time is the time it takes for a bit to travel from sender to receiver
and this time is obviously dependent on the distance and the speed of the
electromagnetic wave.
𝐷𝑖𝑠𝑡𝑎𝑛𝑐𝑒
∴ Propagation time =
𝑆𝑝𝑒𝑒𝑑

The transmission time is the time it takes for a station to transmit a frame. The
Time for transmission of a frame will depend on the length of the frame and also
it will depend on the rate at which the transmission is taking place.
𝐹𝑟𝑎𝑚𝑒 𝑙𝑒𝑛𝑔𝑡ℎ
∴ Transmission time =
𝐵𝑎𝑛𝑑𝑤𝑖𝑑𝑡ℎ

6|P ag e
So,
1
U= 𝑃𝑟𝑜𝑝𝑎𝑔𝑎𝑡𝑖𝑜𝑛 𝑇𝑖𝑚𝑒
1+2×
𝑇𝑟𝑎𝑛𝑠𝑚𝑖𝑠𝑠𝑖𝑜𝑛 𝑇𝑖𝑚𝑒

1
= 𝐷𝑖𝑠𝑡𝑎𝑛𝑐𝑒 𝐵𝑎𝑛𝑑𝑤𝑖𝑑𝑡ℎ
1+2× ×
𝑆𝑝𝑒𝑒𝑑 𝐹𝑟𝑎𝑚𝑒 𝐿𝑒𝑛𝑔𝑡ℎ

From here we can observe,

1
∴ Uα
𝑑𝑖𝑠𝑡𝑎𝑛𝑐𝑒 𝑏𝑒𝑡𝑤𝑒𝑒𝑛 𝑠𝑒𝑛𝑑𝑒𝑟 𝑎𝑛𝑑 𝑅𝑒𝑐𝑒𝑖𝑣𝑒𝑟
1
∴Uα
𝐵𝑎𝑛𝑑𝑤𝑖𝑑𝑡ℎ

∴ U α Transmission speed
∴ U α Length of Frame

7|P ag e
5. Describe the Working Principle of Sliding Window flow Control.

Answer:
Sliding window flow control is a point to point protocol assuming that no other
entity tries to communicate until the current data transfer is complete. The
window maintained by the sender indicates which frames it can send. The sender
sends all the frames in the window and waits for an acknowledgement (as
opposed to acknowledging after every frame). The sender then shifts the window
to the corresponding sequence number, thus indicating that frames within the
window starting from the current sequence number can be sent.

Lets assume, K = 3 so the window size is 23 − 1 = 7.

so here you can see 0 1 2 3 4 5 6 this is the window at the sender’s end, on the
other hand at the receiver send the window is only 1. So, it is now ready to
receive the frame 0 and the sender sends the frame 0. As it sends the frame 0 the
window is shrinking by 1. That means now it is it has got six more frames to send
starting with 1, so when a frame is sent, the window shrinks. On the other hand,
when an acknowledgement is received the window is expanded on this side.

8|P ag e
6. Show that, if k = 1, Stop-and-wait flow has no duplicate frame but
piggybacking system has.
Answer:
As K = 1, so the sender’s window is 21 − 1 = 1 same as the stop and wait flow
control syatem.

A sends (0, 1, A0) A sends (0, 1, A0)


B sends (0, 1, B0)
B gets (0, 1, A0)
B gets (0, 1, A0)
B sends (0, 0, B0)
B sends (0, 0, B0)
A gets (0, 0, B0) A gets (0, 1, B0)
A sends (1, 0, A1) A sends (0, 0, A0)
B gets (1, 0, A1) B gets (0, 0, A0)
B sends (1, 1, B1) B sends (1, 0, B1)

A gets (1, 1, B1) A gets (0, 0, B0)


A sends (0, 1, A2) A sends (1, 0, A1)
B gets (1, 0, A1)
B gets (0, 1, A2)
B sends (1, 1, B1)
B sends (0, 0, B2)
A gets (1, 0, B1)
A gets (0, 0, B2)
A sends (1, 1, A1)
A sends (1, 0, A3)
B gets (1, 1, A1)
B gets (1, 0, A3) B sends (0, 1, B2)
B sends (1, 1, B3)

Stop-And-Wait Flow Control Time Piggybacking

In Stop-and-wait flow control, B waits for A’s first frame before sending one of its
own acknowledgements. There why no frames where crossed and there is no
duplicates.
On the other side, in Piggybacking, when A and B simultaneously initiate
communication, their first frames cross and the data link layers gets into a
situation. Half of the frames contain duplicates, even though there are no
transmission errors.

9|P ag e
7. if k = 5, propagation time = 400ms and transmission time = 2ms, what will be
the link utilization for sliding window flow control?

Answer:
In Sliding Window flow control,
The link utilization
U = 1, for N > 2a + 1
𝑁
for N < 2a + 1 in both cases N = 2𝑘 - 1
1+2𝑎

As k = 5, so N = 2𝑘 – 1
= 25 – 1
= 31

𝑃𝑟𝑜𝑝𝑎𝑔𝑎𝑡𝑖𝑜𝑛 𝑇𝑖𝑚𝑒
Also, a =
𝑡𝑟𝑎𝑛𝑠𝑚𝑖𝑠𝑠𝑖𝑜𝑛 𝑇𝑖𝑚𝑒
400
=
2
= 200

So, N < 2a + 1

31
∴U= = 0.077
1 + 2×200

(Ans.)

10 | P a g e
8. Describe a Stop and wait ARQ scenario where lost frame event
occurs.

Answer:
In Stop-And-Wait ARQ scenario, when a frame is lost the whole process
just stops. Because as the sender has already sent a frame and before
sending the next one it will wait till the acknowledgement of the
receiver.

But the receiver did not get that frame as the frame is lost in the
process, so it will not send any ACK. So, prevent it the Sender will have
a timer option. Sender will wait for ACK till the time out. If time out hits,
it will send the that frame once more.

SENDER RECEIVER
Time Out Waiting time Waiting time
Waiting time

11 | P a g e TIME TIME
9. Advantages and disadvantages of Stop-and-Wait ARQ.

Answer:

Advantages of Stop and Wait ARQ:


a) The main advantage of stop-and-wait ARQ is its simplicity
b) it requires minimum buffer size
c) has timer implementation

Disadvantages of Stop and wait ARQ:


a) it makes highly inefficient use of communication links, particularly when
‘a’ is large.
b) Timer should be set for each individual frame.

12 | P a g e
10. Describe a Stop and wait ARQ scenario where lost ACK event occurs.

Answer:
In Stop-And-Wait ARQ scenario, after the sender sent a frame it waits till the
acknowledgment of receiver to send another frame. But when the
acknowledgment is lost in the process, the sender keeps waiting till the time out
hits. When the time out hits, the sender sends the previous frame as it thinks the
frame did not reach the receiver. Even though the receiver gets duplicate frame,
one of those will be discarded and it will send acknowledgment again for the next
frame.

13 | P a g e
11. Draw a Go-Back-N ARQ scenario of 6 frames transmission where lost or
damaged frame event occurs.

Answer:

SENDER RECEIVER

FARME 0
FARME 0
FARME 1
FARME 1
FARME 2
LOST

FARME 3
DISCARDED
FARME 4
NAK 2
FARME 2
DISCARDED
FARME 3
FRAME 2
FARME 4
FARME 3
FARME 5

FARME 4

FARME 5

14 | P a g e
12. With k-bit sequence number why the window size is limited to 𝟐𝒌 - 1 in Go-
Back-N ARQ.

Answer:
Let us assume full-duplex transmission is going on. The receiving end sends
piggybacked acknowledgement by using some number in the acknowledgement
field of data frame.
Let us assume that a 3- bit sequence number is used and obviously the window
size can be up to 8 so it can be 0 to 7. Now suppose that a station sends frame 0
and gets back received request 1 that is, essentially this is acknowledgement 1.
Then the sender sends the frames 1, 2, 3, 4, 5, 6, 7 and 0 and gets another RR1, so
it has received two RR1s. Now this might either mean that RR1 is the cumulative
acknowledgement or all eight frames were damaged, so the transmitter will be
puzzled. So, if all are damaged and lost then obviously this RR1 corresponds to the
first 0. That means before this frame 0 was sent and it corresponds to frame 0.
On the other hand, if it is not damaged then this RR1 can correspond to the next
frame after this 0. So this can be either for this or the next frame after 0. So the
transmitter gets confused in selecting the right frame. This ambiguity can be
overcome if the maximum window size is limited to 7. That means if the window
size is limited to 7, that is 0 to 6 then this problem would not arise which can be
very easily proved. That is why whenever k bit sequence number is used the
window size is limited to 2 to the power k – 1 in case of go-back-N ARQ.

15 | P a g e
13. Describe the Working Principle of Selective Repeat ARQ.

Answer:
In Selective Repeat ARQ, only those frames are retransmitted for which negative
acknowledgement has been received. This negative acknowledgement is referred
to as SREJ; Selective Reject or time-out has occurred. In either case only that
frame is sent.

SENDER RECEIVER

FARME 0
FARME 0
FARME 1
FARME 1
FARME 2
Received with
some error
FARME 3
NAK 2
FARME 4
FRAME 3
FARME 2
FARME 4
FARME 5
FRAME 2

FARME 5

16 | P a g e
14. Difference between Go-Back-N ARQ and Selective Repeat ARQ.

Answer:
The differences between Go-Back-N ARQ and Selective Repeat ARQ are down
below:

Basis of Difference Go-Back-N Selective Repeat


Retransmits all the frames that Retransmits only those frames
Basic sent after the frame which that are suspected to lost or
suspects to be damaged or lost damaged
Bandwidth Utilization If error rate is high, it wastes a Comparatively less bandwidth is
lot of bandwidth wasted in retransmitting
More complex as it require to
Complexity Less complicated apply extra logic and sorting
and storage, at sender and
receiver
Window Size N-1 <= (N+1)/2
Sorting Sorting is neither required at Receiver must be able to sort as
sender side nor at receiver side it has to maintain the sequence
of the frames
ACK Numbers NAK number refer to the next NAK number refer to the frame
expected frame number lost
Use

17 | P a g e
15. Why the window size should not be more than the possible sequence
number in selective repeat ARQ?

Answer:
Let us consider the following scenario in case of Selective-Repeat ARQ assuming k
= 3 and let us assume the window size is same as go-back-N ARQ.
Now the sender sends frames starting from 0 to 6 one after the other. The
receiver sends RR7, that means after receiving 6 it will send the receive request 7
after receiving all seven frames. So, RR7 gets lost in transit, though sender times-
out and retransmits frame 0. Since it was waiting for acknowledgement for these
frames they are not received, so it will send frame 0.
However, the receiver already has received only seven frames, it was also sending
frame 0 but not the frame 0 of the previous one but for the next one. So, the
receiver already advanced its received window to receive frame 7, 0, 1, 2, 3, 4, 5.
It is now ready to receive frame 0. So the receiver wrongly assumes that frame 7
has been lost and frame 0 is accepted as a new frame, instead of old frame it is
received as a new frame, so we see that the problem arises here. This problem
can again be alleviated by choosing a limited window size and in this case the
window size should be no more than half the possible sequence number. that
means if you are choosing k = 3 then the possible window size in case of Selective-
23
Repeat ARQ has to be = 4.
2

That’s why the window size should not be more than the possible sequence
number in selective repeat ARQ.

18 | P a g e
16. Draw a Go-Back-N ARQ scenario where Lost ACK event occurs.

Answer:

SENDER RECEIVER

FARME 0
FARME 0
FARME 1
FARME 1
FARME 2
FRAME 2

ACK 3
LOST

TIME
OUT
FARME 0
FRAME 0
FARME 1
FARME 1
FARME 2

FARME 2

19 | P a g e

You might also like