Packet Filter Analysis for ICMP in Wireshark

29/12/2020
Chưa phân loại

What is ICMP ?

ICMP or Internet Control Message Protocol is Internet or Network layer protocol. In general it is used to check the reachability of a host or router in a network.

Who uses ICMP?

Ping or traceroute uses ICMP as inner protocol. Ping uses ICMP echo request and ICMP echo reply messages to check whether destination host is reachable or not.

Types of ICMP packet?

In general two types of ICMP packet

  1. ICMP echo request messages.
  2. ICMP echo reply messages.

How to get ICMP packet in Wireshark?

Step1: We can use ping tool to get ICMP request and reply.

Step2: Open command line or terminal in Windows or Linux respectively.

Step3: Run Wireshark.

Step4: Run below command

ping www.google.com

Make sure you have internet connection or ping will be failedJ. Here is the snapshot for successful ping to Google. We can see 0% loss. That means ICMP request packets = ICMP reply packets.

Here are the more details:

In this case we ping to Google web site. Instead we can do ping to ip address also.

OR

ping 192.168.1.1 [This is my router IP address]

Here is successful ping to my router

Step5: Stop Wireshark and put “ICMP” as filter in Wireshark.

Analysis on ICMP:

Let’s check what happens in Wireshark when we ping to Google or 192.168.1.1.

Here is the ICMP request and reply packets for Google ping.

Note: We have to put filter ‘icmp’ as we are interested only in ICMP packets.

Number of ICMP request: From capture we can see there are 4 ICMP request packets.

Check the marked packets.

Number of ICMP reply: From capture we can see there are 4 ICMP reply packets.

Check the marked packets.

ICMP Request:

Now select ICMP request packet in Wireshark and look into IPv4 layer.

As this is ICMP request packet so we can see source IP as my system IP address and destination IP as Google’s one IP address. Also IP layer mentioned the protocol as ICMP.

Here is the screenshot

Now for the same packet select ICMP part in Wireshark.

We can see below important fields:

Type: 8 [Means its ICMP request]
Code: 0 [Always 0 for ICMP packets]
Identifier (BE): 1
Identifier (LE): 256
Sequence Number (BE): 6
Sequence Number (LE): 1536
*BE –> Big Endian
*LE –> Little Endian
Data –> Data present in ICMP packet.

Here is the screenshot

ICMP Reply:

Now select ICMP reply packet in Wireshark and look into IPv4 layer.

As this is ICMP reply packet so we can see destination IP as my system IP address and source IP as Google’s one IP address. Also IP layer      mentioned the protocol as ICMP.

Here is the screenshot

Now for the same packet select ICMP part in Wireshark.

We can see below important fields:

Type: 0 [Means its ICMP reply]
Code: 0 [Always 0 for ICMP packets]
Identifier (BE): 1
Identifier (LE): 256
Sequence Number (BE): 6
Sequence Number (LE): 1536
*BE –> Big Endian
*LE –> Little Endian
Data –> Data present in ICMP packet.

Here is the screenshot

Now let’s see ICMP request and ICMP reply side by side in a picture.

*Red means it’s different

*Green means it’s same.

Special observation:

Let’s look into the Identification field inside IPv4 .We will see something interesting.

What happens if IP address is not reqachable:

Let’s ping some ip address which is not accessible. So we will see below output.

Here is the snapshot for Wireshark

That means we did not receive any ICMP reply for any ICMP request.

Simple Conclusion:

So if we want to check any IP or website is reachable or not, we can use ping or traceroute which internally use ICMP protocol.

Quick Reference:

If interested to know other types of ICMP, follow below link

https://en.wikipedia.org/wiki/Internet_Control_Message_Protocol

ONET IDC thành lập vào năm 2012, là công ty chuyên nghiệp tại Việt Nam trong lĩnh vực cung cấp dịch vụ Hosting, VPS, máy chủ vật lý, dịch vụ Firewall Anti DDoS, SSL… Với 10 năm xây dựng và phát triển, ứng dụng nhiều công nghệ hiện đại, ONET IDC đã giúp hàng ngàn khách hàng tin tưởng lựa chọn, mang lại sự ổn định tuyệt đối cho website của khách hàng để thúc đẩy việc kinh doanh đạt được hiệu quả và thành công.
Bài viết liên quan

Linux Phone, Librem 5

How often do we hear of phones that offer digital privacy and security? Librem 5 is a Linux powered smartphone that is...
29/12/2020

How to Setup an FTP Server with vsftpd on CentOS 7

vsftpd is an open source and lightweight FTP server solution. It is very fast, secure and stable. The configuration of...
29/12/2020

Install latest uGet – Download Manager for Linux

uGet is the number #1 download manager application for the Linux platform. In addition, The app is simple, lightweight and...
28/12/2020
Bài Viết

Bài Viết Mới Cập Nhật

Hướng Dẫn Chọn Dịch Vụ Thuê Địa Chỉ IPv4
10/03/2025

Reliable IPv4 and IPv6 Subnet Rental Services: The Perfect Solution for Global Businesses
23/12/2024

Tìm Hiểu Về Thuê Proxy US – Lợi Ích và Cách Sử Dụng Hiệu Quả
11/12/2024

Mua Proxy V6 Nuôi Facebook Spam Hiệu Quả Tại Onetcomvn
03/06/2024

Hướng dẫn cách sử dụng ProxyDroid để duyệt web ẩn danh
03/06/2024