Public and Private Addresses
IP addresses are broken up into public and private addresses. Public addresses are routable on the internet. Each public IP address on the internet can be used once. To ensure this occurs, the IP addresses are managed by Regional Internet Registries. There are five of these registries which provide ranges of IP addresses to ISPs. These IP addresses are allocated to users by an ISP.
Private IP addresses are not publicly routable. They are allocated by a network admin rather than centrally managed. They are limited to the private network they are allocated to. Thus, different private networks can use the same private IP addresses. Since private IP addresses are not routable on the internet, if a private IP address is forwarded to the public internet, the public internet router will drop the packet. Before I can start looking at public and private IP addresses, I need to first look at another topic.
Address Classes (Classful Networking)
Address classes are an obsolete networking address scheme that was used in the very early days of the internet. You may hear it referred to as classful networking. In 1993, Classless Inter-Domain Routing or CIDR replaced the need to use classful addresses. However, remnants of the classful concept still remain today. So, I would have a basic understanding of it; however, don’t spend too long trying to remember it. In a moment, I will have a closer look at when you will come across it.
There are five different types of classes. The classes are defined by the number of leading bits at the start of the address. Thus, when you look at the first number in the IP address, this will tell you which class it is in. For example, any address starting with anything under 128 will be a class A address.
In the very, very early days of the internet, variable subnet masks did not exist. Instead, a default mask was used. For example, if you were given a class A address, you got a subnet mask of 255 dot zero dot zero dot zero. This means that there were over 16 million addresses for each class A network. Having subnet masks that could not be changed meant a lot of wasted IP addresses.
In 1993, C I D R was released to address these issues. C I D R allowed a variable subnet mask to be applied to the IP address. This allowed large networks to be broken down into smaller networks. Nowadays, to get on the internet, you just need to know the IP address and the subnet mask. You don’t need to know the class or even know that it exists. Let’s have a look at when you could come across classful networking today.
In The Real World
In the real world, you may see address classes used in certain tools, for example, this subnetting tool. You can see this subnet tool has the option to select the class; however, you can just leave it on any rather than setting the class. There is no need nowadays to set the class. The output may also include class information, but personally, I would not worry too much about it; just have a look at the subnet masks.
This is because CIDR allows default class masks to be overwritten. For example, if I have the following IP address, the default subnet mask is /24. Using CIDR means that the subnet mask can be moved in any direction. Thus, the following two IP subnet masks are valid with this address.
Thus, you may see class addresses used from time to time; just know that it is referring to the default subnet mask that is applied to that address. You may sometimes see it referred to in some documentation or output from certain tools. It is not something we need to be concerned about because we can change it to anything we require.
Let’s now have a look at private addresses, which is another time you may see classful addresses mentioned.
Private Addresses
There are three different private IP address ranges defined: one for class A, class B, and class C. These can be used for private LANs and are not routable on the internet. You are free to subnet these addresses if you wish.
The class address you tend to see used a lot for home networks is the class C address. This address range allows you to have 256 networks with 254 devices on each network. This is more than enough for a home user or a small business.
The class A is the largest range and is targeted for enterprise networks. It is not uncommon for a company with businesses all over the world to use these private IP addresses. The class B range is designed for mid-size networks. You don’t see this one used that much because administrators will generally use class A or class C addresses.
Although a class A network could support over 16 million devices on one network, having a network that supports more addresses than you will ever likely need is not a bad thing. It is better than using a smaller network and running out of addresses. Also, having a larger address range gives you more options on how you can divide your network into smaller networks. For example, you could use subnet masks that work on 8-bit boundaries rather than working with non-8-bit aligned subnet masks, which are harder to work with. You can see why many administrators won’t use the class B private address ranges, but they are there if you need them.
Since private IP addresses can’t be routed on the internet, let’s have a look at how we combine the two.
Network Address Translation (NAT)
To have a connection between private and public IP addresses, there needs to be a mapping of the addresses between the two networks. One of the more common ways of doing this is using Network Address Translation or NAT.
Essentially, what occurs is your private networks are connected to a router. This router is connected by a single IP address to the internet. The router keeps a record of which connection goes to which private IP address, thus effectively providing a bridge between your private network and the public network.
This also means that large private networks can share a single IP address, which helps reduce the number of public IP addresses needed on the internet. Your network may be different. For example, you may use a firewall to perform the NAT function or have more than one public IP address being used. In some cases, your network may have a proxy server that performs this role. This is common with web traffic. The proxy server will contact the internet for the device on the private network and transfer data to and from the web server on the public network. It performs the same role; it acts as a bridge between the private network and the public network.
There are a few special IP addresses that I will look at. I won’t look at them all, just two of the common ones.
Loopback Address (127.0.0.0/8)
The loopback address, as the name suggests, sends data back to the host. It is pretty common for the administrator to use 127 dot 0 dot 0 dot 1; however, any valid IP address starting with 127 will work. The loopback address is used to test the network device driver and network stack. It does not test the cabling. Thus, in most cases, if you unplug the network cable, the loopback address will still work.
To get networking to work, there are a number of layers that work together. This includes device drivers, protocols, and services. This is sometimes referred to as the network stack.
The most common way to use the loopback connection is to ping 127 dot 0 dot 0 dot 1. When you do this, you should get a response back. You will notice that I can also ping other addresses starting with 127 as long as the address is valid.
There are different ways of troubleshooting network problems. When looking for a problem on the network, some administrators like to start at the source and work their way out. Others like to start at the destination and work their way back to find the problem. There is no right or wrong answer; it is just personal preference. Pinging the loopback address tests that the basic components like the network adapter and configuration are working. This does not mean they are correct for that network, just that they are working. If your loopback address is not working, there is something wrong with the device drivers or configuration of the device you are using.
Let’s look at the next special IP address.
Multicast Addresses
Multicast addresses are when a single packet goes to many different nodes on the network. These IP addresses are from a particular range. Multicast requires the network to support it. Often, this will mean having a router configured to route multicast packets to the required location. Thus, you don’t tend to find multicast used that often with IPv4.
End Screen
That concludes this video on the different IPv4 address types. I hope that you have found this video useful, and I look forward to seeing you in the next video. Until next time, thanks for watching.
References
“The Official CompTIA A+ Core Study Guide (Exam 220-1101)” pages 174 to 175
“Picture: Multicast” https://en.wikipedia.org/wiki/Multicast#/media/File:Multicast.svg
Credits
Trainer: Austin Mason http://ITFreeTraining.com
Voice Talent: HP Lewis http://hplewis.com
Quality Assurance: Brett Batson http://www.pbb-proofreading.uk