0% found this document useful (0 votes)
7 views11 pages

Applied IPv4 Subnetting Guide

The document explains the concept of IPv4 subnetting, detailing the purpose of subnet masks, their characteristics, and how to determine network IDs. It emphasizes the importance of subnetting for efficient IP address distribution and performance improvement in networks. Additionally, it introduces Variable Length Subnet Masking (VLSM) as a technique to minimize IP address wastage when creating subnets.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views11 pages

Applied IPv4 Subnetting Guide

The document explains the concept of IPv4 subnetting, detailing the purpose of subnet masks, their characteristics, and how to determine network IDs. It emphasizes the importance of subnetting for efficient IP address distribution and performance improvement in networks. Additionally, it introduces Variable Length Subnet Masking (VLSM) as a technique to minimize IP address wastage when creating subnets.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Applied IPv4 Subnetting

Understanding the purpose of the subnet mask


➢ Both IPv4 and IPv6 addresses have an accompanying subnet mask.
➢ It helps a sender device determine whether to forward a message to the default gateway
or not.
The following are the important key characteristics of the subnet mask and its responsibilities:
➢ It has the same length as an IPv4 address, i.e., 32 bits in IPV4 and 128 bits in IPV6.
➢ It is used with an IPv4 or IPv6 address to help devices identify the network and host
portions of the IP address.
➢ It is used to help network professionals to determine the total number of IP addresses
and usable (assignable) addresses within an IP network.
➢ It determines whether the destination host is on the same IP network as the sender or
on another network. If the destination host is on another IP subnet, the sender forwards
the message to the sender’s default gateway.

Default subnet mask for each class of IPv4 addresses on both a private and public network:

Fig. – Default subnet masks


Delving into network prefixes and subnet masks
➢ The /x value that’s appended to the end of the IP address is referred to as the network
prefix and represents the subnet mask in a simplified format.
➢ The x value is calculated based on the total number of bits, which are 1s within the
subnet mask of the IPv4 or IPv6 address.
The following table shows the binary notation of each default class of subnet mask:

Fig. – Subnet masks


The following are the network prefixes for each default subnet mask:
• Class A: [Link] - /8
• Class B: [Link] - /16
• Class C: [Link] - /24
➢ The network portion of the IP address is the same for all devices within the same IP
network, while the host portion of the IP address is unique to the interface of the end
device only.
➢ To determine the network and host portion of an IP address, you can simply convert
both the IP address and subnet mask into binary notation, as shown in the following
table:
Fig. – network ID of Class A
Placing a dotted line after the last 1 within the subnet mask will identify the network
and host portions of both IPv4 and IPv6 addresses.
➢ Similarly, we can find out for class B and class C.

We will commonly discover networks are using custom subnet masks such as [Link].
To calculate the network prefix, convert each octet from decimal into binary, as shown in the
following steps:
1. Converting the first octet, 255, into binary will be 11111111.
2. Converting the second octet, 255, into binary will be 11111111.
3. Converting the third octet, 224, into binary will be 1110000.
4. Converting the fourth octet, 0, into binary will be 0000000.
5. Lastly, calculating the sum of all bits that are 1s from each octet will provide a network
prefix of /19.
The following table shows a classless IPv4 address with a custom subnet mask:

Fig. – Custom subnet mask


Determining the network ID
It’s important to understand how to identify whether devices are on the same IP network or not.
Let’s take a look at the following network topology, which contains a computer, a switch, and
a router:

Fig. – Network topology


➢ As shown in the preceding diagram, there’s a small network that contains a computer
with a label of PC 1 that has an IPv4 address of [Link] that uses a custom subnet
mask of [Link].

➢ There’s a router as the default gateway that provides access to the internet, which is
configured using an IPv4 address of [Link] with a custom subnet mask of
[Link].

➢ The computer is connected to the same physical network as the router. If the computer
has to send a message to a host on the internet, the computer forwards the traffic to its
default gateway on the network.
➢ It seems Router1 and PC1 are on the same IPv4 network. Actually, these two devices
are not on the same IP network and won’t be able to communicate with each other.

➢ We need to calculate the network IDs of each device. The network ID allows network
professionals to identify which IP network a host belongs to.

➢ While devices within an organization are all interconnected to the same physical
network, network professionals create unique IP subnetworks (subnets) where each
subnet has a network ID, a range of usable IP addresses, and a broadcast address.

➢ To determine the network ID of a host, use a logical operation known as ANDing. The
process of ANDing allows a system to accept two input values and provide a single
output. The following are the laws of ANDing:

0 AND 0 = 0
0 AND 1 = 0
1 AND 0 = 0
1 AND 1 = 1

➢ Network professionals AND the IP address of a device against the subnet mask, the
result of which is the network ID. Let’s determine whether the computer and router are
on the same IP subnet by following these steps:

➢ First, let’s convert the IPv4 address and the subnet mask of the computer into binary
notation, then use the laws of ANDing to determine the network ID of the computer:

Fig. – PC 1’s Network ID

➢ Next, let’s covert the IPv4 and subnet mask of the router into binary notation and use
the laws of ANDing to determine the network ID, as follows:

Fig. – The router’s network ID

➢ Lastly, let’s compare the network IDs of both PC 1 and the router. PC 1 has a network
ID of [Link]/25 and the router has a network ID of [Link]/25. Since these
network IDs are not the same, this means PC 1 and the router are not on the same IP
subnet.
➢ Therefore, they will not be able to communicate with each other, even though they are
connected to the same physical network.
Understanding the importance of subnetting
➢ Using classful addressing with default subnet masks isn’t the most suitable solution in
some cases.
➢ Using a classless addressing scheme allows network professionals to create smaller
networks with custom subnet masks with fewer usable IP addresses to avoid wastage
by using a technique known as subnetting.
➢ Subnetting provides the following benefits to organizations and network professionals:
• To efficiently distribute IP addresses with the least wastage
• To create more networks with smaller broadcast domains
➢ A large broadcast domain within an organization can affect the performance of the
network.
➢ Each time a device sends a broadcast message, it’s propagated throughout the entire
network and all devices receive a copy of the message and process it. If more devices
are generating broadcast messages on the network at the same time, these messages will
saturate the available bandwidth on the physical network, causing other traffic types
such as voice and video to be discarded.
➢ Voice and video traffic types use User Datagram Protocol (UDP) as their preferred
transport layer protocol as UDP is better for time-sensitive applications. However, since
UDP does not provide reliability or guarantee of delivery, UDP traffic is most likely to
be discarded when the network becomes saturated.
➢ To reduce the size of a broadcast domain, subnetting allows network professionals to
create smaller IP networks to support fewer devices. For example, while all devices are
interconnected to the same physical network within an organization, a network
professional can create a unique subnet for each department within the company such
that the human resource team will be on a unique IP subnet and the accounting team
will be on another IP subnet.
➢ If a device within the human resources team is generating broadcast messages, it’s
limited to the human resources IP subnet and will not propagate to another IP subnet
within the organization. Therefore, other departments will not be affected and the
broadcast messages are contained while improving the performance of the entire
network.
IPv4 subnetting and VLSM
Let’s imagine you’re the network administrator for an organization that has a total of
four offices that are interconnected using a Wide Area Network (WAN) solution, as
shown in the following network topology:

Fig. – Network topology


Your objective is to create an IPv4 addressing scheme for the entire organization,
ensuring each office location has an IP subnet and that there’s the least wastage of IP
addresses per subnet. The following sub-sections will guide you through the process of
subnetting.
Step 1 – determining the appropriate IPv4 block
You will need to determine the total number of networks within the organization and
the size of the largest network. It helps you choose an appropriate address class for the
organization.

Class C = 28 – 2 = 254 usable IP addresses

Scenario
• Main Office LAN: 28 hosts
• Branch A LAN: 26 hosts
• Branch B LAN: 25 hosts
• Branch C LAN: 15 hosts
• WAN 1 (R1-R2): 2 IPs are needed
• WAN 2 (R2-R3): 2 IPs are needed
• WAN 3 (R3-R4): 2 IPs are needed
Class C address block will be appropriate for the organization.

Step 2 – creating new subnets (subnetworks)


➢ To create new subnets from an address block, you will need to convert some of
the host bits into new network bits. This allows us to create more networks while
reducing the number of IPv4 addresses that are available within each subnet.

➢ Let’s get started by using the first available Class C address block of
[Link]/24 and converting both the address and default subnet mask into
binary notation, as shown in the following table:

➢ When converting host bits into network bits, the following formula is used to
determine the number of new networks:
Number of networks = 2N where the Nth value represents the number
of host bits that are converted into network bits.
Number of networks = 2N
= 23
=2x2x2
=8
➢ Converting three host bits into network bits will provide eight new subnetworks which
will be sufficient as we need 7 networks.

Fig. – Remaining host bits


➢ To determine whether each of the eight new subnets will be able to support the largest
network within the organization of 28 hosts, we need to calculate the total number of
usable IPv4 addresses per network using the following formula:

Usable IPv4 address = 2H – 2


= 25 – 2
= 32 – 2
= 30
➢ Based on the results, each of the eight new subnets will contain 30 usable IPv4
addresses that can be assigned to devices. As a result, we have found a workable
solution of using a Class C address block and using mathematical calculations to
determine whether it’s suitable for the organization.
➢ By changing the new network bits from 0s to 1s within the IP address, we can create all
the possibilities for new network IDs. The following are the calculations for creating
the eight new subnets:

Fig. – New subnets


Step 3 – assigning subnets to each network
In this step, you’ll learn how to calculate the IP address ranges for each new subnet by
determining the network ID, the first and last usable addresses, and the broadcast address per
subnet.
To ensure your calculations are done efficiently, use the following guidelines:
• To determine the first usable IP address within a subnet, use the network ID + 1
formula.
In binary notation, the first bit from the left is set to 1.
• To calculate the broadcast address within a subnet, use the Next network ID – 1
formula.
In binary notation, it’s when all the host bits are 1s within the address.
• To calculate the last usable IP address within a subnet, use the Broadcast Address –
1
Using these guidelines, let’s calculate the network range of the first subnet and assign
it to the main office LAN network:

Fig. – Subnet 1 network range


Next, applying the same mathematical technique, let’s determine the network range of
the next subnet that will be assigned to the Branch A LAN network:

Fig. – Subnet 1 network range


Next, applying the same mathematical technique, let’s determine the network range of
the next subnet that will be assigned to the Branch A LAN network:

Fig. – Subnet 2 network range


Next, repeating our technique, let’s calculate the network range of the third subnet
that will be assigned to the Branch B LAN network:

Fig. – Subnet 3 network range


Next, let’s determine the network range of the fourth subnet that will be assigned to
the Branch C LAN network:

Fig. – Subnet 4 network range


Three WAN networks are used to interconnect each branch router to the main office
router. These WAN links are point-to-point connections that require only two IP
addresses per WAN connection:
• WAN 1: Main office router to Branch A router – only two IP addresses are needed
• WAN 2: Main office router to Branch B router – only two IP addresses are needed
• WAN 3: Main office router to Branch C router – only two IP addresses are needed
➢ If we were to assign the remaining subnets to any of the WAN networks, there will be
a lot of wastage of IPv4 addresses. Since each subnet has 30 usable IPv4 addresses and
each WAN link requires only two IP addresses, there will be a wastage of 28 IPv4
addresses per WAN link.
➢ To further avoid wastage of IPv4 addresses within our new subnets while being able to
assign IPv4 addresses to our WAN networks, we can use a technique known as
Variable Length Subnet Masking (VLSM), which allows us to further break down a
subnet into smaller subnetworks.
➢ Think of it as subnetting a subnet even further to reduce IPv4 address wastage on
a network. We can use any of the remaining following subnets for VLSM:

Fig. – Unallocated networks


Since these unallocated subnets are equal in size, we can use any one of these remaining
subnets to perform our VLSM technique. To keep everything simple and easy to
understand, the following subnets will be documented and reserved for future office
locations:

Fig. – Subnet reservations


The following subnet will be broken down using VLSM to create smaller subnetworks:

Fig. – Eighth subnet


Step 4 – performing Variable-Length Subnet Masking (VLSM)
➢ In this step, you will learn how to further break down a subnet to create smaller IP
networks with smaller broadcast domains while efficiently distributing IP addresses
with the least wastage.
➢ Since each of the three WAN links are point-to-point networks that require only
two IP addresses, we can determine the number of host bits needed within an IP
address to provide two usable IP addresses.
➢ To calculate the number of usable IP addresses within a network, use the following
formula:
Number of usable IPv4 addresses = 2H – 2
Number of usable IPv4 addresses = 2H – 2
= 22 – 2
= (2 x 2) – 2
=4–2
=2
➢ Using two host bits provides two usable addresses. At this point, we have a solution
for creating new subnets from the [Link]/27 network block, which has two
usable IP addresses per new subnet.
➢ The following formula provides the number of new subnets when converting three
host bits into network bits:
Number of networks = 2N
= 23
=2x2x2
=8
➢ By creating eight new with two usable addresses, we can assign three of the eight new
subnets to the existing WAN links; the remaining subnet can be documented as a
reservation for the future growth of the organization.
➢ The following table shows the effects of converting three host bits within the subnet
mask into network bits to create eight new subnets from the [Link]/27 network
block:

Fig. – Creating new network bits


➢ The two host bits are remaining within the host portion of the addresses. These host bits
will ensure there are two usable addresses within each of the new subnets.
➢ The following table shows all the possibilities of modifying the new network bits from
the address by changing the 0s to 1s, creating eight new subnets from the [Link]
network block:

Fig. – VLSM networks


➢ The following are the calculations used to determine the network range of the first
subnet that will be assigned between the main office router and Branch A router:
Fig. – WAN 1 allocation
➢ The following are the calculations used to determine the network range of the second
subnet that will be assigned between the main office router and Branch B router:

Fig. – WAN 2 allocation


➢ The following are the calculations used to determine the network range of the third
subnet that will be assigned between the main office router and Branch C router:

Fig. – WAN 3 allocation


➢ The following five subnets will be documented and reserved within the company to
support future growth:

Fig. – Reserved WAN subnets


Lastly, the following table shows the allocation for networks with a /27 network prefix:

Fig.– Subnets for LANs

The following table shows the allocation for networks that use the /30 network prefix:

Fig. – Subnets for WANs

You might also like