Skip to content
BENIBIX Learn

ping

Infrastructure🌐 NetworkingNetwork Performance

Also known as Ping Command, Ping Test, ICMP Echo

A command that checks if a machine answers. It shows how long the answer takes.

Think of it like

It is like yelling into a cave. You wait for the echo and count.

Example

Emma's site feels slow. She pings the server and sees 180 ms each time, when it is most often 20 ms.

Why it matters

It is the first test when something seems down. It tells you if the path to a machine works at all.

Definition

Ping is a command that checks if another machine can be reached. It sends a small packet called an echo request. The other machine sends back an echo reply. Ping shows how many milliseconds each round trip took. No reply can mean the machine is down, or that a firewall blocks ping.

Example code

console
$ ping -c 3 203.0.113.10
64 bytes from 203.0.113.10: icmp_seq=1 ttl=54 time=21.4 ms
64 bytes from 203.0.113.10: icmp_seq=2 ttl=54 time=20.9 ms
64 bytes from 203.0.113.10: icmp_seq=3 ttl=54 time=22.1 ms
3 packets transmitted, 3 received, 0% packet loss, time 2003ms
Three echo requests and three replies. Each line shows the round trip in milliseconds.
One echo request out, one echo reply back. The time between them is the round trip.

Common mistake

Deciding a server is down because ping gets no reply. Many servers block ping on purpose and still serve web pages.

Key takeaways

  1. 1
    Echo and reply. One small packet out, one back.
  2. 2
    Round-trip time. Shown in milliseconds.
  3. 3
    Silence is unclear. Down, or just blocking ping.

Learn it properly