NetEng Jobs

Tools

Subnetting, the magic number way

Watch the shortcut, practise with hints, then take the ten-question timed drill.

1. Learn the magic number

Every subnetting question comes down to one number. Find it, and the network address, the broadcast address and the host range follow, with no binary. Press Play to watch it worked on an address, one step at a time.

The steps, written out

Take 192.168.10.77/27.

  1. Write the mask. /27 is 255.255.255.224.
  2. Find the interesting octet. It is the first octet of the mask that isn't 255. Here that is the fourth octet: 224.
  3. Subtract it from 256. 256 − 224 = 32. That is the magic number: subnets start every 32 in that octet.
  4. Count up in 32s. 0, 32, 64, 96, 128, 160, 192, 224. The address has 77 in that octet, which falls in the block that starts at 64.
  5. Network address. Keep the octets before, use 64, and set any octets after to 0: 192.168.10.64.
  6. Broadcast address. The next block starts at 96, so this one ends at 95. Set any octets after to 255: 192.168.10.95.
  7. Hosts. Everything in between: 192.168.10.65 to 192.168.10.94. A /27 leaves 5 host bits, and 2 to the power of 5 is 32; take away the network and broadcast addresses and 30 are usable.

When the interesting octet isn't the last one

The method doesn't change. Take 172.16.45.200/20. The mask is 255.255.240.0, so the interesting octet is the third (240) and the magic number is 256 − 240 = 16. The address has 45 there, which falls in the block 32 to 47. Every octet after it becomes 0 for the network, 172.16.32.0, and 255 for the broadcast, 172.16.47.255. The hosts run from 172.16.32.1 to 172.16.47.254: 4,094 of them.

Eight masks, eight magic numbers

A mask octet can only be one of eight values, so there are only eight magic numbers to know.

Mask octetMagic numberIn the 2nd octet In the 3rd octetIn the 4th octet
128128/9/17/25
19264/10/18/26
22432/11/19/27
24016/12/20/28
2488/13/21/29
2524/14/22/30
2542/15/23/31
2551/16/24/32

A mask that ends on an octet boundary (/8, /16, /24) needs no working: the octets it covers stay, and the rest run from 0 to 255. A /31 is a point-to-point link with two usable addresses and no broadcast address, and a /32 is a single address.

Quick check: tap the block

Before you move on, find the block by eye. No typing: tap the block the address falls in.

Want to check an address of your own? Put it through the calculator.

2. Practice with hints

No clock here. Work out the three answers for the address shown. A wrong answer gets a hint, not a mark.

3. Take the timed drill

Ten questions against the clock: network and broadcast addresses, host ranges, host counts and masks. Only the time you spend answering counts. New to this? Read the lesson and practise with hints first.

Everything on this page runs in your browser. Nothing you type is sent anywhere, and your best result is kept on this device only.

Ready to put it to work? See the network engineer jobs open now, with the pay and clearance up front.