Basic Networking: IP Addresses and Subnets

This tutorial covers basic networking concepts regarding IPv4 addresses and their associated subnet masks and is not meant to be a guide to configuring more advanced network subnetting. By the end of this tutorial, you should have a foundational knowledge of the different reserved IP address ranges, their associated subnet masks, and the limitations to having multiple subnets.

Basic Networking Terms

Let’s begin with a few important basic networking terms.

  • IP Address – IP addresses are values assigned to systems/devices allowing them to be identified on a network. You might see someone reference a public IP or a private IP. Public IP addresses identify your entire network on the internet. Private IP addresses are used to identify the systems/devices in your private network.
  • IPv4 – IPv4 refers to the traditional IP address system that consists of four sets of digits, called octets, separated by periods. Example: 192.168.1.100.
  • IPv6 – IPv6 refers to the new IP address system created to address the shortage of available IPv4 addresses. IPv6 addresses consist of 8 sets of 4 digit hexadecimal numbers separated by semicolons. It’s not uncommon for leading zeroes to be omitted from IPv6 addresses. Examples: 00f2:003c:0093:0033:006a:0085 is the same as f2:3c:93:33:6a:85. While not discussed further in this tutorial, I’m mentioning it here so you at least are aware that IPv6 exists.
  • Loopback Address – These addresses are reserved in the IP address system for a system/device to refer to itself. The most commonly used is 127.0.0.1. Again, while not discussed further in this tutorial, I’m mentioning it here so you at least are aware of its existence.
  • Subnet – Subnet is short for subnetwork, or a network inside a network, allowing for additional network security and efficiency. It’s possible for a network to contain multiple subnets that segment the traffic on the network. For example, a computer in the 192.168.1.X/24 subnet can’t communicate with a computer in the 192.168.2.X/24 subnet. This sort of configuration is more advanced and outside the scope of this tutorial.
  • Subnet Mask – A subnet mask is used to configure the subnet restrictions for your networked system/device. Subnet masks look similar to IP addresses, though the values in the default masks used in this tutorial consist of only the values 255 and 0. For example: 255.255.255.0.
  • CIDR Notation – CIDR stands for Classless Inter-Domain Routing. CIDR notation is an alternative method of segmenting networks. CIDR notation and subnet masks are interchangeable. When using CIDR notation to define a subnet, it is denoted using a slash and number after an IP address. For example: 192.168.1.100/24.
  • DHCP – DHCP stands for Dynamic Host Configuration Protocol – this is the service on your network that hands out automatic IP addresses to connected devices. Typically in home networks your router performs this function. DHCP assigned addresses aren’t guaranteed to always stay the same on any particular device.
  • Static IP – Static IP addresses are assigned to a specific device ensuring that the IP address doesn’t change. This kind of IP assignment is generally required for use with servers.
  • Gateway Address – A gateway address is typically the local IP address of your network router. For example, your typical home network’s gateway address is 192.168.1.1. While this topic won’t be discussed further in this tutorial – it’s important to know your network’s gateway address for configuring custom network settings on a system.

IPv4 Network Classes

The odds are your existing home network uses IP addresses like this – 192.168.1.XXX.

There’s no mystery to why I know this – these are the default addresses handed out by consumer routers like you buy on Amazon (affiliate) or get from your ISP. This IP address scheme is part of the reserved IP range for class C networks. If you’re thinking that this implies the existence of class A and class B networks, you’d be right. So what are the network classes?

In total, there are 5 different IPv4 network classes – A through E. We don’t use classes D or E, though, as they’re reserved.

Each network class – A through C – has a reserved IP address space that your private network can use. The primary difference between them is the number of reserved IP addresses each has available for you.

Here’s a simple table to make it easier to understand the available IPs and their associated network masks. We’ll discuss what all of this actually means in a moment.

CLASSSTARTING IPENDING IPSUBNETCIDRNUM IPS
A10.0.0.010.255.255.255255.0.0.0/816,777,216
B172.16.0.0172.31.255.255255.255.0.0/1665,536
C192.168.0.0192.168.255.255255.255.255.0/24254

This table is handy to refer to until you eventually commit it to memory – which I promise you will happen with enough time. If, for example, you’re configuring a static IP address on a server in your home network – you’ll not only need to specify the IP address in the networking settings but also the subnet mask or CIDR notation for your home network. Depending on which Linux distribution your server is using will determine which notation you’ll need – for example Debian’s network configuration typically uses subnet masks while Ubuntu’s network configuration uses CIDR notation.

Please note that only some of the possible 172 and 192 IP addresses are reserved for private use while the entire range of 10.XXX.XXX.XXX IP addresses are available. Addresses with 172 and 192 not included in the reserved range are addresses used on the public internet. Examples of 172 and 192 public IPs would include 172.20.XX.XX or 192.10.XX.XX.

Also note, while it’s technically possible to use an IP like 192.168.0.0 on your network, it’s advisable to not use the 0 address in the final octet as this is often used by systems to refer to that entire range of IPs in a subnet and can cause issues.

While IPv4 addresses in their entirety are thought of as identifying a device on a network, you can also think of IP addresses as being of two separate IDs – a network ID and a device ID. What exactly do I mean by this?

Let’s consider the class C address of 192.168.10.100. With class C networks, the first three octets of the IP identify which subnet – or sub network – the device belongs to – 192.168.10. Think of this as your network ID. The last octet then can be though of as the device ID – in this instance it would be device 100.

For a class B addresses, say 172.16.10.100, the first two octets of the IP identify the subnet or network ID – 172.16 – leaving the last two octets to identify the device on the subnet – 10.100.

As you might guess, for a class A address of 10.1.10.100, the first octet identifies the subnet – 10 – and the remaining three octets identify the device on the subnet – 1.10.100.

Up until now for the vast majority of home networks a class C network has had plenty of IP addresses. With the increasing popularity of home automation, IP cameras, and other network connected devices we’ll start to see home networks outgrowing their IP address space. What do you do in that instance?

When The Defaults Just Aren’t Good Enough

There are two possible solutions to the problem I’ve presented – an easier solution and a more difficult solution. If you guessed that we’re going to stick with the easier solution because this tutorial is only meant to cover basic networking – you’d be right! In this situation where we’ve run out of class C IP addresses, we’re going to use a class A or B network configuration.

The more difficult solution involves using either advanced subnetting and configuring advanced routing rules – which, generally speaking, requires more expensive network equipment capable of supporting this configuration. This is beyond the scope of this tutorial, though, I’ll briefly mention this topic again without getting too technical about it.

If you remember from the table from earlier in this tutorial, class C networks support a maximum of 254 IP addresses per subnet. Choosing to use class B network addresses dramatically increases that number to over 65 thousand IPs per subnet, while class A addresses expand that number to astronomical levels with over 16 million available IPs per subnet.

All it takes to open up your network to expanded range of addresses is to change the IP settings in all of your connected devices – including and especially your network router. If your router also functions as your network’s DHCP server, make sure that if you’re updating the settings on your router to use a new IP address that you also give it an appropriate range of IP addresses on your subnet to use for DHCP addresses.

Another benefit gained from switching to a class A or B network is flexibility in how you assign your IP addresses – allowing your network a certain amount of organization. To demonstrate this, one possible example for the class B range might be:

  • 172.16.1.XXX – Network Hardware (Routers / Switches)
  • 172.16.2.XXX – Servers
  • 172.16.3.XXX – Misc devices such as Chromecasts or network printers
  • 172.16.4.XXX – Desktop computers
  • 172.16.5.XXX – Wifi devices such as phones & laptops

You don’t have to do things this way … you can come up with whatever IP scheme you choose. The point is that class A & B networks give you more flexibility within the default subnet that you don’t have with class C.

It’s important to understand, though, for the example above you wouldn’t be able to use devices in the 172.17.XXX.XXX range and have them talk to your 172.16.XXX.XXX devices – even if they’re on the same physical network as each other. When it comes to basic networking – pick one subnet and stick to it.

Subnets Limit Communication

Going back to the example from the last section with the 172.16 and 172.17 subnets – why would anyone segment networks into multiple subnets if they can’t communicate with each other?

The simplest answer is that this is often done for network security reasons.

Remember the more advanced networks that I mentioned earlier that were beyond the scope of this tutorial? We’re starting to get into that territory now. To understand why you’d do this, though, doesn’t require understanding how it’s done.

Say you’re a business that manufactures thingamabobs. Your company has factory equipment, office equipment, servers and WiFi infrastructure. Do your office computers need to be able to communicate with your factory equipment? What about people’s cell phones that they bring from home and connect to your company WiFi? Should they necessarily have access to your servers?

The answer to both of those questions is likely NO. Someone opening a malicious email attachment in their office or bringing a phone with a malware infected app into work shouldn’t put your entire network at risk. It’s these kinds of situations that make sense as to why you’d segment a network.

Conclusion

It’s my hope that this tutorial has given you a good understanding of basic networking – the different IP address ranges available for your network, what their associated subnet masks / CIDR notation values are, and what the limitations are to communicating between multiple subnets.

If you have questions on any of the material here, please ask in the comment section below. I’m always willing to help explain something better if needed. Me answering your question might help others with the same question – possibly even prompting a tutorial update.

Lastly, If you found this tutorial helpful and would like to support our efforts to create additional resources like this, please consider making a donation. Your support is greatly appreciated. Thanks for reading and I hope you visit again soon!

2 thoughts on “Basic Networking: IP Addresses and Subnets”

Leave a Comment

Your email address will not be published. Required fields are marked *

I accept the Privacy Policy


Scroll to Top