10.0.1.0/2410.0.2.0/2410.0.0.0/16 → local0.0.0.0/0 → internet gateway10.0.0.0/16 → local192.168.1.0/24 → VPN tunnel0.0.0.0/0 → NAT gatewaySYN :443req 1req 2req 3req 4reply/health/healthreq 510.0.2.11203.0.113.30SSH :22
Envelope seal: who sent it; the tag shows what it isTrays: the VPC (indigo) holding a public (blue) and a private (purple) subnetYellow tablets: the two route tables, one row per destination rangeGreen ✓ allowed or healthy · coral × failedA VPC (10.0.0.0/16) is cut into a public subnet (10.0.1.0/24) and a private one (10.0.2.0/24); each subnet's route table decides where traffic goes, and only the public one points 0.0.0.0/0 at the internet gateway. A visitor's request comes in through the internet gateway to the load balancer, which takes turns between two servers and skips one that fails its health checks. A stateful security group on each server and a stateless network ACL at the subnet edge filter what reaches them. The servers reach out through the NAT gateway, and the office reaches them through a VPN tunnel. 10.0.0.0/16 and 192.168.1.0/24 are RFC 1918 private ranges; 192.0.2.7, 203.0.113.20, 203.0.113.30, 198.51.100.80 and 198.51.100.1 are RFC 5737 documentation addresses. Port numbers picked by the load balancer, NAT gateway and clients are illustrative.

The network

  1. A virtual private cloud (VPC) is your own private network inside a cloud provider’s data centres. You choose its address range, here 10.0.0.0/16: 65,536 private addresses that no other customer’s network can see.

Serving visitors

Reaching out

Routes, rules and packets, field by field

;; step 1/10 · vpc · space
;; at vpc
VPC  10.0.0.0/16   (RFC 1918 private range)
size: 2^(32-16) = 65,536 addresses
the provider runs many customers on the same hardware;
each VPC is walled off from the others in software
other customers may use 10.0.0.0/16 too: private ranges repeat,
and that is fine until two networks must be joined
names: AWS and Google Cloud say VPC, Azure says virtual network

The terms are the common ones. AWS and Google Cloud say VPC, Azure says virtual network; Google Cloud has no separate internet gateway object (a default route to the internet does the job); Azure’s nearest thing to a security group is a network security group. The ideas are the same. Clouds reserve a few addresses in every subnet for their own use (on AWS the first four and the last), so not every address in a range can be given to a server.