TCP/IP and the Handshake
Layers, protocols, and the three packets that start every TCP connection.
Port scanners work by playing with the TCP handshake. Understand the handshake and scanners stop being magic.
1
Layers
Networks are described in layers. The OSI model has seven; the practical TCP/IP model has four.
OSI layer Examples 7 Application HTTP, DNS, SSH 4 Transport TCP, UDP 3 Network IP, ICMP 2 Data link Ethernet, Wi-Fi TCP is reliable and ordered (web, email, SSH). UDP is fast and connectionless (DNS lookups, video calls, games).
pinguses ICMP.2
The three-way handshake
A TCP connection starts with three packets:
client โ SYN โ server "I'd like to connect" client โ SYN-ACK โ server "OK, I acknowledge" client โ ACK โ server "Great, connected"If nothing listens on the port, the server answers the SYN with RST (reset). A firewall might drop the packet and answer nothing at all.
This is exactly what a port scanner tests: send SYN, then see whether you get SYN-ACK (open), RST (closed), or silence (filtered).
โ Report a problem with this room
Log in to report a problem.