Why subnet

One network holds everyone. Why split it?

One network192.168.10.0/24Staff120 devicesGuests80 devices✗one broadcast reaches all 200 devices✗a guest laptop can reach every staff machineSubnet 1Staff120 devicesSubnet 2Guests80 devicesrouter✓a broadcast stays inside its own subnet✓traffic between them passes the router, and its rulesSplitting a network into subnets limits how far broadcasts, and trouble, can spread.Devices in one network hear each other’s broadcasts and reach each other with nothing in between. Put the groupsin separate subnets and traffic between them has to pass a router, where it can be filtered, measured or blocked.No new addresses are needed: subnetting divides the block you have, 192.168.10.0/24 here, as the next page shows.

A subnet is a smaller network cut from a larger block. Broadcasts stay inside it, and traffic between subnets must pass a router.

Borrowing a bit

How does one block of addresses become two networks?

/24255.255.255.011111111111111111111111100000000/25255.255.255.12811111111111111111111111110000000bit 25: now a network bit ↑064128192255192.168.10.0/25hosts .1 to .126, broadcast .127192.168.10.128/25hosts .129 to .254, broadcast .255Move the mask one bit to the right and one network becomes two, each half the size.Bit 25 used to be a host bit. As a network bit it is 0 in one subnet and 1 in the other, so the block of 256 addressessplits at 128. Each half gives up two addresses, its network and broadcast address, leaving 126 hosts: enough for120 staff in one and 80 guests in the other. Each further bit halves again: /26 makes four subnets of 62, /27 eight of 30.

Lengthening the mask by one bit splits a block in two: a /24 becomes two /25 subnets of 126 hosts each.

Subnetting

Borrow host bits to cut one network into equal subnets

064128192255192.168.10.0/24: one network, 256 addresses192.168.10.0/26hosts .1 – .62broadcast .63192.168.10.64/26hosts .65 – .126broadcast .127192.168.10.128/26hosts .129 – .190broadcast .191192.168.10.192/26hosts .193 – .254broadcast .255Borrow 2 host bits: 2² = 4 subnets, each with 2⁶ = 64 addresses and 62 hosts. New mask 255.255.255.192.Borrowing 2 bits from the host part cuts one /24 into four /26 subnets of 62 hosts each.Each borrowed bit doubles the number of subnets and halves their size. The subnets start every 64 addresses, the block size256 − 192. Every subnet loses two addresses: the first names the network, the last is its broadcast. A 192.168.10.65 hostand a 192.168.10.130 host are now on different networks and need a router between them.

Two borrowed bits turn 192.168.10.0/24 into four /26 subnets of 62 hosts, starting every 64 addresses.

Subnetting · Going deeper

Every prefix from /24 to /32

PrefixMaskBlockHostsTypical use/24255.255.255.0256254a user VLAN/25255.255.255.128128126half a /24/26255.255.255.1926462a small office/27255.255.255.2243230a server group/28255.255.255.2401614a cloud subnet minimum/29255.255.255.24886a small DMZ/30255.255.255.25242a router-to-router link/31255.255.255.25422a link with no broadcast (RFC 3021)/32255.255.255.25511one host: a loopback, a host routeEvery step down the table halves the block. Learn the last octet’s values: 128, 192, 224, 240, 248, 252, 254, 255.Hosts are the block minus two, except /31, which RFC 3021 allows on point-to-point links with both addresses used, and /32,a single address. Going the other way, /23 gives 510 hosts, /22 1,022 and /16 65,534.

Each prefix step halves the block: /25 has 126 hosts, /26 62, /27 30, /28 14, /29 6, /30 2. A /31 serves a point-to-point link.

A worked example

Which subnet holds 192.168.10.77/26?

064128192255.771/26 leaves 6 host bits, so each block is 2 to the power 6 = 64 addresses2Subnets start at multiples of 64: .0 .64 .128 .192377 falls between 64 and 127, so the subnet is 192.168.10.64/264First host .65, last host .126, broadcast .127Find the block size, count up in blocks, and the subnet is the block the address falls in.A quick way to the block size: 256 minus the last mask octet. For /26 the mask ends in 192, and 256 − 192 = 64.The network address is the first of the block, the broadcast is the last one before the next block, and the hostsare everything in between. The same steps work for every prefix; the deeper page has more to practise on.

Block size is 2 to the host bits. Subnets start at multiples of it; the address belongs to the block it falls inside.

A worked example · Going deeper

Finding any host’s subnet with the block size

1Find the interesting octetthe one the mask does not fill: 255.255.255.192 → the 4th, value 1922Block size = 256 − that value256 − 192 = 64: subnets start at 0, 64, 128, 1923Find the block the host falls in77 is between 64 and 128, so the network is 192.168.10.644Broadcast = next block − 1192.168.10.128 − 1 = 192.168.10.1275Hosts lie between them192.168.10.65 to 192.168.10.126: 62 addresses064128192255.77Subtract the mask octet from 256 to get the block size, then count in blocks. No binary needed.This is how engineers subnet in their heads and how the exam expects you to work against the clock. It works in any octet:for 10.0.5.200/22 the mask is 255.255.252.0, the block is 4 in the third octet, so the network is 10.0.4.0 and the broadcast10.0.7.255. Practise until each answer takes under 30 seconds.

Block size = 256 − the mask’s interesting octet. Count in blocks to find the network; the next block minus one is the broadcast.

VLSM

Size each subnet to its need, largest first

064128192255172.16.0.0/24, carved by need, largest first: 232 of 256 addresses used, 24 left for laterUsers: 100.0/25 · 126 hostsServers: 50.128/26 · 62 hostsWi-Fi guests: 20.192/27 · 30 hostsLink R1–R2 .224/30Link R1–R3 .228/30Variable-length masks size each subnet to its need, so a two-router link no longer wastes a whole /24.Sort the needs from largest to smallest and allocate each from the next free boundary of its own size: 100 hosts needsa /25 (126), 50 a /26 (62), 20 a /27 (30), each link a /30 (2). Allocating largest first keeps every block on a boundary itssize can start at. Every routing protocol in use today carries the mask with each route, which is what allows it.

VLSM gives each subnet its own mask: a /25 for 100 users, a /30 for a two-router link.

Route summarisation

Contiguous, aligned blocks collapse into one route

10.1.0.0/2400001010000000010000000010.1.1.0/2400001010000000010000000110.1.2.0/2400001010000000010000001010.1.3.0/24000010100000000100000011only bits 23 and 24 differthe first 22 bits are the same in all fourSummary: 10.1.0.0/22 · one route covers all four, 1,024 addressesContiguous, aligned blocks collapse into one route: keep the bits they share, drop the ones they do not.A router at the edge of a site can advertise one /22 instead of four /24s, so other routers keep smaller tables and do nothear about every change inside. The blocks must be aligned: 10.1.1.0 to 10.1.4.0 cannot be summarised as one /22, because10.1.4.0 starts a new block of four. This is the same arithmetic as subnetting, run backwards.

Four /24s from 10.1.0.0 to 10.1.3.0 share their first 22 bits, so one summary route, 10.1.0.0/22, covers them all.

Lesson complete

You finished “Subnetting”

Nicely done.

Open in a new tab