Communication Networks · Visualized

IP Addressing & Subnetting

Addressing & Names

How devices get numbers, find each other on the LAN, and turn human-readable names into addresses.

7 interactive subtopics — each one animated, step-through and explained.

IP Addressing & Subnetting

Addressing & Names

An IPv4 address is a 32-bit number split into a network part and a host part; the subnet mask (or CIDR suffix like /24) marks where the split happens. ANDing an address with its mask yields the network address — routers compare that against their routing table to decide where to forward. Subnetting borrows host bits to carve one big network into several smaller ones.

How IP Addressing & Subnetting Works

  1. Write the address in binary; the /n suffix says the first n bits are the network.
  2. AND the address with the mask → the network address (all host bits 0).
  3. Host bits all 1s give the broadcast address; everything between is usable for hosts.
  4. A /24 leaves 8 host bits → 254 usable addresses (0 is the network, 255 is broadcast).
  5. Borrowing one more bit (a /25) splits it into two halves of 126 usable hosts each.

IP Addressing & Subnetting Worked Example

Try it: Is 192.168.1.130/25 in the same subnet as 192.168.1.10?

/25 mask = 255.255.255.128. AND 192.168.1.130 → 192.168.1.128; AND 192.168.1.10 → 192.168.1.0. Different networks! A router (or a /25-aware gateway) is needed between them — this is exactly how routers make forwarding decisions.

Prefix1 subnet × 254 hosts
192.168.1 . 1 3 0 = 1 1 000000 1 0 0 0 0 0 1 0 (last octet: 130)11111111octet 1 — 19211111111octet 2 — 16811111111octet 3 — 100000000octet 4 — host partnetwork bits (first 24)host bits (8)
network bits (fixed by mask) host bits (you may assign)
Stage 1 / 4
An address is 32 bits: 4 octets. The /n suffix says how many leading bits are NETWORK bits.

IP Addressing & Subnetting: Key Facts to Remember

Private ranges10/8, 172.16/12, 192.168/16 — not routable on the public internet
Special addresseshost bits all-0 = network, all-1 = broadcast, 127.0.0.1 = loopback
Math/26 → 4 subnets × 62 hosts; each borrowed bit doubles subnets and halves hosts

Recommended resourcesAffiliate links · may earn us a commission

Recommended for learners

Cloud hosting for side projectsShip the portfolio project that gets you hired — free credits for new accounts.Claim credits Pro code editor & AI assistantWrite, debug and explain code faster while you practice the patterns here.Try it free Structured coding coursesVideo courses that pair well with visual practice — pick one language and go deep.Browse courses

See how packets really travel

Networks are built on the structures and algorithms you can watch step by step — queues, trees, and routing algorithms.