Your first ticket of the day comes from the Warehouse.
A new printer has an IP address, and nothing prints.What the Printer Received
The Warehouse uses the subnet
198.51.100.64/27, and its gateway, the router that carries its traffic out of the subnet, is R1 on198.51.100.65.
The printer received198.51.100.95with the mask255.255.255.224.
A /27 leaves 5 host bits, so the subnet holds 32 addresses.
95 is bigger than 64, so it seems to belong to the Warehouse.
Figure 1 – The Warehouse printer configured with 198.51.100.95/27 cannot reach its gateway.
Yet the printer cannot reach R1.
To find why, you need to know where this subnet starts and where it ends.Answer the question below
Which device is the gateway of the Warehouse subnet?
Three Addresses Every Subnet Has
In every subnet, the first and the last address are reserved, so no device can use them.
Take
198.51.100.0/30.
It has four addresses, and only two of them go to devices:Network address,
198.51.100.0: the first address, it names the subnet itselfUsable range,
198.51.100.1to198.51.100.2: the addresses you give to devicesBroadcast address,
198.51.100.3: the last address, it reaches every device of the subnet at once

Figure 2 – Network address, usable range and broadcast address in 198.51.100.0/30.
Every subnet follows this layout, whatever its size.
So where does the Warehouse block start, and where does it end?Answer the question below
Which address of a subnet reaches every device at once?
To find where a subnet starts, you only need one octet of the mask.
Reading the Mask Octet by Octet
Write the mask of the printer octet by octet:
255.255.255.224.
An octet set to 255 is fully part of the network: it never changes inside the subnet.
An octet set to 0 is fully part of the hosts: it runs freely from 0 to 255.
The octet with any other value is the one where the mask cuts the address.
This is the octet of interest, and it is the only octet you have to work on.
Figure 3 – In 255.255.255.224, the fourth octet is the octet of interest.
In the printer's mask, the first three octets are 255 and the fourth is 224.
So the subnet boundary falls somewhere inside the fourth octet.
The first three octets of the printer's address,198.51.100, are fixed for the whole subnet.
Only the last octet, 95, decides which block the printer belongs to.Finding It From the Prefix Length
You can find the octet of interest from the prefix length too, without writing the mask.
Each octet holds 8 bits, so count where the prefix ends:/1 to /8: the cut is in the first octet
/9 to /16: the cut is in the second octet
/17 to /24: the cut is in the third octet
/25 to /32: the cut is in the fourth octet
A /27 falls between /25 and /32, so the cut is in the fourth octet.
Same answer as the mask:/27and255.255.255.224are two ways of writing the same thing.
One special case: when the prefix ends exactly on an octet, /8, /16 or /24, there is no cut to find.
The mask only holds 255 and 0, and the network address is the address with every host octet set to 0.Answer the question below
In the mask 255.255.240.0, which octet is the octet of interest?
Inside the octet of interest, subnets follow each other in blocks of the same size.
Find that size, and you know where every subnet starts.Two Ways to the Same Number
The simplest way: subtract the mask octet from 256.
For the printer, 256 − 224 = 32.
The second way uses the host bits: a /27 leaves 5 host bits, and 2⁵ = 32.
Both give the same result: the block size is the number of addresses in one subnet.The block size for each mask octet:
Mask octet
256 − octet
Block size
255
256 − 255
1
254
256 − 254
2
252
256 − 252
4
248
256 − 248
8
240
256 − 240
16
224
256 − 224
32
192
256 − 192
64
128
256 − 128
128
0
256 − 0
256, the whole octet
Table 1 – Block size for each possible mask octet.
Answer the question below
What is the block size of a /27 mask?
The Ruler
Picture the octet of interest as a ruler from 0 to 255.
The block size tells you where to draw the marks: every 32, for the printer.
Each mark is the start of a subnet, so each mark is a network address.
Figure 4 – Block size 32: the subnets of a /27 start at 0, 32, 64, 96, 128, 160, 192 and 224.
The marks 0, 32, 64, 96, 128, 160, 192 and 224 are the eight subnets a /27 creates inside
198.51.100.0/24.
Every block is 32 addresses long, so each one ends just before the next mark.
The block that starts at 64 ends at 95.The mask decides where the marks are.
The address only tells you which block to look at.Answer the question below
With a block size of 32, which subnet starts right after 198.51.100.64?
Place the printer's address on the ruler and read the three addresses of its subnet.
From 95 to the Three Addresses
The printer's octet of interest is 95.
On the ruler, 95 sits between the marks 64 and 96.
So the printer belongs to the block that starts at 64:Network address:
198.51.100.64, the mark just below 95Broadcast address:
198.51.100.95, one address before the next markUsable range:
198.51.100.65to198.51.100.94, everything in between

Figure 5 – 198.51.100.95 falls in the block 64–95: it is the broadcast address.
95 is not a host address, it is the broadcast address of the Warehouse subnet.
No device can use it, so the printer cannot reach R1.The method works for any address and any mask.
Find the octet of interest, find the block size, place the octet on the ruler, read the three addresses.Answer the question below
What is the network address of 198.51.100.95/27?
What Your Router Says
Try to give R1 the printer's address on G0/0:
R1# configure terminal Enter configuration commands, one per line. End with CNTL/Z. R1(config)# interface g0/0 R1(config-if)# ip address 198.51.100.95 255.255.255.224 Bad mask /27 for address 198.51.100.95 R1(config-if)# endIOS refuses the address:
Bad mask /27 for address 198.51.100.95.
95 is the last address of the block.
R1 keeps 198.51.100.65 on G0/0, and nothing changes on the Warehouse link.
The printer accepted the address without a warning.Look at the routing table of R1:
R1# show ip route // Output omitted for brevity. C 198.51.100.64/27 is directly connected, GigabitEthernet0/0The routing table shows
198.51.100.64/27.
R1 was configured with198.51.100.65, not with 64, yet it stores the subnet by its network address.
A routing table always lists network addresses.To fix the ticket, give the printer any free address of the usable range, for example
198.51.100.70.Answer the question below
Which address does a routing table use to describe a subnet?
Answer the question below
Apply the ruler method to a new address: a camera has 203.0.113.200/28. What is the first usable host address of its subnet? Give the address only, in dotted decimal format, without the prefix length.
The same method works when the cut is in another octet.
A Server on a /20
A server at the Head Office has the address
172.16.37.200/20.
Which subnet is it in?
A /20 falls between /17 and /24, so the octet of interest is the third one.
The mask confirms it:255.255.240.0, and 240 is the octet that is neither 255 nor 0.The block size is 256 − 240 = 16.
The ruler is now on the third octet, with marks every 16: 0, 16, 32, 48, 64, and so on.
The server's third octet is 37, and 37 sits between the marks 32 and 48.
Its subnet starts at 32 and ends at 47.
Figure 6 – 172.16.37.200/20: the third octet is cut in blocks of 16, the fourth octet is whole.
The fourth octet is 0 in the mask, so it is entirely host bits.
It runs from 0 to 255 inside every block, and you never touch it.
The server's 200 plays no role in finding the subnet.Network address:
172.16.32.0, third octet at the mark, fourth octet at 0Broadcast address:
172.16.47.255, third octet at the end of the block, fourth octet at 255Usable range:
172.16.32.1to172.16.47.254
Answer the question below
What is the broadcast address of 172.16.37.200/20?
Checking With the Router
R2 is the gateway of that subnet.
Read its routing table:R2# show ip route // Output omitted for brevity. C 172.16.32.0/20 is directly connected, GigabitEthernet0/1R2 shows
172.16.32.0/20.
The router finds the same network address as your ruler.
The method holds for any prefix length, from /1 to /30: only the octet you work on moves.
The /31 and the /32 are the two exceptions: they keep no network or broadcast address.Answer the question below
For a /20 mask, which octet do you place on the ruler?
Answer the question below
Apply the ruler method to a new address where the cut is not in the last octet: a switch has 10.44.77.9/21. What is the last usable host address of its subnet? Give the address only, in dotted decimal format, without the prefix length.