Cheat sheet · Systems and cloud

Networking cheat sheet

Layers, ports, TCP and UDP, DNS records, IP ranges and the commands to check a connection.
Sections
7
Items
32
Area
Systems and cloud
Download
PNG, PDF

Cheat sheet

Networking

Layers, ports, TCP and UDP, DNS records, IP ranges and the commands to check a connection.

/blogs

Layers (TCP/IP model)

Application
HTTP, DNS, SSH: what programs say
Transport
TCP, UDP: ports and delivery
Internet
IP: addresses and routing
Link
Ethernet, Wi-Fi: the local network

Well-known ports

22
SSH
53
DNS
80 / 443
HTTP / HTTPS
25 / 587
Email sending (SMTP)
3306 / 5432
MySQL / PostgreSQL
6379 / 27017
Redis / MongoDB

TCP and UDP

TCP
Reliable and in order; connection first (three-way handshake)
UDP
Fast, no promise of delivery; used for video, games, DNS
SYN, SYN-ACK, ACK
The three steps that open a TCP connection

DNS records

A / AAAA
Name to an IPv4 / IPv6 address
CNAME
A name that points to another name
MX
Where email goes
TXT
Free text, often for verification and email rules
NS
Which servers answer for the domain
TTL
How long an answer may be cached

IP addresses

10.0.0.0/8 172.16.0.0/12 192.168.0.0/16
Private ranges, not reachable from the internet
127.0.0.1
This machine (localhost)
/24
256 addresses (254 usable)
/16 / /8
65,536 addresses / about 16.7 million
0.0.0.0/0
Every address

Check a connection

ping <host>
Is it reachable?
dig <name>
Look up DNS records
traceroute <host>
The route the packets take
curl -v https://<host>
Watch the connection and TLS steps
ss -tulpn
Which program listens on which port
ip addr
Your machine's addresses

HTTPS in short

TLS handshake
Agree on keys and check the server's certificate
Certificate
Proves the site's identity; signed by a trusted authority

Remember

  • "It works on my machine" is often DNS, a firewall or a wrong port. Check those three first.
  • A DNS change can take up to the old TTL before everyone sees it.

Learn it properly

A cheat sheet helps you remember. These lessons explain the ideas step by step, with examples.

More cheat sheets

All cheat sheets →