IPv4 is one of the most popular protocols in the world. In this video, you’ll learn about the fundamentals of IPv4 addressing, automatic IP addressing, and the difference between public and private IP addresses.
If you’ve done anything with networking, then you’ve probably run into an IP version 4 address. In this video, let’s look at the different configuration options for IP version 4.
The IP address is the unique identifier that every device on the network must have if it wants to communicate using that IP protocol. An IP address is a series of four numbers separated by a period. This would be something like 192.168.1.165. To be able to properly communicate on the network, every device needs to have its own unique IP address.
The IP address is combined with another value, referred to as the subnet mask. The subnet mask is also a 4-octet value– for example, 255.255.255.0. The subnet mask is used in conjunction with the IP address to determine what IP subnet this particular device is on.
This isn’t something that’s usually transmitted across the network. It’s instead used by your local device to make the determination of what devices are local on this IP subnet and what IP addresses may be outside of this local IP subnet. This becomes especially important when you need to send traffic outside of your local subnet. And you do that through the use of a default gateway. The default gateway is the IP address of a device that’s on your local subnet that allows you to communicate outside of this subnet.
For example, if we have an IP address of 192.168.1.165 and a subnet mask of 255.255.255.0, a common default gateway could be 192.168.1.1. This is an IP address that is configured and assigned to the router on your local subnet by your network administrator. And it must be an IP address that is on your local network.
There are also other IP addresses you should be familiar with. One of these is a loopback address. This is a way to define your local device without having to know a specific IP address. Every device on the network has a loopback address. And it’s a number that is between 127.0.0.1 through 127.255.255.254.
So if you wanted to ping your local device, you could ping 127.0.0.1. And hopefully, your local device would be able to respond to you. This is often used to confirm that your local IP stack is working properly. And it would then be able to communicate to other devices.
We also have a range of IP addresses that we’ve set aside as reserved addresses. This is a range of IP addresses that should never be assigned to other devices. They’re used for future use or for testing in the future. This range of reserved addresses is 240.0.0.1 through 254.255.255.254. Anything that is a class E address is also a reserved address. We’ll talk about classes of addresses in just a moment.
And another address type you might run into is one that is not real. It’s a virtual IP address, or a VIP. Virtual IP addresses are not associated with a physical Ethernet adapter. Instead, VIPs are addresses that you would assign to the internals of a device so that you could always reference that device using that virtual IP address. For example, you might assign a VIP to a virtual machine. Or the VIP may be part of an internal address that you’re associating with a particular router.
The IP protocol and IP version 4 operate at OSI layer three. So any time you’re working with an IP address, you’re working at that network layer of the OSI model. Let’s break apart an IP version 4 address and really see what it’s made of. Let’s take the address 192.168.1.131. We refer to these four values as octets. That’s because they consist of eight individual bits. And you can see the representation of that same IP address broken out into those four groups of 8 bits.
Sometimes you’ll see these 8 bits broken out and described as 1 byte or sometimes 1 octet. So if you were to count up all of these bits, there are 32 total bits in an IP version 4 address. And that is the same as 4 bytes or 4 octets. Since each one of these individual groups inside of IP version 4 consist of 8 bits, the maximum value that you would ever have in decimal for any of these groups would be a maximum of 255.
In the early days of networking, we had to manually configure the IP address, subnet mask, and default gateway, all in a manual way. We had to visit that device, change a configuration file, and then that device would be able to communicate on the network. If anything changed with our network configuration or we needed to change the IP address of that device, we had to revisit the device and manually make those changes.
Today, of course, we can plug in any of our devices. And it automatically receives an IP address. The way that we are able to receive this automated IP addressing is through a protocol known as DHCP, or Dynamic Host Configuration Protocol. When we plug into a wired Ethernet network or a wireless network and we are automatically able to communicate out to the internet, it’s because we’ve received all of our IP configuration settings via DHCP.
But if you’ve ever connected to a network that does not have a DHCP server, you may notice that you’re still assigned an automatic address. But this address is not quite as capable as a DHCP address. Instead, it’s what we call a link-local address because it can only communicate to other devices that are on your local subnet. And we cannot route that traffic outside of your local subnet. For example, if you’re assigned a link-local address, you can’t communicate to the internet, because that’s outside of your local subnet.
In IP version 4, this link-local address is assigned through a process known as Automatic Private IP Addressing, or APIPA. This range of IP addresses automatically assigned through APIPA is 169.254.0.1 through 169.254.255.254. There are also reserved sections of that range. The first and last 256 addresses are reserved, and they’re not assigned to end stations. So if you receive an APIPA address on your device, it’s between 169.254.1.0 through 169.254.254.255.
Just as DHCP works automatically to assign your address, APIPA also has an automated process to assign this address. It uses ARP to confirm that no one else on your local network has that link-local address. And if nothing responds to that Address Resolution Protocol query, then it will assign a random number between that functional block.
One of the challenges with IPv4 is that there are far more devices in the world than there are IP version 4 addresses. And in recent years, we’ve used up all of the available blocks of IP version 4 addresses. There are no other IP version 4 addresses that can be assigned in these blocks. So we need to find other ways to be able to communicate via IP version 4.
One way that we’ve been able to extend the functionality of IP version 4 is to create an assignment of IP address ranges that can only be used on the inside of a network. We refer to these as a private IP address range. And anything that is a private IP address cannot be routed on the public internet.
Fortunately, these are very large ranges. And we’re able to use those ranges on the inside of our corporate networks. If you were to look at the IP address that’s assigned to your device right now, it’s likely that it’s a private IP address. So if your device is currently using a private IP address and you’re watching this video on the internet, how are you able to communicate on the internet with an address that is not able to be routed across the internet?
We’re able to do that through a functionality called network address translation. This allows us to convert a private IP address into a public IP address and use that public IP address to communicate on the public network. We’ll learn more about network address translation as we go through this training course.
If you want to learn more about private IP addresses, you may want to reference a Request For Comment, or RFC. RFC 1918 is the standard that defines these ranges of private IP addresses and how they can be used on our networks. If we were to look into the details of RFC 1918, you would see three different ranges have been set aside for private IP addressing.
These three ranges are 10.0.0.0 through 10.255.255.255. And if you were to count up all of the possible addresses in that range, it would be over 16 million addresses. We often refer to this as a single class A block of addresses. And we often write it as 10.0.0.0/8. If you were to write out the subnet mask of that /8 address, it’s 255.0.0.0. This means the host size of this particular IP address range is 24 bits in length.
Another range is 172.16.0.0 through 172.31.255.255. This gives us a total of just over 1 million addresses that we can assign in 16 contiguous class B address ranges. If we were to write this out in CIDR block notation, it would be 172.16.0.0/12. The decimal subnet mask for a /12 network is 255.240.0.0, which means our host ID size is 20 bits in length.
And the last range is 192.168.0.0 through 192.168.255.255. This allows us to assign over 65,000 addresses as part of 256 contiguous class C address ranges. The CIDR block notation for this would be 192.168.0.0/16. And that /16 subnet mask is the same as 255.255.0.0. Half of this address is assigned for hosts. So your host ID size is 16 bits in length.
As we step through the next series of videos, you’ll learn more about CIDR block notation, the different classes of IP addresses, and other details that you see associated with these private address ranges.