7.1.2.9 Lab - Converting IPv4 Addresses To Binary
7.1.2.9 Lab - Converting IPv4 Addresses To Binary
7.1.2.9 Lab - Converting IPv4 Addresses To Binary
Objectives
Part 1: Convert IPv4 Addresses from Dotted Decimal
to Binary
Part 2: Use Bitwise ANDing Operation to Determine
Network Addresses Part 3: Apply Network Address
Calculations
Background / Scenario
Every IPv4 address is comprised of two parts: a network portion and a host
portion. 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.
To understand the operation of devices on a network, we need to look at
addresses the way devices doin binary notation. To do this, we must convert
the dotted decimal form of an IP address and its subnet mask to binary
notation. After this has been done, we can use the bitwise ANDing operation to
determine the network address.
This lab provides instructions on how to determine the network and host portion
of IP addresses by converting addresses and subnet masks from dotted decimal
to binary, and then using the bitwise ANDing operation. You will then apply this
information to identify addresses in the network.
Part 1: Convert IPv4 Addresses from Dotted Decimal to Binary
In Part 1, you will convert decimal numbers to their binary equivalent. After you
have mastered this activity, you will convert IPv4 addresses and subnet masks
from dotted decimal to their binary form.
Step 1: Convert decimal numbers to their binary equivalent.
Fill in the following table by converting the decimal number to an 8-bit binary
number. The first number has been completed for your reference. Recall that
Page 1 of 6
the eight binary bit values in an octet are based on the powers of 2, and from
left to right are 128, 64, 32, 16, 8, 4, 2, and 1.
Decimal
Binary
192
1100 0000
168
1010 1000
10
0000 1010
255
1111 1111
2
0000 0010
Step 2: Convert the IPv4 addresses to their binary equivalent.
An IPv4 address can be converted using the same technique you used above.
Fill in the table below with the binary equivalent of the addresses provided. To
make your answers easier to read, separate the binary octets with a period.
. All rights reserved. This document is Cisco Public.
Decimal
Binary
192.168.10.1
11000000.10101000.00001010.0000101
0
209.165.200.
229
172.16.18.18
3
10.86.252.17
0
11010001.10100101.11001000.1110010
1
10101100.00010000.00010010.1011011
1
00001010.01010110.11111100.0001000
1
255.255.255.
128
255.255.192.
11111111.11111111.11111111.1000000
0
11111111.11111111.11000000.0000000
0
0
Part 2: Use Bitwise ANDing Operation to Determine Network Addresses
In Part 2, you will use the bitwise ANDing operation to calculate the network
address for the provided host addresses. You will first need to convert an IPv4
decimal address and subnet mask to their binary equivalent. Once you have the
binary form of the network address, convert it to its decimal form.
Note: The ANDing process compares the binary value in each bit position of the
32-bit host IP with the corresponding position in the 32-bit subnet mask. If there
2015 Cisco and/or its affiliates. All rights reserved. This document is Cisco Public.
Page 2 of 6
two 0s or a 0 and a 1, the ANDing result is 0. If there are two 1s, the result is a
1, as shown in the example here.
Step 1: Determine the number of bits to use to calculate the network
address.
Description
Decimal
Binary
IP Address
192.168.10.13
11000000.10101000.00001010.100
00011
255.255.255.1
11111111.11111111.11111111.110
92
00000
Network
192.168.10.12
11000000.10101000.00001010.100
Address
00000
Subnet Mask
How do you determine what bits to use to calculate the network address?
AND result between the ip address and subnet mask
In the example above, how many bits are used to calculate the network
address?
25 bits
Step 2: Use the ANDing operation to determine the network address.
a. Enter the missing information into the table below:
Description
Decimal
IP Address
172.16.145.29
Binary
10101100.00010000.10010001.0001110
1
Subnet Mask
255.255.0.0
11111111.11111111.00000000.0000000
0
Network
172.16.0.0
10101100.00010000.00000000.0000000
Address
0
b. Enter the missing information into the table below:
Description
Decimal
IP Address
192.168.10.10
Binary
11000000.10101000.00001010.0000101
0
Subnet Mask
255.255.255.0
11111111.11111111.11111111.0000000
0
2015 Cisco and/or its affiliates. All rights reserved. This document is Cisco Public.
Page 3 of 6
Network
192.168.10.0
11000000.10101000.00001010.0000000
Address
0
c. Enter the missing information into the table below:
Description
Decimal
Binary
IP Address
192.168.68.210
11000000.10101000.1000100.11010010
Subnet Mask
255.255.255.12
11000000.10101000.1000100.10000000
8
Network
192.168.68.128
11000000.10101000.1000100.10000000
Address
d. Enter the missing information into the table below:
Description
Decimal
IP Address
172.16.188.15
Binary
10101100.00010000.10111100.000011
11
Subnet Mask
255.255.240.0
11111111.11111111.11110000.000000
00
Network
172.16.175.0
10101100.00010000.10110000.000000
Address
00
e. Enter the missing information into the table below:
Description
Decimal
IP Address
10.172.2.8
Binary
00000101.10101100.00000001.000001
00
Subnet Mask
255.224.0.0
11111111.11100000.00000000.000000
00
Network
10.160.0.0
00000101.10100000.00000000.000000
Address
00
Part 3: Apply Network Address Calculations
In Part 3, you must calculate the network address for the given IP addresses and
subnet masks. After you have the network address, you should be able to
determine the responses needed to complete the lab.
Step 1: Determine whether IP addresses are on same network.
2015 Cisco and/or its affiliates. All rights reserved. This document is Cisco Public.
Page 4 of 6
a. You are configuring two PCs for your network. PC-A is given an IP address of
192.168.1.18, and PC-B is given an IP address of 192.168.1.33. Both PCs receive
a subnet mask of 255.255.255.240.
What is the network address for PC-A? 192.168.1.18
What is the network address for PC-B? 192.168.1.33
Will these PCs be able to communicate directly with each other? Yes
What is the highest address that can be given to PC-B that allows it to be on
the same network as PC-A? 192.168.1.254
b. You are configuring two PCs for your network. PC-A is given an IP address of
10.0.0.16, and PC-B is given an IP address of 10.1.14.68. Both PCs receive a
subnet mask of 255.254.0.0.
What is the network address for PC-A? 10.0.0.0
What is the network address for PC-B? 10.0.0.0
Will these PCs be able to communicate directly with each other? Yes
What is the lowest address that can be given to PC-B that allows it to be on
the same network as PC-A? 10.0.0.1
Step 2: Identify the default gateway address.
a. Your company has a policy to use the first IP address in a network as the default
gateway address. A host on the local-area network (LAN) has an IP address of
172.16.140.24 and a subnet mask of 255.255.192.0.
What is the network address for this network? 172.16.128.0
Page 5 of 6
2015 Cisco and/or its affiliates. All rights reserved. This document is Cisco Public.
Page 6 of 6