TCP's Three-Way Handshake: What Those Messages Do
Before two computers can exchange information over a new TCP connection, they have to agree on how the conversation will begin. That short exchange is the three-way handshake.
TCP, short for Transmission Control Protocol, is a set of rules for delivering data in order and recovering missing pieces. The handshake sets up that connection; it doesn't encrypt what follows.
Three messages, two starting points
The usual exchange happens between a client, which requests a service, and a server, which provides it. A browser and a website's server are one possible pair.
TCP sends small chunks of information called segments. During the handshake, special markers in those segments carry three messages:
- SYN: The client proposes starting a connection and supplies its starting sequence number.
- SYN + ACK: The server acknowledges that number and supplies its own starting number.
- ACK: The client acknowledges the server's number.
SYN means synchronize; ACK means acknowledgment. Sequence numbers help each side track the order of data, so the connection needs a starting point for each direction.
TCP or UDP: Which One Carries Your Data?
The server combines its acknowledgment and its own proposal in one reply, which keeps the usual exchange to three messages. The TCP standard illustrates this exchange.
A connection isn't a security guarantee
A successful handshake doesn't tell you whether a website is honest or whether someone can read the traffic. Those are separate questions.
HTTPS is the protected form of web communication. Its protection comes from TLS, short for Transport Layer Security.
TLS uses encryption to make transmitted data unreadable without the required keys and checks for changes in transit. Its own handshake establishes the security settings and checks the server's identity through a digital certificate, an electronic document linking an identity to a cryptographic key.
A cryptographic key is a value used in mathematical operations that protect or verify information. The TLS specification describes these protections.
Even an encrypted connection can lead to a dishonest business. Protecting the journey doesn't certify everything waiting at the destination.
Why a webpage doesn't always start this way
A browser can reuse an existing connection, so loading another page doesn't always mean starting another TCP handshake. There are also web connections that don't use TCP at all.
HTTP/3, a version of the rules browsers use to exchange web content, runs over a different transport called QUIC. QUIC uses UDP, a protocol for sending individual messages, and handles connection setup through its own process.
The HTTP/3 standard explains that arrangement. A three-way handshake is a feature of TCP, rather than a ceremony that every internet exchange must perform.
- Keep work, guest and smart-home gear apart with up to 32 VLANs on one small switch.
- Copy any port's traffic to your laptop with port mirroring and see what is on the wire.
- Set it up from a web page instead of learning a command line.
When the opening exchange becomes a target
In a SYN flood, an attacker sends many connection requests that leave the server waiting for handshakes to finish. Those unfinished requests can consume resources that legitimate visitors need.
That makes it a denial-of-service attack: an attempt to make a service unavailable. The attack exploits the work involved in starting connections, even before useful application data arrives.
Defenses include limiting unfinished requests and using SYN cookies, a technique that puts information needed to validate a connection into the server's reply instead of keeping a full waiting record. Their design involves tradeoffs, as the IETF's SYN-flood analysis explains.
A failed handshake alone isn't proof of an attack; a broken connection or unreachable service can also prevent completion. When troubleshooting, separate the questions: did the connection start, did its security checks succeed, and did the application answer?
TCP: Putting the Missing Bytes Back in Order

SYN Floods Fill the Space Where Connections Wait

TCP Half-Open Scans Learn From an Unfinished Handshake

QUOTE:
"Amateurs hack systems, professionals hack people."
