N-01 · Subnet · /28
/28 subnet
A /28 network keeps 28 of the 32 address bits for the network and leaves 4 for hosts. Its mask, host count, the blocks it fits in and example networks, all worked out below.
Short answer
- Subnet mask
- 255.255.255.240Wildcard 0.0.0.15
- Usable hosts
- 1416 addresses in total
2^4 = 16 addresses. The first is the network address and the last the broadcast, so 14 can go to devices.
The /28 mask in binary and hex
28 one bits, then 4 zero bits. The wildcard is the mask inverted.
| Mask | Dotted | Hex |
|---|---|---|
| Subnet mask | 255.255.255.240 | FF.FF.FF.F0 |
| Wildcard | 0.0.0.15 | 00.00.00.0F |
The mask ends inside the fourth octet, at 240 (11110000). That leaves 4 host bits in the octet, so /28 networks start every 16 in it: 0, 16, 32, 48 and so on. Cisco access lists take the wildcard form, 0.0.0.15, where a 1 bit means “any value” (Cisco document 23602).
RFC 1878's table lists /28 as FF.FF.FF.F0 hex, 16 addresses, equal to 1/16 C in the old class terms. Its Table 1-2 counts a /28 as 16 subnets of a class C network with 14 hosts each.
How many /28 subnets fit
The three private ranges (RFC 1918) and one /24.
| Block | /28 subnets in it |
|---|---|
| 10.0.0.0/8 | 1,048,576 |
| 172.16.0.0/12 | 65,536 |
| 192.168.0.0/16 | 4,096 |
| 192.168.181.0/24 | 16 |
10.0.0.0/8 holds 1,048,576, 172.16.0.0/12 holds 65,536 and 192.168.0.0/16 holds 4,096 /28 subnets. A /24 splits into 16 of them.
Splitting a /28
Each extra prefix bit halves the block.
| Into | Subnets | Usable each |
|---|---|---|
| /29 | 2 | 6 |
| /30 | 4 | 2 |
| /31 | 8 | 2 |
Two /29 subnets hold 12 usable addresses between them, 2 fewer than one /28: each half gives up its own network and broadcast address.
/28 subnets of 192.168.181.0/24
192.168.181.0/24 holds 16 of them. The row in bold holds 192.168.181.150.
| Subnet | First usable | Last usable |
|---|---|---|
| 192.168.181.0/28 | 192.168.181.1 | 192.168.181.14 |
| 192.168.181.16/28 | 192.168.181.17 | 192.168.181.30 |
| 192.168.181.32/28 | 192.168.181.33 | 192.168.181.46 |
| 192.168.181.48/28 | 192.168.181.49 | 192.168.181.62 |
| 192.168.181.64/28 | 192.168.181.65 | 192.168.181.78 |
| 192.168.181.80/28 | 192.168.181.81 | 192.168.181.94 |
| 192.168.181.96/28 | 192.168.181.97 | 192.168.181.110 |
| 192.168.181.112/28 | 192.168.181.113 | 192.168.181.126 |
| 192.168.181.128/28 | 192.168.181.129 | 192.168.181.142 |
| 192.168.181.144/28 | 192.168.181.145 | 192.168.181.158 |
| 192.168.181.160/28 | 192.168.181.161 | 192.168.181.174 |
| 192.168.181.176/28 | 192.168.181.177 | 192.168.181.190 |
| 192.168.181.192/28 | 192.168.181.193 | 192.168.181.206 |
| 192.168.181.208/28 | 192.168.181.209 | 192.168.181.222 |
| 192.168.181.224/28 | 192.168.181.225 | 192.168.181.238 |
| 192.168.181.240/28 | 192.168.181.241 | 192.168.181.254 |
Check an address
Pre-filled with 192.168.181.150/28. Change the address or the prefix.
Result
192.168.181.144/28
14 usable hosts
- Network
- 192.168.181.144
- First usable
- 192.168.181.145
- Last usable
- 192.168.181.158
- Broadcast
- 192.168.181.159
- Subnet mask
- 255.255.255.240
- Wildcard mask
- 0.0.0.15
- Total addresses
- 16
Inside 192.168.0.0/16, a private range (RFC 1918). Not routable on the public internet.
Binary view
- Address · 192.168.181.150
- 11000000.10101000.10110101.10010110
- Mask · 255.255.255.240
- 11111111.11111111.11111111.11110000
- Network · 192.168.181.144
- 11000000.10101000.10110101.10010000
Bold bits are fixed for the network; orange bits number the hosts.
192.168.181.0/24 split into /28
- 192.168.181.144/28.145–.158 ◂
/28 next to /27 and /29
One bit shorter, a /27 (255.255.255.224) has 32 addresses and 30 usable, 16 more than a /28. One bit longer, /29 (255.255.255.248) has 8 addresses and 6 usable. /27 subnet · /29 subnet
Ask the calculator for a host count and it answers /28 for 7 to 14 hosts: typing "192.168.181.144 14 hosts" gives this size, one more host gives a /27.
Worked example
Take 192.168.181.150/28. The mask ends in the fourth octet. There the address is 150 = 10010110 and the mask 240 = 11110000; AND keeps the first 4 bits: 10010000 = 144. So the network is 192.168.181.144. OR the wildcard 0.0.0.15 onto it to set every host bit: 192.168.181.159, the broadcast.
Devices use 192.168.181.145 through 192.168.181.158: 14 addresses. 192.168.181.150 is number 6 of them. In 192.168.181.0/24 this is subnet 10 of 16.
References
- RFC 4632, Classless Inter-domain Routing (CIDR), §3.1: prefix lengths and block sizes.
- RFC 950, Internet Standard Subnetting Procedure: subnet masks.
- RFC 1878, Variable Length Subnet Table For IPv4, Table 1-2.
- RFC 1918, Address Allocation for Private Internets: 10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16.
Other prefixes
Related tools
- Subnet calculatorNetwork, broadcast, host range, masks and a binary view from any IPv4 or IPv6 address and prefix.
- CIDR calculatorTurn IPv4 or IPv6 ranges into the fewest CIDR blocks, merge a list, and check it for overlaps.
- VLAN plannerCarve a parent block into right-sized subnets with VLAN IDs, then export CSV or Markdown.