Analyzing Existing Subnets

An address alone never says which subnet it is in; its mask does. So take each address with its own mask, find the block that holds it, and compare blocks. Two checks catch many bad assignments: whether the address is a usable host address, neither the subnet ID nor the broadcast, and whether its default gateway is in the same subnet.

In Daveth Pro (Network)13 min video

By , founder of Daveth · Updated

Opening frame of the video walkthrough of Analyzing Existing Subnets

Watch this lesson

13 min · Video walkthrough

In Daveth Pro (Network)

The full 13 min walkthrough is in Daveth Pro (Network). See what the plan opens

What this page answers

How do you tell if two IP addresses are in the same subnet?

Never judge from the dots. Take each address with its own mask, find the subnet that holds it, and compare the subnets. Two addresses sharing three octets can still be in different subnets. Read it in “Read the mask with the address”

How do you find overlapping subnets?

Compare whole ranges, subnet ID to broadcast, not just the subnet IDs. Two subnets in different places whose ranges share any address are always wrong: hosts can get the same address and routing cannot work. Read it in “Overlaps in a list”

An address on a ticket isn't the whole story

Friday. A new PC has gone onto head office's Staff VLAN. It prints to head office's Staff printer, but it can't reach Ravi's servers, the office, or even most of the Staff VLAN. Ravi sends Maya a list of the addresses involved, with a note: "It's all 10.x, so it's all one network, right?"

The PC printed, so everyone checked everything except the mask.

This is where 04.3 and 04.4 get used for real. To understand how the network routes packets to a host, you need the subnet the host sits in, its resident subnet, and three facts about it: the subnet ID, the broadcast address and the range of usable addresses. Finding them from an address and mask is one of the most common jobs in operating and troubleshooting a network. This page does it for a whole list at once, and checks the list against itself.

Read the mask with the address

"It's all 10.x" is the classful network talking. An address alone never says which subnet it's in; the mask does. Two addresses that share their first three octets can still be in different subnets, and two that don't can be in the same one. So never judge from the dots: take each address with its own mask, find the block that holds it, and compare blocks.

Words make this worse. People say "network" when they mean subnet, and "the network ID" when they mean the subnet ID, so a note that says "same network" might mean the same classful network or the same subnet. Ask which, or check it yourself.

And each host makes the decision for itself. When a host sends a packet, it generally compares the destination with its own address and mask: inside its own subnet, it delivers the packet directly; outside it, it sends the packet to its default gateway (01.6). So two hosts with different masks can disagree about each other.

It works kind of like two neighbours holding different maps: one map shows the other's house on the same street, while the other map puts it a few streets away, so that neighbour sends everything round through the sorting office. (Where it stops: a neighbour can look up and notice the mistake. A host never does; it follows its mask until someone changes it.)

Is it a host address, and is its gateway local?

Two checks catch many bad assignments. First, is the address a host address at all? In binary, a subnet ID's host bits are all 0s and a broadcast's are all 1s (04.3), and neither can be given to a host. So a usable address has host bits that are neither all 0s nor all 1s, and an address that lands exactly on the ID or the broadcast is a mistake, even though it's a perfectly real number. Nor may two devices share one address.

Second, is the host's default gateway inside the host's own subnet? A host reaches other subnets through a gateway on its own subnet (01.6), and to send a frame to the gateway it needs the gateway's MAC address, which it asks for with ARP only for addresses it thinks are on its own LAN (01.7). If the gateway falls outside the host's own range, then by those rules the host has no way to reach it: the configuration is wrong, whatever a particular operating system then does about it.

That's the new PC. It was typed in by hand as 10.100.0.120/26, while the rest of the Staff VLAN uses /24. Worked through, both ways:

StepBinary (04.3)Decimal (04.4)
Mask/26: 26 prefix bits, 6 host bits255.255.255.192: the fourth octet is interesting, magic 64
Fourth octet120 is 01111000: copy the first 2 bits (01), then fill the other 6the biggest multiple of 64 not above 120 is 64
Subnet IDfill with 0s: 01000000 = 6410.100.0.64
Broadcastfill with 1s: 01111111 = 12764 + 64 − 1 = 127: 10.100.0.127
Usable10.100.0.65 – 10.100.0.12610.100.0.65 – 10.100.0.126

So the PC believes its subnet is 10.100.0.64 to 10.100.0.127. The printer, at 10.100.0.80, is inside that range, so the PC sends to it directly and printing works. The gateway, R3 at 10.100.0.1, is outside it, so the PC can't use it, and nothing outside .64 to .127 works: not Ravi's servers, not the office, not the Staff hosts at .2 to .63 or .128 and up.

Overlaps in a list

The PC's /26 also sits inside the Staff VLAN's /24. That isn't a second subnet anyone designed; it's one host disagreeing with its LAN's mask. But the check that catches it is the one that catches real design overlaps: two subnets in different places whose ranges share addresses. Those are always wrong, because hosts in two places can get the same address and routing can't work correctly. An exam question may only say that some hosts can't ping each other.

Without VLSM, overlapping subnets have the same subnet ID. With several masks they can have different IDs, so check ranges, not IDs, with 04.5's three steps: work out each subnet's ID and broadcast, sort them by ID, and compare neighbours, comparing the next entry with both whenever two overlap. When you find an overlap, one of the two subnets has to change.

Three sets to try, five addresses each. Find every overlap:

  1. Problem 1: 10.1.34.9/22, 10.1.29.101/23, 10.1.23.254/22, 10.1.17.1/21, 10.1.1.1/20
  2. Problem 2: 172.16.126.151/22, 172.16.122.57/27, 172.16.122.33/30, 172.16.122.1/30, 172.16.128.151/20
  3. Problem 3: 192.168.1.253/30, 192.168.1.113/28, 192.168.1.245/29, 192.168.1.125/30, 192.168.1.122/30
Address and prefixSubnet IDBroadcastOverlaps
10.1.1.1/2010.1.0.010.1.15.255no
10.1.17.1/2110.1.16.010.1.23.255yes: with 10.1.23.254/22
10.1.23.254/2210.1.20.010.1.23.255yes: with 10.1.17.1/21
10.1.29.101/2310.1.28.010.1.29.255no
10.1.34.9/2210.1.32.010.1.35.255no
Address and prefixSubnet IDBroadcastOverlaps
172.16.122.1/30172.16.122.0172.16.122.3no
172.16.122.57/27172.16.122.32172.16.122.63yes: with 172.16.122.33/30
172.16.122.33/30172.16.122.32172.16.122.35yes: with 172.16.122.57/27
172.16.126.151/22172.16.124.0172.16.127.255no
172.16.128.151/20172.16.128.0172.16.143.255no
Address and prefixSubnet IDBroadcastOverlaps
192.168.1.113/28192.168.1.112192.168.1.127yes: with 192.168.1.122/30 and 192.168.1.125/30
192.168.1.122/30192.168.1.120192.168.1.123yes: with 192.168.1.113/28
192.168.1.125/30192.168.1.124192.168.1.127yes: with 192.168.1.113/28
192.168.1.245/29192.168.1.240192.168.1.247no
192.168.1.253/30192.168.1.252192.168.1.255no