Use Sophia to knock out your gen-ed requirements quickly and affordably. Learn more
×

IPv4 Addressing

Author: Jacob Sorem

IPv4 Basics

This is a basic overview of IPv4 Addressing

IPv4 Classes and Private IP Addressing

A quick look at the classes of IPv4 addresses and the limitations of each class. Understanding this helps us to understand why we subnet.

Note: I use Network ID in the video at a time when I should have called it the Network Address. Technically Network ID is the information related to the network portion of the address, and Host ID the host. The Network Address is the first possible IP address in a network or subnet (sometimes referred to as the Subnet ID). Here's an example:

192.168.1.15
255.255.255.0

Network ID: 192.168.1
Host ID: 15
Network Address: 192.168.1.0

Sorry for any confusion.

Supplement to IP Addressing

In the above video, the classes for private IP addressing are mentioned.  These three, plus two more, can help define a nice set of information one might see on the Network+ Certification.  Here are the details of the five IPv4 addresses (in bold) I recommend memorizing and why they are helpful.

  • 10.     ___.___.___  Class A private
  • 255.0.0.0 Starting Subnet Mask, /8 starting CIDR
  • 1 possible network (before subnetting)  16 million possible hosts (nodes) in the one network (before subnetting)
    • 126.___.___.___  End of the Class A range
  • 127.0.0.1  Loopback (the home machine)
    • 128.___.___.___  Start of the Class B range
  • 169.254.     ___.___  APIPA (Automatic Private IP Addressing, self assigning addresses when no DHCP is available)
  • 172.16-31.     ___.___  Class B private
  • 255.255.0.0 Starting Subnet Mask, /16 starting CIDR
  • 16 possible networks (before subnetting)  65k possible hosts (nodes) in each network (before subnetting)
    • 191.___.___.___ End of Class B, 192.___.___.___ beginning of Class C
  • 192.168.0-255.     ___  Class C private
  • 255.255.255.0 Starting Subnet Mask, /24 starting CIDR
  • 256 possible networks (before subnetting)  254 possible hosts (nodes) in each network (before subnetting)

Here's a handy table, in case you just want the 5 IP addresses and what they are.

IP address Description
10.___.___.___ /8 Class A Private
127.0.0.1 Loopback
169.254.___.___ APIPA
172.16-31.___.___ /16 Class B Private
192.168.0-255.___ /24 Class C Private

With this information, it should be possible to answer most, if not all, IPv4 addressing related questions.

IP Addressing as Logical Network Segmentation

Now that we have an understanding of the different parts of the IP Address and the impact of a Classful system on that structure, we can look at individual addresses and determine important information.  The Subnet Mask is an important indicator of which part is the Network ID.  (The Subnet Mask will become even more important in the next section on subnetting.)

  • Class A: 10.0.0.0, Subnet Mask 255.0.0.0 - The Subnet Mask helps us see that just the first octet is assigned to the Network ID.  This means that with the given Mask, 10.0.0.0 is a different network than 16.0.0.0.  For a computer at 10.3.55.86 to communicate with a computer at 16.45.86.208, a router is required to "route" the packets across multiple networks. (Note that there is just a single Private Class A Address space available)
  • Class B: 172.16.0.0, Subnet Mask 255.255.0.0 - The Subnet Mask helps us see that the first two octets are assigned to the Network ID.  Now, these two networks are different and distinct: 172.18.0.0 and 172.21.0.0.  This, once again, means that computers on one network need a router to reach computers on the other network.  (Note that in the Private Class B Address space, there are 16 different networks, 172.16.0.0 to 172.31.0.0)
  • Class C:  192.168.0.0, Subnet Mask 255.255.255.0 - The Subnet Mask now shows that the first three octets determine the Network ID.  So, 192.168.14.0 and 192.168.201.0 are distinct and separate networks, requiring routing to communicate between them.  (Note that in the Private Class C Address space, there are 256 different networks, 192.168.0.0 to 192.168.255.0)

Subnetting as a concept

Before we get to the math, this is basically what subnetting is doing with a network address space.

Custom Subnetting

Subnetting is basically the concept of splitting a single address space into multiple sub-networks, Subnets!  If the custom Subnet Mask is made up entirely of 255 and 0, things are much cleaner, aligning with Classful addressing.  When a custom number appears in an octet, like 255.255.128.0, then we have an octet that is split, where some of the numbers in the IP Address are in one subnet, and others are in another.  Here is a rule-of-thumb to help with this.  The very first Subnet ID will be the same as the Network Address if no custom subnetting were used.  Every other Subnet ID will be the address immediately following the previous subnet's Broadcast Address.  More on this below.

The Math Behind Subnetting

Now that we understand the concept, it's time to calculate the specifics. Once we do this the hard way, we'll do it the easy way. (Note: the thumbnail image was taken in the middle of making changes. The Class A subnet mask does not match the binary. I hope this clears up any potential confusion.)

Subnetting Scenario

When trying to apply subnetting to a scenario, we need to ask some specific questions.

How we should subnet (Summary)

The video describes a scenario in which we are looking to subnet a single address space.  Regardless of the class, we should be asking these questions as they determine the direction to take in calculating the subnets:

  • Number of Subnets approach: How many networks are we looking to create?  Let's say we have 6 departments for which we want to create subnets.  We need to calculate our custom subnet mask to account for all of these departments.  Note that the number of subnets we can create is always a power of 2.  So, the options would be 4 subnets, which is not enough, and 8, which is too many.  However, to cover all 6 departments, we would need to choose 8.  (Choosing a subnet mask that provides more than 8 networks would satisfy too, but would be a waste of possible host addresses in each subnet.)
  • Number of Hosts approach: Do we have a set number of host addresses that are needed?  Let's say that our largest network has 86 devices.  We want to make sure that we choose a subnet mask that provides addresses to all devices.  A Mask that provides 62 addresses does not provide enough, so we would need to use the next setting that provides 126 addresses.
    • Note that the possible number of hosts available in each subnet is not a full power of 2.  This is because there are always two reserved addresses in each subnet.  The first is the Subnet ID, and the last is the Broadcast Address.

These two approaches should work well in determining the best Subnet Mask to use in any scenario.

Calculating the Subnet We Need

Now that the network specifications are known, we can calculate the subnet mask and CIDR.

How to use the calculator

Here is a collection of steps on using a Subnet Calculator:

  • Which approach?
    • By number of needed networks?  Use the "Maximum Subnets" in the calculator (or similar if using a different calculator)
    • By number of host addresses? Use the "Hosts per Subnets" in the calculator (or similar if using a different calculator)
  • Once this selection is made, the subnet mask is set.  Use this subnet mask for all subnets.  (The exception is when using variable length subnet masking (VLSM), but that is a more advanced concept that can be addressed in other tutorials.)
    • If CIDR notation is desired, use the "Mask Bits" field.  This is the total number of bits assigned to the Network ID.
  • If the very first possible address is in the "IP Address" field, the specifications in the following fields will be a part of the first subnet:
    • Subnet ID - this field defines the Subnet for many devices.  It is the very first address in the subnet and is reserved, so it cannot be assigned to any devices.
    • Broadcast Address - this is another reserved address, and is the last address in the subnet.
    • Host Address Range - every address between the Subnet ID and Broadcast is available to use for addressing nodes on the network.  This info can help inform DHCP scope configuration.
  • After calculating the first subnet, each subsequent subnet can be calculated using the following steps
    • The Subnet ID of the next subnet will always be the address immediately following the broadcast address from the previous subnet.
    • Use the "IP Address" field to change to an address beyond the broadcast address of the previous subnet.  This will change the Subnet ID, Broadcast Address, and Host Address Range settings for the next subnet.
  • Lather, rinse, and repeat until all needed subnets are calculated!

Final Application of the Subnet Calculator to the Scenario

Besides calculating the specific subnet mask and CIDR numbers, a subnet calculator can help with configuring the specifics of a network. These last three questions might be something you encounter when actually setting up a subnet in the enterprise environment.

How do we find the third subnet?

Here is how to use the above bullet points to find the third subnet in the scenario:

  • Calculated Subnet Mask: 255.255.248.0
  • First Subnet ID: 10.0.0.0, First Broadcast Address: 10.0.7.255
    • Based on the Broadcast Address, the second subnet ID should be the immediately next address: 10.0.8.0
  • Second Subnet ID: 10.0.8.0, Second Broadcast Address: 10.0.15.255
  • Third Subnet ID: 10.0.16.0, Third Broadcast Address: 10.0.23.255