Skip to main content
N10-009 objective 1.7

Network+ subnetting practice

Subnetting is the math part of Network+: given an address and a prefix, find the network address, the broadcast address, the usable range and how many hosts fit. The method comes first, with three worked problems after it. Then there's a drill with as many problems as you want, and a CIDR chart to check yourself against.

The block size method

  1. Write out the mask for the prefix, and find the octet where it stops being 255.
  2. Subtract that octet of the mask from 256. That number is the block size, and subnets start at multiples of it in that octet.
  3. Find the multiple at or below your address in that octet. That is the network address; the octets after it are 0.
  4. The broadcast address is one less than the next network address. The octets after the interesting one are 255.
  5. The usable hosts sit between the two: the network address plus one, through the broadcast address minus one. How many is two to the power of (32 minus the prefix), minus two.

Three worked problems

192.168.10.77/26

Mask 255.255.255.192. It stops being 255 in the fourth octet, so the block size is 64.

Network
192.168.10.64
Broadcast
192.168.10.127
Hosts
192.168.10.65 to 192.168.10.126
Usable
62

172.16.45.200/21

Mask 255.255.248.0. It stops being 255 in the third octet, so the block size is 8.

Network
172.16.40.0
Broadcast
172.16.47.255
Hosts
172.16.40.1 to 172.16.47.254
Usable
2,046

10.0.0.130/30

Mask 255.255.255.252. It stops being 255 in the fourth octet, so the block size is 4.

Network
10.0.0.128
Broadcast
10.0.0.131
Hosts
10.0.0.129 to 10.0.0.130
Usable
2

Subnet it yourself

You get a host address and a prefix. Work out the network address, the broadcast address, the first and last usable hosts and how many hosts fit, then check. Every problem is new, and they never run out.

CIDR chart, /16 to /30

Each step down halves the block. Usable hosts are the addresses in the block less two, the network address and the broadcast address.

CIDR prefixes from /16 to /30 with masks and host counts
PrefixSubnet maskAddressesUsable hosts
/16255.255.0.065,53665,534
/17255.255.128.032,76832,766
/18255.255.192.016,38416,382
/19255.255.224.08,1928,190
/20255.255.240.04,0964,094
/21255.255.248.02,0482,046
/22255.255.252.01,0241,022
/23255.255.254.0512510
/24255.255.255.0256254
/25255.255.255.128128126
/26255.255.255.1926462
/27255.255.255.2243230
/28255.255.255.2401614
/29255.255.255.24886
/30255.255.255.25242

Two prefixes work differently. A /31 has two addresses and both are usable on a point-to-point link (RFC 3021), and a /32 is a single host, such as a loopback interface.

Private and special ranges

  • 10.0.0.0/8Private (RFC 1918)
  • 172.16.0.0/12Private (RFC 1918): 172.16.0.0 through 172.31.255.255
  • 192.168.0.0/16Private (RFC 1918)
  • 169.254.0.0/16APIPA link-local: what a host gives itself when DHCP does not answer
  • 127.0.0.0/8Loopback: the host talking to itself, usually 127.0.0.1

The address classes

Classful addressing is history, since CIDR replaced it, but the exam still expects you to know the classes by their first octet. 127 belongs to no class: it is loopback.

ClassFirst octetDefault mask
A1 to 126255.0.0.0 (/8)
B128 to 191255.255.0.0 (/16)
C192 to 223255.255.255.0 (/24)
D224 to 239Multicast, no mask
E240 to 255Experimental, no mask

Questions about Network+ subnetting

  • Is subnetting on the Network+ N10-009 exam?
    Yes. Objective 1.7 asks you to use the right IPv4 addressing for a scenario, which covers subnetting with CIDR and VLSM, the private and special ranges such as APIPA and loopback, and the old address classes.
  • How many usable hosts are in a /26?
    62. A /26 has 64 addresses, and two of them are taken by the network address and the broadcast address. The same rule works for any prefix from /1 to /30: two to the power of (32 minus the prefix), minus two.
  • What is the fastest way to subnet by hand?
    Use the block size. Find the octet where the mask stops being 255 and subtract that octet of the mask from 256. Subnets start at multiples of that number in that octet, so the network address is the multiple at or below your address, and the broadcast address is one below the next multiple.
  • What is VLSM?
    Variable-length subnet masking. Each subnet gets the prefix it actually needs, so a link between two routers can be a /30 while a floor of users gets a /24, instead of every subnet being cut to the same size.
  • What is a /31 used for?
    Point-to-point links between two routers. RFC 3021 lets both addresses in a /31 be assigned, because a link with only two ends has no use for a broadcast address. A /32 names a single host, for example a loopback interface.

Learn the rest of Network+ the same way

IPv4 addressing is objective 1.7, and Domain 1 is free in NetPlus Mastery, lessons and quizzes included.

Keep studying: the free practice test, the ports list, PBQ practice, and the full course.