Uploaded by Muhammad Qasim Atiq Ullah

Quiz 4 Solution (1)

advertisement
QUIZ 4
[Q1] Different Forms of ACKs Version 1
Max time allowed: 15 mins
Total marks: 10
Suppose your TA Sarah is designing a new photo-sharing application. Sarah wants to make sure
that photos are reliably transferred between users. To do so, she decides to design her own
reliable data transfer protocol, RTPS (Reliable Transfer for Photo Sharing). RTPS receivers
respond with an acknowledgment if a packet is correctly received (and do not use any NACKs).
RTPS uses a sliding window of size 6. The senders in RTPS use timers to detect packet losses.
In addition, senders also use an ACK-triggered loss detection mechanism, where if ACKs are
received for any k subsequent packets, the senders infer the packet is lost. RTPS sets k to be 3.
On detecting a loss, the RTPS sender retransmits the earliest unacknowledged packet.
To test RTPS, Sarah transfers a photo between two users, which requires sending 6 packets into
the network. The diagram below shows the send and receiver and the state of packets and ACKs
exchanged. Packets 1 and 4 are not delivered and the ACK for packet 2 is lost. Timeout at T1
represents the timeout for packet 1.
a) Which packets would need to be retransmitted at T1 if RTPS uses:
(1) Individual ACKs 2
(2) Full Information ACKs 3
(3) Cumulative ACKs 2
b) After testing the above three ACK schemes, Sarah decides to design a new ACK scheme -Cumulative ACKs with selective ACKs. In this scheme, the RTPS receivers use cumulative ACKs,
however, if an out-of-order packet is received, the receiver sends an individual ACK specifying the
exact packet received (e.g., in the above example scenario if packet 3 is received, the receiver
send an individual ACK 3). If such an ACK scheme, which packets would need to be
retransmitted at T1
Please briefly explain your answers to get any points.
Answers:
(i) 2,4 [1 retransmitted thru subsequent ACKs] /2
Explanation: Packet 1 did not make it to the receiver so it needs to be resent; this is
detected through k subsequent acks (from 3, 5 and 6). The ack for packet 2 was lost so it
needed to be resent because of timeout at T1. Packet 4 did not make it to the receiver so
it needs to be resent because of timeout at T1.
(ii) 4 [1 retransmitted thru subsequent ACKs and 2 doesn’t need to be transmitted] /2
Explanation: Packet 4 did not make it to the receiver so it needs to be resent because it
timed out at T1. Packet 1 did not make it to the receiver so it needs to be resent; this is
detected through k subsequent acks (from 3, 5 and 6). (The ack for packet 2 was lost but
when the ack for packet 3 was received, the full information ack informed the sender that
packet 2 was received)
(iii) 1,2,3,4,5,6 /3
Explanation: Since the first packet was lost, the acks being received show: acks <= 0 and
3 dup acks were not received, so all the packets in the window will be resent.
b) 1,2,4 / 3
Explanation: Packets 1 and 4 did not make it to the receiver so they need to be resent
because they timed out at T1. The ack for packet 2 was lost and was timed out at T1 so it
needs to be resent. After the first packet was not received, all the rest were out order and
individual acks were sent instead of cumulative ones.
[Q1] Different Forms of ACKs Version 2
Max time allowed: 15 mins
Total marks: 10
Suppose your TA Sarah is designing a new photo-sharing application. Sarah wants to make sure
that photos are reliably transferred between users. To do so, she decides to design her own
reliable data transfer protocol, RTPS (Reliable Transfer for Photo Sharing). RTPS receivers
respond with an acknowledgment if a packet is correctly received (and do not use any NACKs).
RTPS uses a sliding window of size 6. The senders in RTPS use timers to detect packet losses.
In addition, senders also use an ACK-triggered loss detection mechanism, where if ACKs are
received for any k subsequent packets, the senders infer the packet is lost. RTPS sets k to be 2.
On detecting a loss, the RTPS sender retransmits the earliest unacknowledged packet.
To test RTPS, Sarah transfers a photo between two users, which requires sending 6 packets into
the network. The diagram below shows the send and receiver and the state of packets and ACKs
exchanged. Packets 2 and 4 are not delivered and the ACKs for packet 5 is lost. Timeout at T1
represents the timeout for packet 1.
a) Which packets would need to be retransmitted at T1 if RTPS uses:
(4) Individual ACKs 2
(5) Full Information ACKs 3
(6) Cumulative ACKs 2
b) After testing the above three ACK schemes, Sarah decides to design a new ACK scheme -Cumulative ACKs with selective ACKs. In this scheme, the RTPS receivers use cumulative ACKs,
however, if an out-of-order packet is received, the receiver sends an individual ACK specifying the
exact packet received (e.g., in the above example scenario if packet 3 is received, the receiver
send an individual ACK 3). If such an ACK scheme, which packets would need to be
retransmitted at T1
Please briefly explain your answers to get any points.
Answers:
(i) 4,5 [2 retransmitted thru subsequent ACKs] /3
Explanation: Packet 2 did not make it to the receiver so it needs to be resent; this is
detected through k subsequent acks (from 3,6). The ack for packet 5 was lost so it needed
to be resent because of timeout at T1. Packet 4 did not make it to the receiver so it needs
to be resent because of timeout at T1.
(ii) 4, [2 retransmitted thru subsequent ACKs and 5 doesn’t need to be transmitted] /2
Explanation: Packet 4 did not make it to the receiver so it needs to be resent because it
timed out at T1. Packet 2 did not make it to the receiver so it needs to be resent; this is
detected through k subsequent acks (from 3,6). (The ack for packet 5 was lost but when
the ack for packet 6 was received, the full information ack informed the sender that packet
5 was received)
(iii) 3,4,5,6 [2 retransmitted due to k dup ACKs] /2
Explanation: Since the packet 2 was lost, the acks being received show: acks <= 1 all the
packets after 1 need to be resent. However, packet 2’s loss is detected by 2 dup acks (first
ack of packet 1 saying ack<=1 and then two dup acks from packets 3 and 6) so it is resent
using dup acks.
b) 4, 5 [2 retransmitted due to k dup ACKs] /3
Explanation: Packets 4 did not make it to the receiver so it needs to be resent because it
timed out at T1. The ack for Packet 2 did not make it to the receiver so it needs to be
resent; this is detected through k dup acks (from 1 (first ack), 3 (dup ack) and 6(dup ack)).
After the second packet was not received, all the rest were out of order and individual acks
were sent instead of cumulative ones.
[Q1] Different Forms of ACKs Version 3
Max time allowed: 15 mins
Total marks: 10
Suppose your TA Sarah is designing a new photo-sharing application. Sarah wants to make sure
that photos are reliably transferred between users. To do so, she decides to design her own
reliable data transfer protocol, RTPS (Reliable Transfer for Photo Sharing). RTPS receivers
respond with an acknowledgment if a packet is correctly received (and do not use any NACKs).
RTPS uses a sliding window of size 6. The senders in RTPS use timers to detect packet losses.
In addition, senders also use an ACK-triggered loss detection mechanism, where if ACKs are
received for any k subsequent packets, the senders infer the packet is lost. RTPS sets k to be 3.
On detecting a loss, the RTPS sender retransmits the earliest unacknowledged packet.
To test RTPS, Sarah transfers a photo between two users, which requires sending 6 packets into
the network. The diagram below shows the send and receiver and the state of packets and ACKs
exchanged. Packet 4 is not delivered and the ACKs for packets 2 and 5 are lost. Timeout at T1
represents the timeout for packet 1.
a) Which packets would need to be retransmitted at T1 if RTPS uses:
(7) Individual ACKs 2
(8) Full Information ACKs 3
(9) Cumulative ACKs 2
b) After testing the above three ACK schemes, Sarah decides to design a new ACK scheme -Cumulative ACKs with selective ACKs. In this scheme, the RTPS receivers use cumulative ACKs,
however, if an out-of-order packet is received, the receiver sends an individual ACK specifying the
exact packet received (e.g., in the above example scenario if packet 3 is received, the receiver
send an individual ACK 3). If such an ACK scheme is used , which packets would need to be
retransmitted at T1
Please briefly explain your answers to get any points.
Answers:
(i) 2,4,5 [None retransmitted thru subsequent ACKs] /3
Explanation:The ack for packet 2 and 5 were lost so they need to be resent because of
timeout at T1. Packet 4 did not make it to the receiver so it needs to be resent because of
timeout at T1.
(ii) 4 [None retransmitted thru subsequent ACKs and 2, 5 don’t need to be transmitted] /2
Explanation: Packet 4 did not make it to the receiver so it needs to be resent because it
timed out at T1. (The acks for packet 2 and 5 were lost but when the ack for packet 3 and
6 were received, the full information ack informed the sender that packet 2 and 5 were
received)
(iii) 4,5,6 [None retransmitted thru subsequent ACKs] /2
Explanation: The ack for packet 5 was lost so it needed to be resent because of timeout at
T1. Packet 4 did not make it to the receiver so it needs to be resent because of timeout at
T1. The last ack that was received was: acks <= 5 so packet 6 also needs to be resent.
Packet 2 does not need to be resent because after packet 3 was delivered, the ack was:
acks <= 3 so the sender knew that packet 2 was received.
b) 4, 5 /3
Explanation: Packet 4 did not make it to the receiver so it needs to be resent because it
timed out at T1. The ack for packet 5 was lost and the cumulative ack was upto 3 so
packet 5 also timed out and needs to be resent. After the first packet was not received, all
the rest were out order and individual acks were sent instead of cumulative ones.
Download