Tcp Connection Management, Reliability and Congestion Control Notes for Gate Cs
Tcp Connection Management, Reliability and Congestion Control notes for GATE CS: 31 study cards covering concepts, formulas, shortcuts and exam traps, plus so
Tcp Connection Management Reliability and Congestion Control notes
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
Why Do We Need a Handshake?
Why Do We Need a Handshake?
TCP is connection-oriented. Before any application data flows, the endpoints must establish a logical pipe. This handshake serves two critical purposes:
1. Liveness and Resource Allocation
Both sides confirm the other is reachable. The operating system allocates buffers and variables (the Transmission Control Block) for this specific connection.
2. Sequence Number Synchronization
TCP tracks every byte with a sequence number. The handshake allows both sides to exchange their Initial Sequence Numbers (ISNs) so they can correctly order data and acknowledge receipt.
28 more cards in this chapter
Try a question
Answer it here to see how it works. Nothing is recorded until you sign in.
Question 1
Level 1: Warm-up
According to the rules of TCP sequence number consumption, which of the following statements are TRUE? (Select all that apply)
Question 2
Level 1: Warm-up
Which of the following statements regarding TCP sequence number consumption is TRUE?
Question 3
Level 1: Warm-up
Match the segment in the standard TCP 3-way handshake with its correct flag configuration (assuming no piggybacked data):
P. First segment (Client to Server)
Q. Second segment (Server to Client)
R. Third segment (Client to Server)
SYN=1, ACK=0
SYN=1, ACK=1
SYN=0, ACK=1
Question 4
Level 1: Warm-up
During TCP connection establishment, the client and server must exchange segments. A student claims that a 2-way handshake is sufficient to establish a full-duplex TCP connection. What is the minimum number of segments actually required in a standard TCP handshake to contradict this claim and reach the ESTABLISHED state?
Question 5
Level 1: Warm-up
Consider the following Assertion (A) and Reason (R) regarding TCP handshake sequence numbers:
Assertion (A): If a client sends a SYN with sequence number X, the server's SYN-ACK will have an acknowledgement number of X+1.
Reason (R): The SYN flag consumes exactly one sequence number, making the next expected sequence number X+1.
Question 6
Level 1: Warm-up
A student claims that establishing a full-duplex TCP connection requires the client to send a SYN, the server to send a SYN-ACK, the client to send an ACK, and finally the server to send a second ACK to confirm the client's ACK. What is the minimum number of segments actually required to reach the ESTABLISHED state, contradicting the student's claim?
Question 7
Level 1: Warm-up
Consider the following Assertion (A) and Reason (R) regarding TCP handshake sequence numbers:
Assertion (A): If a client sends a SYN with sequence number X, the server's SYN-ACK will have an acknowledgement number of X+1.
Reason (R): The SYN flag carries no data payload, therefore it consumes $0$ sequence numbers.
Question 8
Level 1: Warm-up
In the standard 3-way handshake mechanics, when the server replies to the client's initial SYN segment, what is the minimum number of control flags that are set to $1$ in the server's response segment?
Question 9
Level 1: Warm-up
Consider the following Assertion (A) and Reason (R) regarding TCP handshake sequence numbers:
Assertion (A): In a TCP handshake, if the client sends a SYN with sequence number $1000$ and the server sends a SYN-ACK with sequence number $5000$, the client's final ACK will have a sequence number of $1001$.
Reason (R): The client's initial SYN consumes exactly one sequence number, so the client's next sequence number is incremented by one.
Question 10
Level 1: Warm-up
In a TCP implementation, the sequence number field is allocated n bits. What is the total number of unique sequence numbers available in the sequence space before it must wrap around?
Free preview ends here
Login to view the complete notes
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.
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 Notes for GATE CS
Tcp Connection Management, Reliability and Congestion Control notes for GATE CS: 31 study cards covering concepts, formulas, shortcuts and exam traps, plus solved practice questions.
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
Why Do We Need a Handshake?
Why Do We Need a Handshake?
TCP is connection-oriented. Before any application data flows, the endpoints must establish a logical pipe. This handshake serves two critical purposes:
1. Liveness and Resource Allocation
Both sides confirm the other is reachable. The operating system allocates buffers and variables (the Transmission Control Block) for this specific connection.
2. Sequence Number Synchronization
TCP tracks every byte with a sequence number. The handshake allows both sides to exchange their Initial Sequence Numbers (ISNs) so they can correctly order data and acknowledge receipt.
The 3-Way Handshake Mechanics
The 3-Way Handshake Mechanics
1
Client → Server: SYN
Client initiates connection. SYN=1, Seq=x, Ack=0
2
Server → Client: SYN-ACK
Server acknowledges and synchronizes. SYN=1, ACK=1, Seq=y, Ack=x+1
3
Client → Server: ACK
Connection established. Data can now flow. SYN=0, ACK=1, Seq=x+1, Ack=y+1
Tcp Connection Management, Reliability and Congestion Control: Solved Questions with Step-by-Step Explanations (10 Problems)
Question 1 · Computer NetworksMSQ
According to the rules of TCP sequence number consumption, which of the following statements are TRUE? (Select all that apply)
A.
An ACK flag consumes $0$ sequence numbers.
B.
A SYN flag consumes $1$ sequence number.
C.
A data payload of N bytes consumes N+1 sequence numbers.
D.
A FIN flag consumes $1$ sequence number.
Correct Answer:
["A","B","D"]
Step-by-Step Solution
Key idea: Recall the exact consumption rules for TCP flags and data.
Step 1: ACK flag consumes $0$ sequence numbers. (Option A is true)
Step 2: SYN flag consumes $1$ sequence number. (Option B is true)
Step 3: Data payload of $N$ bytes consumes exactly $N$ sequence numbers, not $N+1$. (Option C is false)
Step 4: FIN flag consumes $1$ sequence number. (Option D is true)
Answer: A, B, D
Question 2 · Computer NetworksMCQ
Which of the following statements regarding TCP sequence number consumption is TRUE?
A.
A SYN flag consumes $0$ sequence numbers.
B.
An ACK flag consumes $1$ sequence number.
C.
A data payload of N bytes consumes exactly N sequence numbers.
D.
A FIN flag consumes $0$ sequence numbers.
Correct Answer:
C
Step-by-Step Solution
Key idea: Recall the exact sequence number consumption rules for TCP flags and data.
Step 1: A SYN flag consumes $1$ sequence number. (Option A is false)
Step 2: An ACK flag consumes $0$ sequence numbers. (Option B is false)
Step 3: A data payload of $N$ bytes consumes exactly $N$ sequence numbers. (Option C is true)
Step 4: A FIN flag consumes $1$ sequence number. (Option D is false)
Answer: C
Question 3 · Computer NetworksMCQ
Match the segment in the standard TCP 3-way handshake with its correct flag configuration (assuming no piggybacked data):
P. First segment (Client to Server)
Q. Second segment (Server to Client)
R. Third segment (Client to Server)
SYN=1, ACK=0
SYN=1, ACK=1
SYN=0, ACK=1
A.
P-1, Q-2, R-3
B.
P-2, Q-1, R-3
C.
P-1, Q-3, R-2
D.
P-3, Q-2, R-1
Correct Answer:
A
Step-by-Step Solution
Key idea: This is a direct mapping question testing the exact flag states of the 3-way handshake segments.
Step 1: Analyze the first segment. The client initiates with a SYN. Flags: SYN=1, ACK=0. This matches 1. So, P-1.
Step 2: Analyze the second segment. The server responds with SYN-ACK. Flags: SYN=1, ACK=1. This matches 2. So, Q-2.
Step 3: Analyze the third segment. The client sends a final ACK. Flags: SYN=0, ACK=1. This matches 3. So, R-3.
Step 4: Combine the matches: P-1, Q-2, R-3.
Answer: P-1, Q-2, R-3.
Question 4 · Computer NetworksMCQ
During TCP connection establishment, the client and server must exchange segments. A student claims that a 2-way handshake is sufficient to establish a full-duplex TCP connection. What is the minimum number of segments actually required in a standard TCP handshake to contradict this claim and reach the ESTABLISHED state?
A.
1
B.
2
C.
3
D.
4
Correct Answer:
C
Step-by-Step Solution
Key idea: The standard TCP connection establishment is explicitly called a "3-way handshake".
Step 1: Recall the steps: Client sends SYN (1), Server sends SYN-ACK (2), Client sends ACK (3).
Step 2: The minimum number of segments required to establish the connection is $3$.
Answer: 3
Question 5 · Computer NetworksMCQ
Consider the following Assertion (A) and Reason (R) regarding TCP handshake sequence numbers:
Assertion (A): If a client sends a SYN with sequence number X, the server's SYN-ACK will have an acknowledgement number of X+1.
Reason (R): The SYN flag consumes exactly one sequence number, making the next expected sequence number X+1.
A.
Both A and R are true and R is the correct explanation of A.
B.
Both A and R are true but R is not the correct explanation of A.
C.
A is true but R is false.
D.
A is false but R is true.
Correct Answer:
A
Step-by-Step Solution
Key idea: Verify the assertion and reason, and check if the reason logically explains the assertion.
Step 1: Check Assertion (A). The client sends SYN with Seq = X. The server acknowledges the next expected byte, which is X+1. So, A is true.
Step 2: Check Reason (R). The SYN flag indeed consumes exactly 1 sequence number. So, R is true.
Step 3: Check the link. The acknowledgement number is X+1 precisely because the SYN consumes 1 sequence number. Thus, R correctly explains A.
Answer: Both A and R are true and R is the correct explanation of A.
Question 6 · Computer NetworksMCQ
A student claims that establishing a full-duplex TCP connection requires the client to send a SYN, the server to send a SYN-ACK, the client to send an ACK, and finally the server to send a second ACK to confirm the client's ACK. What is the minimum number of segments actually required to reach the ESTABLISHED state, contradicting the student's claim?
A.
1
B.
2
C.
3
D.
4
Correct Answer:
C
Step-by-Step Solution
Key idea: Recall the standard TCP connection establishment mechanism.
Step 1: The standard mechanism is the "3-way handshake".
Step 2: The segments are: 1. Client SYN, 2. Server SYN-ACK, 3. Client ACK.
Step 3: After these 3 segments, the connection is ESTABLISHED. No fourth segment is required.
Answer: 3
Question 7 · Computer NetworksMCQ
Consider the following Assertion (A) and Reason (R) regarding TCP handshake sequence numbers:
Assertion (A): If a client sends a SYN with sequence number X, the server's SYN-ACK will have an acknowledgement number of X+1.
Reason (R): The SYN flag carries no data payload, therefore it consumes $0$ sequence numbers.
A.
Both A and R are true and R is the correct explanation of A.
B.
Both A and R are true but R is not the correct explanation of A.
C.
A is true but R is false.
D.
A is false but R is true.
Correct Answer:
C
Step-by-Step Solution
Key idea: Evaluate the truth of both statements and the logical link between them.
Step 1: Check Assertion (A). The client sends SYN with Seq = X. The server acknowledges the next expected byte. Since SYN consumes 1, the next expected is X+1. So, A is true.
Step 2: Check Reason (R). The SYN flag carries no data payload, but it is a special control flag that consumes exactly $1$ sequence number. So, R is false.
Step 3: Since A is true and R is false, the correct choice is "A is true but R is false".
Answer: C
Question 8 · Computer NetworksMCQ
In the standard 3-way handshake mechanics, when the server replies to the client's initial SYN segment, what is the minimum number of control flags that are set to $1$ in the server's response segment?
A.
1
B.
2
C.
3
D.
4
Correct Answer:
B
Step-by-Step Solution
Key idea: Recall the exact flags set in the server's response during the 3-way handshake.
Step 1: The client sends a SYN segment.
Step 2: The server replies with a SYN-ACK segment.
Step 3: The name "SYN-ACK" indicates that both the SYN flag and the ACK flag are set to $1$.
Step 4: Therefore, the minimum number of flags set to $1$ is $2$.
Answer: 2
Question 9 · Computer NetworksMCQ
Consider the following Assertion (A) and Reason (R) regarding TCP handshake sequence numbers:
Assertion (A): In a TCP handshake, if the client sends a SYN with sequence number $1000$ and the server sends a SYN-ACK with sequence number $5000$, the client's final ACK will have a sequence number of $1001$.
Reason (R): The client's initial SYN consumes exactly one sequence number, so the client's next sequence number is incremented by one.
A.
Both A and R are true and R is the correct explanation of A.
B.
Both A and R are true but R is not the correct explanation of A.
C.
A is true but R is false.
D.
A is false but R is true.
Correct Answer:
A
Step-by-Step Solution
Key idea: Evaluate the truth of both statements and the logical link between them.
Step 1: Check Assertion (A). The client sends SYN with Seq = $1000$. The SYN consumes $1$ sequence number. The client's next sequence number is $1000 + 1 = 1001$. The final ACK will indeed have Seq = $1001$. So, A is true.
Step 2: Check Reason (R). The client's initial SYN consumes exactly one sequence number, incrementing the next sequence number by one. This is a fundamental rule. So, R is true.
Step 3: Check the link. R directly explains why the sequence number in A is $1001$. Thus, R is the correct explanation of A.
Answer: Both A and R are true and R is the correct explanation of A.
Question 10 · Computer NetworksMCQ
In a TCP implementation, the sequence number field is allocated n bits. What is the total number of unique sequence numbers available in the sequence space before it must wrap around?
A.
2n−1
B.
2n
C.
2n−1
D.
n2
Correct Answer:
B
Step-by-Step Solution
Key idea: The size of the sequence space is determined by the number of bits allocated to the sequence number field.
Step 1: A field with n bits can represent 2n distinct values (from $0$ to 2n−1).
Step 2: Therefore, the total number of unique sequence numbers available before wraparound is exactly 2n.