Computer Networking and Internet Protocol Addresses
Table of contents
Introduction
For most people that are not deep in tech and computer networking, internet protocols, short for IP addresses, are just a bunch of hard-to-memorize characters that are used to identify their devices on the internet.
But, it is more than that. IP addresses are more than a bunch of characters; they are more than enablers of internet communications. The communication that goes on within a network begins with these characters.
In this article, I am going to clarify IP addresses—what they are, the work they do, how they arise, and the various types of IP addresses we have. If you are ready, let's hit the gas pedal and commence our learning journey together.
What Really is an IP Address?
An IP address is a unique identifier which every single device communicating with another device over any network must have to be identified.
With all the numerous types of devices (especially devices bearing similar names) flooding different networks today and ultimately the largest of all networks, the internet, it is essential that these devices have a unique ID, different from their name, that can be used to find them wherever they are.
Names aren't enough; everyone knows that. Two or more devices can have the same name. There are possibly hundreds of thousands of iPhone 15s in the market today, the same with every other internet-connecting device. If all these devices are using the internet simultaneously, wouldn't it be confusing if they all had similar names?
For instance, my name is Joseph. Now, imagine going to a public place and shouting “Joseph,” only for 20 people to answer. Wouldn't that be embarrassing and confusing? It is. And this is why IP is essential in avoiding internet traffic clashes.
The Role of IP Addresses
One major role of IP addresses is to ensure that data packets sent from one source successfully get to their destination. For this to happen, the devices must be uniquely identified on the network.
Now, let’s examine how IP addresses work.
How Do IP Addresses Work?
Assigning
IP addresses, regardless of its type, work in a similar pattern.
The organization that manages IP addresses is the Internet Assigned Numbers Authority, (IANA), IANA is charged with the creation of IP addresses. Despite the fact that they are the ones in charge of creating new addresses, they only allocate to another more specific body called the Regional Internet Registry, (RIR).
There are five RIRs, these bodies are the ones that allocate IP addresses to ISPs and organizations depending on the type of address and the geographical location.
There is AfriNIC for Africa, LacNIC for Southern America, APNIC for Pacific Asia and Australia, ARIN for North America, RIPE NCC for EU countries, The Middle East and some parts of central Asia.
These bodies assign IP addresses to ISPs and sometimes to very large corporations. Now, when a device is to access the internet and connects to an Internet Service Provider, the ISP gives that device a temporary public IP address from its pool of allocated IP addresses which it had gotten from a RIR.
When the device is taken off the internet, the IP address is withdrawn by the ISP and returned to the pool where it stays until it is assigned to another device.
Communication
Like I wrote earlier, IP addresses identify devices over a network. So, when you are sending a packet over a network, one of the things the packet leaving your device will contain is your device’s IP address, and the IP address of the device it is sending the packet to. The packet either gets sent to the router or ISP which will find the best possible path the packet is to follow until it gets to its destination.
For instance, if the IP assigned to my device is 192.168.20.3 and I want to access a website titled www.example.com, when I type that URL into my browser, the DNS server will convert that domain into its IP address (for instance, its IP address is 102.65.7.8) because every site is hosted on a web server which also has an IP address, so using the IP address of the website, my ISP will find the best possible path to access it and when I access the IP address, the site will load up on my device.
There is a whole lot of complex stuff that goes on here, but for the sake of this article, I reduced it to just this.
Types of IP Addresses
Versions: IPv4 vs. IPv6
When it comes to the type of IP address, IPV4 and IPV6 are the most popular types of IP known by people. Well, everyone knows them, but what actually are the differences between them?
IPV4 or Internet Protocol Version 4 was the first type of IP addresses used by devices to connect to the network. The total allocation of IPV4 addresses is an estimated 4.3 billion. Originally, when IPV4 was created, it could comfortably accommodate every device that was connected to a network, it was so until IoT became a thing and more and more devices that were previously offline began to come online; automobiles, ATMS, vending machines, CCTVs, refrigerators, TVs, etc.
All these new devices needed to communicate with other end devices and servers, hence, the need to create something more accommodating and still unique, IPV6 became the solution to this depletion.
To solve the issue of IPV4 depletion, IPV6 was made to be 128 bits long, with eight sections, each containing 16 bits. This length makes the possible amount of IPV6 available to be about 36 undecillion unlike IPV4 that is 32 bits long.
Here is how an ipv4 typically looks like: 192.100.2.15. It has a network portion and a host portion. The network portion is used to identify the network the device is on and it is the first three sections of the IP address while the last section identifies the host.
From the image above, the 15 on the right hand side indicates that the device with this IPV4 address is the 15th device to be added on the network.
Key advantages of IPv6 over IPV4
Expanded Address Space: IPv6 ensures sufficient addresses for the foreseeable future.
No NAT Required: Devices can have unique public IP addresses, simplifying communication.
Improved Routing: Simplified routing tables for faster data transfers.
Native Security: IPv6 includes built-in support for IPsec, enhancing security.
IPV6 hasn’t been fully implemented across interconnected devices, so you can still see devices running both IPV4 and IPV6 at the same time. This is possible due to a protocol known as Dual Stacking.
Private vs. Public IP Addresses
Devices in a private network are assigned private IP addresses. These are unique within the private network but are not accessible on the public internet. Instead, the router uses the network's public IP address for internet communication.
So when a device in a private network wants to communicate on the public internet, it is assigned a public IP address by its router or ISP, every single device under that private network will use the same public IP address of the router or that assigned to it by the ISP.
Now, since no two devices can use the same IP address, how come multiple devices under a private network use one single public IP address when communicating on the internet? In simpler language, the Router or ISP knows the private IP and MAC address of every device on its private network that is requesting for a resource on the public internet, the intended destination address of the resource it wants to communicate with as well as their source and destination ports and thus will map all these in its table, so that when each packet is coming back to the private network, it can accurately direct it to the device that requested for it.
Heads up: I may make a separate article for this, just hit my mailing list so you get to know when I do.
Now, you may ask, how do I know which is a private IP address and which is public? Well, it all depends on the network that the IP address belongs to. There are three classes of Private IP address ranges,
Class A: 10.0.0.0 to 10.255.255.255
Class B: 172.16.0.0 to 172.31.255.255
Class C: 192.168.0.0 to 192.168.255.255
Static and Dynamic IP Addresses
Another classification of IP addresses is based on their permanence.
Static IP Addresses
Some devices or hosts are configured manually to have a static IP address. Remember when I wrote about IP addresses being returned to a pool of addresses when the device is taken off the network? Well, in the case of a static IP address, even when the device is taken off the network, its IP address would not be assigned to another device, but stays with it.
Static IP addresses are manually configured on each device by the network administrator or by the user.
Typically, devices that use static IP addressing are devices that are constantly accessed by many other devices on a network and as such, it will become a hurdle if the IP addresses of these devices change constantly. For instance, a printer needs to be configured with a static IP address so that when other devices need to reach it, they can also use its known static IP address all the time.
The image above is an example of how a static IP address is manually configured on a device.
Dynamic IP Address
For most other devices, their IP needs to be dynamically configured. This means that they are assigned an IP address anytime they enter a new network or re-enter an old network.
The automatic assignment of IP addresses is done by a protocol called DHCP. The DHCP or Dynamic Host Configuration Protocol is a rule that gives a device an IP address for the network it is in and this it does by the DHCP server. So, whenever a device wants to communicate on a network, it first gets the DHCP server’s IP address via a broadcast message which it sends using its default gateway.
My computer here is using a dynamic IP address assigned to it by its DHCP server.
Conclusion
Understanding how IP addresses work isn't just for techies, it is necessary that we all understand how this backbone of network communication operates.
With the ongoing growth of IoT and internet-based communication, the relevance of these unique identifiers will only continue to expand.