Lab 10 ICMP

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 8

Data Communication and Network

(EL-2007)
LABORATORY MANUAL
Fall 2024

(LAB# 10)
ICMP
Dr. Aamer Hafeez

Student Name: ____Abdurrehman Mehmood_____

Roll No: _______i22-9878______

Date: _____________________

DCN LAB NUCES, ISLAMABAD Page 1 of 8


_______________________________

LAB ENGINEER SIGNATURE & DATE

MARKS AWARDED: /10

Objective
Understand the working of the ICMP protocol

TCP/IP protocol stack

Internet Control Message Protocol Version 4


(ICMPv4)
The Internet Control Message Protocol (ICMP) is a network layer protocol used by network
devices to diagnose network communication issues. ICMP is mainly used to determine whether
or not data is reaching its intended destination in a timely manner. Commonly, the ICMP
protocol is used on network devices, such as routers.

DCN LAB NUCES, ISLAMABAD Page 2 of 8


ICMP itself is a network layer protocol. However, its messages are not passed directly to the data
link layer as would be expected. Instead, the messages are first encapsulated inside IP datagrams
before going to the lower layer ICMP messages are divided into two broad categories: error-
reporting messages and query messages.

Types of ICMP messages

ICMP messages are divided into two broad categories:

● error-reporting messages: The error-reporting messages report problems that a router or a


host (destination) may encounter when it processes an IP packet.
● query messages: The query messages, which occur in pairs, help a host or a network
manager get specific information from a router or another host.

ICMP header

An ICMP message has an 8-byte header and a variable-size data section. Although the general
format of the header is different for each message type, the first 4 bytes are common to all.

DCN LAB NUCES, ISLAMABAD Page 3 of 8


Type 8&0: Echo Request and Reply

The echo-request and echo-reply messages are designed for diagnostic purposes. Network
managers and users utilize this pair of messages to identify network problems. The combination
of echo-request and echo-reply messages determines whether two systems (hosts or routers) can
communicate with each other.

A host or router can send an echo-request message to another host or router. The host or router
that receives an echo-request message creates an echo-reply message and returns it to the original
sender.

Task01: Ping two computers, and use Wireshark to capture the ICMP request n reply packets.
Select any request and its reply packet, and write down its header contents.

Type 11: Time Exceeded

Whenever a router decrements a datagram with a time-to-live value to zero, it discards the
datagram and sends a time-exceeded message to the original source. Such Error message fills the
payload of the ICMP with the discarded packet, for which this error message is being generated.

DCN LAB NUCES, ISLAMABAD Page 4 of 8


To see the time exceeded messages, we can create a complex PDU with small TTL, so that the
TTL becomes 0 before reaching to its destination. The router at which the TTL becomes 0, will
not forward the packet, rather send a time exceeded ICMP message to the sender of this message.

Task02: Create or use an existing network in packet tracer with more than 2 routers, and send a
complex PDU with a TTL small enough resulting in the Time exceeded error message. Take
screenshots of such scenario along with the packet contents.

tracert command

tracert command employs this technique of TTL to disover the routers in a route.

Example of a tracert command is given below

DCN LAB NUCES, ISLAMABAD Page 5 of 8


This command sends out the ping packet to the pinged destination, but reduces its TTL, so that
the packet gets discarded at some router, and the router will send us an ICMP error message,
which we will capture through the wireshark.

Tracert sends a series of ICMP echo requests, and the request’s TTL increased by 1 each time.
This allows the utility to display the routers through which packets are passing to be identified

Capturing tracert packets

To see the time exceeded messages, we can run the wireshark, and then use the trace route
command to see the route of a packet from the source to the destination.

Following is a screenshot of the captured packets for the above command.

DCN LAB NUCES, ISLAMABAD Page 6 of 8


Task03: Find out all the error packets, and compare them with the tracert command result. Check
if the error message senders are the same as shown the tracert command result.

Task04: Check out the contents of a time exceed message, especially the payload of icmp header

DCN LAB NUCES, ISLAMABAD Page 7 of 8


DCN LAB NUCES, ISLAMABAD Page 8 of 8

You might also like