Introduction
Older manuals divide IPv4 addresses into classes using the first few bits. This reference helps interpret those documents. Modern subnet calculations require the actual configured prefix length.
Method and concepts
Historically, the initial patterns 0, 10 and 110 selected unicast formats with network boundaries at 8, 16 and 24 bits. The pattern 1110 identifies multicast space and 1111 covers the historical Class E range. Special-purpose assignments can further restrict how an address within a range is used.
- Look up the first octet of the address and compare its highest bits with the table.
- For a historical A, B or C result, distinguish its original class boundary from any prefix supplied with the address.
- Check special-use context separately. Loopback, private, documentation and other reservations carry meanings beyond their historical class.
IPv4 addresses and packet headers diagram
- IP packet · 1,500 bytes
- IPv4 header · 20 bytes
- IP payload · 1,480 bytes
- TCP data · 1,460 bytes
Worked examples
Read an old Class B label beside a modern /20
- For 172.20.29.209, write 172 as 10101100. Its leading 10 places it in the historical Class B range, with a /16 class boundary.
- Now read the actual configuration 172.20.29.209/20. The first four bits of its third octet are fixed too, giving the network 172.20.16.0/20.
- The address also falls in the private allocation 172.16.0.0/12. These three prefix lengths answer different questions about historical format, local subnet and special use.
IPv4 addresses and packet headers: Read the first IPv4 byte 0x45
- Split 0x45 into the high hex digit 4 and low digit 5. The upper four bits identify version 4. The lower four encode an IHL of five words.
- Multiply 5 by 4 bytes to obtain the 20-byte header. With Total Length 1,500, the IP payload contains 1,480 bytes.
- If Protocol is 6 and the TCP header also occupies 20 bytes, the segment carries 1,460 application bytes. Adding IPv4 or TCP options reduces that amount at the same packet size.
Reference table
| Historical class | Leading bits | First octet | Original role |
|---|---|---|---|
| A | 0 | 0–127 | Unicast format, /8 boundary |
| B | 10 | 128–191 | Unicast format, /16 boundary |
| C | 110 | 192–223 | Unicast format, /24 boundary |
| D | 1110 | 224–239 | Multicast groups |
| E | 1111 | 240–255 | Reserved range with special cases |
Reading the result
A first-octet range describes the historical bit pattern only. For example, 127 has a Class A bit pattern yet 127.0.0.0/8 is loopback space. The all-ones address 255.255.255.255 has a specific limited-broadcast meaning inside the historical Class E range.
Common mistakes
- Inferring a production network's mask from the first octet.
- Treating all addresses with first octet 172 as private. The private range spans second octets 16 through 31.
Frequently asked questions
Why do some tables list Class A as 1 through 126?
That range omits the special first octets 0 and 127. The leading-zero bit pattern itself spans 0 through 127.
What subnet mask belongs to Class D?
The historical A/B/C host-and-network split does not apply to multicast group identifiers. The prefix 224.0.0.0/4 describes the multicast address space as a whole.
What does /32 mean on a route?
All 32 address bits must match. The route represents exactly one IPv4 value and can identify a loopback or another specific destination.
Is the IPv4 Protocol number the service port?
No. The protocol number selects a payload format, for example UDP 17. A UDP header then carries source and destination port numbers.
How many bytes are in the minimum IPv4 header?
The minimum header is 20 bytes. The IHL field counts 32-bit words, so a value of five represents 20 bytes; options can make it longer.
Does IPv4 Total Length include Ethernet framing?
No. It counts the IPv4 header and IPv4 payload. Link-layer framing is outside that length field.
What happens when an IPv4 packet is larger than an outgoing MTU?
Depending on the Don't Fragment setting and path behavior, it may be fragmented or dropped with an ICMP message. Path MTU discovery uses this feedback to find a usable packet size.
Does an IPv4 Protocol number identify a TCP or UDP port?
No. The Protocol field identifies the payload protocol, such as TCP or UDP. A TCP or UDP header then contains the service ports.
What does TTL protect against?
IPv4 Time To Live bounds how many forwarding hops a packet can survive. Routers decrement it so a packet cannot circulate forever in a forwarding loop.
Is the IPv4 header checksum an end-to-end payload checksum?
No. It covers the IPv4 header only and is recomputed when mutable header fields such as TTL change. Transport protocols have separate integrity fields.
Can IPv4 fragmentation be reassembled at every router?
No. Fragmentation can occur during forwarding when permitted, but fragments are normally reassembled by the destination host, not each intermediate router.
Why use documentation IPv4 ranges in examples?
The designated documentation blocks avoid using a real organization's address in examples. They should not be treated as ordinary public service addresses.
What is the difference between limited broadcast and directed broadcast?
The limited broadcast address is 255.255.255.255 and is confined to the local link. A directed broadcast targets the all-ones host part of a particular IPv4 subnet and is commonly filtered by routers.
Can two routers advertise the same IPv4 prefix?
They can provide alternative routes to the same prefix. Routing policy and metrics determine whether one is preferred or both are installed for load sharing.
Why is classful addressing considered historical?
The original A, B, and C boundaries fixed network sizes at coarse octet edges. CIDR allows a prefix boundary at any bit and is used for modern allocation and routing.
What is the IPv4 header checksum recalculated over?
It covers the IPv4 header, not the payload. Because forwarding changes TTL, a router updates the checksum as the packet traverses the path.
When can a /31 IPv4 prefix be useful?
On a point-to-point link, RFC 3021 allows both addresses to be assigned to the two endpoints. It avoids reserving separate network and broadcast values where those functions are not needed.
Further learning and references
- IANA IPv4 Special-Purpose Address Registry
Reference source for the concepts and service described in this guide.
- RFC 791 · IPv4 header and address format
- RFC 1191 · IPv4 path MTU discovery
- IANA · Protocol numbers

