Cheatsheets
Networking
Subnetting, ports, protocols & layers, and essential CLI tools — with a topology diagram.
Visualize
TCP 3-way handshake
SYN → SYN-ACK → ACK before any data flows.
Press play for the 3-way handshake.
Network — encapsulation across the layers (3D)
Each layer wraps the payload in another header — data → segment → packet → frame — then the receiver peels them off.
28 entries
Addressing & subnets7
/24 = 255.255.255.0Recipe: read a CIDR block — size, range, gateway.
10.0.0.0/8Private range (also 172.16/12, 192.168/16)
Network / broadcastFirst / last address in a subnet
Default gatewayRouter that forwards off-subnet traffic
127.0.0.1 / ::1Loopback (localhost)
IPv6 ::/0128-bit addressing; fe80::/10 = link-local
CIDR hosts = 2^(32-n) - 2Usable hosts in an IPv4 /n.
Common ports7
22SSH
53DNS
80 / 443HTTP / HTTPS
25 / 587 / 993SMTP / submission / IMAPS
3306 / 5432MySQL / PostgreSQL
6379 / 27017Redis / MongoDB
3000 / 8080Common dev/app ports
Protocols & layers6
TCP vs UDPReliable, ordered vs fast, connectionless
SYN → SYN-ACK → ACKTCP 3-way handshake — how a connection is established.
OSI 7 layersPhysical→DataLink→Network→Transport→Session→Presentation→App
DNS recordsA / AAAA / CNAME / MX / TXT / NS
HTTP/2, HTTP/3 (QUIC)Multiplexed; HTTP/3 runs over UDP
DHCPAuto-assign IP, mask, gateway, DNS
CLI tools8
ping <host>Reachability + round-trip time
traceroute <host>Path & per-hop latency
dig <name> / nslookupRecipe: diagnose a DNS resolution problem.
ss -tulpnRecipe: find which process owns a port.
ip addr / ip routeInterfaces / routing table
nmap -sV <host>Port scan + service/version detection.
curl -v <url>HTTP request with full trace
tcpdump -i any port 443Capture packets on the wire.