Internet Protocol Version 4 (IPv4) — Part 2
Not all IPv4 addresses are equal. Some are for hosts, some are private, some are reserved for testing, and one block is reserved for the machine itself. This lesson maps the whole 32-bit space: the classic address classes, private ranges, loopback, and the special-purpose blocks every exam asks about.
Classful addressing and why it existed
When IPv4 was designed, addresses were split into fixed classes so a router could tell, from the first octet alone, how large a network was and which part of the address was the network and which was the host. This is classful addressing, defined in the RFC 791 era. A Class A address was for a huge network, a Class C for a small one.
Classful
Fixed classes (A–E) chosen by the leading bits of the first octet.
Legacy
Later, classless addressing (CIDR) replaced it; the Internet is prefix-based today.
Still useful
Class ranges remain the fastest mental check for “what kind of address is this?” and for the default mask.
The five classes
Five classes were defined. Only the first three are assigned to ordinary hosts; the others exist for multicast and experimental use.
| Class | First octet | Default prefix | Default mask | Purpose |
|---|---|---|---|---|
| Class A | 1–126 | /8 | 255.0.0.0 | Very large networks |
| Loopback | 127 | /8 | 255.0.0.0 | Reserved for the local host (not a normal class) |
| Class B | 128–191 | /16 | 255.255.0.0 | Medium networks |
| Class C | 192–223 | /24 | 255.255.255.0 | Small networks |
| Class D | 224–239 | — | — | Multicast (one-to-many groups) |
| Class E | 240–255 | — | — | Reserved / experimental |
Class D and Class E addresses are not assigned to hosts. Multicast (Class D) sends one stream to a group of receivers; Class E is set aside for experimental use. When you are asked for the class of a host address, the answer is almost always A, B or C.
First-octet ranges and leading bits
Each class is also identified by the pattern of the leading bits of the first octet. This is how a device can classify an address in binary without any table.
| Class | Leading bits | First octet (decimal) |
|---|---|---|
| A | 0 | 1–126 |
| B | 10 | 128–191 |
| C | 110 | 192–223 |
| D | 1110 | 224–239 |
| E | 1111 | 240–255 |
The first octet 00000000 (0) and 01111111 (127) are both special: 0 is “this network” and 127 is loopback. That is why Class A host addresses start at 1 and stop at 126, leaving 127 for loopback.
Loopback, link-local and carrier-grade NAT
Three special blocks show up constantly in troubleshooting and in the exam. Each one has a single, memorable job.
Loopback (127.0.0.0/8)
The entire block 127.0.0.0/8 is reserved for loopback, as defined in RFC 1122. When a host sends traffic to a loopback address, the packet never leaves the machine: the operating system turns it around and delivers it back to the local TCP/IP stack. This is used to test whether the protocol stack and local software are working before blaming the network. The most common loopback address is 127.0.0.1, often called “localhost”, and 127.0.0.0/8 means any 127.x.x.x address.
127.0.0.1 fails, the local stack is broken; that tells you nothing about the physical link.APIPA / link-local (169.254.0.0/16)
When a host is configured to get its address automatically (DHCP) but no server answers, Windows and many other systems self-assign an address from 169.254.0.0/16. This is APIPA (Automatic Private IP Addressing) or, more formally, an IPv4 link-local address, standardised in RFC 3927. A link-local address is valid only on the local link; it is never routed. Seeing a 169.254.x.x address on a PC is a strong diagnostic clue that the machine could not reach a DHCP server.
Carrier-grade NAT (100.64.0.0/10)
RFC 6598 reserves 100.64.0.0/10 for carrier-grade NAT (also called shared address space). ISPs use it between their own equipment and customer premises when they cannot give every customer a unique public address. Like RFC 1918 space, it is not globally routable. The /10 prefix spans 100.64.0.0 – 100.127.255.255.
Public vs private addresses
Addresses fall into two worlds, and the difference decides whether a packet can cross the Internet at all.
Globally unique and routable on the Internet. They are allocated through IANA, the regional registries, and your ISP.
Reusable inside any organisation. They are not routable on the public Internet; a router on the Internet will drop them. To reach the Internet, private addresses are translated to public ones by NAT (Network Address Translation).
Because every home and office on the planet can reuse the same private blocks, private addressing is the single biggest reason IPv4 has lasted so long despite the address shortage.
RFC 1918 private ranges
RFC 1918 defines exactly three private blocks. Learn the ranges and the prefixes — both are tested:
| Block (CIDR) | Range | Classful origin | Default mask |
|---|---|---|---|
| 10.0.0.0/8 | 10.0.0.0 – 10.255.255.255 | one Class A | 255.0.0.0 |
| 172.16.0.0/12 | 172.16.0.0 – 172.31.255.255 | 16 Class B blocks | 255.240.0.0 |
| 192.168.0.0/16 | 192.168.0.0 – 192.168.255.255 | 256 Class C blocks | 255.255.0.0 |
192.168.0.0/16 is the private block, while 192.169.0.0 is public.How /12 gives 172.16 through 172.31: the prefix /12 fixes the first octet (8 bits) plus the top 4 bits of the second octet. The second octet must start with 0001, so its binary value runs from 00010000 (16) to 00011111 (31).
Documentation ranges and the special-address map
RFC 5737 sets aside three /24 blocks specifically for use in documentation, tutorials and examples. You will see these in every textbook — they can never be real public hosts. The map below gathers every special block in one place.
| Block | Name | Range |
|---|---|---|
| 192.0.2.0/24 | TEST-NET-1 | 192.0.2.0 – 192.0.2.255 |
| 198.51.100.0/24 | TEST-NET-2 | 198.51.100.0 – 198.51.100.255 |
| 203.0.113.0/24 | TEST-NET-3 | 203.0.113.0 – 203.0.113.255 |
Special addresses at a glance
| Block | What it is | Reference |
|---|---|---|
| 0.0.0.0/8 | “This network” / unspecified source | RFC 5735 |
| 10.0.0.0/8 | Private (RFC 1918) | RFC 1918 |
| 100.64.0.0/10 | Carrier-grade NAT / shared address space | RFC 6598 |
| 127.0.0.0/8 | Loopback | RFC 1122 |
| 169.254.0.0/16 | Link-local / APIPA | RFC 3927 |
| 172.16.0.0/12 | Private (RFC 1918) | RFC 1918 |
| 192.0.2.0/24 | Documentation TEST-NET-1 | RFC 5737 |
| 192.168.0.0/16 | Private (RFC 1918) | RFC 1918 |
| 198.51.100.0/24 | Documentation TEST-NET-2 | RFC 5737 |
| 203.0.113.0/24 | Documentation TEST-NET-3 | RFC 5737 |
| 224.0.0.0/4 | Multicast (Class D) | RFC 5735 |
| 240.0.0.0/4 | Reserved / experimental (Class E) | RFC 5735 |
| 255.255.255.255 | Limited broadcast (this subnet only) | RFC 5735 |
Key terms
Classful addressing
Legacy scheme that partitioned IPv4 into fixed classes (A–E) by the leading bits of the first octet.
Public address
A globally unique, Internet-routable IPv4 address.
Private address
A non-routable address from RFC 1918, reusable inside any organisation.
Loopback
127.0.0.0/8; traffic to it returns to the local host without leaving the machine.
APIPA / link-local
169.254.0.0/16; self-assigned when DHCP fails; valid only on the local link.
Carrier-grade NAT
100.64.0.0/10 (RFC 6598); shared address space used inside ISPs.
NAT
Network Address Translation; maps private addresses to public ones for Internet access.
Sources & references
- Postel, J. RFC 791: Internet Protocol (1981). Classful address format.
- Braden, R. RFC 1122: Requirements for Internet Hosts — Communication Layers (1989). Loopback.
- Rekhter, Y. et al. RFC 1918: Address Allocation for Private Internets (1996).
- Arkko, J., Cotton, M. & Vegoda, L. RFC 5737: IPv4 Address Blocks Reserved for Documentation (2010).
- Cotton, M. & Vegoda, L. RFC 5735: Special Use IPv4 Addresses (2010).
- Cheshire, S., Aboba, B. & Guttman, E. RFC 3927: Dynamic Configuration of IPv4 Link-Local Addresses (2005).
- Weil, J. et al. RFC 6598: IANA-Reserved IPv4 Prefix for Shared Address Space (2012).
- IANA. IPv4 Special-Purpose Address Registry.
- Cisco. CCNA (200-301) Exam Topics, Network Fundamentals (IP addressing).
Review
Check what you have learned with these review questions.
Sources & references
- Postel, J. RFC 791: Internet Protocol (1981). Classful address format. rfc-editor.org/rfc/rfc791.
- Braden, R. RFC 1122: Requirements for Internet Hosts — Communication Layers (1989). Loopback. rfc-editor.org/rfc/rfc1122.
- Rekhter, Y. et al. RFC 1918: Address Allocation for Private Internets (1996). rfc-editor.org/rfc/rfc1918.
- Arkko, J., Cotton, M. & Vegoda, L. RFC 5737: IPv4 Address Blocks Reserved for Documentation (2010). rfc-editor.org/rfc/rfc5737.
- Cotton, M. & Vegoda, L. RFC 5735: Special Use IPv4 Addresses (2010). rfc-editor.org/rfc/rfc5735.
- Cheshire, S., Aboba, B. & Guttman, E. RFC 3927: Dynamic Configuration of IPv4 Link-Local Addresses (2005). rfc-editor.org/rfc/rfc3927.
- Weil, J. et al. RFC 6598: IANA-Reserved IPv4 Prefix for Shared Address Space (2012). rfc-editor.org/rfc/rfc6598.
- IANA. IPv4 Special-Purpose Address Registry. iana.org.
- Cisco. CCNA (200-301) Exam Topics, Network Fundamentals (IP addressing). cisco.com.
Target exams: CCNA 200-301 v1.1 · CyberOps Associate 200-201. Last content verification: 2026-10-11.