IPv4 addressing · Fundamentals · Module 2
Splitting a network into equal subnets
Show topologyHide topology
Interfaces and addresses · Et = Ethernet. LAN C, LAN D and branch LAN 2 are planned and not cabled yet.
- 192.168.8.0/26 · LAN AR1 Et0/0 192.168.8.1H1 eth0 192.168.8.10
- 192.168.8.64/26 · LAN BR1 Et0/1 192.168.8.65R3 Et0/0 192.168.8.126
- 192.168.9.224/30R1 Et0/2 192.168.9.225R2 Et0/0 192.168.9.226
- 192.168.9.228/31R2 Et0/2 192.168.9.228R4 Et0/0 192.168.9.229
- 192.168.9.0/25 · branch LAN 1 · SW1R2 Et0/1 192.168.9.1no other device yet
- 192.168.9.192/27 · branch LAN 3 · SW2R4 Et0/1 192.168.9.193no other device yet
Device icons joined by plain cables, each cable labeled with its subnet. Down the middle, top to bottom: R3, a router; R1, the HQ router; R2, the branch router; R4, a branch router; and the switch SW2. R3 is cabled to R1 (192.168.8.64/26), R1 to R2 (192.168.9.224/30), R2 to R4 (192.168.9.228/31) and R4 to SW2 (192.168.9.192/27). At the upper left, the host H1, a laptop, is cabled down from its base to R1 (192.168.8.0/26). Left of R2, the switch SW1 is cabled across to it (192.168.9.0/25).
What block size is
Four equal subnets
HQ needs four LANs from 192.168.8.0/24. What is the simplest way to cut it?
HQ splits its block, 192.168.8.0/24, with one prefix, /26, for every LAN, so each subnet holds the same 64 addresses. Subnets cut this way are equal subnets.
They are simple to plan, because each one starts where the one before it ends. They waste addresses when the LANs need different sizes, because a small LAN still takes all 64.
HQ’s block holds four subnets in a row (Figure 2.1). LAN A and LAN B are built, and LAN C and LAN D are planned and not cabled yet.
Under the title “192.168.8.0/24 · four /26”, a bar of four equal boxes: LAN A and LAN B as solid boxes, LAN B highlighted; LAN C and LAN D as one dashed outline split in two, because they are planned. Each box gives its name and where it starts: .0, .64, .128 and .192. Two thin lines open LAN B into a row of three cells across the full width: a small cell at the left, labeled “.64 network” under it; a wide middle cell, “hosts .65 to .126”; and a small cell at the right, labeled “broadcast .127” under it.
Each of HQ’s subnets has the same three parts. Its first address is its network address, the subnet’s name, its last is its broadcast address, and the addresses between go to devices.
The first subnet of a block, the one whose subnet bits are all zeros, is called subnet zero. In HQ’s block it is LAN A, 192.168.8.0/26.
Can a router use subnet zero, and LAN D, the last subnet, whose subnet bits are all ones? Yes, like any other. An early subnetting standard said that the all-zeros and all-ones subnets should not be assigned, here LAN A and LAN D, but a later one says that this restriction may be safely ignored. You can see R1 use subnet zero, since its LAN A line reads ip address 192.168.8.1 255.255.255.192.
Key idea
One mask splits the block into subnets of one size, and the first, subnet zero, is as usable as the rest.
How it works
The block size
Finding the block
R3’s address is 192.168.8.126 with a /26 mask. Which subnet is it in?
To place R3, you need to know where each subnet starts, and one number tells you that: the block size, how many addresses each subnet holds.
The mask gives it. Take the octet where the mask stops being 255, for /26 the last one, 192. The block size is 256 minus that octet, 256 − 192 = 64, the same count as 2⁶ for the 6 host bits.
A subnet’s network address has every host bit zero, and in the last octet the 6 host bits are all zero only at .0, .64, .128 and .192, the multiples of 64. A subnet starts only at a multiple of its block size.
In HQ’s block only the first subnet’s network address ends in .0. LAN B’s is 192.168.8.64.
A /26 cannot start at an address such as .65, which is not a multiple of 64. That address lies inside the block that starts at .64.
In LAN B, the network address has every host bit zero, and the broadcast address has every host bit one, which means “all”. Between them lies the host range, from the first host, one after the network address, to the last host, one before the broadcast address.
Step through Figure 2.2 to find R3’s block and its network address, first and last host and broadcast address.
Step 1 of 7
The mask 255.255.255.192 stops being 255 in the last octet, at 192. So each subnet holds 256 − 192 = 64 addresses, and HQ’s /24 is four blocks of 64.
Step 2 of 7
The blocks start at the multiples of 64 in the last octet, .0, .64, .128 and .192. Each block ends one address before the next one starts.
Step 3 of 7
R3’s address ends in .126. To find its subnet, find the block whose range holds .126.
Which block holds 192.168.8.126?
- The block that starts at .64. (Correct): .126 is at least .64 and less than .128, where the next block starts. So it sits in the block from .64 to .127: LAN B.
- The block that starts at .128.: .126 is less than .128, so it has not reached that block yet. A block holds the addresses from its own start up to one before the next start.
- The block that starts at .0.: Only the first subnet starts at .0. That block ends at .63; .126 is further on, in the block that starts at .64.
- A block that starts at .126 itself.: A block cannot start at just any address: a /26 block starts only at a multiple of 64. .126 is not one, so it lies inside a block that started earlier.
Step 4 of 7
.126 lies between .64 and .127, so it is in the block that starts at .64. That block’s first address, 192.168.8.64, is its network address, the name of LAN B.
Step 5 of 7
The hosts run from .65, one after the network address, to .126. R1 has the first host, .65, and R3 the last, .126.
Step 6 of 7
The block’s last address, .127, is LAN B’s broadcast address. It is one before .128, where the next block starts. So .126 is the last address a device can have in LAN B.
Step 7 of 7
LAN B is 192.168.8.64/26, with network .64, hosts .65 to .126, broadcast .127.
At the top, “block size = 256 − 192 = 64”, and under it, from step 3, “R3 · 192.168.8.126”. Under that, HQ’s block as a bar of four equal boxes, LAN A to LAN D; from step 2 each box also gives where it starts: .0, .64, .128 and .192. From step 4, the LAN B box is highlighted and two thin lines open it into a row of three cells: a small network cell labeled “.64 network”, a wide hosts cell that reads “R1 .65 · hosts · R3 .126” from step 5, and a small broadcast cell labeled “broadcast .127” at step 6. At step 7 the line “LAN B · 192.168.8.64/26” sits at the foot.
Predict the next step, then go on.
A broadcast address is the last address of its own block. LAN A’s is .63, and LAN B starts one address later, at .64.
The block size counts addresses, not hosts: LAN B has 64 addresses and 62 hosts, because the network and broadcast addresses go to no device.
Key idea
Block size = 256 minus the first mask octet that is not 255. The subnet is the block that holds the address: network first, broadcast last, hosts between.
R3’s place in LAN B
What does R3 itself report about its place in LAN B?
On R3, show ip interface Ethernet0/0 | include Internet address shows the address and prefix length of its interface toward LAN B.
R3 is 192.168.8.126 with /26, the last host of LAN B.
R3#show ip interface Ethernet0/0 | include Internet address1 Internet address is 192.168.8.126/26
Scroll sideways to see the whole output
- /26 means a block size of 64, here the block from .64 to .127.
This line gives neither R3’s network nor its broadcast address. You get both, and the first host, from the address and the /26.
The same works for planned LAN C, before anyone cables it.
/26: 4 subnets of 64 addresses, 62 hosts each
- Network address
- 192.168.8.0
- First host
- 192.168.8.1
- Last host
- 192.168.8.62
- Broadcast address
- 192.168.8.63
Task 1 of 1
Planned LAN C is the third /26 of 192.168.8.0/24. Write its network address, first host, last host and broadcast address.
Type the last octet of each address.
| Subnet | Network address | First host | Last host | Broadcast address |
|---|---|---|---|---|
| 1 | .0 | .1 | .62 | .63 |
| 2 | .64 | .65 | .126 | .127 |
| 3 | .128 | .129 | .190 | .191 |
| 4 | .192 | .193 | .254 | .255 |
Task 1 of 1 Planned LAN C is the third /26 of 192.168.8.0/24. Write its network address, first host, last host and broadcast address.
Answer
Network address 192.168.8.128 · First host 192.168.8.129 · Last host 192.168.8.190 · Broadcast address 192.168.8.191
The third block of 64 starts at .128: that is LAN C’s network address. The hosts run from .129 to .190, and the broadcast address is .191, one before LAN D starts at .192.
Key idea
Find the block, then read its four addresses: network first, then the first and last host, broadcast last.
The block is given; find its last address.
Each subnet of HQ’s /24 has its own network address, first host, last host and broadcast address, one block of 64 after another.
Step through the subnets with the arrows and read each one’s four addresses.
/26: 4 subnets of 64 addresses, 62 hosts each
- Network address
- 192.168.8.64
- First host
- 192.168.8.65
- Last host
- 192.168.8.126
- Broadcast address
- 192.168.8.127
Marked address: 192.168.8.126
| Subnet | Network address | First host | Last host | Broadcast address |
|---|---|---|---|---|
| 1 | .0 | .1 | .62 | .63 |
| 2 | .64 | .65 | .126 | .127 |
| 3 | .128 | .129 | .190 | .191 |
| 4 | .192 | .193 | .254 | .255 |