TCP connections
Three-way handshake
SYN, SYN-ACK, ACK: how TCP opens a connection, each side agreeing on starting sequence numbers.
The client asks (SYN), the server agrees and acknowledges (SYN-ACK), the client acknowledges (ACK); then data flows. Each side closes its direction with a FIN. Options like the MSS and window scaling are agreed in the SYNs.
Read next
- TCP Reliable, ordered byte streams between programs: handshake, acknowledgements, retransmission.
- Sequence and acknowledgement numbers TCP's byte counters: what this segment carries, and the next byte expected from the other side.
- MSS The most TCP data per packet, announced in the SYN: the link's MTU minus 40 bytes of headers.
- TCP reset A TCP packet that aborts a connection; the answer to a SYN for a port with no listener.
- SYN flood and SYN cookies Forged SYNs that fill a server's half-open connection queue, and the stateless trick that defeats them.
- HTTP keep-alive Several HTTP requests over one TCP connection instead of a new handshake for each.
- Packet capture A copy of the packets crossing a network card, read live or saved to a file.
- Half-open scan Probing a TCP port with a SYN and hanging up after the reply, so no connection is ever made.
- IP source spoofing Putting a false source address on a packet, the basis of floods and reflection attacks.
- Packet crafting Building one packet by hand — choosing every flag and field — to probe a target a single reply at a time.