The five classes
Early IPv4 split addresses into classes by the first number (octet). Today networks use CIDR prefixes instead (see the subnet calculator), but the classes are still taught in every networking course, including Cisco CCNA.
| Class | First octet | Default mask | Networks | Hosts per network | Typical use |
|---|---|---|---|---|---|
| A | 1 to 126 | 255.0.0.0 (/8) | 126 | 16,777,214 | Very large networks |
| B | 128 to 191 | 255.255.0.0 (/16) | 16,384 | 65,534 | Medium to large networks |
| C | 192 to 223 | 255.255.255.0 (/24) | 2,097,152 | 254 | Small networks |
| D | 224 to 239 | Not used | - | - | Multicast (one to many) |
| E | 240 to 255 | Not used | - | - | Reserved for experiments |
The whole 127.0.0.0 block is kept for loopback, which is why Class A stops at 126 in the usual tables.
Private ranges
Private addresses are for use inside your own network. They are not routed on the public internet, so many homes and offices can reuse the same ones. A router with NAT lets private devices reach the internet through one public address. These three blocks are defined in RFC 1918.
| Range | CIDR | Addresses | Class it falls in |
|---|---|---|---|
| 10.0.0.0 to 10.255.255.255 | 10.0.0.0/8 | 16,777,216 | A |
| 172.16.0.0 to 172.31.255.255 | 172.16.0.0/12 | 1,048,576 | B |
| 192.168.0.0 to 192.168.255.255 | 192.168.0.0/16 | 65,536 | C |
Other special ranges
| Range | Name | Meaning |
|---|---|---|
| 127.0.0.0/8 | Loopback | The device talking to itself. 127.0.0.1 is "localhost". (RFC 1122) |
| 169.254.0.0/16 | Link-local (APIPA) | A device gives itself this address when it cannot find a DHCP server. (RFC 3927) |
| 100.64.0.0/10 | Shared address space | Used by internet providers for carrier-grade NAT. (RFC 6598) |
| 0.0.0.0/8 | This network | 0.0.0.0 means "any address" or "not yet assigned". |
| 192.0.2.0/24, 198.51.100.0/24, 203.0.113.0/24 | Documentation | Safe examples for books and guides. (RFC 5737) |
| 224.0.0.0/4 | Multicast | One sender, many receivers. |
| 255.255.255.255 | Limited broadcast | Everyone on the local network. |
Public addresses
Everything else is a public address. Public addresses are handed out through regional registries and internet providers, and each one is unique on the internet.
Reference: the IANA registry of special-purpose IPv4 addresses, and RFC 1918 and RFC 1122 at the IETF (rfc-editor.org). Please confirm important designs against those originals.
Use this guide for learning and planning. Always confirm important designs against the original standards linked above.