Subnet
ELI5 — The Vibe Check
A subnet is a smaller chunk of a larger network, like dividing a city into neighborhoods. All devices in a subnet can talk to each other directly. To talk to devices in a different subnet, you need to go through a router. It helps organize large networks and improves security.
Real Talk
A subnet (subnetwork) is a logical subdivision of an IP network. Subnetting divides a network into smaller segments by borrowing bits from the host portion of the address. Defined by a network address and a subnet mask (e.g., 192.168.1.0/24). Reduces broadcast traffic and improves security.
Show Me The Code
# Common subnet examples
192.168.1.0/24
# /24 = 255.255.255.0 mask
# 256 addresses (254 usable hosts)
# Range: 192.168.1.1 - 192.168.1.254
10.0.0.0/16
# /16 = 255.255.0.0 mask
# 65,536 addresses (65,534 usable)
# Cloud VPC subnets:
# Public subnet: 10.0.1.0/24 (has internet gateway)
# Private subnet: 10.0.2.0/24 (no direct internet access)
When You'll Hear This
"Put the database servers in a private subnet with no internet access." / "How many hosts can fit in a /26 subnet?"
Related Terms
CIDR (Classless Inter-Domain Routing)
CIDR is the shorthand notation for specifying IP address ranges. '192.168.1.
DHCP (Dynamic Host Configuration Protocol)
DHCP is the system that automatically assigns IP addresses to devices when they join a network.
Firewall
A firewall is the bouncer at your network's door. It checks every incoming and outgoing connection against a list of rules and blocks anything suspicious.
IP Address
An IP address is your device's home address on the internet.
NAT (Network Address Translation)
NAT is how your home router lets all your devices share one public IP address. Your phone, laptop, and TV each get a private IP (192.168.x.