Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What data is included in ICMP (ping) request?

Tags:

ping

icmp

I know the ICMP request contains the IP address. Is the client MAC address included in an ICMP request? What other info (if any) is included in a ping request?

like image 280
exvance Avatar asked Oct 23 '13 20:10

exvance


People also ask

What is the data used in the ping request?

Ping uses the Internet Control Message Protocol (ICMP) Echo function which is detailed in RFC 792. A small packet is sent through the network to a particular IP address. This packet contains 64 bytes - 56 data bytes and 8 bytes of protocol reader information.

What are ICMP ping requests?

ICMP (Internet Control Message Protocol) is an error-reporting protocol that network devices such as routers use to generate error messages to the source IP address when network problems prevent delivery of IP packets.

Does ICMP include ping?

ICMP is probably most well known as the message protocol used for the ping command. A ping command sends an ICMP echo request to the target host. The target host responds with an echo reply.


2 Answers

An ICMP request is a layered packet which is sent over the internet. It contains the Ether layer, which has the target and source MAC address in it. It also contains the IP layer, which has the source and target IP and also a couple of flags included. And at last it contains the ICMP data. This contains a type, a subtype, then a checksum and the rest of the header, which can vary from type and subtype (E.g. The code for echo is 8 and reply is 0).

There is a lot of information in a network packet. Also note that ICMP is an part of the IPv4 protocol, so it cannot officially be carried by other protocols. Although the IP protocol can be carried on a different protocol than the ethernet protocol.

The MAC address will be changed after each passing of a router. So this is never the MAC address of the source IP address on the internet. But the IP address is definitely included and on a local network, the mac address of the client is still in the packet in the Ether layer.

Wikipedia has some readable article about ICMP packets: icmp message and different protocols with readable diagrams.

If you want to see some live requests, you can install wireshark, which will show and dissect all network traffic for you. It is a very convenient and cool tool.

like image 44
Edgar Klerks Avatar answered Sep 20 '22 00:09

Edgar Klerks


The ICMP 'ping' packet, officially known as 'echo request', contains whatever the originating ping executable wants to have echoed back to it. In the Bad Old Days when the internet was first getting started up, the routers they had (and all computers, really) were subject to random memory failures. In order to detect that the path between two systems was clear, they would send echo request packets and compare the contents of the request with the reply. If the contents differed, they knew that there was a problem with either of the machines involved, or the routers in between.

It's impossible to state here categorically exactly what's in any given ping packet because it changes between implementations of ping.

like image 124
sjcaged Avatar answered Sep 21 '22 00:09

sjcaged