Networking Tutorial with Examples.
Networking tutorial you can run: subnets, sockets, the TCP handshake in tcpdump, DNS, raw HTTP, nftables firewalls and nmap on your own lab.
Beginner
Start here — no prior experience needed
IP Addresses and CIDR: Which Hosts Are on My Subnet?
Read CIDR with Python's ipaddress: network, broadcast and host counts, the /25 membership bug a string check hides, and a Docker network that enforces it.
Ports and Sockets: Connection Refused vs Timed Out
A Python TCP echo server and client in Docker: what a port and socket are, why refused is instant but timed out isn't, and how UDP fails differently.
Watching the TCP Handshake with tcpdump
Capture a real TCP connection with tcpdump in a Docker lab: SYN, SYN-ACK, ACK, the data, the FIN close, and the RST that makes Connection refused.
DNS: From a Name to an Address, and the Ways It Fails
Query a local dnsmasq with dig: an A record and its TTL, NXDOMAIN vs SERVFAIL vs no answer, what Python sees for each, and /etc/hosts beating DNS.
Intermediate
For developers with core concepts down
HTTP on the Wire: a Request Is Just Text
Type raw HTTP/1.1 requests into nc against a local nginx: a missing Host header gets a 400, Host picks the site, keep-alive holds the connection open.
Host Firewalls with nftables: DROP Times Out, REJECT Refuses
Firewall a container's own port with nftables: a drop rule makes clients time out, reject makes them refused, and a source allow-list lets one host in.
Troubleshooting a Broken Network, Layer by Layer
Debug a Docker Compose app with three planted faults, a DNS typo, the wrong network and the wrong port, using one tool per layer until curl returns 200.
Port Scanning Your Own Lab with nmap: Open, Closed, Filtered
Scan a container you own with nmap on a private Docker network: what open, closed and filtered mean, the packets behind each, and -sV version banners.
Also part of Networking
Taught in other topics. Each link opens the lesson in its home topic.
Linux Networking: Routes, Interfaces, and Bind Addresses
Two real networking failures at the OS layer: a deleted default route that leaves the local subnet reachable but the internet not, and a socket bound to 127.0.0.1 that refuses every connection from outside the container.
Bash Networking
Bash networking with curl, jq, nc, /dev/tcp and rsync: status and exit codes, safe JSON, port checks, wait-for-port, and SSH heredoc quoting.
Docker Networking
Connect containers by name on user-defined bridge networks, see network isolation, aliases, the host and none drivers, and reach the host from a container.
FastAPI HTTP Methods and Status Codes
GET, POST, PUT, PATCH and DELETE on an in-memory FastAPI store, with real curl output for 200, 201, 204, 404, 405, 422 and an unhandled 500.
FastAPI Headers and Cookies
Read request headers with Header(), set response headers, and set, read and delete cookies in FastAPI, with real curl -i output and a curl cookie jar.
Cloud Networking Basics: What's the Same Everywhere
VPCs, subnets, and firewall rules share one model everywhere — the same allow-443-deny-rest rule as a security group, an NSG rule, and a GCP rule.
VPC and Networking Basics
Build a subnet, route table, and internet gateway, then walk through the exact debugging sequence for an EC2 instance that can't reach the internet.
GCP VPC Networking Basics
Build a custom VPC with a subnet and firewall rules, then debug the classic case of a VM with a public IP that still can't reach the internet.
Azure Virtual Network Basics
Build a VNet with two subnets, apply an NSG, then walk the exact debugging sequence for a VM that can't reach the internet.
The TLS Handshake, Run Locally with openssl s_server
Run a TLS 1.3 handshake on localhost with openssl s_server and s_client, then watch it fail on an unknown CA, a wrong hostname and a TLS 1.2-only client.
Load Balancing: Round Robin vs Least Connections
Round robin sends every server an equal share regardless of load; least connections adapts to which servers are actually busy right now.