0% found this document useful (0 votes)
16 views

DCN Lab - 05 - IP Addressing and ARP

Uploaded by

i222153
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
16 views

DCN Lab - 05 - IP Addressing and ARP

Uploaded by

i222153
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 10

Data Communication and Network

(EL-2007)
LABORATORY MANUAL
Fall 2024

(LAB# 05)
IP Addressing and ARP
Dr. Aamer Hafeez

Student Name: Abdullah Ali

Roll No: 22i-2153

Date: 18-9-2024

_______________________________
LAB ENGINEER SIGNATURE & DATE

MARKS AWARDED: /10

DCN LAB NUCES, ISLAMABAD Page 1 of 10


Objectives

• Define what the Internetwork is.


• Define why we need IP addresses
• Experience how the ARP works

InterNetwork

An internetwork is any collection of computer networks connected. The Internet is an example of


internetwork, where tens of thousands of networks are connected worldwide. The number of
devices connected to the internet will reach 38.6 billion by the end of 2025, according to research
from Strategy Analytics (https://www.helpnetsecurity.com/2019/05/23/connected-devices-
growth/).

The above figure shows various networks are connected, where each network is represented with
a cloud symbol. Cloud symbol is used to represent any kind of computer network.

Task 01: Search for any diagram for internetwork, paste that below, and write a few lines
describing the diagram.

DCN LAB NUCES, ISLAMABAD Page 2 of 10


This diagram represents a logical network layout showing how different network devices and
components are interconnected.

• The network starts from the Internet connected to a firewall that secures the network from
external threats.

• The firewall is linked to a router which manages traffic within the local network.

• The router connects to a server and two network switches that distribute connections to
multiple networked computers.

• One branch of the network goes through another firewall, connected to a wireless access
point that provides wireless connectivity for two laptops.

• The network switches further extend the wired connections to other networked
computers.

IP Addresses:

DCN LAB NUCES, ISLAMABAD Page 3 of 10


Each device on a computer network needs an address to uniquely define it, just like every phone
has a unique number assigned to it. In computers, there are MAC addresses that are assigned to
devices by the manufacturer in a way that every device gets a unique MAC address.

When we are dealing with a very large internetwork like the Internet where there are billions of
devices, then it becomes impossible to keep track of every computer on the network. To solve this
issue, a new addressing scheme was needed. IP addressing was then designed and implemented to
solve this issue.

There are two types of IP addresses, IPv4 and IPv6. We are only talking about IPv4 here, except
mentioned otherwise.

IPv4 addresses are 32-bit long.

To make the IPv4 address more compact and easier to read, an IPv4 address is usually written in
decimal form with a decimal point (dot) separating the bytes. This format is referred to as dotted-
decimal notation.

Task 02: Write the IP address of your computer and its binary. Find another computer on
the same network, and write down its IP address both in dotted decimal notation and in
binary.

IPv4 Address. . . . . . . . . . . : 172.16.51.239

In binary:

• 172 in binary: 10101100

• 16 in binary: 00010000

• 51 in binary: 00110011

• 239 in binary: 11101111

So, the full binary form of 172.16.51.239 is: 10101100.00010000.00110011.11101111

DCN LAB NUCES, ISLAMABAD Page 4 of 10


ping 172.16.59.139

Pinging 172.16.59.139 with 32 bytes of data:

Reply from 172.16.59.139: bytes=32 time=5ms TTL=128

Reply from 172.16.59.139: bytes=32 time=8ms TTL=128

Reply from 172.16.59.139: bytes=32 time=5ms TTL=128

Reply from 172.16.59.139: bytes=32 time=7ms TTL=128

Ping statistics for 172.16.59.139:

Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),

Approximate round trip times in milli-seconds:

Minimum = 5ms, Maximum = 8ms, Average = 6ms

In Binary:

172.16.59.139 in binary is 10101100.00010000.00111011.10001011

Hierarchy in IP addressing:

As discussed above IP was introduced because it's impossible to keep track of every computer in
the world. So in IP addressing, a hierarchy was introduced to solve this issue. There is a two-level
hierarchy in the IP addresses. IP address is divided into two parts, NetId and HostId.

NetworkID: Computers in the same network have the same NetworkID, but different HostID. Due
to this hierarchy, the internet has just to know where each network is located instead of where each
computer is located. Thus instead of dealing with billions of entries, now we have to deal with
only thousands of entries.

DCN LAB NUCES, ISLAMABAD Page 5 of 10


Task 2: What is the network ID of the network you are connected to?

Once the packet arrives in the destination network, finding the destination computer is easy to
accomplish.

IPv4 Address. . . . . . . . . . . : 172.16.51.239

IP address: 172.16.51.239 in binary: 10101100.00010000.00110011.11101111

Subnet Mask . . . . . . . . . . . : 255.255.240.0

Subnet mask: 255.255.0.0 in binary: 11111111.11111111.00000000.00000000

For network ID, perform bitwise AND operation

10101100.00010000.00110011.11101111 (IP address)

AND

11111111.11111111.00000000.00000000 (Subnet mask)

10101100.00010000.00000000.00000000 (Network ID)

The network ID is 172.16.0.0

NetID and HostID have variable lengths depending on the size of the network.

DCN LAB NUCES, ISLAMABAD Page 6 of 10


SubnetMask:
A subnet mask is a 32-bit number created by setting host bits to all 0s and setting network bits to
all 1s. In this way, the subnet mask separates the IP address into the network and host addresses.

Class A, B, and C networks have default subnet masks:

• Class A: 255.0.0.0
• Class B: 255.255.0.0
• Class C: 255.255.255.0

Finding out the NetworkID given an IP address and its subnet mask

Task 03: Find out the IP address and its subnet mask on your computer. And then find the
netID. Check out two more computers near you, and do the same. Fill the table below with
this information.

IP address Subnet Mask NetworkID


172.16.51.239 255.255.240.0 172.16.48.0
172.16.22.215 255.255.255.0 172.16.22.0
172.16.59.139 255.255.240.0 172.16.48.0

DCN LAB NUCES, ISLAMABAD Page 7 of 10


Range of IP Addresses:

The length of HostID determines the range of IP addresses. If there are 4 bits in the HostID, then
the maximum IP addresses that can be generated are 16. In general, 2n is the maximum number of
IP addresses that can be generated with n bits.

Task 04: Find the range of IP addresses for the following neworkID
NetID/SubnetMask Range of IP addresses
180.8.0.0 / 255.255.0.0 180.8.0.1 – 180.8.255.254
210.74.16.0 / 255.255.255.0 210.74.16.1 – 210.74.16.254
190.45.128.0 / 255.255.128.0 190.45.128.1 – 190.45.255.254

Task 05: Find out the range of IP addresses for the netID of your computer.

IP address: 172.16.51.239
Subnet mask: 255.255.240.0
Network ID: 172.16.48.0
The subnet mask 255.255.240.0 means that the first 20 bits are used to identify the network, and
the remaining 12 bits are used for hosts (devices) within that network.
Now 212 = 4096 IP addresses
For broadcast address invert the subnet mask(i.e 11000000.10101000.00000001.00000000) and
then Perform a bitwise OR operation between the network address and the invert subnet mask.
10101100.00010000.00110000.00000000
OR
00000000.00000000.00001111.11111111
10101100.00010000.00111111.11111111
So, the result in decimal is 172.16.63.255.
Broadcast Address: 172.16.63.255
The first usable IP address is the network address plus one.
So First usable IP: 172.16.48.1
The last usable IP is the broadcast address minus one.
So Last usable IP: 172.16.63.254
So, the range of usable IP addresses on your network is: 172.16.48.1 – 172.16.63.254

DCN LAB NUCES, ISLAMABAD Page 8 of 10


Task 06: Create two networks each with 4 computers and a switch using Packet Tracer.
Connect the two networks with a router as shown below.

Select networkIDs for the two networks, and assign the IP addresses to the computers.

Write down the networkIDs

NetworkID: 192.168.1.0 NetworkID: 192.168.2.0

The list below the IP addresses for each computer.

For network ID 192.168.1.0;

PC0: 192.168.1.2, PC1: 192.168.1.3, PC2: 192.168.1.4, PC3: 192.168.1.5

For network ID 192.168.2.0;

PC0: 192.168.2.2, PC1: 192.168.2.3, PC2: 192.168.2.4, PC3: 192.168.2.5

You also need to add a gateway address in each computer, as it is necessary where multiple
networks are connected.

Gateway: 192.168.1.1 Gateway: 192.168.2.1

DCN LAB NUCES, ISLAMABAD Page 9 of 10


Router configuration: The Router will be assigned multiple IP addresses depending on the
number of connections it has. In the above scenario, two IP addresses are needed.

After configuring the router as explained above, you need to check connectivity by pinging a
computer on the other network.

Task 07: Send a packet from a computer in one network to a computer in the other network
using Packet Tracer. Note down all the source and dest MAC and IP addresses in the packet
at each leg of the transmission, i.e

Src MAC Dst MAC Src IP Dst IP


PC to switch, AA:AA:AA:AA:01 AA:AA:AA:AA 192.168.1.2 192.168.2.3
switch to router, AA:AA:AA:AA:01 AA:AA:AA:AA 192.168.1.2 192.168.2.3
router to switch, BB:BB:BB:BB BB:BB:BB:BB:05 192.168.1.2 192.168.2.3
switch to dest BB:BB:BB:BB BB:BB:BB:BB:05 192.168.1.2 192.168.2.3
PC

DCN LAB NUCES, ISLAMABAD Page 10 of 10

You might also like