What it means
TCP turns a network that can lose, repeat or reorder packets into a dependable stream. It numbers every byte it sends, and the receiver acknowledges what arrived, so lost data is sent again and everything is delivered in order.
Before any data moves, the two sides agree where their numbering starts. The client sends a SYN with its starting number. The server replies with a SYN-ACK that confirms that number and gives its own. The client confirms the server number with an ACK. Only a machine that received the reply can send that third packet, so a finished handshake shows both ends can reach each other. TCP does not encrypt, and it does not know who is using either machine.
See the idea / Networks
The third packet proves the sender heard the reply.
Follow one TCP handshake packet by packet. Then see why a sender with a forged address cannot finish it.
Station North, 03:11:52. A client at 10.4.0.77 opens a TCP connection to the antenna controller. TCP numbers every byte, so each side picks a starting number: the client 100, the controller 500. A SYN is the packet that announces a starting number. An ACK confirms one. CLOSED, LISTEN, SYN_SENT, SYN_RCVD and ESTABLISHED are the names of the connection states as tools such as netstat show them. RFC 9293 writes SYN-SENT and SYN-RECEIVED.
01 / 04
SYN
The client sends a SYN with its starting number, 100. It moves to SYN_SENT and waits for a reply.
More about this step
Packet 1 in the capture is SYN seq=100 from 10.4.0.77. Sending it moves the client from CLOSED to SYN_SENT. The controller has not received anything yet, so it is still in LISTEN. At this point the source address is only a claim written in the packet.
Step through at your own pace.
Keep in mindThe numbers 100 and 500 are small so they are easy to read. Real starting numbers are 32-bit values chosen to be hard to guess. A finished handshake shows two-way reachability and agreed counters. It does not encrypt, identify a person, or grant permission. A sender on the path who can see the replies can still finish with a forged address.
Read the visual, step by step
Sender hears replies
- SYN. The client sends a SYN with its starting number, 100. It moves to SYN_SENT and waits for a reply. Packet 1 in the capture is SYN seq=100 from 10.4.0.77. Sending it moves the client from CLOSED to SYN_SENT. The controller has not received anything yet, so it is still in LISTEN. At this point the source address is only a claim written in the packet.
- SYN-ACK. The controller answers with a SYN-ACK. It confirms the client's number with ack=101 and announces its own, 500. It moves to SYN_RCVD. Packet 2 is SYN-ACK seq=500 ack=101. The value ack=101 is the client number plus one, which shows the controller received seq=100. The controller sends this reply to the source address written in the SYN. It now waits in SYN_RCVD. It has no proof yet that anything at that address received 500.
- ACK. The client receives the SYN-ACK and replies with an ACK that carries ack=501. The client is now ESTABLISHED. Packet 3 is ACK seq=101 ack=501. The client could only write 501 because it received the reply that carried 500. Receiving a valid SYN-ACK and sending this ACK moves the client to ESTABLISHED. The controller is still in SYN_RCVD until the ACK arrives.
- Established. The ACK arrives. Only a sender that received 500 could send ack=501, so the controller moves to ESTABLISHED. Both starting numbers are now confirmed in both directions. That is what the handshake settles: a machine that could receive packets sent to 10.4.0.77 opened this connection at 03:11:52. The capture does not say who was using that machine. Nothing here is encrypted, and nobody signed in.
Forged source address
- SYN. A sender somewhere else writes 10.4.0.77 as its source and sends a SYN. Replies will go to that address, where this sender cannot see them. Anyone can write a false source address on a SYN. The packet is SYN seq=100 and looks the same to the controller as the real one. The forger is not on the path between the controller and 10.4.0.77, so it will not see what the controller sends back.
- SYN-ACK. The controller cannot tell the difference. It answers the written address with seq=500 and ack=101, then waits in SYN_RCVD. The reply SYN-ACK seq=500 ack=101 goes to 10.4.0.77, not to the forger. The controller holds a half-open connection in SYN_RCVD. If a live machine at 10.4.0.77 received this unexpected reply, it would answer with a reset and the controller would discard the entry sooner.
- No ACK. The forger never sees the number 500, so it cannot send a valid ack=501. The controller keeps waiting, half-open. A valid third packet must acknowledge the controller number plus one. The forger would have to guess a 32-bit value it never saw. In this example no ACK arrives. The connection stays in SYN_RCVD and never carries data.
- Give up. The controller stops waiting and drops the half-open entry. It never reaches ESTABLISHED. Common TCP implementations resend the SYN-ACK a few times, then release the entry after a timeout. The exact timing is an implementation choice. A forged address can send the first packet. It cannot finish the handshake without seeing the reply. Many forged SYNs at once are a SYN flood, which the DDoS guide shows.
The numbers 100 and 500 are small so they are easy to read. Real starting numbers are 32-bit values chosen to be hard to guess. A finished handshake shows two-way reachability and agreed counters. It does not encrypt, identify a person, or grant permission. A sender on the path who can see the replies can still finish with a forged address.
Flow references: RFC 9293: TCP connection establishment and states · RFC 4987: half-open connections and SYN flooding
AN ILLUSTRATIVE SCENARIO
A warehouse label printer
A logistics company finds that label printers at one warehouse drop off the network for a few seconds each hour. A packet capture shows SYN packets from the print server with no SYN-ACK in reply during each gap. That places the fault before any application is involved: the printers are not answering at all. The cause turns out to be a switch that restarts a port. Reading the handshake saved a week of blaming the printing software.
Put it to work
- Learn to read the handshake in a capture: SYN, then SYN-ACK, then ACK. Note which of the three is missing when a connection fails.
- Tell a timeout from a reset. Silence means nothing answered. A reset means a machine was reached and refused.
- Protect what TCP carries with TLS, and identify users in the application. TCP provides neither.
How to check your work
Capture a connection to a service you run and find the three handshake packets. Check that the acknowledgment number in each reply is the other side's starting number plus one.
Connect the ideas
- Port
A number on a host that distinguishes one listening service from another.
- IP address
A numeric locator used to deliver packets to a host on a network.
- TLS
A protocol that encrypts and integrity-protects an application conversation and checks a certificate for a name.
- DDoS
An attack that makes a service unavailable by overwhelming it with traffic or requests from many sources at once.