Internet Protocol version 4 (IPv4) is the first version of the Internet Protocol (IP) as a standalone specification. It is one of the core protocols of standards-based internetworking methods in the Internet and other packet-switched networks. IPv4 was the first version deployed for production on SATNET in 1982 and on the ARPANET in January 1983. It is still used to carry most Internet traffic today, even with the ongoing deployment of Internet Protocol version 6 (IPv6), its successor.
IPv4 uses a 32-bit address space which provides 4,294,967,296 (232) unique addresses, but large blocks are reserved for special networking purposes. This quantity of unique addresses is not large enough to meet the needs of the global Internet, which has caused a significant issue known as IPv4 address exhaustion during the ongoing transition to IPv6.
Purpose The Internet Protocol ("IP") is the protocol that defines and enables internetworking at the internet layer of the Internet Protocol Suite. It gives the Internet a global-scale logical addressing system which allows the routing of IP data packets from a source host to the next router that is one hop closer to the intended destination host on another network.
IPv4 is a connectionless protocol and operates on a best-effort delivery model, in that it does not guarantee delivery, nor does it assure proper sequencing or avoidance of duplicate delivery. These aspects may be addressed by upper layer transport protocols, such as the Transmission Control Protocol (TCP) or the QUIC protocol.
History Earlier versions of TCP/IP were a combined specification through TCP/IPv3. With IPv4, the Internet Protocol became a separate specification.
Internet Protocol version 4 is described in IETF publication RFC 791 (September 1981), replacing an earlier definition of January 1980 (RFC 760). In March 1982, the US Department of Defense decided on the Internet Protocol Suite (TCP/IP) as the standard for all military computer networking.
Address space exhaustion
In the late 1980s, it became apparent that the pool of available IPv4 addresses was depleting at a rate that was not initially anticipated in the original design of the network. The main market forces that accelerated address depletion beginning in the 1990s included the rapidly growing number of Internet users, who increasingly used mobile computing devices, such as laptop computers, and personal digital assistants (PDAs), and smart phones with IP data services. In addition, high-speed Internet access was based on always-on devices. The threat of exhaustion motivated the introduction of a number of remedial technologies, such as: Classless Inter-Domain Routing (CIDR), for smaller ISP allocations Unnumbered interfaces removed the need for addresses on transit links. Network address translation (NAT) removed the need for the end-to-end principle. By the mid-1990s, NAT was used pervasively in network access provider systems, along with strict usage-based allocation policies at the regional and local Internet registries.
The primary address pool of the Internet, maintained by IANA, was exhausted on 3 February 2011, when the last five blocks were allocated to the five RIRs. APNIC was the first RIR to exhaust its regional pool on 15 April 2011, except for a small amount of address space reserved for the transition technologies to IPv6, which is to be allocated under a restricted policy.
The long-term solution to address exhaustion was the 1998 specification of a new version of the Internet Protocol, IPv6. It provides a vastly increased address space, but also allows improved route aggregation across the Internet, and offers large subnetwork allocations of a minimum of 264 host addresses to end users. However, IPv4 is not directly interoperable with IPv6, so IPv4-only hosts cannot directly communicate with IPv6-only hosts. With the phase-out of the 6bone experimental network starting in 2004, permanent formal deployment of IPv6 commenced in 2006. Completion of IPv6 deployment is expected to take considerable time, so that intermediate transition technologies are necessary to permit hosts to participate in the Internet using both versions of the protocol.
Addressing
IPv4 uses 32-bit addresses which limits the address space to (232) addresses.
IPv4 reserves special address blocks for private networks (224 + 220 + 216 ≈ 18 million addresses) and multicast addresses (228 ≈ 268 million addresses).
Address representations IPv4 addresses may be represented in any notation expressing a 32-bit integer value. They are most often written in dot-decimal notation, which consists of four octets of the address expressed individually in decimal numbers (without any extra leading zeros) and separated by periods.
For example, the quad-dotted IP address in the illustration () represents the 32-bit decimal number 2886794753, which in hexadecimal format is 0xAC10FE01.
CIDR notation combines the address with its routing prefix in a compact format, in which the address is followed by a slash character (/) and the count of leading consecutive 1 bits in the routing prefix (subnet mask).
Other address representations were in common use when classful networking was practiced. For example, the loopback address was commonly written as , given that it belongs to a class-A network with eight bits for the network mask and 24 bits for the host number. When fewer than four numbers were specified in the address in dotted notation, the last value was treated as an integer of as many bytes as are required to fill out the address to four octets. Thus, the address is equivalent to .
Allocation In the original design of IPv4, an IP address was divided into two parts: the network identifier was the most significant octet of the address, and the host identifier was the rest of the address. The latter was also called the rest field. This structure permitted a maximum of 256 network identifiers, which was quickly found to be inadequate.
To overcome this limit, the most-significant address octet was redefined in 1981 to create network classes, in a system which later became known as classful networking. The revised system defined five classes. Classes A, B, and C had different bit lengths for network identification. The rest of the address was used as previously to identify a host within a network. Because of the different sizes of fields in different classes, each network class had a different capacity for addressing hosts. In addition to the three classes for addressing hosts, Class D was defined for multicast addressing, and Class E was reserved for future applications.
Dividing existing classful networks into subnets began in 1985 with the publication of . This division was made more flexible with the introduction of variable-length subnet masks (VLSM) in in 1987. In 1993, based on this work, introduced Classless Inter-Domain Routing (CIDR), which expressed the number of bits (from the most significant) as, for instance, , and the class-based scheme was dubbed classful, by contrast. CIDR was designed to permit repartitioning of any address space so that smaller or larger blocks of addresses could be allocated to users. The hierarchical structure created by CIDR is managed by the Internet Assigned Numbers Authority (IANA) and the regional Internet registries (RIRs). Each RIR maintains a publicly searchable WHOIS database that provides information about IP address assignments.
Special-use addresses The Internet Engineering Task Force (IETF) and IANA have restricted from general use various reserved IP addresses for special purposes. Notably these addresses are used for multicast traffic and to provide addressing space for unrestricted uses on private networks.
+Special address blocksAddress block (CIDR)Address rangeNumber of addressesScopeDescription–SoftwareCurrent (local, "this") network–Private networkUsed for local communications within a private network–Private networkShared address space for communications between a service provider and its subscribers when using a carrier-grade NAT–HostUsed for loopback addresses to the localhost–SubnetUsed for link-local addresses between two hosts on a single link when no IP address is otherwise specified, such as would have normally been retrieved from a DHCP server–Private networkUsed for local communications within a private network–Private networkIETF Protocol Assignments, sub-assignments are made for specific use cases, such as IPv6 transition–DocumentationAssigned as TEST-NET-1, documentation and examples–InternetReserved. Formerly used for IPv6 to IPv4 relay (included IPv6 address block ).–Private networkUsed for local communications within a private network–Private networkUsed for benchmark testing of inter-network communications between two separate subnets–DocumentationAssigned as TEST-NET-2, documentation and examples–DocumentationAssigned as TEST-NET-3, documentation and examples–InternetIn use for multicast (former Class D network)–DocumentationAssigned as MCAST-TEST-NET, documentation and examples (This is part of the above multicast space.)–InternetReserved for future use (former Class E network)SubnetReserved for the "limited broadcast" destination address
Private networks Of the approximately four billion addresses defined in IPv4, about 18 million addresses from three ranges are reserved for use in private networks as outlined by RFC 1918. Packets with addresses in these ranges are not routable in the public Internet; they are ignored by all public routers. Therefore, private hosts cannot directly communicate with public networks, but require network address translation at a routing gateway for this purpose.
+Reserved private IPv4 network rangesNameCIDR blockAddress rangeNumber ofaddressesClassful description24-bit block – Single Class A20-bit block – Contiguous range of 16 Class B blocks16-bit block – Contiguous range of 256 Class C blocks
Since two private networks, e.g., two branch offices, cannot directly interoperate via the public Internet, the two networks must be bridged across the Internet via a virtual private network (VPN) or an IP tunnel, which encapsulates packets, including their headers containing the private addresses, in a protocol layer during transmission across the public network. Additionally, encapsulated packets may be encrypted for transmission across public networks to secure the data.
Special-purpose addresses
IANA has reserved the address block for special assignments. The following assignments from this block currently exist: — IPv4 Service Continuity Prefix, used for IPv6 transition mechanisms such as DS-Lite and 464XLAT — IPv4 dummy address, used as a synthetic IPv4 source address in the 4rd transition mechanism — Port Control Protocol Anycast — Traversal Using Relays around NAT Anycast (Draft) — Use IPv6 Neighbor Discovery as the Default Gateway , — NAT64/DNS64 Discovery. Allows a client to discover the presence of DNS64 by querying its recursive DNS resolver for the domain ipv4only.arpa
Furthermore, IANA has reserved the following two IPv6 prefixes for AS112 nameserver operations: — Blackhole servers with the traditional authoritative zones configured — Blackhole servers for the new blackholing approach involving DNAME records to empty.as112.arpa
Link-local addressing RFC 3927 defines the special address block for link-local addressing. These addresses are only valid on the link (such as a local network segment or point-to-point connection) directly connected to a host that uses them. These addresses are not routable. Like private addresses, these addresses cannot be the source or destination of packets traversing the Internet. These addresses are primarily used for address autoconfiguration (Zeroconf) when a host cannot obtain an IP address from a DHCP server or other internal configuration methods.