Practical 3
IPv4 Addressing
Learning Objectives
Upon completion of this practical, you will be able to:
· Identify the network information from a given IPv4 address and a subnet mask
· Identify the subnet information from a given IPv4 address and a subnet mask
· Implement a subnetting scheme
· Lab Activity 1: Identify the network information from a given IP address with the subnet mask
· Lab Activity 2: identify the subnet information from a given IP address with the subnet mask
· Lab Activity 3: Implement a subnetting scheme with Packet Tracer (PT)
Lab Activity 1 – Identify Networks
Upon completion of this lab activity, you will be able to identify the network information from a given IP address with the subnet mask, including:
· Network address
· Broadcast address
· Number of Host-ID Bits
· Number of usable (or valid) hosts
· Valid IP addresses per subnet
Task 1: Identify the Network Information from a given IPv4 Address and Subnet Mask
Given an example of a host IP address of 193.2.1.9 and a subnet mask of 255.255.255.0 (/24), find out the network information listed in following table.
Network Address
Broadcast Address
Number of Host-ID Bits
Number of Usable Hosts
IP Address of First Host
IP Address of Last Host
To guide you through addressing calculation, follow the steps listed below.
Step 1: Translate the given host IPv4 address and subnet mask from the decimal representation into binary notation
IP Address
Decimal
193
2
1
9
Binary
11000001
00000010
00000001
00001001
Subnet Mask
Decimal
255
255
255
0
Binary
11111111
11111111
11111111
00000000
Step 2: Identify the network address
The network address is the address by which we refer to a network. The network address is not a valid address assigned to a host. The way we can identify the network address from a given IP address is to apply a subnet mask to the IP address. That is, the subnet mask is used to identify which part of an IP address is the Network-ID and which part of the IP address is the Host-ID. The subnet mask sets the Network-ID to 1s and the Host-ID portion to 0s.
Perform the bit-wise AND operation on the IP address and subnet mask.
Note: 1 AND 1 results in 1; 0 AND 0 or 1 results in a 0.
Express the result in both binary and decimal notations:
IP Address (in Binary):
11000001
00000010
00000001
00001001
Subnet Mask (in Binary):AND
11111111
11111111
11111111
00000000
Network Address (in Binary):
Network Address (in Decimal):
The result is the Network Address for the given host IP address.
Note: All hosts in a network have the same Network-ID.
Step 3: Determine the broadcast address
The broadcast address is used to send datagrams to all the hosts on a network. The broadcast address for an IPv4 host can be obtained by taking the host’s IP address, and set to ‘1’ any bit positions which hold a ‘0’ in the Host ID. The broadcast address cannot be assigned to a host.
1. Convert the network address into binary.
2. Set the Host-ID bits to all 1s.
3. Convert the binary address to dotted decimal notation.
Network Address (in Binary):
Broadcast Address (in Binary):
Broadcast Address (in Decimal):
Step 4: Determine the total number of useable (valid) host addresses
Each host in a network needs a unique IP address that is in the range of the network address and the broadcast address. By using the number of Host-ID bits, you can derive the total number of useable hosts for a network.
1. Determine the number bits remaining in the Host-ID portion of the IP address: ___8___.
2. Determine the total number of addresses by using the formula of:
2n – 2, where “n” is the number of bits remaining for the Host-ID portion.
28 – 2 = 256 – 2 = 254
Q1: Which two addresses are reserved and cannot be used for a valid IP address assignment?
Step 5: Determine the range of useable host addresses on the network
1. The first valid IP address is always the network address incremented by 1.
In this example, the network address is 193.2.1.0, so the first host IP address is 193.2.1.1.
2. To get the subsequent host addresses, you just increment by 1 until all the bits for Host-ID become all 1s. Then you mark the second last IP address as the last valid IP address of the network, which is 193.2.1.254 in this case. (Complete the table below using the binary notation).
Network-ID
Host-ID
IP Address
11000001
00000010
00000001
00001001
Subnet Mask
11111111
11111111
11111111
00000000
Network Address
11000001
00000010
00000001
First Host IP address
11000001
00000010
00000001
Second Host IP address
11000001
00000010
00000001
Third Host IP address
11000001
00000010
00000001
Last Host IP address
11000001
00000010
00000001
Broadcast Address
11000001
00000010
00000001
Step 6: Fill in the network information in decimal notation
Now you should be able to fill the network information in the following table.
Host IP Address
193.2.1.9
Subnet Mask
255.255.255.0 (/24)
Network Address
Broadcast Address
Number of Host-ID Bits
Number of Usable Hosts
IP Address of First Host
IP Address of Last Host
Task 2: More Exercises – Practice Makes Perfect
Calculating IP addressing requires basic mathematical skills. It may seem a bit daunting at first, but the process is relatively straightforward. The more IP addressing calculation you do, the clearer and easier it becomes. Use the same procedure from the previous task to complete the following three exercises.
Exercise 1:
Host IP Address
192.168.10.66
Subnet Mask
255.255.255.0 (/24)
Network Address
192.168.10.0
Broadcast Address
192.168.10.255
Number of Host-ID Bits
8
Number of Usable Hosts
IP Address of First Host
IP Address of Last Host
Exercise 2:
Host IP Address
172.30.1.33
Subnet Mask
255.255.0.0 (/16)
Network Address
172.30.0.0
Broadcast Address
Number of Host-ID Bits
Number of Usable Hosts
IP Address of First Host
IP Address of Last Host
Exercise 3:
Host IP Address
172.30.1.33
Subnet Mask
255.255.255.0 (/24)
Network Address
Broadcast Address
Number of Host-ID Bits
Number of Usable Hosts
IP Address of First Host
IP Address of Last Host
Lab Activity 2 – Subnetting Basics
Understanding subnetting is a very fundamental requirement for almost any IT professional. By going through this lab activity, you are able to reinforce your understanding of subnetting, and determine the subnet information for a given IPv4 address and subnet mask, including:
· Subnet-ID bits
· Number of Subnets
· Number of Host-ID bits per subnet
· Number of addresses and useable hosts per subnet
· Network address for a subnet
· Valid IP addresses per subnet
· Broadcast address for a subnet
Task 1: Identify the Number of Bits Needed to Borrow from the Left-most Host-ID Portion
Subnetting is the concept of dividing the network into smaller portions called subnets, which is done by borrowing bits from the Host-ID portion of the IP address to enable more efficient use of the network address.
Borrowing Bits
You need to identify the number of bits for Host-ID that must be borrowed from the left-most Host-ID portion to create a certain number of subnets or a certain number of hosts per subnet as listed in the following table:
2x
27
26
25
24
23
22
21
20
Number of Subnets
128
64
32
16
8
4
2
1
Number of Host-ID bits per Subnet
1
2
3
4
5
6
7
8
Number of Addresses per Subnet
N/A
4
8
16
32
64
128
256
Number of Usable Hosts per Subnet
N/A
2
6
14
30
62
126
254
Where 2x = Number of Subnets.
· The value of x denotes the number of Host-ID bits that is needed to be borrowed from the Host-ID portion.
Valid Subnet Mask Values
A subnet mask defines the boundary between the network and host addresses. Namely, a subnet mask defines which portion of an address is used to identify the network and which denotes the hosts. Subnet masks must be contiguous 1’s followed by contiguous 0’s.
Decimal
Binary
0
00000000
128
10000000
192
11000000
224
11100000
240
11110000
248
11111000
252
11111100
254
11111110
255
11111111
Task 2: Determine the Subnet Information for a given IPv4 Address and Subnet Mask
Given an example of a host IPv4 address of 193.2.1.9 and a subnet mask of 255.255.255.128 (/25), by following the steps given below find out the subnetting information listed in the following table:
Number of Subnet-ID Bits
Number of Subnets
Number of Host-ID Bits per Subnet
Number of Usable Hosts per Subnet
Network Address for this subnet
The first IP address for this Subnet
The last IP Address for this Subnet
The subnet broadcast Address
To guide you through subnet calculation, follow the steps listed below:
Step 1: Translate the given host IP address and subnet mask into binary notation
IP Address
Decimal
193
2
1
9
Binary
11000001
00000010
00000001
00001001
Subnet Mask
Decimal
255
255
255
128
Binary
11111111
11111111
11111111
10000000
Step 2: Determine the network address for the given IP address
Perform the bit-wise AND operation on the IP address and subnet mask and then express the result in both dotted binary and decimal notations.
IP Address (in Binary)
11000001
00000010
00000001
00001001
Subnet Mask (in Binary)AND
11111111
11111111
11111111
10000000
Network Address (in Binary)
Network Address (in Decimal)
The result is the Network Address for the given IP address.
Step 3: Determine the broadcast address
The Network Address has all 0s in the Host-ID portion of the address. The Broadcast Address has all 1s in the Host-ID portion of the address.
Network Address (in Binary)
Broadcast Address (in Binary)
Broadcast Address (in Decimal)
Step 4: Determine the subnet-ID
1. In this example, the default network mask is 255.255.255.0, i.e. the network mask without subnetting.
2. The Subnet-ID is where you borrow a bit from the left-most Host-ID portion.
Host-ID
Network-ID
Subnet-ID
Network Address
11000001
00000010
00000001
00000000
Subnet Mask
11111111
11111111
11111111
10000000
3. The result is the Number of Subnet-ID bits, which can be determined by simply counting the number of bits between the Network-ID and Host-ID.
Q2: How many bit(s) is/are used for the subnet-ID in the given example? 1
Q3: How many bits are used for the Host-ID bits in the given example? 7.
Step 5: Determine the number of useable IP addresses per subnet
By knowing the number of bits used for the Host-ID portion, you can figure out the number of useable hosts for each subnet.
1. How many bits are used for the Host-ID portion for each subnet: 7
2. How many useable IP address for each subnet:____________
Step 6: Determine the range of useable host addresses per subnet
1. The first usable IP address is always the network address incremented by 1. With this example, the first host IP address is 193.2.1.1.
2. Mark the second last IP address as the last valid IP address of the network, which is 193.2.1.126 in this example.
Network-ID
Subnet-ID & Host-ID
IP Address
11000001
00000010
00000001
00001001
Subnet Mask
11111111
11111111
11111111
10000000
Network Address
11000001
00000010
00000001
00000000
First Host IP address
11000001
00000010
00000001
00000001
Second Host IP address
11000001
00000010
00000001
00000010
Third Host IP address
11000001
00000010
00000001
00000011
Last Host IP address
11000001
00000010
00000001
01111110
Broadcast Address
11000001
00000010
00000001
01111111
Step 7: Fill in the network information in decimal notation
Fill the network information in the following table
Number of Subnet-ID Bits
Number of Subnets
Number of Host-ID Bits per Subnet
Number of Usable Hosts per Subnet
Network Address for this IP Address
The first IP Address in a subnet
IP Address of Last Host on this Subnet
The Subnet Broadcast address
Task 3: Another Subnetting Exercise
Follow the same steps from Task 2 to find out the subnet information for another subnetting exercise. Given a host IP address of 193.2.1.225 and a subnet mask of 255.255.255.128 (/25).
Find out the subnetting information listed in the following table:
Number of Subnet-ID Bits
1
Number of Subnets
2
Number of Host-ID Bits per Subnet
7
Number of Usable Hosts per Subnet
126
Network Address for this subnet
193.2.1.128
The first IP address for this Subnet
1
The last IP Address for this Subnet
254
The subnet broadcast Address
255
Task 4: List out the Subnet Information
A given class C network 193.2.1.0/24 has been divided into two subnets by borrowing 1 Host-ID bit from the left-most Host-ID portion.
Use the following table to list out the subnet information in decimal notation:
Subnet
Network Address
Subnet Mask
Slash Notation
First Usable
IP Address
Last Usable
IP Address
Broadcast Address
1
2
Lab Activity 3
In this activity, you will design and apply an IP addressing scheme for a given scenario shown in the topology diagram, and then implement the IP addressing scheme with Packet Tracer.
Activity Objectives:
· Subnet the address space
· Configure IP addresses
TOPOLOGY DIAGRAM
Figure 1 Network Topology
IFN507 Network Systems P3: IP Addressing
Page 18 of 18
Addressing Table 1
Device
Interface
IP Address
Subnet Mask
Default Gateway
R1
S0/0/0
200.0.0.2
255.255.255.0
N/A
R2
S0/0/0
200.0.0.1
255.255.255.0
N/A
Gi0/0
N/A
Gi1/0
N/A
PC1
NIC
PC2
NIC
Task 1: Subnet the Address Space
ABC company has been given the 193.64.33.0/24 address space. You are employed to restructure ABC’s network and would need to set up an addressing scheme that can accommodate for the Internet access and data sharing between the two branches. Each branch needs to be on a separate network (subnet).
· Branch A’s network (LAN1) would house 120 devices.
· Branch B’s network (LAN2) would house 100 devices.
Consider the following questions when creating your network design:
Q1: How many subnets are needed for ABC local area network? _______.
Q2: What is the subnet mask used for this addressing scheme in dotted-decimal notation? _______________.
Q3: What is the subnet mask used for this addressing scheme in slash notation? ________.
Q4: What is the maximum number of usable IP addresses per subnet? _______.
Use the following table to list out the subnet information in decimal notation:
Subnet
Network Address
Subnet Mask
Slash Notation
First Usable
IP Address
Last Usable
IP Address
Broadcast Address
1
2
Task 2: Assign IP Addresses
1. IP addressing requirements for company ABC:
· Assign the first usable IP address of the first subnet to the LAN1 interface.
· Assign the last usable IP address of the first subnet to PC1.
· Assign the first usable IP address of the second subnet to the LAN2 interface.
· Assign the last usable IP address from the second subnet to PC2.
2. Fill in Addressing Table 1 with IP addressing information based on the IP address requirements mentioned above.
Task 3: Build a Network Topology
Using Cisco Packet Tracer, build the network topology shown in Figure 1.
Task 4: Perform Basic Configurations on Routers R1 and R2
Note: It is optional to use the command line configuration. It is perfectly fine to just use the GUI when configuring the routers
!Configurations on R1
Router>enable
Router#config terminal
Router(config)#hostname R1
R1(config)#no ip domain-lookup
R1(config)#
!Configurations on R2
Task 5: Configuring IP Addresses
Use the information from Addressing Table 1 to assign IP addresses to the routers and PCs.
!Configurations on R1
R1(config)#int s0/0/0
R1(config-if)#ip add 200.0.0.2 255.255.255.0
R1(config-if)#no sh
R1(config-if)#
!Configurations on R2
Task 6: Verify Connectivity
Step 1: Test connectivity between directly connected devices
· From router ISP, can you ping ABC successfully? Yes / No
· From PC1, can you ping its default gateway successfully? Yes / No
· From PC2, can you ping its default gateway successfully? Yes / No
If you cannot ping successfully at any points, verify the following:
1. Check the cable connection. Have you used the correct Ethernet cables for network connections?
2. Check the router interfaces. Are all relevant interfaces on each router activated?
3. Check your IP address configuration. Is your IP address configuration consistent with the Topology Diagram and Addressing Table?
4. Check the subnet information. Is your subnetting scheme calculated correctly?
Step 2: Test connectivity between devices that are NOT on the same network
· From PC1, can you ping PC2 successfully? Yes / No
· From router ISP, can you ping PC1 and PC2 successfully? Yes / No
Is there a rationale why you cannot ping successfully at any points?
End of Practical 3