Вы находитесь на странице: 1из 10

Sliding Window Protocol | Set 1 (Sender

Side)
• The Stop and Wait ARQ offers error and flow control, but may cause big performance issues as
sender always waits for acknowledgement even if it has next packet ready to send.
• Sliding Window protocol handles this efficiency issue by sending more than one packet at a time
with a larger sequence numbers.
Few Terminologies :
• Transmission Delay (Tt) – Time to transmit the packet from host to the outgoing link. If B is the
Bandwidth of the link and D is the Data Size to transmit Tt = D/B
• Propagation Delay (Tp) – It is the time taken by the first bit transferred by the host onto the
outgoing link to reach the destination. It depends on the distance d and the wave propagation
speed s (depends on the characteristics of the medium). Tp = d/s
• Efficiency – It is defined as the ratio of total useful time to the total cycle time of a packet. For
stop and wait protocol,
Total cycle time = Tt (Data) + Tt (Ack) + Tp(Data) + Tp(Ack) = Tt + 2 * Tp
Since acknowledgements are very less in size, their transmission delay can be neglected.
Sliding Window Protocol | Set 1 (Sender
Side)
Efficiency = Useful time / Total Cycle time = Tt / (Tt + 2*Tp)
= 1 / (1 + 2*a) [a=Tp/Tt]
Go-Back-N
• https://www.geeksforgeeks.org/sliding-window-protocol-set-2-receiv
er-side/?
ref=rp
Read this page from this link.
Why Selective Repeat Protocol
• The go-back-n protocol works well if errors are rare, but if the line is poor it wastes
a lot of bandwidth on retransmitted frames.
• An alternative strategy, the selective repeat protocol, is to allow the receiver to
accept and buffer the frames following a damaged or lost one.
SR Protocol Characteristic
In this protocol, both sender and receiver maintain a window of outstanding and
acceptable sequence numbers, respectively.
• The sender’s window size starts out at 0 and grows to some predefined maximum.
• The receiver’s window, in contrast, is always fixed in size and equal to the
predetermined maximum.
• The receiver has a buffer reserved for each sequence number within its fixed
window.
Selective Repeat Protocol
• This protocol(SRP) is mostly identical to GBN protocol, except that buffers are
used and the receiver, and the sender, each maintain a window of size. SRP works
better when the link is very unreliable. Because in this case, retransmission tends
to happen more frequently, selectively retransmitting frames is more efficient
than retransmitting all of them. SRP also requires full duplex link. backward
acknowledgements are also in progress.
1. Sender’s Windows ( Ws) = Receiver’s Windows ( Wr).
2. Window size should be less than or equal to half the sequence number in
SR protocol. This is to avoid packets being recognized incorrectly. If the
windows size is greater than half the sequence number space, then if an ACK is
lost, the sender may send new packets that the receiver believes are
retransmissions.
Selective Repeat Protocol

Figure – the sender only retransmits frames, for which a NAK is received
Efficiency of Selective Repeat Protocol (SRP) is same as GO-Back-N’s efficiency
Selective Repeat Protocol
• The sender only retransmits frames, for which a NAK is received.
• This will increase the efficiency of the protocol.
Advantage over Go-Back-N:
• Fewer Retransmissions.
Disadvantages:
• More complexity at sender and receiver
• Each frame must be acknowledged individually (no cumulative
• acknowledgements)
• Receiver may receive frames out of sequence
Example-1. In Stop and wait protocol every 4th packet is lost and we need to send
total 10 packets so how many transmission it took to send all the packets?
1 2 3 4 5 6 7 8 9 10 (Initially)
1 2 3 4 4 5 6 7 8 9 10 (Packet no. 4 retransmitted)
1 2 3 4 4 5 6 7 7 8 9 10 (Packet no. 10 retransmitted)
1 2 3 4 4 5 6 7 7 8 9 10 10 (Result)
So, we retransmitted packet noumber 4, 7, 10
Total count = 13
• Example-2. In GBN sender Window size = 10 and Tp = 49.5ms & Tt = 1ms. What
is the Efficiency of the protocol and Throughput given Bandwidth = 1000 bps?
Explanation –
Efficiency = N/(1+2a), N = 10 (given), a = Tp/Tt = 49.5
Efficiency = 10/(1 + 2 * 49.5) = 10/100 = 0.1 or 10%
Throughput = Efficiency * Bandwidth
= 0.1 * 1000 = 100
Example-3. In GB3 if every 5th packet is lost & we need to send 10 packets so how
many retransmissions are required ? [GB3 means Window size = 3]
1 2 3 4 5 6 7 | 8 9 10 (packet no. 5 lost)
^ $
1 2 3 4 5 6 7 5 6 7 8 9 | 10
* ^ $
1 2 3 4 5 6 7 5 6 7 8 9 7 8 9 10
* ^ $
1 2 3 4 5 6 7 5 6 7 8 9 7 8 9 10 9 10
(count starts from * till ^) (from ^ to $ retranmission is done)
Total no. of transmissions = 18
Example-4. In Selective Repeat Ws = 5 and we are sending 10 packets
where every 5th packet is lost find number of retransmissions?
1 2 3 4 5 6 7 8 9 10
1 2 3 4 5 5 6 7 8 9 10
1 2 3 4 5 6 7 8 9 9 10
We see here there is no role of Window size in SR only the lost packet is resent.
Total transmissions = 12
Question
1. Difference between stop & wait protocol and sliding window protocol.
2. Advantage and disadvantage of Go-Back-N and Selective repeat protocol.

Вам также может понравиться