Internet Protocol version 4 (IPv4) is the cornerstone upon which the internet lies. Sounds very lofty, but it actually is the truth – without IPv4 the internet would have been impossible. So what is IPv4, how does it work, why is it so important… and why are we moving away from it, then? Read this article for all the answers!
To discuss IPv4 is to essentially discuss the Internet Protocol in general, as this is (quite counterintuitively) the first widely applicable version of the protocol and remains dominant on the market even as IPv6 keeps rolling out.
So let’s start with a definition of the Internet Protocol first. It is a network layer (OSI-ISO layer 3) protocol in the Internet Protocol suite (also known as TCP/IP) used for forwarding packet streams and datagrams across networks. To put it very simply: it provides everyone with a unified way of addressing (by assigning IP addresses to devices) which allows users in different networks to communicate. And communication between different networks is, after all, the underlying principle of the internet (hence the name: inter means “between” and net is short for “network”).
In the TCP/IP model, there are 4 layers that in one way or another correspond to the OSI model layers. These are link, internet, transport, and application layers (1 through 4, respectively). When data is sent from one device to another, it is encapsulated in different protocols from top down, i.e. in the application layer (roughly corresponding to OSI-ISO layer 7 , 6, and 5) it can be wrapped in HTTP protocol, then in transport (OSI-ISO layer 4) – in TCP, in internet layer (OSI-ISO layer 3) – in IP, and then transported over the Ethernet in the link layer (corresponding to OSI-ISO layers 1 and 2). When the data is received, the process is reversed, and the message gets “unwrapped.”
What interests us here, is the internet layer, where the data packet receives an IP header that contains an IP address. This allows the packet to be routed outside the network and arrive at its destination through a series of hops between different routers.
The distinguishing feature of any device is its MAC address, yet this is not how devices communicate between networks. For that, they are assigned an IP address that tells the router where the data packet should be sent. You can think of it like a postal service: your letter doesn’t go straight to its addressee; it is first sent from one postal hub to another to optimize the delivery process. Similarly, data packets are forwarded from one router to another until they reach the right IP address.
The Internet Protocol, and specifically the Internet Protocol version 4, defines how the addressing works and how network hosts can be identified and found on the network. IPv4 addresses are represented by 32-bit values organized into four octets (4x8), usually expressed by dotted decimal numbers that look like this: 22.214.171.124.
It is relatively easy to translate a decimal IPv4 address to its binary form and vice versa. Any octet consists of eight bits, to which a particular number is assigned, from left to right: 128, 64, 32, 16, 8, 4, 2, 1. The trick is to add these numbers – starting from the highest possible ones – to arrive at the decimal value. One means the number is there, zero – that it isn’t. So for “172” this would be 128 + 32 + 8 + 4 = 172, which in binary translates to “10101100.” As you can count quickly, the possible range for decimal values is 0 to 255.
Anatomy of IPv4 address
An IPv4 address actually consists of two parts: one that identifies your network, and the other that identifies the host (i.e. the device) within the network. These parts aren’t equal or fixed, so to determine the length of the network part, the address also has a “network mask.” In CIDR notation, this is a number after a slash that determines how many bits of the address make up the network prefix. For example, 192.168.0.1/24 indicates that an IPv4 address 192.168.0.1 has a 24-bit long prefix and that the network it belongs to contains addresses ranging from 192.168.0.0 to 192.168.0.255 (i.e. all having a common value of the first 24 bits). Thanks to routing protocols such as RIP, OSPF, and BGP, routers can inform each other about the network addresses that are assigned to them or that they “know of” from other routers, so that the data packets can be forwarded to the right network and therefore also the right device.
When checking the IPv4 address of your own device, you may find out that it is not always the same. This is because the DHCP server will assign an IP address to your device dynamically, i.e., lease it for a specific amount of time. If your device doesn’t request a DHCP lease renewal in time, then the IPv4 address will be released and assigned to a different device. This mechanism has been implemented to conserve the very limited pool of IPv4 addresses available.
As a consequence of its architecture, the Internet Protocol version 4 is capable of providing 232 or over 4 billion IP addresses (4 294 967 296, to be precise). If all of them were static we would only be able to provide roughly half our population with an IP-equipped device. Thanks to dynamic assignment, we’ve been able to manage with only IPv4 until just last decade and have been actively using it alongside IPv6 since it was first introduced. But don’t be fooled – IPv6 adoption is inevitable, and you will see more of that protocol as the years go by.
Yes, we certainly do! You can read more on the problems of IPv6 adoption in our article devoted to that particular protocol, but for now, suffice it to say that we are far from switching from Internet Protocol version 4 to version 6 entirely as it is a lengthy and resource-intensive process. In the upcoming years, network managers will have to deal with both protocols, so don’t forget about IPv4 yet!