IPv4 Overview
IPv4 Overview
The original version of IP, IPv4 is still very much in-use and alive across the globe. Addresses are 32 bits long, with groups of eight bits (octets) shown divided by a period. IPv4 address include "192.168.1.1", "8.8.8.8", "127.0.0.1", and many more. The total range of IPv4 addresses is shown below:
0.0.0.0 - 255.255.255.255
All IPv4 addresses in the world are somewhere within that range. Each subnet is a "slice" of the much larger address space.
- Public Addresses
- Private Addresses
- Loopback Addresses
- APIPA Addresses
- Multicast Addresses
- Broadcast Addresses
- Classful Addresses
Public Addresses
Most IPv4 addresses are publicly-routable, typical addresses. They can be used on devices like routers to send data across public networks like the internet. Putting a public address on an internet-facing resource like a web or mail server makes it available to users in other networks. Examples of public addresses include "18.121.35.7", "8.8.8.8", and "198.23.171.36".
Most ISP subscribers have a single public address assigned on their router, and private addresses are used internally for LAN devices like printers and desktops.
Private Addresses
Special address blocks inside the full range have been set aside for internal use by RFC-1918. These blocks include the following:
Network Prefix | Address Range | Total Addresses |
---|---|---|
10/8 | 10.0.0.0 - 10.255.255.255 | 16,777,216 |
172.16/12 | 172.16.0.0 - 172.31.255.255 | 1,048,576 |
192.168/16 | 192.168.0.0 - 192.168.255.255 | 65,536 |
These addresses can be used in private networks like homes or businesses, and they don't have to be registered. Unfortunately, these private blocks aren't routable on the internet, so a mechanism like NAT must be used to translate connections from private to public addresses.
The use of private addresses slowed the exhaustion of IPv4 addresses, but it's reached the point where IPv6 adoption is becoming a requirement.
Loopback Addresses
The 127.0.0.0/8 network is reserved for local or "Loopback" interfaces. Typically 127.0.0.1 is assigned to the first network interface. Other 127.0.0.0/8 addresses can be assigned to other loopback addresses as needed. The 127.0.0.0/8 address block is routable, but most ISPs blackhole this range at the edge of their network.
APIPA Addresses
RFC-3927 defined the Automatic Private IP Addressing (APIPA) block for use as Link-Local addresses. The 169.254.0.0/16 network is reserved for APIPA. DHCP clients that cannot get an address lease will automatically assign themselves an APIPA address. While using the APIPA address block for internal networking is possible, it is not recommended. Some organizations monitor networks for the presence of 169.254.X.X traffic, which means hosts are failing to auto-configure (DHCP, PXE-Boot, etc.)
Multicast Addresses
Multicast addresses are set aside for special multicast (one-to-many) traffic. Some of these addresses include the following:
Multicast Address | Usage |
---|---|
224.0.0.1 | All Hosts |
224.0.0.2 | All Routers |
224.0.0.5 | All OSPF Routers |
224.0.0.6 | OSPF DRs |
224.0.0.9 | RIPv2 Routers |
224.0.0.10 | EIGRP Routers |
224.0.0.13 | PIMv2 |
224.0.0.18 | VRRP Devices |
224.0.0.19-21 | IS-IS Routers |
224.0.1.1 | Multicast NTP |
Broadcast Address
The 255.255.255.255 address is set aside for broadcast traffic on the local network. Anything sent to this address is received by all hosts, but not routed from one network to another.
Classful Addresses
Early in the history of IPv4, address blocks were broken up into classes with different, static sizes. When IP addresses were assigned to organizations, they were in one class or another depending on how many hosts their network had. Routers and routing protocols only worked with addresses in these monolithic classes. The following classes were defined historically:
Class | Address Range | Block Size (host bits) | Addresses | Usage |
---|---|---|---|---|
Class A | 0.0.0.0 - 127.255.255.255 | 24 | 16,777,216 | Large networks |
Class B | 128.0.0.0 - 191.255.255.255 | 16 | 65,536 | Medium networks |
Class C | 192.0.0.0 - 223.255.255.255 | 8 | 256 | Small networks |
Class D | 224.0.0.0 - 239.255.255.255 | -- | -- | Multicast |
Class E | 240.0.0.0 - 255.255.255.255 | -- | -- | Reserved |
As IPv4 addresses were rapidly consumed with more companies and individuals coming online, large classful blocks could no longer be assigned. Classless assignment of IPv4 addresses is now standard across the globe, with subscribers only getting as many public IP addresses as they can provide justification for.