Before a single server exists, there's a network for it to live in. In AWS that's a VPC — a Virtual Private Cloud. Think of it as renting an empty office floor: nothing's in it yet, but the walls are up, and crucially, you decide the addressing scheme for everything that will ever live inside.
That addressing scheme is written in CIDR notation: something like 10.0.0.0/16. The number after the slash says how many bits of the IP address are fixed. The bits left over are yours to hand out. Fewer fixed bits → more addresses.
Drag the slider to change the prefix length and watch your address space grow and shrink. AWS allows VPC blocks from /16 (biggest) to /28 (smallest).
*AWS reserves 5 addresses in every subnet (network, router, DNS, future use, broadcast) — hence 65,531 instead of 65,536.
You never place servers directly "in the VPC" — you place them in subnets, smaller CIDR blocks carved out of the VPC's range. A subnet has two defining properties:
① It lives in exactly one Availability Zone (one physical data-center cluster). If you want to survive an AZ outage, you need subnets in at least two AZs — this is why every "highly available" architecture diagram shows things in pairs.
② It has exactly one route table attached, and that route table is what makes a subnet "public" or "private." There is no public: true checkbox. It's all routing.
0.0.0.0/0 (i.e. "everything else") to an Internet Gateway. That's it. That's the whole distinction.Below is a VPC with two subnets and an instance in each. Subnet A's route table has an internet route; Subnet B's doesn't. Send packets and see what happens — then toggle routes to change reality.
Send a packet to 8.8.8.8 from each instance. Then toggle routes below and try again. Watch where the packet dies.
Notice what happened when you gave Subnet B a NAT route: the packet went to the NAT gateway (which lives in the public subnet), and the NAT relayed it out through the IGW. That's the standard pattern for private workloads: they can dial out — to pull packages, call APIs — but nothing on the internet can dial in, because they have no public IP and no inbound path.