8.1.4.6 Lab - Calculating IPv4 Subnets
8.1.4.6 Lab - Calculating IPv4 Subnets
8.1.4.6 Lab - Calculating IPv4 Subnets
Objectives
Part 1: Determine IPv4 Address Subnetting
Part 2: Calculate IPv4 Address Subnetting
Background / Scenario
The ability to work with IPv4 subnets and determine network and host information based on a given
IP
address and subnet mask is critical to understanding how IPv4 networks operate. The first part is
designed to
reinforce how to compute network IP address information from a given IP address and subnet
mask. When
given an IP address and subnet mask, you will be able to determine other information about the
subnet.
Required Resources
1 PC (Windows 7 or 8 with Internet access)
Optional: IPv4 address calculator
Knowing this, you may only have to perform binary ANDing on an octet that does not have 255 or 0
in its
subnet mask portion.
Example:
Analyzing this example, you can see that you only have to perform binary ANDing on the third octet.
The first
two octets will result in 172.30 due to the subnet mask. The fourth octet will result in 0 due to the
subnet
mask.
Continuing with this example, determining the number of hosts per network can be calculated by
analyzing
the subnet mask. The subnet mask will be represented in dotted decimal format, such as
255.255.192.0, or in
network prefix format, such as /18. An IPv4 address always has 32 bits. Subtracting the number of
bits used
for the network portion (as represented by the subnet mask) gives you the number of bits used for
hosts.
Using our example above, the subnet mask 255.255.192.0 is equivalent to /18 in prefix notation.
Subtracting
18 network bits from 32 bits results in 14 bits left for the host portion. From there, it is a simple
calculation:
2(number of host bits) - 2 = Number of hosts
214 = 16,384 2 = 16,382 hosts
Determine the network and broadcast addresses and number of host bits and hosts for the given
IPv4
IPv4 Network Address Broadcast Address Total Number Total Number
Address/Prefix of Host Bits of Hosts
The following example shows a sample problem along with the solution for solving this problem:
Step 1: Fill out the tables below with appropriate answers given the IPv4 address,
original
subnet mask, and new subnet mask.
a. Problem 1:
Given:
Host IP Address: 10.101.99.228
Original Subnet Mask 255.0.0.0
New Subnet Mask: 255.255.128.0
Find:
Number of Subnet Bits 3
Number of Subnets Created 8
Number of Host Bits per Subnet 5
Number of Hosts per Subnet 30
Network Address of this Subnet 10.101.99.128
IPv4 Address of First Host on this Subnet 10.101.99.129
IPv4 Address of Last Host on this Subnet 10.101.99.158
IPv4 Broadcast Address on this Subnet 10.101.99.159
Given:
Host IP Address: 10.101.99.228
Original Subnet Mask 255.0.0.0
New Subnet Mask: 255.255.128.0
Find:
Number of Subnet Bits 9
Number of Subnets Created 512
Number of Host Bits per Subnet 32,766
Number of Hosts per Subnet 10.101.0.0
Network Address of this Subnet 10.101.1.0
IPv4 Address of First Host on this Subnet 10.101.0.127
IPv4 Address of Last Host on this Subnet 10.101.127.254
IPv4 Broadcast Address on this Subnet 10.101.127.255
Given:
Host IP Address: 172.22.32.12
Original Subnet Mask 255.255.0.0
New Subnet Mask: 255.255.224.0
Find:
Number of Subnet Bits 3
Number of Subnets Created 8
Number of Host Bits per Subnet 12
Number of Hosts per Subnet 4,096
Network Address of this Subnet 172.22.32.0
IPv4 Address of First Host on this Subnet 172.22.32.1
IPv4 Address of Last Host on this Subnet 172.22.63.254
IPv4 Broadcast Address on this Subnet 172.22.63.255
Given:
Host IP Address: 192.168.1.245
Original Subnet Mask 255.255.255.0
New Subnet Mask: 255.255.255.252
Find:
Number of Subnet Bits 6
Number of Subnets Created 64
Number of Host Bits per Subnet 2
Number of Hosts per Subnet 4
Network Address of this Subnet 192.168.1.244
IPv4 Address of First Host on this Subnet 192.168.1.245
IPv4 Address of Last Host on this Subnet 192.168.1.246
IPv4 Broadcast Address on this Subnet 192.168.1.247
Given:
Find:
Reflection
Why is the subnet mask so important when analyzing an IPv4 address?