Network & delivery
7 min readUpdated/24 subnet mask (255.255.255.0): hosts, splits and why BGP needs a /24
Quick answer
A /24 subnet has the mask 255.255.255.0: 24 network bits and 8 host bits, so 256 addresses, of which 254 are usable hosts once the network and broadcast addresses are set aside. It is the default size of most home and office networks. On the public internet it matters for another reason: a /24 is the smallest IPv4 block that propagates across the global BGP table, so routing or protecting your own addresses needs at least one.
01What is a /24 subnet?
The /24 says that the first 24 bits of an address identify the network. As a mask that is 255.255.255.0, and as a wildcard mask 0.0.0.255. Because the boundary falls exactly between the third and fourth octets, a /24 is the easiest network to read: in 203.0.113.0/24 every address starting 203.0.113 is on the network, and the last number picks the host. For masks in general, see what a subnet mask is.
| Property | Value for a /24 |
|---|---|
| Subnet mask | 255.255.255.0 |
| Mask in binary | 11111111.11111111.11111111.00000000 |
| Wildcard mask | 0.0.0.255 |
| Total addresses | 2^8 = 256 |
| Usable hosts | 254, from .1 to .254 |
| Network and broadcast | .0 and .255 |
| Reverse DNS | Exactly one zone, e.g. 113.0.203.in-addr.arpa for 203.0.113.0/24 |
| Contained in | A /23 (two /24s), a /22 (four), a /16 (256) |
| Old class name | The size of a class C network |
02How many hosts are in a /24?
254. Subtracting 24 from 32 leaves 8 host bits, and 2^8 is 256 addresses. The all-zeros address, 203.0.113.0, names the network, and the all-ones address, 203.0.113.255, is the broadcast address that reaches every host on the segment, so neither is given to a device.
In practice one more goes to the router, which leaves 253 addresses for devices. Many networks also keep a block back for static assignments such as printers, switches or a second gateway and give the DHCP server the rest; a pool from .100 to .199, for example, holds 100 leases. When 253 is not enough, the next size up is a /23 (255.255.254.0) with 510 usable hosts.
03Why /24 is the smallest prefix routed on the internet
A /24 is the longest IPv4 prefix that networks generally accept from each other in BGP. RFC 7454, the IETF's best-practice document for BGP operations, records that IPv4 prefixes longer than /24 are generally neither announced nor accepted on the internet, citing RIPE community practice. Geoff Huston's review of BGP in 2025 states the same convention: a /24 is the smallest block that propagates across the whole default-free zone.
The reason is the size of the global table. Every prefix costs memory and processing in each router that carries a full table, and Huston counted between 1,040,000 and 1,050,000 IPv4 prefixes at the end of 2025, with /22, /23 and /24 prefixes making up 84% of them. Operators filter anything more specific than /24 to keep that growth bounded.
The effect has been measured directly. In October 2014 the RIPE NCC announced a /24, a /25 and a /28, each once with and once without a route object in the routing registry, and counted how many of its 98 full-table route collector peers saw each one. A RIPE Labs follow-up in 2019 found no reason to expect a /25 to propagate any further than it did in 2014.
| Prefix announced (RIPE NCC test, October 2014) | Full-table peers that saw it | Share |
|---|---|---|
| /24 with route object | 90 of 98 | 92% |
| /25 with route object | 20 of 98 | 20% |
| /28 with route object | 15 of 98 | 15% |
| /24 without route object | 90 of 98 | 92% |
| /25 without route object | 14 of 98 | 14% |
| /28 without route object | 10 of 98 | 10% |
04What the /24 minimum means for BGP and GRE DDoS protection
Network-level DDoS protection for your own address space works by having the protection provider announce your prefix with BGP, so traffic for it flows through the provider's filters, and then delivering the clean traffic to you, usually through a GRE tunnel. Because nothing longer than a /24 propagates reliably, the block being protected must be at least a /24. A single server address, or a /29 from a hosting company, cannot be announced on its own.
Routers prefer the most specific matching route, so a /24 announced by a protection provider wins over the /22 that its holder announces directly, for the addresses inside it. That lets a network move only the /24 under attack. It also means the holder's route origin authorisations must allow the more specific prefix from the provider's AS, or networks that validate RPKI will reject it.
Without your own /24 there are two common alternatives: protection the hosting company applies to its own larger block, or protected addresses from the provider's space with traffic delivered by tunnel. Remote DDoS protection compares these delivery methods.
Holding a /24 of your own, rather than addresses inside a provider's block, lets you:
- Announce it from your own ASN, or have a provider announce it for you
- Move it between upstreams or protection providers without renumbering hosts
- Have its reverse DNS delegated to you as a single zone
- Create the RPKI route origin authorisations for it yourself, deciding which ASNs may announce it
05How to split a /24 into smaller subnets
Inside your own network the /24 floor does not apply: a /24 can be divided into any mix of smaller subnets, and each extra network bit halves the size and doubles the count. Splitting costs addresses, because every subnet gives up two to its network and broadcast addresses, as the last column shows.
| Split into | Mask | Subnets | Addresses each | Usable each | Usable in total |
|---|---|---|---|---|---|
| /25 | 255.255.255.128 | 2 | 128 | 126 | 252 |
| /26 | 255.255.255.192 | 4 | 64 | 62 | 248 |
| /27 | 255.255.255.224 | 8 | 32 | 30 | 240 |
| /28 | 255.255.255.240 | 16 | 16 | 14 | 224 |
| /29 | 255.255.255.248 | 32 | 8 | 6 | 192 |
| /30 | 255.255.255.252 | 64 | 4 | 2 | 128 |
06Worked example: one /24, seven subnets
Suppose 203.0.113.0/24 has to hold a server network of about 100 hosts, an office of 50, a VPN pool of 25, a DMZ of 10, a management segment of 5 and two router links. Allocate the largest first, each starting on a multiple of its own size, and the whole /24 is used without overlap: 128 + 64 + 32 + 16 + 8 + 4 + 4 = 256 addresses. Using /31s for the two router links (RFC 3021) would free another four. The subnet calculator checks any one of these networks.
| Need | Subnet | Mask | Usable range | Broadcast |
|---|---|---|---|---|
| Servers, up to 126 | 203.0.113.0/25 | 255.255.255.128 | .1 to .126 | 203.0.113.127 |
| Office, up to 62 | 203.0.113.128/26 | 255.255.255.192 | .129 to .190 | 203.0.113.191 |
| VPN pool, up to 30 | 203.0.113.192/27 | 255.255.255.224 | .193 to .222 | 203.0.113.223 |
| DMZ, up to 14 | 203.0.113.224/28 | 255.255.255.240 | .225 to .238 | 203.0.113.239 |
| Management, up to 6 | 203.0.113.240/29 | 255.255.255.248 | .241 to .246 | 203.0.113.247 |
| Router link 1 | 203.0.113.248/30 | 255.255.255.252 | .249 to .250 | 203.0.113.251 |
| Router link 2 | 203.0.113.252/30 | 255.255.255.252 | .253 to .254 | 203.0.113.255 |
$ python3 -c "import ipaddress as i; print(*i.ip_network('203.0.113.0/24').subnets(new_prefix=26))"
203.0.113.0/26 203.0.113.64/26 203.0.113.128/26 203.0.113.192/26
$ python3 -c "import ipaddress as i; print(*i.ip_network('10.40.0.0/22').subnets(new_prefix=24))"
10.40.0.0/24 10.40.1.0/24 10.40.2.0/24 10.40.3.0/2407The four /24s inside a /22, and reverse DNS
Many European networks hold a /22 rather than a single /24. When the RIPE NCC reached its last /8 in 2012, policy limited each member to one /22, and after its pool ran out in November 2019 it moved to a waiting list that allocates single /24s from recovered space to members that have not yet received an IPv4 allocation. A /22 (255.255.252.0) is exactly four consecutive /24s, and it must start on a third octet divisible by four.
Reverse DNS follows the same octet boundary. A /24 maps to exactly one in-addr.arpa zone, such as 113.0.203.in-addr.arpa for 203.0.113.0/24, so it can be delegated to its holder as a whole. Delegating anything smaller requires the CNAME technique of RFC 2317, which is why providers often keep reverse DNS for small blocks themselves.
- 10.40.0.0/22 contains 10.40.0.0/24, 10.40.1.0/24, 10.40.2.0/24 and 10.40.3.0/24 (private space, used only for the arithmetic)
- 10.40.4.0/22 is the next /22; 10.40.2.0/22 is not a valid network, because 2 is not a multiple of 4
- Each of the four /24s can be announced, protected or moved on its own, if the RPKI and routing registry records allow it
Questions
Frequently asked questions
Sources
Sources and verification
Every mask, range and subnet count on this page was computed, and both commands were run, with Python 3.11's ipaddress module on Debian 12, October 2026.
- 01RFC 7454: BGP Operations and Security, section 6.1.3 · RFC Editor
- 02BGP in 2025 (Geoff Huston, 8 January 2026) · APNIC Blog
- 03Propagation of Longer-than-/24 IPv4 Prefixes · RIPE Labs
- 04Visibility of IPv4 and IPv6 Prefix Lengths in 2019 · RIPE Labs
- 05IPv4 Run-out (final /22 policy and the /24 waiting list) · RIPE NCC
- 06RFC 2317: Classless IN-ADDR.ARPA delegation · RFC Editor
- 07RFC 3021: Using 31-Bit Prefixes on IPv4 Point-to-Point Links · RFC Editor
- 08RFC 4632: Classless Inter-domain Routing (CIDR) · RFC Editor
- 09RFC 5737: IPv4 Address Blocks Reserved for Documentation · RFC Editor
Last updated