615 views
0 0 votes
PLEASE FRAME AN EXAMPLE TO  EXPLAIN  THE CASES MENTIONED IN THIS

The third major event that must be handled by the TCP sender is the arrival of an
acknowledgment segment (ACK) from the receiver (more specifically, a segment containing
a valid ACK field value). On the occurrence of this event, TCP compares the
ACK value y with its variable SendBase. The TCP state variable SendBase is the
sequence number of the oldest unacknowledged byte. (Thus SendBase–1 is the
sequence number of the last byte that is known to have been received correctly and in
order at the receiver.) As indicated earlier, TCP uses cumulative acknowledgments, so
that y acknowledges the receipt of all bytes before byte number y. If y > SendBase,
/* Assume sender is not constrained by TCP flow or congestion control, that data from above is less
than MSS in size, and that data transfer is in one direction only. */

1 Answer

0 0 votes
Whenever a sending host sends a segment to a receiving host, the receiving hosts sends an acknowledgement of the last segment which was correctly received in order. The sending host maintains information on the current state of the sending window (next segment to send and last segment which was correctly received) and slides the window according to the last segment which was correctly received.

Cumulative acknowledgement means that when out-of-order acknowledgements are received (i.e. when some ACK is lost during transmission from receiver), the sender is sure that the receiver received the sent segments in order till the ACK of the highest sequence number.

To make it clear, consider the following scenario:

- Sending host 'A' sends 5 segments to receiving host 'B'

- Window size is 5 for both A and B

- Sender side variables: next_sequence_number, send_base

Case 1: Segment dropped during transmission from A to B

Assume Segments 3 and 4 are lost.

Since 5 segments were sent, next_sequence_number = 6, send_base = 1 (didn't receive ACKs yet)

 

1. B was expecting segment 1. It arrives. B sends an ACK for segment 1 and slides its receiving window by 1.

A receives the ACK for segment 1, slides the sending window by 1 and increments the send_base.

send_base = 2

 

2. B was expecting segment 2. It arrives. B sends an ACK for segment 2 and slides its receiving window by 1.

A receives the ACK for segment 2, slides the sending window by 1 and increments the send_base.

send_base = 3

 

3. B was expecting segment 3 but segment 5 arrived instead (as segments 3 and 4 were lost). B sends an ACK for segment 2. (as it was the last segment which had arrived in correct order). B doesn't slide its receiving window.

A was expecting ACK for segment 3 but receives the ACK for segment 2. Hence it doesn't slide the sending window by 1 and doesn't increment the send_base.

send_base = 3

B discards all the out-of-order segments (as we're talking about Go-Back-N here)

As the timer expires, A retransmits all the segments starting from send_base to next_sequence_number - 1,  i.e segments 3, 4 and 5.

Case 2: ACK dropped during transmission from B to A.

Assume B received all the segments in order and sent the respective ACKs.

Assume ACK of segments 3 and 4 are lost.

 

1. A expecting ACK for segment 1, receives it, increments send_base and slides the window by 1. send_base = 2

2. A expecting ACK for segment 2, receives it, increments send_base and slides the window by 1. send_base = 3

3. A expecting ACK for segment 3, receives ACK for segment 5 instead. A becomes sure that B received the segments 3 and 4 as B wouldn't have sent ACK for segment 5 if it didn't receive segment 3 or segment 4.

Hence, A increments send_base by 3 and slides the window by 3.
• edited by
Position:
Show:

Related questions

1 1 vote
1 1 answer
1.2k
1.2k views
Mak Indus asked Oct 26, 2018
1,197 views
Consider the following foo function and identify the return value of foo function.int foo (unsigned int n){ int c, x = 0; while (n! = 0) ...
0 0 votes
1 1 answer
1.2k
1.2k views
Jarvis asked Jun 17, 2015
1,159 views
Is deadlock possible in Test Set Lock?
1 1 vote
1 1 answer
497
497 views
abhi1998 asked Sep 13, 2021
497 views
In a randomised BST is constructing with 7 distinct elements . What is the probability that its Inorder and postOrder traversal are same