The idea
The previous topic covered what a TCP segment looks like once a connection exists. Before any of that data can flow, both sides have to agree the connection is open — and once they are done, both sides have to agree it is closed. TCP handles both with the same basic idea: a three-step exchange.
How it works
Three phases
Connection-oriented transmission in TCP requires three phases:
- Connection establishment
- Data transfer
- Connection termination
Connection establishment is called three-way handshaking. Once a connection is established, data may flow back and forth in both directions until the connection is closed.
How it works
The three-way handshake
- Client sends SYN to server, with no data — signalling that it is ready for a connection.
- Server responds with SYN-ACK, with no data. This single segment does three things: it acknowledges the client’s sequence number, it sends the server’s own initial sequence number (ISN), and it includes the server’s received window (rwnd) for flow control.
- Client sends ACK, which may or may not include data, acknowledging the server’s sequence number.
Where marks get lost
Not every handshake segment is data-free
The first two steps — SYN and SYN-ACK — carry no data, but the lecture is explicit that the client’s final ACK may include data. Treating all three handshake segments as necessarily empty is a common mistake.
How it works
rwnd
rwnd is the received window of the client or server, used for flow control. It first appears in the server’s SYN-ACK during the handshake. What rwnd actually constrains, and how it is calculated, is covered in the next topic.
How it works
Data transfer
Once the connection is up, 2,000 data bytes might be sent as two segments, or as a single segment — segment sizes are not fixed. The PSH flag indicates a data transmission from the client.
Aside
The slides’ complete sequence diagram for data transfer — showing SYN, ACK and PSH flags alongside actual data payloads step by step — did not survive extraction. Only the points above are stated directly in the source.
How it works
Terminating connections
Termination uses a handshake similar to establishment, but with FIN flags in place of SYN. The FIN flag is sent together with the last data segment, signalling there is nothing further to transmit.
Aside
The slides’ complete state machine diagram for termination — the sequence of FIN and ACK segments each side sends — did not survive extraction. This page states only that FIN accompanies the last data segment, as the source gives it, without reconstructing the full close-down sequence.
In the exam
- Name all three phases in order: establishment, data transfer, termination.
- Know what each handshake step carries, not just “SYN, SYN-ACK, ACK” as labels — step 2 alone does three jobs at once (ack, ISN, rwnd).
- The final ACK may carry data. Only the first two steps are stated as data-free.
- FIN accompanies the last data segment during termination — it is not a separate, contentless close request.
Check yourself
- Three phases: connection establishment (three-way handshake), data transfer, connection termination.
- SYN (no data) → SYN-ACK (acknowledges client, gives server’s ISN and rwnd, no data) → ACK (acknowledges server, data optional).
- rwnd is introduced in the SYN-ACK step, for flow control detailed next.
- Termination mirrors establishment’s handshake shape but uses FIN, sent with the last data segment.