Networking · 09 · 4 min read
TCP, UDP and ports
IP brings data to the right computer; the port brings it to the right program.
TCP — reliable
TCP opens a connection with a three-way handshake (SYN → SYN-ACK → ACK), numbers every byte, resends what gets lost and keeps the order. Used when every bit matters: web pages, email, files, SSH.
UDP — fast
UDP just sends, with no handshake and no resends. A lost packet is simply skipped — perfect for calls, games, live video and DNS, where late data is useless anyway.
Ports to know
| Port | Protocol | Used for |
|---|---|---|
| 22 | SSH | Secure remote login |
| 25 | SMTP | Sending email |
| 53 | DNS | Name lookups |
| 80 | HTTP | Web (unencrypted) |
| 443 | HTTPS | Web (encrypted) |
| 3389 | RDP | Windows remote desktop |