Lab– Identifying IPv4 Addresses
Objectives
Part 1: Identify IPv4 Addresses
Identify the network and host portion of an IP address.
Identify the range of host addresses given a network/prefix mask pair.
Part 2: Classify IPv4 Addresses
Identify the type of address (network, host, multicast, or broadcast).
Identify whether an address is public or private.
Determine if an address assignment is a valid host address.
Background / Scenario
Addressing is an important function of network layer protocols because it enables data communication
between hosts on the same network, or on different networks. In this lab, you will examine the structure of
Internet Protocol version 4 (IPv4) addresses. You will identify the various types of IPv4 addresses and the
components that help comprise the address, such as network portion, host portion, and subnet mask. Types
of addresses covered include public, private, unicast, and multicast.
Required Resources
Device with Internet access
Optional: IPv4 address calculator
Part 1: Identify IPv4 Addresses
In Part 1, you will be given several examples of IPv4 addresses and will complete tables with appropriate
information.
Step 1: Analyze the table shown below and identify the network portion and host portion of the
given IPv4 addresses.
The first two rows show examples of how the table should be completed.
Key for table:
N = all 8 bits for an octet are in the network portion of the address
n = a bit in the network portion of the address
H = all 8 bits for an octet are in the host portion of the address
h = a bit in the host portion of the address
© 2013 Cisco and/or its affiliates. All rights reserved. This document is Cisco Public. Page 1 of 11
Lab– Identifying IPv4 Addresses and Calculating IPv4 Subnets
Network/Host
N,n = Network
IP Address/Prefix H,h = Host Subnet Mask Network Address
[Link]/24 N.N.N.H [Link] [Link]
[Link]/23 [Link].H [Link] [Link]
[Link]/27
[Link]/24
[Link]/26
[Link]/20
[Link]/25
[Link]/27
[Link]/28
Step 2: Analyze the table below and list the range of host and broadcast addresses given a
network/prefix mask pair.
The first row shows an example of how the table should be completed.
Last Host Broadcast
IP Address/Prefix First Host Address Address Address
[Link]/24 [Link] [Link] [Link]
[Link]/23
[Link]/27
[Link]/24
[Link]/26
[Link]/20
[Link]/25
[Link]/27
[Link]/28
Part 2: Classify IPv4 Addresses
In Part 2, you will identify and classify several examples of IPv4 addresses.
Step 1: Analyze the table shown below and identify the type of address (network, host,
multicast, or broadcast address).
The first row shows an example of how the table should be completed.
© 2013 Cisco and/or its affiliates. All rights reserved. This document is Cisco Public. Page 2 of 11
Lab– Identifying IPv4 Addresses and Calculating IPv4 Subnets
IP Address Subnet Mask Address Type
[Link] [Link] host
[Link] [Link]
[Link] [Link]
[Link] [Link]
[Link] [Link]
[Link] [Link]
[Link] [Link]
[Link] [Link]
[Link] [Link]
Step 2: Analyze the table shown below and identify the address as public or private.
IP Address/Prefix Public or Private
[Link]/27
[Link]/24
[Link]/16
[Link]/28
[Link]/24
[Link]/22
[Link]/16
[Link]/24
[Link]/16
Step 3: Analyze the table shown below and identify whether the address/prefix pair is a valid
host address.
© 2013 Cisco and/or its affiliates. All rights reserved. This document is Cisco Public. Page 3 of 11
Lab– Identifying IPv4 Addresses and Calculating IPv4 Subnets
IP Address/Prefix Valid Host Address? Reason
[Link]/24
[Link]/16
[Link]/24
[Link]/24
[Link]/24
[Link]/14
[Link]/16
[Link]/8
[Link]/24
Reflection
Why should we continue to study and learn about IPv4 addressing if the available IPv4 address space is
depleted?
_______________________________________________________________________________________
_______________________________________________________________________________________
© 2013 Cisco and/or its affiliates. All rights reserved. This document is Cisco Public. Page 4 of 11
Lab– Identifying IPv4 Addresses and Calculating IPv4 Subnets
Lab – Calculating IPv4 Subnets
Objectives
Part 1: Determine IPv4 Address Subnetting
Determine the network address.
Determine the broadcast address.
Determine the number of hosts.
Part 2: Calculate IPv4 Address Subnetting
Determine the number of subnets created.
Determine number of hosts per subnet.
Determine the subnet address.
Determine the host range for the subnet.
Determine the broadcast address for the subnet.
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 such
as:
Network address
Broadcast address
Total number of host bits
Number of hosts per subnet
In the second part of the lab, for a given IP address and subnet mask, you will determine such information as
follows:
Network address of this subnet
Broadcast address of this subnet
Range of host addresses for this subnet
Number of subnets created
Number of hosts for each subnet
Required Resources
1 PC (Windows 7, Vista, or XP with Internet access)
Optional: IPv4 address calculator
Part 3: Determine IPv4 Address Subnetting
In Part 1, you will determine the network and broadcast addresses, as well as the number of hosts, given an
IPv4 address and subnet mask.
REVIEW: To determine the network address, perform binary ANDing on the IPv4 address using the subnet
mask provided. The result will be the network address. Hint: If the subnet mask has decimal value 255 in an
© 2013 Cisco and/or its affiliates. All rights reserved. This document is Cisco Public. Page 5 of 11
Lab– Identifying IPv4 Addresses and Calculating IPv4 Subnets
octet, the result will ALWAYS be the original value of that octet. If the subnet mask has decimal value 0 in an
octet, the result will ALWAYS be 0 for that octet.
Example:
IP Address [Link]
Subnet Mask [Link]
==========
Result (Network) [Link]
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:
IP Address [Link]
Subnet Mask [Link]
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.
IP Address [Link]
Subnet Mask [Link]
==========
Result (Network) 172.30.?.0
Perform binary ANDing on the third octet.
Decimal Binary
239 11101111
192 11000000
=======
Result 192 11000000
Analyzing this example again produces the following result:
IP Address [Link]
Subnet Mask [Link]
==========
Result (Network) [Link]
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 [Link], 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 [Link] 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
addresses and prefixes in the following table.
© 2013 Cisco and/or its affiliates. All rights reserved. This document is Cisco Public. Page 6 of 11
Lab– Identifying IPv4 Addresses and Calculating IPv4 Subnets
IPv4 Total Number Total Number
Address/Prefix Network Address Broadcast Address of Host Bits of Hosts
[Link]/28
[Link]/30
[Link]/19
[Link]/24
[Link]/22
[Link]/27
Part 4: Calculate IPv4 Address Subnetting
When given an IPv4 address, the original subnet mask and the new subnet mask, you will be able to
determine:
Network address of this subnet
Broadcast address of this subnet
Range of host addresses of this subnet
Number of subnets created
Number of hosts per subnet
The following example shows a sample problem along with the solution for solving this problem:
Given:
Host IP Address: [Link]
Original Subnet Mask [Link]
New Subnet Mask: [Link]
Find:
Number of Subnet Bits 4
Number of Subnets Created 16
Number of Host Bits per Subnet 12
Number of Hosts per Subnet 4,094
Network Address of this Subnet [Link]
IPv4 Address of First Host on this Subnet [Link]
IPv4 Address of Last Host on this Subnet [Link]
IPv4 Broadcast Address on this Subnet [Link]
Let’s analyze how this table was completed.
© 2013 Cisco and/or its affiliates. All rights reserved. This document is Cisco Public. Page 7 of 11
Lab– Identifying IPv4 Addresses and Calculating IPv4 Subnets
The original subnet mask was [Link] or /16. The new subnet mask is [Link] or /20. The
resulting difference is 4 bits. Because 4 bits were borrowed, we can determine that 16 subnets were created
because 24 = 16.
The new mask of [Link] or /20 leaves 12 bits for hosts. With 12 bits left for hosts, we use the
following formula: 212 = 4,096 – 2 = 4,094 hosts per subnet.
Binary ANDing will help you determine the subnet for this problem, which results in the network [Link].
Finally, you need to determine the first host, last host, and broadcast address for each subnet. One method to
determine the host range is to use binary math for the host portion of the address. In our example, the last 12
bits of the address is the host portion. The first host would have all significant bits set to zero and the least
significant bit set to 1. The last host would have all significant bits set to 1 and the least significant bit set to 0.
In this example, the host portion of the address resides in the 3rd and 4th octets.
Description 1st Octet 2nd Octet 3rd Octet 4th Octet Description
Network/Host nnnnnnnn nnnnnnnn nnnnhhhh hhhhhhhh Subnet Mask
Binary 10101100 00010000 01000000 00000001 First Host
Decimal 172 16 64 1 First Host
Binary 10101100 00010000 01001111 11111110 Last Host
Decimal 172 16 79 254 Last Host
Binary 10101100 00010000 01001111 11111111 Broadcast
Decimal 172 16 79 255 Broadcast
Step 1: Fill out the tables below with appropriate answers given the IPv4 address, original
subnet mask, and new subnet mask.
a. Problem 1:
© 2013 Cisco and/or its affiliates. All rights reserved. This document is Cisco Public. Page 8 of 11
Lab– Identifying IPv4 Addresses and Calculating IPv4 Subnets
Given:
Host IP Address: [Link]
Original Subnet Mask [Link]
New Subnet Mask: [Link]
Find:
Number of Subnet Bits
Number of Subnets Created
Number of Host Bits per Subnet
Number of Hosts per Subnet
Network Address of this Subnet
IPv4 Address of First Host on this Subnet
IPv4 Address of Last Host on this Subnet
IPv4 Broadcast Address on this Subnet
b. Problem 2:
Given:
Host IP Address: [Link]
Original Subnet Mask [Link]
New Subnet Mask: [Link]
Find:
Number of Subnet Bits
Number of Subnets Created
Number of Host Bits per Subnet
Number of Hosts per Subnet
Network Address of this Subnet
IPv4 Address of First Host on this Subnet
IPv4 Address of Last Host on this Subnet
IPv4 Broadcast Address on this Subnet
c. Problem 3:
© 2013 Cisco and/or its affiliates. All rights reserved. This document is Cisco Public. Page 9 of 11
Lab– Identifying IPv4 Addresses and Calculating IPv4 Subnets
Given:
Host IP Address: [Link]
Original Subnet Mask [Link]
New Subnet Mask: [Link]
Find:
Number of Subnet Bits
Number of Subnets Created
Number of Host Bits per Subnet
Number of Hosts per Subnet
Network Address of this Subnet
IPv4 Address of First Host on this Subnet
IPv4 Address of Last Host on this Subnet
IPv4 Broadcast Address on this Subnet
d. Problem 4:
Given:
Host IP Address: [Link]
Original Subnet Mask [Link]
New Subnet Mask: [Link]
Find:
Number of Subnet Bits
Number of Subnets Created
Number of Host Bits per Subnet
Number of Hosts per Subnet
Network Address of this Subnet
IPv4 Address of First Host on this Subnet
IPv4 Address of Last Host on this Subnet
IPv4 Broadcast Address on this Subnet
e. Problem 5:
© 2013 Cisco and/or its affiliates. All rights reserved. This document is Cisco Public. Page 10 of 11
Lab– Identifying IPv4 Addresses and Calculating IPv4 Subnets
Given:
Host IP Address: [Link]
Original Subnet Mask [Link]
New Subnet Mask: [Link]
Find:
Number of Subnet Bits
Number of Subnets Created
Number of Host Bits per Subnet
Number of Hosts per Subnet
Network Address of this Subnet
IPv4 Address of First Host on this Subnet
IPv4 Address of Last Host on this Subnet
IPv4 Broadcast Address on this Subnet
f. Problem 6:
Given:
Host IP Address: [Link]
Original Subnet Mask [Link]
New Subnet Mask: [Link]
Find:
Number of Subnet Bits
Number of Subnets Created
Number of Host Bits per Subnet
Number of Hosts per Subnet
Network Address of this Subnet
IPv4 Address of First Host on this Subnet
IPv4 Address of Last Host on this Subnet
IPv4 Broadcast Address on this Subnet
Reflection
Why is the subnet mask so important when analyzing an IPv4 address?
_______________________________________________________________________________________
© 2013 Cisco and/or its affiliates. All rights reserved. This document is Cisco Public. Page 11 of 11