remaining layer 4 Flashcards
(55 cards)
What are the three phases of TCP connection management?
- Connection establishment (setup)
- Data transfer
- Connection termination (teardown)
What are the steps of the TCP three-way handshake?
SYN (x)
SYN (y) + ACK (x+1)
ACK (y+1)
What does the client send first in the three-way handshake?
A segment with the SYN flag set and an initial sequence number (ISN).
What does the server send in response to the client’s SYN?
A segment with SYN and ACK flags
What does the client send to complete the three-way handshake?
An ACK with ack = server ISN + 1.
Why is a two-way handshake insufficient in TCP?
It can’t confirm that the client received the server’s ISN or that the client is reachable.
Why is a four-way handshake unnecessary for TCP?
The third ACK can carry data
What are the steps of the TCP four-way handshake for connection termination?
- FIN: Client sends a segment with the FIN flag set
- ACK: Server acknowledges the FIN
- FIN: Server sends its own FIN when it’s ready to close
- ACK: Client acknowledges the server’s FIN
Why are four steps required for TCP connection termination?
Because each direction must be closed independently.
What is the purpose of the TIME-WAIT state?
To ensure the final ACK is received and allow old duplicate segments to expire.
What is the typical duration of the TIME-WAIT state?
2 times the Maximum Segment Lifetime (2MSL).
What are the main TCP control flags used in connection management?
- SYN (Synchronize): Initiates a connection
- ACK (Acknowledgment): Acknowledges received data
- FIN (Finish): Initiates the connection termination
- RST (Reset): Abruptly terminates the connection
What does the SYN flag do?
It initiates a connection.
What does the ACK flag do?
It acknowledges received data.
What does the FIN flag do?
It initiates connection termination.
What does the RST flag do?
It abruptly resets the connection.
When is a TCP connection reset (RST) used?
- segment arrives for a non-existent connection
- host crashes and restarts
- host receives unexpected data or control flags
- host wants to abort a connection immediately
What does the client-side TCP state CLOSED mean?
No connection exists.
What does the client-side TCP state SYN_SENT mean?
Sent SYN, waiting for SYN-ACK
What does the client-side TCP state ESTABLISHED mean?
Connection established
What does the server-side TCP state LISTEN mean?
Waiting for incoming connections.
What does the server-side TCP state SYN_RCVD mean?
Received SYN, sent SYN-ACK, waiting for ACK
What transition happens on the client during connection establishment?
CLOSED → SYN_SENT → ESTABLISHED.
What transition happens on the server during connection establishment?
CLOSED → LISTEN → SYN_RCVD → ESTABLISHED.