Q1➡|GATE 2021 Set-1 A TCP server application is programmed to listen on port number P on host S. A TCP client is connected to the TCP server over the network. Consider that while the TCP connection was active, the server machine S crashed and rebooted. Assume that the client does not use the TCP keep alive timer. Which of the following behaviours is/are possible?
i ➥ If the client sends a packet after the server reboot, it will receive a FIN segment.
ii ➥ The TCP server application on S can listen on P after reboot.
iii ➥ If the client sends a packet after the server reboot, it will receive a RST segment.
iv ➥ If the client was waiting to receive a packet, it may wait indefinitely.
Q2➡| GATE 2021 Set-2 Consider the three-way handshake mechanism followed during TCP connection established between hosts P and Q. Let X and Y be two random 32-bit starting sequence numbers chosen by P and Q respectively. Suppose P sends a TCP connection request message to Q with a TCP segment having SYN bit = 1, SEQ number = X, and ACK bit = 0. Suppose Q accepts the connection request. Which one of the following choices represents the information present in the TCP segment header that is sent by Q to P?
i ➥ SYN bit = 1, SEQ number = Y, ACK bit = 1, ACK number = X, FIN bit = 0
ii ➥ SYN bit = 1, SEQ number = X+1, ACK bit = 0, ACK number = Y, FIN bit = 0
iii ➥ SYN bit = 1, SEQ number = Y, ACK bit = 1, ACK number = X+1, FIN bit = 0
iv ➥ SYN bit = 0, SEQ number = X+1, ACK bit = 0, ACK number = Y, FIN bit = 1
Show Answer With Best Explanation
Answer: III
Explanation: Given, Random Sequence number chosen by P is X. Random Sequence number chosen by Q is Y.
P sends a TCP connection request to Q with TCP Segment having, SYN bit = 1, SEQ (Sequence) number = X, ACK bit = 0
Let’s briefly understand some terms, Sequence Number: The Sequence Number for each segment is the number of the 1st Byte carried in that segment. Host can choose any Random Sequence Number.
SYN bit: It is used during connection to synchronize the connection. First TCP segment send by any Host have SYN bit =1. TCP is full Duplex protocol. So, 1st Segment sent by Host P to Host Q and 1st Segment sent by Host Q to Host P contain SYN bit = 1.
ACK bit: The ACK bit =1, indicate the segment contains Acknowledge. The ACK bit =0, indicate the segment does not contain Acknowledge.
ACK(Acknowledge) number: ACK number is the Byte Number expected next. If the receiver of the segment has successfully received Byte Number x from other party, if defines X+1 as the Acknowledge Number.
TCP Segment Header that is sent by Q to P have :
SYN = 1, Because it is 1st Segment sent from Q to P, it is used to Synchronize the connection.
Seq number = y , It is given that y be Sequence number chosen by Q.
Ack number = X+1 , SYN flag consume one Sequence number. Byte number X is consume by Q. So, Q expect X+1 next Byte number.
FIN bit = 0 , when FIN bit = 1, Host want to terminate connection. when FIN bit = 0, Host does not want to terminate connection.
Q3➡|GATE 2020 Consider a TCP connection between a client and a server with the following specifications: the round trip time is 6 ms, the size of the receiver advertised window is 50 KB, slow start threshold at the client is 32 KB, and the maximum segment size is 2 KB. The connection is established at time t=0. Assume that there are no timeouts and errors during transmission. Then the size of the congestion window (in KB) at time t+60 ms after all acknowledgements are processed is ________.
Ask, Congestion window size at time t+60 ms after all acknowledgements are processed= ? Here, t+60 ms is nothing but t +(60/6) = t+10th RTT {After 10thRTT or at 11th RTT}
Logic to solve, 1) Start with given MSS(2KB). 2) Increase the sender window size in multiple of MSS(2KB) and stops when thresold(32KB) reached. 3) Once Thresold reached, increased sender window size by 1MSS(2KB) till timeout occurs.
Q4➡| GATE 2018 Consider the following statements regarding the slow start phase of the TCP congestion control algorithm. Note that cwnd stands for the TCP congestion window and MSS denotes the Maximum Segment Size. (i) The cwnd increase by 2 MSS on every successful acknowledgement. (ii) The cwnd approximately doubles on every successful acknowledgement. (iii) The cwnd increase by 1 MSS every round trip time. (iv) The cwnd approximately doubles every round trip time. Which one of the following is correct?
i ➥ Only (ii) and (iii) are true
ii ➥ Only (i) and (iii) are true
iii ➥Only (iv) is true
iv ➥ Only (i) and (iv) are true
Show Answer With Best Explanation
Answer: III
Explanation: Statement(I): The cwnd increase by 2 MSS on every successful acknowledgement.(False) It is False because cwnd increase by 1 MSS on every successful acknowledgement.
Statement(II): The cwnd approximately doubles on every successful acknowledgement. (False) It is False as the same reason for above.
Statement(III): The cwnd increase by 1 MSS every round trip time. (False)
Statement(IV): The cwnd approximately doubles every round trip time. (True)
There is a confusion between statement(II) and statement(IV). Let’s understand it example
It is cleared with the diagram that: The congestion window is increase by 1MSS on every successful acknowledge and The congestion window approximately doubles every round trip time.
Q5➡| GATE 2018 Consider a long-lived TCP session with an end-to-end bandwidth of 1 Gbps (= 109 bits/second). The session starts with a sequence number of 1234. The minimum time (in seconds, rounded to the closest integer) before this sequence number can be used again is ________.
Q6➡| GATE 2017 Set-1 Consider a TCP client and a TCP server running on two different machines. After completing data transfer, the TCP client calls close to terminate the connection and a FIN segment is sent to the TCP server. Server-side TCP responds by sending an ACK, which is received by the client-side TCP. As per the TCP connection state diagram (RFC 793), in which state does the client-side TCP connection wait for the FIN from the server-side TCP?
i ➥ FIN-WAIT-2
ii ➥ LAST-ACK
iii ➥ TIME-WAIT
iv ➥ FIN-WAIT-1
Show Answer With Best Explanation
Answer: I
Explanation: TCP connection state diagram (RFC 793) * FIN-WAIT-1 Client-side TCP is waiting for an acknowledgment of the connection termination request or for a simultaneous connection termination request from Server-side TCP. This state is normally of short duration.
* FIN-WAIT-2 TCP client is sent FIN segment to the TCP server. Server-side TCP responds by sending an ACK, which is received by the client-side TCP.Client-side TCP connection wait for the FIN from the server-side TCP.
* TIME-WAIT Server side TCP is waiting for enough time to pass to be sure the server side TCP received the acknowledgment of its connection termination request.
* LAST-ACK Client-side TCP is waiting for an acknowledgment of the connection termination request previously sent to Server. This state is entered when client-side TCP received a termination request before it sent its termination request.
Q7➡| GATE 2016 Set-2 Identify the correct sequence in which the following packets are transmitted on the network by a host when a browser requests a webpage from a remote server, assuming that the host has just been restarted.
Q8➡| GATE 2015 Set-1 Suppose two hosts use a TCP connection to transfer a large file. Which of the following statements is/are False with respect to the TCP connection?
I. If the sequence number of a segment is m, then the sequence number of the subsequent segment is always m+1. II. If the estimated round trip time at any given point of time is t sec, the value of the retransmission timeout is always set to greater than or equal to t sec. III. The size of the advertised window never changes during the course of the TCP connection. IV. The number of unacknowledged bytes at the sender is always less than or equal to the advertised window.
i ➥ III only
ii ➥ I and III only
iii ➥ I and IV only
iv ➥ II and IV only
Show Answer With Best Explanation
Answer: II
Explanation: Statement(I): If the sequence number of a segment is m, then the sequence number of the subsequent segment is always m+1.(False) 1 Byte of Data consumes 1 Sequence number.If Sequence number of segment is m, then the Sequence number of subsequent segment is m+1,only if 1 Byte of Data is transferred. But it is already given that Host transfer large file. So, the statement is False.
Statement(II): If the estimated round trip time at any given point of time is t sec, the value of the retransmission timeout is always set to greater than or equal to t sec.(True) TCP sets a timeout when it sends Data and if Data is not acknowledged before timeout expires it retransmit data. Timeout is based on RTT. Timeout is always set to greater than or equal to RTT.
Statement(III): The size of the advertised window never changes during the course of the TCP connection.(False) Receiver’s window buffer is never changed.But depending upon the available window size, Advertised window is keep changing. Let’s undestand it with example, Suppose receiver window size is 1000B, so the size of advertised window is 1000B. Again suppose sender have 400B of data to sent, it sends to receiver. Now receiver window have (1000-400) 600B of available space. Now receiver will sent acknowlege to sender with advertised window of 600B. So, The size of the advertised window keep change during the course of the TCP connection.
Statement(IV): The number of unacknowledged bytes at the sender is always less than or equal to the advertised window.(True) Because sender will never sends number of Byte greater than the advertised window.
Q9➡| GATE 2015 Set-2 Assume that the bandwidth for a TCP connection is 1048560 bits/sec. Let α be the value of RTT in milliseconds (rounded off to the nearest integer) after which the TCP window scale option is needed. Let β be the maximum possible window size the window scale option. Then the values of α and β are
i ➥ 63 milliseconds, 65535×214
ii ➥ 63 milliseconds, 65535×216
iii ➥ 500 milliseconds, 65535×214
iv ➥ 500 milliseconds, 65535×216
Show Answer With Best Explanation
Answer: III
Explanation: RTT: Round-trip delay (RTD) or round-trip time (RTT) is the amount of time it takes for a signal to be sent plus the amount of time it takes for acknowledgement of that signal having been received.
Bandwidth-Delay Product(BDP): The bandwidth-delay product is the product of a data link’s capacity (in bits per second) and its round-trip time (in seconds). BDP = RTT * bandwidth
Given, Bandwidth(or data link capacity) = 1048560 bits/sec TCP window scale option is needed. It is needed for efficient transfer of data when the Bandwidth-Delay Product (BDP) is greater than 64 KB {* BDP = 64KB (BDP is maximum 216-1 =65535 B )*}
By using the window scale option, the receiver window size increased up to a maximum of 1GB. Receiver window size from 64KB to 1GB i.e. 216B to 230B. a 14bits shift count is used in TCP Header. So, the maximum possible window size gets increased from 216-1 to (216-1 * 214) or 65,535 to 65,535 * 214.
Q10➡| GATE 2015 Set-3 Consider the following statements. I. TCP connections are full duplex. II. TCP has no option for selective acknowledgment. III. TCP connections are message streams.
i ➥ Only I is correct
ii ➥ Only I and III are correct
iii ➥ Only II and III are correct
iv ➥ All of I, II and III are correct
Show Answer With Best Explanation
Answer: I
Explanation: Statement(I): TCP connections are full duplex.(True) TCP offers full-duplex service, in which data can flow in both directions at the same time. Each TCP then has a sending and receiving buffer, and segments move in both directions.
Statement(II): TCP has no option for selective acknowledgment.(False) TCP has option for selective acknowledgment. With selective acknowledgments, the data receiver can inform the sender about all segments that have arrived successfully, so the sender need retransmit only the segments that have actually been lost.
Statement(III): TCP connections are message streams.(False) TCP connections are Byte stream protocol. While sending data, each Byte of segment is counted and First Byte number of segment is called Sequence number.Sequence number of TCP segment is stored in TCP Header.
Q11➡|GATE 2014 Set-1 Let the size of congestion window of a TCP connection be 32 KB when a timeout occurs. The round trip time of the connection is 100 msec and the maximum segment size used is 2 KB. The time taken (in msec) by the TCP connection to get back to 32 KB congestion window is ________.
Show Answer With Best Explanation
Answer: 1000 To 1300
Explanation: Given, size of congestion window = 32KB Round Trip Time = 100ms Maximum segment size = 2KB
Logic to solve, When Time-out occurs in TCP slow start phase, Thresold value is calculated by Thresold = (Congestion window size)/2
So, start with 1MSS (or 2KB) as sender window size. Slow start phase will begin and window size will grow exponentially till Thresod reached. After that congestion avaidance phase will begin. Now window size will grow linearly till 16MSS (or 32KB).
Slow start phase: window size is 1 MSS (or 2KB) After 1st Round Trip, window size is 2 MSS (or 4KB) After 2nd Round Trip, window size is 4 MSS (or 8KB) After 3rd Round Trip, window size is 8 MSS (or 16KB) (Thresold reached) Congestion avaodance phase: After 4th Round Trip, window size is 9 MSS (or 18KB) After 5th Round Trip, window size is 10 MSS (or 20KB) After 6th Round Trip, window size is 11 MSS (or 22KB) After 7th Round Trip, window size is 12 MSS (or 24KB) After 8th Round Trip, window size is 13 MSS (or 26KB) After 9th Round Trip, window size is 14 MSS (or 28KB) After 10th Round Trip, window size is 15 MSS (or 30KB) After 11th Round Trip, window size is 16 MSS (or 32KB)
Total Round Trip = 11 Total Round Trip Time = 11* 100 ms = 1100ms The time taken (in msec) by the TCP connection to get back to 32 KB congestion window is 1100.