All cheatsheets

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.

ClientServer

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.

Loading 3D…

28 entries

Addressing & subnets7

/24 = 255.255.255.0

Recipe: read a CIDR block — size, range, gateway.

10.0.0.0/8

Private range (also 172.16/12, 192.168/16)

Network / broadcast

First / last address in a subnet

Default gateway

Router that forwards off-subnet traffic

127.0.0.1 / ::1

Loopback (localhost)

IPv6 ::/0

128-bit addressing; fe80::/10 = link-local

CIDR hosts = 2^(32-n) - 2

Usable hosts in an IPv4 /n.

Common ports7

22

SSH

53

DNS

80 / 443

HTTP / HTTPS

25 / 587 / 993

SMTP / submission / IMAPS

3306 / 5432

MySQL / PostgreSQL

6379 / 27017

Redis / MongoDB

3000 / 8080

Common dev/app ports

Protocols & layers6

TCP vs UDP

Reliable, ordered vs fast, connectionless

SYN → SYN-ACK → ACK

TCP 3-way handshake — how a connection is established.

OSI 7 layers

Physical→DataLink→Network→Transport→Session→Presentation→App

DNS records

A / AAAA / CNAME / MX / TXT / NS

HTTP/2, HTTP/3 (QUIC)

Multiplexed; HTTP/3 runs over UDP

DHCP

Auto-assign IP, mask, gateway, DNS

CLI tools8

ping <host>

Reachability + round-trip time

traceroute <host>

Path & per-hop latency

dig <name> / nslookup

Recipe: diagnose a DNS resolution problem.

ss -tulpn

Recipe: find which process owns a port.

ip addr / ip route

Interfaces / routing table

nmap -sV <host>

Port scan + service/version detection.

curl -v <url>

HTTP request with full trace

tcpdump -i any port 443

Capture packets on the wire.