chapter

    Tcp Connection Management, Reliability and Congestion Control Pyqs for Gate Cs

    Solve 10+ Tcp Connection Management, Reliability and Congestion Control previous year questions for GATE CS with answers and detailed solutions. Free sample q

    Try a question

    Answer it here to see how it works. Nothing is recorded until you sign in.

    Question 1
    2026 Slot Set2 PYQ
    Level 3: Exam Standard
    Consider a new TCP connection between a sender and a receiver. The receiver advertised window is constant at 48 KB, the maximum segment size (MSS) is 2 KB, and the slow start threshold for TCP congestion control is 16 KB. Assume that there are no timeouts or duplicate acknowledgements. The number of rounds of transmission required for the congestion control algorithm of the TCP connection to reach the congestion avoidance phase is ___________. (answer in integer)

    Note:
    Question 2
    2026 Slot Set1 PYQ
    Level 3: Exam Standard

    With respect to a TCP connection between a client and a server, which one of the following statements is true?

    Question 3
    2026 Slot Set1 PYQ
    Level 3: Exam Standard
    A TCP sender successfully establishes a connection with a TCP receiver and starts the transmission of segments. The TCP congestion control mechanism’s slow-start threshold is set to 10000 segments. Assume that the round-trip time is fixed at 1 millisecond. Assume that the sender always has data to send, the segments are numbered from 1, and no segment is lost. Let denote the time (in milliseconds) at which the transmission of segment number 2000 starts.

    Which one of the following options is correct?
    Question 4
    2025 Slot Set1 PYQ
    Level 3: Exam Standard

    Consider the 3-way handshaking protocol for TCP connection establishment. Let the three packets exchanged during the connection establishment be denoted as P1, P2, and P3, in order. Which of the following option(s) is/are <b>TRUE</b> with respect to TCP header flags that are set in the packets?

    Question 5
    2024 Slot Set2 PYQ
    Level 3: Exam Standard

    Consider a TCP connection operating at a point of time with the congestion window of size 12 MSS (Maximum Segment Size), when a timeout occurs due to packet loss. Assuming that all the segments transmitted in the next two RTTs (Round Trip Time) are acknowledged correctly, the congestion window size <i>(in MSS)</i> during the third RTT will be __________

    Question 6
    2024 Slot Set1 PYQ
    Level 3: Exam Standard

    TCP client P successfully establishes a connection to TCP server Q. Let denote the sequence number in the SYN sent from P to Q. Let denote the acknowledgement number in the SYN ACK from Q to P. Which of the following statements is/are CORRECT?

    Question 7
    2023 PYQ
    Level 3: Exam Standard
    Suppose you are asked to design a new reliable byte-stream transport protocol like TCP. This protocol, named myTCP, runs over a 100 Mbps network with Round Trip Time of 150 milliseconds and the maximum segment lifetime of 2 minutes.

    Which of the following is/are valid lengths of the Sequence Number field in the myTCP header?
    Question 8
    2022 PYQ
    Level 3: Exam Standard

    Consider the data transfer using TCP over a 1 Gbps link. Assuming that the maximum segment lifetime (MSL) is set to 60 seconds, the minimum number of bits required for the sequence number field of the TCP header, to prevent the sequence number space from wrapping around during the MSL is____________.

    Question 9
    2021 Slot Set2 PYQ
    Level 3: Exam Standard

    Consider the three-way handshake mechanism followed during TCP connection establishment 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?

    Question 10
    2021 Slot Set1 PYQ
    Level 3: Exam Standard
    A TCP server application is programmed to listen on port number on host . A TCP client is connected to the TCP server over the network.
    Consider that while the TCP connection was active, the server machine crashed and rebooted. Assume that the client does not use the TCP keepalive timer.
    Which of the following behaviors is/are possible?
    Free preview ends here

    Login to view the complete previous-year questions and solutions

    Creating an account is free. You get the rest of this chapter, step-by-step solutions, and a study plan built around the topics you are actually weak at.

    Explore complete test series, official past papers, and chapter-wise study tools.

    Why MastersUp

    Personalised first. High quality throughout.

    Most platforms hand everyone the same content. Here the content moves with your performance, topic by topic.

    Built around you, not around a syllabus PDF

    Every answer you give moves your topic-level intelligence rate. The next question, the next revision card and tomorrow's plan all change with it.

    Revision that hits your weak spots

    We only revise topics you have actually attempted and are still below the safe bar on — never the same chapter on repeat.

    Questions calibrated to the real exam

    Each question carries a measured toughness. You are served a rung above your current level, so practice keeps stretching you.

    Notes written for recall, not for volume

    Full lesson cards for first study, curated short-note cards for the last mile — with derivations, traps and exam patterns marked.

    One place for everything

    Notes, chapter practice, previous-year questions, test series and full-length papers — all feeding one picture of your preparation.

    Honest progress

    No vanity streaks. Progress here means chapters mastered and accuracy that held up on harder questions.

    Unlock the whole course

    Full notes and short notes, the complete question bank with worked solutions, mock tests, full-length papers, and an adaptive plan that rebuilds itself as you improve.

    Tcp Connection Management, Reliability and Congestion Control PYQs for GATE CS

    Solve 10+ Tcp Connection Management, Reliability and Congestion Control previous year questions for GATE CS with answers and detailed solutions. Free sample questions below.

    Chapter Roadmap: TCP Connection Management

    Chapter Roadmap

    TCP Connection Management, Reliability and Congestion Control

    1. TCP Handshake, State and Termination
    The foundation. How connections are established, tracked via state machines, and gracefully closed.
    2. TCP Sequence Numbers and Wraparound
    The math of reliability. Ensuring bytes are ordered correctly and preventing sequence number space exhaustion.
    3. TCP Slow Start and Congestion-Window Evolution
    Network survival. How TCP dynamically adjusts its sending rate to avoid collapsing the internet.

    TCP Handshake, Connection State and Termination

    Topic 1 of 3

    TCP Handshake, Connection State and Termination

    How two machines agree to talk, track their conversation, and politely say goodbye.

    What You Will Master
    • The exact mechanics of the 3-way handshake
    • Calculating Sequence and Acknowledgement numbers
    • TCP connection state transitions
    • Graceful termination and the TIME_WAIT state

    Tcp Connection Management, Reliability and Congestion Control: Solved Questions with Step-by-Step Explanations (10 Problems)

    Question 1 · Computer Networks · 2026_Set2 NAT
    Consider a new TCP connection between a sender and a receiver. The receiver advertised window is constant at 48 KB, the maximum segment size (MSS) is 2 KB, and the slow start threshold for TCP congestion control is 16 KB. Assume that there are no timeouts or duplicate acknowledgements. The number of rounds of transmission required for the congestion control algorithm of the TCP connection to reach the congestion avoidance phase is ___________. (answer in integer)

    Note:
    Correct Answer:

    3.00

    Step-by-Step Solution

    Insight: The congestion window doubles every RTT during Slow Start until it reaches the slow start threshold (ssthresh).

    Exam route: ssthresh = 16 KB = 8 MSS. Initial cwnd = 1 MSS. RTT 1: 1->2. RTT 2: 2->4. RTT 3: 4->8. After 3 rounds, cwnd reaches 8 MSS, entering Congestion Avoidance.

    Learning route:

    1. Identify the parameters: MSS = 2 KB, ssthresh = 16 KB.
    2. Convert ssthresh to MSS: .
    3. The receiver window is 48 KB, which is much larger than the cwnd, so it doesn't restrict growth.
    4. Initial cwnd is 1 MSS.
    5. During Slow Start, cwnd doubles every RTT.
    6. Round 1: cwnd starts at 1 MSS, ends at 2 MSS.
    7. Round 2: cwnd starts at 2 MSS, ends at 4 MSS.
    8. Round 3: cwnd starts at 4 MSS, ends at 8 MSS.
    9. After 3 rounds, cwnd reaches 8 MSS, which is equal to ssthresh. The next phase is Congestion Avoidance.
    10. Thus, 3 rounds are required to reach the congestion avoidance phase.
    Question 2 · Computer Networks · 2026_Set1 MCQ

    With respect to a TCP connection between a client and a server, which one of the following statements is true?

    1. A.

      The client and server use a two-way handshake mechanism before the start of data transmission

    2. B.

      The server cannot initiate closing of the connection before the client initiates closing of the connection

    3. C.

      The TCP connection is half-duplex

    4. D.

      The client and server can initiate closing of the connection at the same time

    Correct Answer:

    D

    Step-by-Step Solution

    Insight: TCP is a full-duplex protocol, meaning both sides can send and receive independently. This allows either side to initiate a connection closure, and they can even do so simultaneously.

    Exam route:

    • A: False. TCP uses a 3-way handshake for establishment, not 2-way.
    • B: False. Either side can initiate the 4-way handshake for termination.
    • C: False. TCP is full-duplex, not half-duplex.
    • D: True. Simultaneous close is a standard TCP feature where both sides send FINs at the same time.

    Learning route:

    1. TCP provides a full-duplex communication channel. This means data can flow in both directions simultaneously and independently. (Option C is false).
    2. Connection establishment requires a 3-way handshake (SYN, SYN-ACK, ACK) to synchronize sequence numbers in both directions. (Option A is false).
    3. Connection termination uses a 4-way handshake (FIN, ACK, FIN, ACK) because each direction must be closed independently.
    4. Since the connection is full-duplex, either the client or the server can initiate the closure by sending the first FIN. There is no restriction that the client must close first. (Option B is false).
    5. It is entirely possible for both applications to decide to close the connection at the exact same time. In this "simultaneous close" scenario, both sides send a FIN, and both sides acknowledge the other's FIN. TCP handles this gracefully. (Option D is true).
    Question 3 · Computer Networks · 2026_Set1 MCQ
    A TCP sender successfully establishes a connection with a TCP receiver and starts the transmission of segments. The TCP congestion control mechanism’s slow-start threshold is set to 10000 segments. Assume that the round-trip time is fixed at 1 millisecond. Assume that the sender always has data to send, the segments are numbered from 1, and no segment is lost. Let denote the time (in milliseconds) at which the transmission of segment number 2000 starts.

    Which one of the following options is correct?
    1. A.

    2. B.

    3. C.

    4. D.

    Correct Answer:

    B

    Step-by-Step Solution

    Insight: The total number of segments sent in slow start follows a geometric series, and we just need to find which RTT interval contains the 2000th segment.

    Exam route: Sum of segments after RTTs is . For , sum is $1023$. For , sum is $2047$. Since , segment 2000 is sent in the 11th RTT. The 11th RTT starts at ms.

    Learning route:

    1. In slow start, the congestion window () starts at 1 MSS and doubles every RTT.
    2. The number of segments sent in the -th RTT is .
    3. The cumulative number of segments sent after RTTs is .
    4. We need to find the RTT where the 2000th segment is sent. This means the cumulative sum after RTTs must be less than 2000, and the cumulative sum after RTTs must be .
    5. Calculate cumulative sums:
    • After 10 RTTs: segments.
    • After 11 RTTs: segments.
    1. Since , the 2000th segment is transmitted during the 11th RTT.
    2. The 1st RTT starts at . Since each RTT is 1 ms, the -th RTT starts at .
    3. The 11th RTT starts at ms, and ends at ms.
    4. Therefore, the transmission of segment 2000 starts at a time where .
    Question 4 · Computer Networks · 2025_Set1 MSQ

    Consider the 3-way handshaking protocol for TCP connection establishment. Let the three packets exchanged during the connection establishment be denoted as P1, P2, and P3, in order. Which of the following option(s) is/are <b>TRUE</b> with respect to TCP header flags that are set in the packets?

    1. A.

      P3: SYN = 1, ACK = 1

    2. B.

      P2: SYN = 1, ACK = 1

    3. C.

      P2: SYN = 0, ACK = 1

    4. D.

      P1: SYN = 1

    Correct Answer:

    ["B","D"]

    Step-by-Step Solution

    Insight: The 3-way handshake consists of a SYN from the client, a SYN-ACK from the server, and a final ACK from the client.

    Exam route:

    • P1 (Client Server): SYN flag is set. (SYN=1, ACK=0)
    • P2 (Server Client): SYN and ACK flags are set. (SYN=1, ACK=1)
    • P3 (Client Server): Only ACK flag is set. (SYN=0, ACK=1)

    Learning route:

    1. The TCP connection establishment uses a 3-way handshake to synchronize sequence numbers and allocate resources.
    2. Step 1 (P1): The client initiates the connection by sending a segment with the SYN flag set to 1. The ACK flag is 0.
    3. Step 2 (P2): The server receives the SYN, allocates resources, and replies with a segment containing both SYN and ACK flags set to 1. This acknowledges the client's SYN and sends the server's own SYN.
    4. Step 3 (P3): The client receives the SYN-ACK, acknowledges the server's SYN, and sends a final segment with the ACK flag set to 1 and the SYN flag set to 0. The connection is now established.
    5. Evaluating the options:
    • P3 has SYN=0, ACK=1. (Option A is false).
    • P2 has SYN=1, ACK=1. (Option B is true).
    • P2 does not have SYN=0. (Option C is false).
    • P1 has SYN=1. (Option D is true).
    Question 5 · Computer Networks · 2024_Set2 NAT

    Consider a TCP connection operating at a point of time with the congestion window of size 12 MSS (Maximum Segment Size), when a timeout occurs due to packet loss. Assuming that all the segments transmitted in the next two RTTs (Round Trip Time) are acknowledged correctly, the congestion window size <i>(in MSS)</i> during the third RTT will be __________

    Correct Answer:

    4.00

    Step-by-Step Solution

    Insight: A timeout indicates severe congestion. The sender halves the current window to set the new threshold and resets the window to 1 MSS, restarting slow start.

    Exam route:

    • Initial MSS. Timeout occurs.
    • New MSS.
    • New MSS.
    • 1st RTT after timeout: . Next .
    • 2nd RTT after timeout: . Next .
    • 3rd RTT after timeout: .

    Learning route:

    1. When a timeout occurs, TCP triggers the "severe congestion" response.
    2. The slow start threshold () is updated to half of the current congestion window () just before the loss. Here, MSS.
    3. The congestion window is reset to 1 MSS, and the sender re-enters the Slow Start phase.
    4. We need to find the during the third RTT after the timeout. Let's trace RTT by RTT:
    • 1st RTT after loss: The sender starts with MSS. It sends 1 segment. Upon successful ACK, doubles to 2 MSS.
    • 2nd RTT after loss: The sender starts with MSS. Since (6), it is still in Slow Start. It sends 2 segments. Upon successful ACKs, doubles to 4 MSS.
    • 3rd RTT after loss: The sender starts with MSS. Since , it is still in Slow Start.
    1. Therefore, the congestion window size during the third RTT is 4 MSS.
    Question 6 · Computer Networks · 2024_Set1 MSQ

    TCP client P successfully establishes a connection to TCP server Q. Let denote the sequence number in the SYN sent from P to Q. Let denote the acknowledgement number in the SYN ACK from Q to P. Which of the following statements is/are CORRECT?

    1. A.

      The sequence number is chosen randomly by P

    2. B.

      The sequence number is always 0 for a new connection

    3. C.

      The acknowledgement number is equal to

    4. D.

      The acknowledgement number is equal to

    Correct Answer:

    ["A","D"]

    Step-by-Step Solution

    Insight: TCP handshakes synchronize initial sequence numbers (ISNs), which are randomized for security, and the ACK number always points to the next expected byte (ISN + 1 for a SYN).

    Exam route: P's SYN has Seq = . SYN consumes 1 sequence number. Q's SYN-ACK must ACK the next expected byte from P, which is . ISNs are random to prevent spoofing.

    Learning route:

    1. In TCP, the initial sequence number (ISN) is chosen randomly by the sender to prevent sequence prediction attacks. Thus, is random, not always 0. (A is correct, B is wrong).
    2. When P sends a SYN with Seq = , the SYN flag itself consumes 1 sequence number, even though it carries no data.
    3. The receiver (Q) must acknowledge the next expected sequence number. The next expected byte from P is .
    4. Therefore, in Q's SYN-ACK segment, the Acknowledgement number is exactly . (D is correct, C is wrong).
    Question 7 · Computer Networks · 2023 MSQ
    Suppose you are asked to design a new reliable byte-stream transport protocol like TCP. This protocol, named myTCP, runs over a 100 Mbps network with Round Trip Time of 150 milliseconds and the maximum segment lifetime of 2 minutes.

    Which of the following is/are valid lengths of the Sequence Number field in the myTCP header?
    1. A.

      30 bits

    2. B.

      32 bits

    3. C.

      34 bits

    4. D.

      36 bits

    Correct Answer:

    ["B","C","D"]

    Step-by-Step Solution

    Insight: To prevent wraparound, the sequence number space must be strictly larger than the maximum data that can be sent during the Maximum Segment Lifetime (MSL).

    Exam route: Bandwidth = 100 Mbps = bytes/sec. MSL = 120s. Max data = bytes. (too small). (valid). Thus, 32, 34, 36 bits are all valid lengths.

    Learning route:

    1. The protocol is a byte-stream protocol, so sequence numbers count bytes.
    2. Convert bandwidth to bytes per second: .
    3. The time window to prevent wraparound is the MSL, which is 2 minutes = 120 seconds.
    4. Calculate the maximum data that can be sent in this window: bytes.
    5. The sequence number space must be strictly greater than .
    6. Check the options: (Invalid). (Valid).
    7. Since 32 is valid, any larger number of bits (34, 36) is also valid.
    Question 8 · Computer Networks · 2022 NAT

    Consider the data transfer using TCP over a 1 Gbps link. Assuming that the maximum segment lifetime (MSL) is set to 60 seconds, the minimum number of bits required for the sequence number field of the TCP header, to prevent the sequence number space from wrapping around during the MSL is____________.

    Correct Answer:

    33.00

    Step-by-Step Solution

    Insight: The sequence number space must be strictly greater than the maximum data that can be transmitted during the Maximum Segment Lifetime (MSL).

    Exam route: 1 Gbps = bytes/sec. MSL = 60s. Max data = bytes. (too small). (valid). Min bits = 33.

    Learning route:

    1. The link speed is 1 Gbps = bits per second.
    2. TCP sequence numbers count bytes, not bits. Convert bandwidth to bytes/sec: bytes/sec.
    3. The time window to prevent wraparound is the MSL, which is 60 seconds.
    4. Calculate the maximum data that can be sent in 60 seconds: bytes.
    5. The sequence number space must be strictly greater than .
    6. We know , so . More precisely, .
    7. Since , 32 bits are not enough.
    8. .
    9. Since , 33 bits are sufficient.
    10. The minimum number of bits required is 33.
    Question 9 · Computer Networks · 2021_Set2 MCQ

    Consider the three-way handshake mechanism followed during TCP connection establishment 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?

    1. A.

      SYN bit = 1, SEQ number = X+1, ACK bit = 0, ACK number = Y, FIN bit = 0

    2. B.

      SYN bit = 0, SEQ number = X+1, ACK bit = 0, ACK number = Y, FIN bit = 1

    3. C.

      SYN bit = 1, SEQ number = Y, ACK bit = 1, ACK number = X+1, FIN bit = 0

    4. D.

      SYN bit = 1, SEQ number = Y, ACK bit = 1, ACK number = X, FIN bit = 0

    Correct Answer:

    C

    Step-by-Step Solution

    Insight: In a TCP handshake, the responder's SYN-ACK uses its own ISN for the Seq field and the initiator's ISN + 1 for the Ack field.

    Exam route: P sends SYN with Seq=X. Q replies with SYN-ACK. Q's Seq is its own ISN (Y). Q's Ack is P's next expected Seq (X+1).

    Learning route:

    1. P initiates the connection with a SYN segment. The sequence number is P's ISN, which is X.
    2. The SYN flag consumes 1 sequence number. The next expected sequence number from P is X + 1.
    3. Q accepts the request and replies with a SYN-ACK segment.
    4. The SYN-ACK segment must contain Q's own ISN in the Sequence Number field. Q's ISN is Y. So, SEQ = Y.
    5. The Acknowledgement Number field must contain the next expected sequence number from P, which is X + 1. So, ACK = X + 1.
    6. The SYN and ACK flags are both set to 1. FIN is 0.
    7. This matches Option C.
    Question 10 · Computer Networks · 2021_Set1 MSQ
    A TCP server application is programmed to listen on port number on host . A TCP client is connected to the TCP server over the network.
    Consider that while the TCP connection was active, the server machine crashed and rebooted. Assume that the client does not use the TCP keepalive timer.
    Which of the following behaviors is/are possible?
    1. A.

      If the client was waiting to receive a packet, it may wait indefinitely.

    2. B.

      The TCP server application on can listen on after reboot.

    3. C.

      If the client sends a packet after the server reboot, it will receive a RST segment.

    4. D.

      If the client sends a packet after the server reboot, it will receive a FIN segment.

    Correct Answer:

    ["A","B","C"]

    Step-by-Step Solution

    Insight: A server crash wipes its TCP state (Transmission Control Block). The client, unaware of the crash, keeps its state. If the client sends data, the rebooted server will reject it with a RST because it has no matching connection record.

    Exam route:

    • A: True. Without keepalive, a passive client waiting for data will never know the server died.
    • B: True. Crash clears RAM, freeing port P for a new application to bind.
    • C: True. Client sends data -> server OS finds no TCB -> replies with RST.
    • D: False. Server doesn't know the connection exists, so it cannot gracefully close it with a FIN.

    Learning route:

    1. When a server crashes, its operating system reboots and all volatile memory (including TCP connection states or TCBs) is lost.
    2. The client machine does not crash and retains its TCB for the connection.
    3. If the client is passively waiting for data (Option A), it will wait indefinitely because no keepalive mechanism is used to probe the server's liveness.
    4. After reboot, the server's OS starts fresh. The port P is no longer bound to the old crashed application, so a new server application can successfully call listen() on port P (Option B).
    5. If the client sends a data segment after the reboot (Option C), the segment arrives at the server. The server's TCP stack looks for a TCB matching the source/destination IP and ports. Since it finds none, it responds with a Reset (RST) segment to indicate the connection does not exist.
    6. The server will not send a FIN (Option D) because a FIN is used for graceful closure of a known, active connection. The server has no knowledge of the connection to close.

    More previous year questions (pyqs) in this unit