Open In App

How ping commands work?

Last Updated : 16 Apr, 2024
Improve
Improve
Like Article
Like
Save
Share
Report

Answer: Ping is a network utility Command which helps to measure the round-trip time for messages sent to that host, and tests whether another computer or device on a network can be reached. In its operations, it makes use of Internet Control Message Protocol (ICMP) to send “echo request” packets aiming at hosts likewise listening for “echo reply” packets.

How Ping Command Works?

  1. ICMP Echo Request: As you run ping command with an IP address in mind or domain name, the ICMP ‘echo request’ packets are sent by your computer to the target host.
  2. ICMP Echo Reply: After requesting, ping waits for the ICMP ‘echo reply’ packets from the target host.
  3. Time Measurement: Compute time taken by echo response from intended target host. Helps in calculate the Round Trip Time (RTT). This is more often represented as latency between your PC and target host.
  4. Show Result: Each packet sent is displayed by ping command indicating how long it took to get back a reply and whether any got lost. The packet loss rate might also be given as well as average, minimum and maximum RTTs.
  5. Timeout: If a packet takes too long to be replied to or is lost, it will be marked as a timeout or lost packet.

On your operating system you can adjust ping command by adding some options that will help you specify things like the number of packets that must be sent, packet’s size, timeout duration and many others.


Like Article
Suggest improvement
Previous
Next
Share your thoughts in the comments

Similar Reads