0% found this document useful (0 votes)
376 views60 pages

Delays in Computer Networks

The document discusses various types of delays that can occur when transmitting data packets over computer networks, including transmission delay, propagation delay, queuing delay, and processing delay. It then describes the stop-and-wait protocol, including how it works, factors that affect its efficiency and throughput, and its limitations. Specifically, the stop-and-wait protocol is inefficient because it does not fully utilize bandwidth and can lead to deadlocks if packets or acknowledgements are lost.

Uploaded by

Sakshi Chidar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
376 views60 pages

Delays in Computer Networks

The document discusses various types of delays that can occur when transmitting data packets over computer networks, including transmission delay, propagation delay, queuing delay, and processing delay. It then describes the stop-and-wait protocol, including how it works, factors that affect its efficiency and throughput, and its limitations. Specifically, the stop-and-wait protocol is inefficient because it does not fully utilize bandwidth and can lead to deadlocks if packets or acknowledgements are lost.

Uploaded by

Sakshi Chidar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 60

Delays in Computer Networks

Consider-
•Two hosts A and B are connected over a transmission link /
transmission media.
•A data packet is sent by the Host A to Host B.
 
Following different types of delay occur during transmission- 
 
1.Transmission delay
2.Propagation delay
3.Queuing delay
4.Processing delay
Transmission Delay

• Time taken to put the data packet on the


transmission link is called as transmission
delay.
Mathematically,
• Transmission delay ∝ Length or Size of data packet
• Transmission delay ∝ 1 / Bandwidth
Propagation Delay

• Time taken for one bit to travel from sender to


receiver end of the link is called
as propagation delay. 
Mathematically,
• Propagation delay ∝ Distance between sender and receiver
• Propagation delay ∝ 1 / transmission speed
Queuing Delay

• Time spent by the data packet waiting in the


queue before it is taken for execution is called
as queuing delay. 

• It depends on the congestion in the network.


Processing Delay

• Time taken by the processor to process the


data packet is called as processing delay. 
• It depends on the speed of the processor.
• Processing of the data packet helps in
detecting bit level errors that occurs during
transmission.
• Total delay in sending one data packet or End
to End time

Total delay = Transmission delay + Propagation


delay + Queuing delay + Processing delay
In optical fibre, transmission speed of data packet = 2.1 x 10 8 m/sec 

In optical fibre, signals travel with 70% speed of


light.
70% speed of light
= 0.7 x 3 x 108 m/sec
= 2.1 x 108 m/sec
So, consider transmission speed = 2.1 x
108 m/sec for calculations when using optical
fibre.
• Both queuing delay and processing delay are
dependent on the state of the system.
This is because-
• If destination host is busy doing some heavy
processing, then these delays will increase.
• If destination host is free, then data packets
will be processed immediately and these
delays will decrease.
• For any particular transmission link,
bandwidth and transmission speed are always
constant.
• This is because they are properties of the
transmission medium.
• Bandwidth is always expressed in powers of
10 and data is always expressed in powers of
2.
• 1 kilo bytes = 210 bytes
• 1 kilo bits = 210 bits
• 1 Mega bytes = 220 bytes
• 1 kilo bytes per second = 103 bytes per second
• 1 kilo bits per second = 103 bits per second
• 1 Mega bytes per second = 106 bytes per
second
Channel Capacity

• The total number of bits a channel can hold is called


as its capacity.
 
• Capacity of a half duplex channel
= Bandwidth x Propagation delay
 
• Capacity of a full duplex channel
= 2 x Capacity of a half duplex channel
= 2 x Bandwidth x Propagation delay
Flow Control in Computer Networks

• In computer networks, flow control is defined


as-

A set of procedures which are used for


restricting the amount of data that a sender
can send to the receiver.
Flow Control Protocols
Stop and Wait Protocol

Stop and Wait Protocol is the simplest flow


control protocol. 

It works under the following assumptions-


• Communication channel is perfect.
• No error occurs during transmission.
Working
The working of a stop and wait protocol may be
explained as-
• Sender sends a data packet to the receiver.
• Sender stops and waits for the acknowledgement
for the sent packet from the receiver.
• Receiver receives and processes the data packet.
• Receiver sends an acknowledgement to the
sender.
• After receiving the acknowledgement, sender
sends the next data packet to the receiver.
Working
Analysis

• Sender puts the data packet on the transmission link.


• Data packet propagates towards the receiver’s end.
• Data packet reaches the receiver and waits in its buffer.
• Receiver processes the data packet.
• Receiver puts the acknowledgement on the transmission
link.
• Acknowledgement propagates towards the sender’s end.
• Acknowledgement reaches the sender and waits in its
buffer.
• Sender processes the acknowledgement.
Analysis
Total Time

• Total time taken in sending one data packet


= (Transmission delay + Propagation delay +
Queuing delay + Processing delay)packet
+
(Transmission delay + Propagation delay +
Queuing delay + Processing delay)ACK
Total Time

Assume-
• Queuing delay and processing delay to be zero at
both sender and receiver side.
• Transmission time for the acknowledgement to be
zero since it’s size is very small.

• Total time taken in sending one data packet


= (Transmission delay + Propagation
delay)packet + (Propagation delay)ACK
Total Time

We know,
• Propagation delay depends on the distance and
speed.
• So, it would be same for both data packet and
acknowledgement.
So, we have-
 
• Total time taken in sending one data packet
= (Transmission delay)packet + 2 x Propagation delay
Efficiency

• Efficiency of any flow control control protocol is given by-

• Efficiency (η) = Useful Time / Total Time 


where-

• Useful time = Transmission delay of data packet = (Transmission delay)packet

• Useless time = Time for which sender is forced to wait and do nothing = 2
x Propagation delay

• Total time = Useful time + Useless time


 
Efficiency
Factors Affecting Efficiency

From here, we can observe-


• Efficiency (η) ∝ 1 / Distance between sender
and receiver
• Efficiency (η) ∝ 1 / Bandwidth
• Efficiency (η) ∝ Transmission speed
• Efficiency (η) ∝ Length of data packet
Throughput

• Number of bits that can be sent through the


channel per second is called as its throughput.

Round Trip Time-


 
• Round Trip Time = 2 x Propagation delay
The advantages of stop and wait
The advantages of stop and wait protocol are-
• It is very simple to implement.
• The incoming packet from receiver is always
an acknowledgement.
The limitations of stop and wait protocol

It is extremely inefficient because-


• It makes the transmission process extremely
slow.
• It does not use the bandwidth entirely as each
single packet and acknowledgement uses the
entire time to traverse the link.
The limitations of stop and wait protocol

If the data packet sent by the sender gets lost,


then-
• Sender will keep waiting for the
acknowledgement for infinite time.
• Receiver will keep waiting for the data packet
for infinite time.
The limitations of stop and wait protocol

If acknowledgement sent by the receiver gets


lost, then
• Sender will keep waiting for the
acknowledgement for infinite time.
• Receiver will keep waiting for another data
packet for infinite time.
Note

Efficiency may also be referred by the following


names-
• Line Utilization
• Link Utilization
• Sender Utilization
• Utilization of Sender
Note

Throughput may also be referred by the


following names-
• Bandwidth Utilization
• Effective Bandwidth
• Maximum data rate possible
• Maximum achievable throughput
Note
Stop and Wait protocol performs better for LANs
than WANs.
This is because
• Efficiency of the protocol is inversely proportional
to the distance between sender and receiver.
• So, the protocol performs better where the
distance between sender and receiver is less.
• The distance is less in LANs as compared to WANs.
Stop and Wait ARQ

• Stop and Wait ARQ is an improved and


modified version of Stop and Wait protocol.
Stop and Wait ARQ assumes-
• The communication channel is noisy.
• Errors may get introduced in the data during
the transmission.
Working

• Stop and wait ARQ works similar to stop and wait


protocol.
• It provides a solution to all the limitations of stop and
wait protocol.
• Stop and wait ARQ includes the following three extra
elements.
Number of Sequence Numbers Required

For any sliding window protocol to work without any problem,the following condition must be satisfied-
• Available Sequence Numbers >= Sender Window Size + Receiver Window Size

Stop and wait ARQ is a one bit sliding window protocol where-


• Sender window size = 1
• Receiver window size = 1
 
Thus, in stop and wait ARQ,
• Minimum number of sequence numbers required
• = Sender Window Size + Receiver Window Size
• =1+1
• =2
 
Thus,
• Minimum number of sequence numbers required in Stop and Wait ARQ = 2.
• The two sequence numbers used are 0 and 1.
How the Problem of Lost Data Packet Solve?

• Time out timer helps to solve the problem of lost data


packet.
• After sending a data packet  to the receiver, sender starts
the time out timer.
• If the data packet gets acknowledged before the timer
expires, sender stops the time out timer.
• If the timer goes off before receiving the acknowledgement,
sender retransmits the same data packet.
• After retransmission, sender resets the timer.
• This prevents the occurrence of deadlock.
How the Problem of Lost Data Packet Solve?
How Problem of Lost Acknowledgement solve?

• Sequence number on data packets help to solve the problem


of delayed acknowledgement.
• Consider the acknowledgement sent by the receiver gets lost.
• Then, sender retransmits the same data packet after its timer
goes off.
• This prevents the occurrence of deadlock.
• The sequence number on the data packet helps the receiver
to identify the duplicate data packet.
• Receiver discards the duplicate packet and re-sends the same
acknowledgement.
How Problem of Lost Acknowledgement
solve?
How Problem of Delayed Acknowledgement Solve?

• Sequence number on acknowledgements help to


solve the problem of delayed acknowledgement.
Problem of Damaged Packet

• If receiver receives a corrupted data packet from the


sender, it sends a negative acknowledgement (NAK)
to the sender.
• NAK requests the sender to send the data packet
again.
Stop and Wait Protocol Vs Stop and Wait ARQ
Explanation

In stop and wait ARQ,


• Sender window size is 1.
• This allows the sender to keep only one frame
unacknowledged.
• So, sender sends one frame and then waits
until the sent frame gets acknowledged.
• After receiving the acknowledgement from
the receiver, sender sends the next frame.
Explanation

Here,
• Sender uses Tt time for transmitting the packet over the link.
• Then, sender waits for 2 x Tp time.
• After 2 x Tp time, sender receives the acknowledgement for the sent
frame from the receiver.
• Then, sender sends the next frame.
• This 2 x Tp waiting time is the actual cause of less efficiency.
Problem 1. If the bandwidth of the line is 1.5 Mbps, RTT is 45 msec and
packet size is 1 KB, then find the link utilization in stop and wait.

Solution-
 
• Given-
• Bandwidth = 1.5 Mbps
• RTT = 45 msec
• Packet size = 1 KB
 
Calculating Transmission Delay-
 
• Transmission delay (Tt)
• = Packet size / Bandwidth
• = 1 KB / 1.5 Mbps
• = (210 x 8 bits) / (1.5 x 106 bits per sec)
• = 5.461 msec
Problem 1. If the bandwidth of the line is 1.5 Mbps, RTT is 45 msec and
packet size is 1 KB, then find the link utilization in stop and wait.

Calculating Propagation Delay-


 
• Propagation delay (Tp)
• = Round Trip Time / 2
• = 45 msec / 2
• = 22.5 msec
 
Calculating Value Of ‘a’-
 
• a = Tp / Tt
• a = 22.5 msec / 5.461 msec
• a = 4.12
Problem 1. If the bandwidth of the line is 1.5 Mbps, RTT is 45 msec and
packet size is 1 KB, then find the link utilization in stop and wait.

Calculating Link Utilization-

Link Utilization or Efficiency (η)


• = 1 / 1+2a
• = 1 / (1 + 2 x 4.12)
• = 1 / 9.24
• = 0.108
• = 10.8 %
Problem-02: A channel has a bit rate of 4 Kbps and one way propagation delay of 20 msec. The channel
uses stop and wait protocol. The transmission time of the acknowledgement frame is negligible. To get
a channel efficiency of at least 50%, the minimum frame size should be-
(a) 80 bytes (b) 80 bits (c) 160 bytes (d) 160 bits

Solution-
 
• Given-
• Bandwidth = 4 Kbps
• Propagation delay (Tp) = 20 msec
• Efficiency >= 50%

Let the required frame size = L bits.


 
Calculating Transmission Delay-
 
• Transmission delay (Tt)
• = Packet size / Bandwidth
• = L bits / 4 Kbps

Calculating Value Of ‘a’-

• a = Tp / Tt
• a = 20 msec / ( L bits / 4 Kbps)
• a = (20 msec x 4 Kbps) / L bits
Problem-02: A channel has a bit rate of 4 Kbps and one way propagation delay of 20 msec. The channel
uses stop and wait protocol. The transmission time of the acknowledgement frame is negligible. To get
a channel efficiency of at least 50%, the minimum frame size should be-
(a) 80 bytes (b) 80 bits (c) 160 bytes (d) 160 bits

Condition For Efficiency To Be At least 50%-


 
• For efficiency to be at least 50%, we must have-
• 1 / 1+2a >= 1/2
• a <= 1/2

• Substituting the value of ‘a’, we get-


• (20 msec x 4 Kbps) / L bits <= 1/2
• L bits >= (20 msec x 4 Kbps) x 2
• L bits >= (20 x 10-3 sec x 4 x 103 bits per sec) x 2
• L bits >= 20 x 4 bits x 2
• L >= 160
 
• From here, frame size must be at least 160 bits.
• Thus, Correct Option is (d).
Problem-03: Consider a MAN with average source and destination 20 Km
apart and one way delay of 100 μsec. At what data rate does the round trip
delay equals the transmission delay for a 1 KB packet?

Solution-
Given-
• Distance = 20 Km
• Propagation delay (Tp) = 100 μsec
• Packet size = 1 KB
We need to have-
• Round Trip Time = Transmission delay
• 2 x Propagation delay = Transmission delay
Substituting the values in the above relation, we get-
• 2 x 100 μsec = 1 KB / Bandwidth
• Bandwidth = 1 KB / 200 μsec
• Bandwidth = (210 x 106 / 200 ) bytes per sec
• Bandwidth = 5.12 MBps or 40.96 Mbps
Problem-04:Consider two hosts X and Y connected by a single direct link of rate 10 6 bits/sec. The
distance between the two hosts is 10,000 km and the propagation speed along the link is 2 x 10 8 m/sec.
Host X sends a file of 50,000 bytes as one large message to host Y continuously. Let the transmission
and propagation delays be p milliseconds and q milliseconds respectively.
Then the value of p and q are- (a) p = 50 and q = 100 (b) p = 50 and q = 400 (c) p = 100 and q = 50 (d)p =
400 and q = 50

Solution-
 Given-
• Bandwidth = 106 bits/sec
• Distance = 10,000 km
• Propagation speed = 2 x 108 m/sec
• Packet size = 50,000 bytes
 
Calculating Transmission Delay-
Transmission delay (Tt)
• = Packet size / Bandwidth
• = 50000 bytes / 106 bits per sec
• = (5 x 104 x 8 bits) / 106 bits per sec
• = ( 4 x 105 bits ) / 106 bits per sec
• = 0.4 sec
• = 400 msec
Problem-04:Consider two hosts X and Y connected by a single direct link of rate 10 6 bits/sec. The
distance between the two hosts is 10,000 km and the propagation speed along the link is 2 x 10 8 m/sec.
Host X sends a file of 50,000 bytes as one large message to host Y continuously. Let the transmission
and propagation delays be p milliseconds and q milliseconds respectively.
Then the value of p and q are- (a) p = 50 and q = 100 (b) p = 50 and q = 400 (c) p = 100 and q = 50 (d)p =
400 and q = 50

Calculating Propagation Delay-


 
• Propagation delay (Tp)
• = Distance / Propagation speed
• = 10000 km / (2 x 108 m/sec)
• = 107 m / (2 x 108 m/sec)
• = 50 msec

• Thus, Option (d) is correct.


Problem-05:The values of parameters for the stop and wait ARQ protocol are as given below-
Bit rate of the transmission channel = 1 Mbps
Propagation delay from sender to receiver = 0.75 ms
Time to process a frame = 0.25 ms
Number of bytes in the information frame = 1980
Number of bytes in the acknowledge frame = 20
Number of overhead bytes in the information frame = 20
Assume that there are no transmission errors. Then the transmission efficiency (in %) of the stop and
wait ARQ protocol for the above parameters is ___________ . (correct to 2 decimal places)
 

Solution-
Given-
• Bandwidth = 1 Mbps
• Propagation delay (Tp) = 0.75 ms
• Processing time (Tprocess) = 0.25 ms
• Data frame size = 1980 bytes
• Acknowledgement frame size = 20 bytes
• Overhead in data frame = 20 bytes
Problem-05:The values of parameters for the stop and wait ARQ protocol are as given below-
Bit rate of the transmission channel = 1 Mbps
Propagation delay from sender to receiver = 0.75 ms
Time to process a frame = 0.25 ms
Number of bytes in the information frame = 1980
Number of bytes in the acknowledge frame = 20
Number of overhead bytes in the information frame = 20
Assume that there are no transmission errors. Then the transmission efficiency (in %) of the stop and
wait ARQ protocol for the above parameters is ___________ . (correct to 2 decimal places)
 
Calculating Useful Time-
 Useful data sent
• = Transmission delay of useful data bytes sent
• = Useful data bytes sent / Bandwidth
• = (1980 bytes – 20 bytes) / 1 Mbps
• = 1960 bytes / 1 Mbps
• = (1960 x 8 bits) / (106 bits per sec)
• = 15680 μsec
• = 15.680 msec
Problem-05:The values of parameters for the stop and wait ARQ protocol are as given below-
Bit rate of the transmission channel = 1 Mbps
Propagation delay from sender to receiver = 0.75 ms
Time to process a frame = 0.25 ms
Number of bytes in the information frame = 1980
Number of bytes in the acknowledge frame = 20
Number of overhead bytes in the information frame = 20
Assume that there are no transmission errors. Then the transmission efficiency (in %) of the stop and
wait ARQ protocol for the above parameters is ___________ . (correct to 2 decimal places)
 
Calculating Total Time-
 Total time
= Transmission delay of data frame + Propagation delay of data
frame + Processing delay of data frame + Transmission delay of
acknowledgement + Propagation delay of acknowledgement
= (1980 bytes / 1 Mbps) + 0.75 msec + 0.25 msec + (20 bytes / 1
Mbps) + 0.75 msec
= 15.840 msec + 0.75 msec + 0.25 msec + 0.160 msec + 0.75 msec
= 17.75 msec
Problem-05:The values of parameters for the stop and wait ARQ protocol are as given below-
Bit rate of the transmission channel = 1 Mbps
Propagation delay from sender to receiver = 0.75 ms
Time to process a frame = 0.25 ms
Number of bytes in the information frame = 1980
Number of bytes in the acknowledge frame = 20
Number of overhead bytes in the information frame = 20
Assume that there are no transmission errors. Then the transmission efficiency (in %) of the stop and
wait ARQ protocol for the above parameters is ___________ . (correct to 2 decimal places)
 

Calculating Efficiency-

Efficiency (η)
= Useful time / Total time
= 15.680 msec / 17.75 msec
= 0.8833
= 88.33%
Problem-06: A sender uses the stop and wait ARQ protocol for reliable transmission of frames. Frames
are of size  1000 bytes and the transmission rate at the sender is 80 Kbps. Size of an acknowledgement
is 100 bytes and the transmission rate at the receiver is 8 Kbps. The one way propagation delay is 100
msec. Assuming no frame is lost, the sender throughput is __________ bytes/sec.

• Solution-
•  
• Given-
• Frame size = 1000 bytes
• Sender bandwidth = 80 Kbps
• Acknowledgement size = 100 bytes
• Receiver bandwidth = 8 Kbps
• Propagation delay (Tp) = 100 msec
•  
• Calculating Transmission Delay Of Data Frame-
•  
• Transmission delay (Tt)
• = Frame size / Sender bandwidth
• = 1000 bytes / 80 Kbps
• = (1000 x 8 bits) / (80 x 103 bits per sec)
• = 0.1 sec
• = 100 msec
Problem-06: A sender uses the stop and wait ARQ protocol for reliable transmission of frames. Frames
are of size  1000 bytes and the transmission rate at the sender is 80 Kbps. Size of an acknowledgement
is 100 bytes and the transmission rate at the receiver is 8 Kbps. The one way propagation delay is 100
msec. Assuming no frame is lost, the sender throughput is __________ bytes/sec.

• Calculating Transmission Delay Of Acknowledgement-


•  
• Transmission delay (Tt)
• = Acknowledgement size / Receiver bandwidth
• = 100 bytes / 8 Kbps
• = (100 x 8 bits) / (8 x 103 bits per sec)
• = 100 msec
•  
• Calculating Useful Time-
•  
• Useful Time
• = Transmission delay of data frame
• = 100 msec
•  
• Calculating Total Time-
•  
• Total Time
• = Transmission delay of data frame + Propagation delay of data frame + Transmission delay of acknowledgement + Propagation
delay of acknowledgement
• = 100 msec + 100 msec + 100 msec + 100 msec
• = 400 msec
Problem-06: A sender uses the stop and wait ARQ protocol for reliable transmission of frames. Frames
are of size  1000 bytes and the transmission rate at the sender is 80 Kbps. Size of an acknowledgement
is 100 bytes and the transmission rate at the receiver is 8 Kbps. The one way propagation delay is 100
msec. Assuming no frame is lost, the sender throughput is __________ bytes/sec.

• Calculating Efficiency-
•  
• Efficiency (η)
• = Useful time / Total time
• = 100 msec / 400 msec
• =1/4
• = 25%
•  
• Calculating Sender Throughput-
•  
• Sender throughput
• = Efficiency (η) x Sender bandwidth
• = 0.25 x 80 Kbps
• = 20 Kbps
• = (20 x 1000 / 8) bytes per sec
• = 2500 bytes/sec
Problem-07: Using stop and wait protocol, sender wants to transmit 10 data
packets to the receiver. Out of these 10 data packets, every 4th data packet is
lost. How many packets sender will have to send in total?

Solution-
• Draw a time line diagram and analyze.
• The packets will be sent as-
• 1, 2, 3, 4, 4, 5, 6, 7, 7, 8, 9, 10, 10
• The lost packets are- 4, 7 and 10.
• Thus, sender will have to send 13 data packets
in total.

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy