0

Ping Output:

$ ping 192.168.20.36
PING 192.168.20.36 (192.168.20.36) 56(84) bytes of data.
64 bytes from 192.168.20.36: icmp_req=1 ttl=64 time=0.165 ms
64 bytes from 192.168.20.36: icmp_req=2 ttl=64 time=0.164 ms
^C
--- 192.168.20.36 ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 999ms
rtt min/avg/max/mdev = 0.164/0.164/0.165/0.012 ms
$ 

While we ping to a particular remote host, the ICMP echo-request is sent to that host and echo-replay is arrived if the host is available. In source if we execute the command, the RAW socket is created, and using that ping program send the packet. Here, the destination IP is 192.168.20.36. But, what is the destination port no. For ping, there should be a reserved port no. Without this, how the remote user able to send the echo-request to the remote host.

So, what is the port used by the ping program ? And what is the name of the program which runs in our system to handle ping echo-request ?

  • Ping doesn't use ports. See What handles ping in linux? – DavidPostill Apr 13 '16 at 12:31
  • @DavidPostill You pointed to a good post, but be careful not to confuse mrg, he might be led to believe that this is peculiar to Linux, while it is independent of OS. – MariusMatutiae Apr 13 '16 at 17:38
1

Ping command send an ICMP packet.

ICMP protocol is a layer 3 protocol and does not use TCP or UDP (from layer 4) ports mechanism.

You can check the protocole definition here : https://tools.ietf.org/html/rfc792

  • So, we are not able to capture those packets. Is it right? – mrg Apr 13 '16 at 12:40
  • Ports are used by TCP and UDP protocols. Many other protocols exist and are used for networking. This is why tools like Wireshark or other capture tools are able to listen to many protocols, including ICMP. ICMP packets are like IP packets with slightly different headers. – nex84 Apr 13 '16 at 12:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.