Objectives
The goal of this experiment is to:
Background
An IP address is an address used in order to uniquely identify a device on an IP network. The
address is made up of 32 binary bits, which can be divisible into a network portion and host portion
with the help of a subnet mask. The network portion of an address is the same for all devices that
reside in the same network. The host portion identifies a specific host within a given network. The
subnet mask is used to determine the network portion of an IP address. Devices on the same
network can communicate directly; devices on different networks require an intermediary Layer 3
device, such as a router, to communicate.
The 32 binary bits are broken into four octets (1 octet = 8 bits). Each octet is converted to decimal
and separated by a period (dot). For this reason, an IP address is said to be expressed in dotted
decimal format (for example, 172.16.81.100). The value in each octet ranges from 0 to 255
decimal, or 00000000 - 11111111 binary. These octets are broken down to provide an addressing
scheme that can accommodate large and small networks. There are five different classes of
networks, A to E. Given an IP address, its class can be determined from the three high-order bits
(the three left-most bits in the first octet),
1. In a Class A address, the first octet is the network portion, and network addresses range
from 1.0.0.0 to 127.255.255.255. Octets 2, 3, and 4 (the next 24 bits) are for the network
manager to divide into subnets and hosts as he/she sees fit. Class A addresses are used for
networks that have more than 65,536 hosts (actually, up to 16777214 hosts!).
2. In a Class B address, the first two octets are the network portion, and network addresses
range from of 128.0.0.0 to 191.255.255.255. Octets 3 and 4 (16 bits) are for local subnets
and hosts. Class B addresses are used for networks that have between 256 and 65534 hosts.
-1-
3. In a Class C address, the first three octets are the network portion, and network addresses
range from 192.0.0.0 to 223.255.255.255. Octet 4 (8 bits) is for local subnets and hosts -
perfect for networks with less than 254 hosts.
A network mask helps you know which portion of the address identifies the network and which
portion of the address identifies the node. Class A, B, and C networks have default masks, also
known as natural masks,
Class A: 255.0.0.0
Class B: 255.255.0.0
Class C: 255.255.255.0
An IP address on a Class A network that has not been subnetted would have an address/mask pair
similar to: 8.20.15.1 255.0.0.0. In order to see how the mask helps you identify the network and
node parts of the address, convert the address and mask to binary numbers. After this has been
done, we can use the bitwise ANDing operation to determine the network address. As an example,
8.20.15.1 = 00001000.00010100.00001111.00000001
255.0.0.0 = 11111111.00000000.00000000.00000000
Once you have the address and the mask represented in binary, then identification of the network
and host ID is easier. Any address bits which have corresponding mask bits set to 1 represent the
network ID. Any address bits that have corresponding mask bits set to 0 represent the node ID.
8.20.15.1 = 00001000.00010100.00001111.00000001
255.0.0.0 = 11111111.00000000.00000000.00000000
--------------------------------------------------
net id | host id
netid = 00001000 = 8
hostid = 00010100.00001111.00000001 = 20.15.1
Variable Length Subnet Masking (VLSM) is a technique that allows network administrators to
divide an IP address space into subnets of different sizes to create subnets of various sizes based
on the number of hosts required in each subnet. With VLSM, you can create multiple logical
networks that exist within a single Class A, B, or C network. If you do not subnet, you are only
able to use one network from your Class A, B, or C network, which is unrealistic and wasteful of
IP addresses.
-2-
In order to subnet a network, extend the natural mask with some of the bits from the host ID portion
of the address in order to create a subnetwork ID. For example, given a Class C network of
204.17.5.0 which has a natural mask of 255.255.255.0, you can create subnets in this manner:
204.17.5.0 - 11001100.00010001.00000101.00000000
255.255.255.224 - 11111111.11111111.11111111.11100000
--------------------------------------------------
net id |host id
By extending the mask to be 255.255.255.224, you have taken three bits (indicated by "sub") from
the original host portion of the address and used them to make subnets. With these three bits, it is
possible to create eight subnets. With the remaining five host ID bits, each subnet can have up to
32 host addresses, 30 of which can actually be assigned to a device since host ids of all zeros or
all ones are not allowed (it is very important to remember this). So, with this in mind, these subnets
have been created.
204.17.5.0 255.255.255.224 host address range 1 to 30
204.17.5.32 255.255.255.224 host address range 33 to 62
204.17.5.64 255.255.255.224 host address range 65 to 94
204.17.5.96 255.255.255.224 host address range 97 to 126
204.17.5.128 255.255.255.224 host address range 129 to 158
204.17.5.160 255.255.255.224 host address range 161 to 190
204.17.5.192 255.255.255.224 host address range 193 to 222
204.17.5.224 255.255.255.224 host address range 225 to 254
There are two ways to denote these masks. First, since you use three bits more than the "natural"
Class C mask, you can denote these addresses as having a 3-bit subnet mask of 255.255.255.224.
Or, secondly, the mask of 255.255.255.224 can be denoted as /27 as there are 27 bits that are set
to one in the mask.
-3-
Decimal Binary
192.168.10.10 11000000.10101000.00001010.00001010
209.165.200.229
172.16.18.183
10.86.252.17
255.255.255.128
255.255.192.0
How do you determine what bits to use to calculate the network address?
___________________________________________________________________________
In the example above, how many bits are used to calculate the network address?
___________________________________________________________________________
-4-
Description Decimal Binary
IP Address 172.16.145.29
Subnet Mask 255.255.0.0
Network Address
IP Address 192.168.10.10
Subnet Mask 255.255.255.0
Network Address
IP Address 192.168.68.210
Subnet Mask 255.255.255.128
Network Address
IP Address 172.16.188.15
Subnet Mask 255.255.240.0
Network Address
IP Address 10.172.2.8
Subnet Mask 255.224.0.0
Network Address
-5-
What is the network address for PC-A? __________________________
What is the network address for PC-B? __________________________
Will these PCs be able to communicate directly with each other? ______
What is the lowest address that can be given to PC-B that allows it to be on the same
network as PC-A?___________________________
Network/Host
IP Address/Prefix N,n = Network, H,h = Host Subnet Mask Network Address
209.165.200.227/27
172.31.45.252/24
10.1.8.200/26
-6-
172.16.117.77/20
10.1.1.101/25
209.165.202.140/27
192.168.28.45/28
4. Analyze the table below and list the range of host and broadcast addresses given a
network/prefix mask pair (7.1.4.9)
The first row shows an example of how the table should be completed.
10.101.99.17/23
209.165.200.227/27
172.31.45.252/24
10.1.8.200/26
172.16.117.77/20
10.1.1.101/25
209.165.202.140/27
192.168.28.45/28
-7-
Total Total
IPv4 Broadcast Number of Number of
Address/Prefix Network Address Address Host Bits Hosts
192.168.100.25/28
172.30.10.130/30
10.1.113.75/19
198.133.219.250/24
128.107.14.191/22
172.16.104.99/27
-8-
The following example shows a sample problem along with the solution for solving this
problem:
Given:
Find:
-9-
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
Subnet
Network/Host nnnnnnnn nnnnnnnn nnnnhhhh hhhhhhhh Mask
1. Fill out the tables below with appropriate answers given the IPv4 address, original subnet
mask, and new subnet mask.
Problem 1:
Given:
Find:
- 10 -
IPv4 Address of First Host on this Subnet
IPv4 Address of Last Host on this Subnet
IPv4 Broadcast Address on this Subnet
Problem 2:
Given:
Find:
Reflection
Why is the subnet mask so important when analyzing an IPv4 address?
___________________________________________________________________________
- 11 -
Exercise 2: Designing and Implementing a Subnetted IPv4 Addressing Scheme
Topology
Addressing Table
Default
Device Interface IP Address Subnet Mask Gateway
R1 G0/0 N/A
G0/1 N/A
Lo0 N/A
Lo1 N/A
S1 VLAN 1 N/A N/A N/A
PC-A NIC
PC-B NIC
Scenario
In this exercise, starting from a single network address and network mask, you will subnet the
network into multiple subnets. The subnet scheme should be based on the number of host
computers required in each subnet, as well as other network considerations, like future network
host expansion.
After you have created a subnetting scheme and completed the network diagram by filling in
the host and interface IP addresses, you will configure the host PCs and router interfaces,
including loopback interfaces. The loopback interfaces are created to simulate additional LANs
attached to router R1.
After the network devices and host PCs have been configured, you will use the ping command
to test for network connectivity.
- 12 -
A. Design a Network Subnetting Scheme
Step 1: Create a subnetting scheme that meets the required number of subnets and
required number of host addresses.
In this scenario, you are a network administrator for a small subdivision within a larger
company. You must create multiple subnets out of the 192.168.0.0/24 network address space
to meet the following requirements:
• The first subnet is the employee network. You need a minimum of 25 host IP addresses.
• The second subnet is the administration network. You need a minimum of 10 IP
addresses.
• The third and fourth subnets are reserved as virtual networks on virtual router interfaces,
loopback 0 and loopback 1. These virtual router interfaces simulate LANs attached to R1.
• You also need two additional unused subnets for future network expansion.
Note: Variable length subnet masks will not be used. All of the device subnet masks will
be the same length.
Answer the following questions to help create a subnetting scheme that meets the stated
network requirements:
1) How many host addresses are needed in the largest required subnet?
_____________________
2) What is the minimum number of subnets required?
_________________________________
3) The network that you are tasked to subnet is 192.168.0.0/24. What is the /24 subnet
mask in binary?
_____________________________________________________________________
4) The subnet mask is made up of two portions, the network portion, and the host
portion. This is represented in the binary by the ones and the zeros in the subnet
mask.
In the network mask, what do the ones represent? _____________________________
In the network mask, what do the zeros represent? _____________________________
- 13 -
5) To subnet a network, bits from the host portion of the original network mask are
changed into subnet bits. The number of subnet bits defines the number of subnets.
Given each of the possible subnet masks depicted in the following binary format, how
many subnets and how many hosts are created in each example?
Hint: Remember that the number of host bits (to the power of 2) defines the number of
hosts per subnet (minus 2), and the number of subnet bits (to the power of two) defines
the number of subnets. The subnet bits (depicted in bold type face) are the bits that have
been borrowed beyond the original network mask of /24. The /24 is the slash prefix
notation and corresponds to a dotted decimal mask of 255.255.255.0.
(/25) 11111111.11111111.11111111.10000000
Dotted decimal subnet mask equivalent: ________________________________
Number of subnets? ________________, Number of hosts? ________________
(/26) 11111111.11111111.11111111.11000000
Dotted decimal subnet mask equivalent: ________________________________
Number of subnets? ________________, Number of hosts? ________________
(/27) 11111111.11111111.11111111.11100000
Dotted decimal subnet mask equivalent: ________________________________
Number of subnets? ________________ Number of hosts? ________________
(/28) 11111111.11111111.11111111.11110000
Dotted decimal subnet mask equivalent: ________________________________
Number of subnets? ________________ Number of hosts? _________________
(/29) 11111111.11111111.11111111.11111000
Dotted decimal subnet mask equivalent: ________________________________
Number of subnets? ________________ Number of hosts? _________________
(/30) 11111111.11111111.11111111.11111100
Dotted decimal subnet mask equivalent: ________________________________
Number of subnets? ________________ Number of hosts? _________________
6) Considering your answers, which subnet masks meet the required number of
minimum host addresses?
_____________________________________________________________________
7) Considering your answers, which subnet masks meets the minimum number of
subnets required?
_____________________________________________________________________
- 14 -
8) Considering your answers, which subnet mask meets both the required minimum
number of hosts and the minimum number of subnets required?
_____________________________________________________________________
9) When you have determined which subnet mask meets all of the stated network
requirements, you will derive each of the subnets starting from the original network
address. List the subnets from first to last below. Remember that the first subnet is
192.168.0.0 with the newly acquired subnet mask.
Subnet Address / Prefix Subnet Mask (dotted decimal)
___________________ / ____ __________________________
___________________ / ____ __________________________
___________________ / ____ __________________________
___________________ / ____ __________________________
___________________ / ____ __________________________
___________________ / ____ __________________________
___________________ / ____ __________________________
___________________ / ____ __________________________
___________________ / ____ __________________________
___________________ / ____ __________________________
Step 4: Complete the diagram showing where the host IP addresses will be applied.
On the following lines provided, fill in the IP addresses and subnets masks in slash prefix
notation. On the router, use the first usable address in each subnet for each of the interfaces,
Gigabit Ethernet 0/0, Gigabit Ethernet 0/1, loopback 0, and loopback 1. Fill in an IP address
for both PC-A and PC-B. Also enter this information into the Addressing Table on Page 1.
- 15 -
B. Configure the Devices in Cisco Packet Tracer
Set up the network topology and configure basic settings on the PCs and router, such as the
router Gigabit Ethernet interface IP addresses, and the PC’s IP addresses, subnet masks, and
default gateways. Refer to the Addressing Table for device names and address information.
Note: Appendix A provides configuration details for this part. However, you should attempt
to complete it prior to reviewing Appendix A.
- 16 -
________________________________________________________________________
Reflection
1. Subnetting one larger network into multiple smaller subnetworks allows for greater
flexibility and security in network design. However, what do you think some of the
drawbacks are when the subnets are limited to being the same size?
___________________________________________________________________________
2. Why do you think the gateway/router IP address is usually the first usable IP address in the
network?
___________________________________________________________________________
d. Configure both the G0/0 and G0/1 interfaces with IP addresses and subnet masks, and enable
them.
R1(config)# interface g0/0
R1(config-if)# ip address <ip address> <subnet mask>
R1(config-if)# no shutdown
R1(config-if)# interface g0/1
R1(config-if)# ip address <ip address> <subnet mask>
R1(config-if)# no shutdown
e. Loopback interfaces are created to simulate additional LANs off of router R1. Configure the
loopback interfaces with IP addresses and subnet masks. When they are created, loopback
interfaces are enabled, by default.
R1(config)# interface loopback 0
R1(config-if)# ip address <ip address> <subnet mask>
R1(config-if)# interface loopback 1
R1(config-if)# ip address <ip address> <subnet mask>
R1(config-if)# end
- 17 -
f. Save the running configuration to the startup configuration file.
R1# copy running-config startup-config
Topology
Step 1: Determine how many host addresses and subnets are available.
How many host addresses are available in a /17 network? ________
What is the total number of host addresses needed in the topology diagram? ________
How many subnets are needed in the network topology? ______
- 18 -
Can you subnet the 172.16.128.0/17 network address to support this subnet? _____
What are the two network addresses that would result from this subnetting?
_____________________
_____________________
Use the first network address for this subnet.
- 19 -
How many IP addresses are required for the next largest subnet? ______
What subnet mask can support that many host addresses?
___________________
How many total host addresses can that subnet mask support? __________
Can you subnet the remaining subnet again and still support this subnet? ______
What are the two network addresses that would result from this subnetting?
_____________________
_____________________
Use the first network address for this subnet.
- 20 -
_____________________
Use the first network address for this subnet.
HQ G0/0 16,000
HQ G0/1 8,000
- 21 -
Step 2: Complete the device interface address table.
Assign the first host address in the subnet to the Ethernet interfaces. HQ should be given the
first host address on the Serial links to BR1 and BR2. BR1 should be given the first host address
for the serial link to BR2.
S0/0/1 HQ S0/0/1
- 22 -
Step 3: Configure the interfaces on each router.
a. Assign an IP address and subnet mask to each interface using the table that you
completed in Part 2.
b. Configure an interface description for each interface.
c. Set the clocking rate on all DCE serial interfaces to 128000.
HQ(config-if)# clock rate 128000
d. Activate the interfaces.
- 23 -