Network Fundamentals: OSI, Protocols and Ports
The OSI and TCP/IP models, TCP vs UDP, the ports worth knowing by heart, and what ARP, DHCP, DNS, NAT and ICMP actually do.

Models and protocols are the vocabulary of networking. You don't need to recite RFCs — you need to place each protocol on the right layer and say in one sentence what it does.
OSI layers
| # | Layer | Examples |
|---|---|---|
| 1 | Physical | Copper cable, fibre |
| 2 | Data link | Switch, MAC address, Ethernet, VLAN |
| 3 | Network | Router, IP, ICMP |
| 4 | Transport | TCP, UDP |
| 5 | Session | |
| 6 | Presentation | |
| 7 | Application | HTTP, DNS, SMTP |
The TCP/IP model has four layers: network access, internet, transport and application.
TCP vs UDP
TCP sets up a connection with a three-way handshake (SYN, SYN-ACK, ACK) and guarantees delivery and order. HTTP, SSH and SMTP use it.
UDP has no connection and no acknowledgements, so it is faster and lighter. DNS queries, DHCP, SNMP, NTP, voice and video use it.
Ports worth knowing by heart
| Service | Port |
|---|---|
| FTP | 20/21 |
| SSH | 22 |
| Telnet | 23 |
| SMTP | 25 |
| DNS | 53 |
| DHCP | 67/68 |
| HTTP | 80 |
| POP3 | 110 |
| NTP | 123 |
| IMAP | 143 |
| SNMP | 161 (traps 162) |
| BGP | 179 |
| HTTPS | 443 |
| Syslog | 514 |
| RDP | 3389 |
ARP
For a known IPv4 address in the same subnet, ARP finds the MAC address. It broadcasts a question, and the owner of the address answers.
DHCP: four steps
DORA — Discover, Offer, Request, Acknowledge. The client ends up with an address, a mask, a default gateway and DNS servers.
DNS records
- A — name to IPv4 address
- AAAA — name to IPv6 address
- CNAME — alias for another name
- MX — mail server for the domain
- NS — authoritative name servers
- PTR — address to name (reverse lookup)
- TXT — free text, used for SPF, DKIM and domain verification
NAT and PAT
NAT translates private addresses into public ones. PAT is NAT where many private addresses share one public address and are told apart by port. A home router does PAT.
ICMP
The protocol for error messages and diagnostics. ping uses echo request and echo reply, and traceroute relies on the "TTL exceeded" message each router sends back.