/31 Subnet Mask and RFC 3021: Point-to-Point Links Explained
Point-to-point links are the smallest but most frequently repeated building blocks of a network. With the classic /30 subnet, every router-to-router link consumes 4 IP addresses, and half of them (the network and broadcast addresses) can never be assigned to a device. The /31 mask, standardized in RFC 3021, removes that waste. This guide explains how /31 works, how it differs from /30 and what to watch out for when you deploy it.
What Is a /31 Subnet Mask? An Overview
/31 is the CIDR prefix in which the first 31 bits of the 32-bit IPv4 address belong to the network and only 1 bit is left for hosts. Its key values:
- Subnet mask: 255.255.255.254
- Binary: 11111111.11111111.11111111.11111110
- Wildcard mask: 0.0.0.1
- Total addresses: 2^(32 − 31) = 2
- Usable hosts by the classic formula: 2 − 2 = 0
The last line is the interesting one. Under the classic subnetting rule, the first address (network) and the last address (broadcast) cannot be assigned to devices. A /31 has only 2 addresses, so the formula gives "0 usable hosts". This is exactly where RFC 3021 changes the rule for point-to-point links: both addresses can be assigned to the endpoints.
Key Differences Between Classic /30 Subnetting and /31
Let's compare the two step by step.
/30 example — 10.0.0.0/30 (mask 255.255.255.252):
- Host bits: 32 − 30 = 2 → 2² = 4 total addresses
- Network address: 10.0.0.0
- Usable range: 10.0.0.1 – 10.0.0.2 (2 addresses)
- Broadcast address: 10.0.0.3
/31 example — 10.0.0.4/31 (mask 255.255.255.254):
- Host bits: 32 − 31 = 1 → 2¹ = 2 total addresses
- Addresses in the block: 10.0.0.4 and 10.0.0.5
- Under RFC 3021 both addresses are assigned to the endpoints; there is no network/broadcast split
For the same job, /30 spends 4 addresses while /31 uses only 2. A /31 block always starts on a multiple of 2: 10.0.0.0/31, 10.0.0.2/31, 10.0.0.4/31… So a single /30 block (for example 10.0.0.0/30) can be split into two /31s: 10.0.0.0/31 and 10.0.0.2/31.
The RFC 3021 Standard: No More Network and Broadcast Addresses
RFC 3021 ("Using 31-Bit Prefixes on IPv4 Point-to-Point Links"), published in 2000, standardizes the use of /31 on point-to-point links. The reasoning is simple:
- A point-to-point link has only two endpoints.
- Every packet sent by one end is, by definition, delivered to the other end; broadcasting makes no sense.
- The network address (all host bits zero) is never used as a destination, so there is no need to reserve it.
So of the two addresses in a /31 block, one has host bit 0 and the other host bit 1. In the 10.0.0.4/31 example, 10.0.0.4 (last bit 0) would classically be the "network address" and 10.0.0.5 (last bit 1) the "broadcast". RFC 3021 allows both to be assigned to router interfaces.
There is one important limit: this interpretation applies only to true point-to-point links. On multi-access media such as a shared Ethernet segment, network and broadcast addresses are still required.
Address Savings: How Much Does /31 Save?
The math is simple:
- Each /30 link uses 4 addresses; a /31 uses only 2 → 50% savings per link.
- A /24 block (256 addresses) supports 64 links with /30, but 128 links with /31: twice as many point-to-point connections from the same block.
- In a network with 100 router-to-router links, /30 consumes 400 addresses and /31 consumes 200.
In a small network the difference looks negligible. For service providers, data center fabrics and large campus networks running hundreds or thousands of links, the cumulative effect is significant. With IPv4 exhaustion, /31 has become standard practice in modern address planning.
Use Cases: Router-to-Router and Switched Links
Where /31 is the right choice:
- Router-to-router WAN links (serial, Metro Ethernet, leased lines)
- Spine–leaf routed links in data center underlay networks
- Tunnel endpoints such as GRE and IPsec
- Two-endpoint links where OSPF, IS-IS or BGP adjacencies are formed
Switched environments need a clear statement: /31 is not used on a classic LAN segment with several devices (a group of switch ports). However, if the link between two routers passes through a single VLAN and there are only two endpoints, /31 can be used over Ethernet too. If a protocol such as OSPF runs on it, setting the network type to point-to-point is recommended.
Configuration: What to Watch When Deploying /31
A typical configuration in Cisco IOS-style syntax. First router:
R1(config)# interface GigabitEthernet0/0 R1(config-if)# ip address 10.0.0.4 255.255.255.254 The other end:
R2(config)# interface GigabitEthernet0/0 R2(config-if)# ip address 10.0.0.5 255.255.255.254
If OSPF runs over Ethernet, set the network type:
R1(config-if)# ip ospf network point-to-point
Keep these points in mind:
- Use /31 only on two-endpoint links; multi-access segments need /30 or larger.
- Confirm that both ends of the link support /31.
- Use 0.0.0.1 as the wildcard mask in ACLs.
- Use /32, not /31, for loopback addresses (what is a /32 subnet mask?).
- Check how your IPAM and monitoring tools display /31; tools that are not RFC 3021-aware may show a false "0 usable hosts" warning.
Compatibility: Which Devices Support /31?
- Router operating systems from major vendors such as Cisco IOS and Juniper Junos support /31; check the vendor documentation for the version it was introduced in.
- Older firmware, some firewalls and host operating systems may interpret /31 unexpectedly.
- Testing in a lab or on a pilot link before production is the safest approach.
- On the calculation side, the UK Bilişim subnet calculator accepts /31 input; 10.0.0.0/31 (RFC 3021) is one of its built-in examples.
Summary Comparison: /30 vs /31
| Property | /30 | /31 |
|---|---|---|
| Subnet mask | 255.255.255.252 | 255.255.255.254 |
| Wildcard mask | 0.0.0.3 | 0.0.0.1 |
| Total addresses | 4 | 2 |
| Usable hosts | 2 | 2 (RFC 3021, p2p only) |
| Network address | Reserved | Assigned to an endpoint |
| Broadcast address | Reserved | Assigned to an endpoint |
| Suitable for | General use, older devices | Point-to-point only |
| Addresses used per link | 4 | 2 |
To see the result of any CIDR value, /31 included — subnet mask, usable host range, binary bit layout and subnet breakdown — in seconds, use the IPv4 subnet calculator. All calculations run in your browser; no IP or topology data is sent to a server. You can try RFC 3021 inputs such as 10.0.0.0/31 right away.
Frequently Asked Questions (FAQ)
How many usable IP addresses are there in a /31 subnet? →
Per RFC 3021, both of the 2 addresses can be used on point-to-point links. The classic formula (2^host_bits − 2) gives 0 for /31; the standard defines an exception to this rule only for p2p links.
Can I use a /31 mask on a LAN? →
No. /31 is valid only on two-endpoint links. Multi-access segments with more than one device require network and broadcast addresses.
How does the link work without a broadcast address? →
A point-to-point link has only two endpoints; every packet sent by one end is already physically delivered to the other end. Since there is no need for broadcast, no broadcast address is reserved.
Is there an IPv6 equivalent of /31? →
Yes. Router-to-router links in IPv6 use a /127 prefix with similar logic, and this use is defined by RFC 6164.
Should I choose /30 or /31? →
If the link is truly point-to-point and both ends support /31, prefer /31; it saves addresses. If you are not sure about compatibility or the link is multi-access, use /30.