# ping

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

**Field:** Infrastructure  
**Category:** Networking  
**Also known as:** Ping Command, Ping Test, ICMP Echo

## Think of it like

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

## 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

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

## 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.

## Why it matters

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

## Common mistake

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

## Three principles

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

## Related terms

- [Latency](https://learn.benibix.com/term/infrastructure/latency)
- [Internet Protocol Address (IP Address)](https://learn.benibix.com/term/infrastructure/ip-address)
- [Network Packet](https://learn.benibix.com/term/infrastructure/packet)
- [Firewall](https://learn.benibix.com/term/infrastructure/firewall)
- [Localhost](https://learn.benibix.com/term/infrastructure/localhost)

## Taught in

- [Latency, Bandwidth and Ping](https://learn.benibix.com/learn/infrastructure-networking/latency-bandwidth-and-ping): Computer Networking, 8/13

![A laptop on the left and a server on the right. An arrow marked echo request goes from the laptop to the server, and an arrow marked echo reply comes back. A bracket over both arrows is marked round trip, 21 milliseconds.](https://learn.benibix.com/diagrams/inf2-ping.svg)

---

Source: https://learn.benibix.com/term/infrastructure/ping
Author: Behnia Zarei (a developer in Vienna, Austria, who builds and teaches data, AI and business intelligence at BENIBIX)
Publisher: BENIBIX Learn (https://learn.benibix.com/)
Last updated: 2026-11-19
Licence: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Quote freely with attribution.
