IP addressing and subnetting explained
How addresses are distributed, and what the subnet mask actually does
An IP address identifies a device on a network. IPv4 is written as four numbers separated by periods, e.g. 192.168.1.10, where each number can range from 0 to 255. Because there is a shortage of available IPv4 addresses in the world, IPv6 is being introduced, which is written with hexadecimal groups separated by colons and provides many more addresses.
§Network part and host part
An IP address consists of two parts: a network part that tells which network the address belongs to, and a host part that identifies the individual device on the network. The subnet mask determines where the boundary between the two parts lies. Devices on the same subnet can communicate directly; if they need to communicate with another subnet, the traffic goes through a router (default gateway).
§Private and public addresses
Certain address ranges are reserved for private networks and cannot be routed on the open internet — these are the ones we typically see behind a home router. To get out on the internet private addresses are translated to a public address via NAT (Network Address Translation). This is why many devices in a home can share one public address from the internet provider.
- 01Private areas are used internally and translated via NAT
- 02Public addresses are unique and routable on the internet
- 03The loopback address points to the device itself and is used for testing
- 04APIPA addresses are automatically assigned when a DHCP server does not respond
§Why subnets?
You divide a large network into smaller subnets for several reasons: you limit broadcast traffic so the network doesn't drown in unnecessary messages; you can separate departments or systems for security reasons; and you get a more manageable and documentable network. Subnetting is essentially about moving the boundary between network and host parts, so you get multiple smaller networks instead of one large one.
§Typical troubleshooting
When a device doesn't connect to the network, you go through systematically: Did the device get a valid IP address, or is it stuck on an automatic emergency address? Can it reach its gateway? Can it resolve names via DNS? By testing the connection in steps—first to gateway, then to a known server by IP, then by name—you can quickly determine whether the problem is local, at routing, or at name resolution.