Overview
ping is the simplest and most widely used network diagnostic tool. It answers a basic question: "Can I reach that host, and how fast?" Built on ICMP, ping is often the first command anyone runs when troubleshooting connectivity.
Learning objectives
- Explain what
pingdoes and how. - Interpret ping output.
- Understand ping's limits.
Core concept
ping sends ICMP Echo Request messages to a target and listens for ICMP Echo Reply responses. If replies come back, the target is reachable over the network and responding. Ping also measures round-trip time (RTT) — how long each request/reply cycle takes — and reports packet loss (how many requests went unanswered).
How it works
You run ping <target> (an IP or hostname). The tool repeatedly sends echo requests and prints each reply with its RTT (e.g. time=12 ms) and the TTL value. After stopping, it summarizes packets sent/received and loss percentage, plus min/avg/max RTT. Consistent low RTT and 0% loss indicate a healthy path; high RTT suggests latency; missing replies suggest loss or a block.
Practical example
$ ping example.com
64 bytes from 93.184.216.34: icmp_seq=1 ttl=56 time=11.4 ms
64 bytes from 93.184.216.34: icmp_seq=2 ttl=56 time=10.9 ms
--- example.com ping statistics ---
2 packets transmitted, 2 received, 0% packet loss
This shows the host is reachable, DNS resolved the name to an IP, RTT is about 11 ms, and there is no packet loss — a healthy connection. (Exact numbers vary by network.)
Cybersecurity relevance
Ping is a basic reconnaissance tool: a ping sweep checks many addresses to find live hosts. Because of this, some hosts and firewalls are configured not to reply to ping (dropping ICMP Echo) to stay less visible. So a non-responding host is not necessarily down — it may simply be configured to ignore pings, an important caveat when interpreting results.
Common mistakes
- Assuming "no ping reply" means the host is down — it may just be blocking ICMP.
- Using ping to test a specific service — ping tests basic reachability, not whether a particular port/service (like a web server) is working.
Key takeaways
pinguses ICMP Echo Request/Reply to test reachability, measuring round-trip time and packet loss.- Output shows RTT, TTL, and loss; healthy paths show low, steady RTT and 0% loss.
- A missing reply can mean the host is down or just blocking ICMP; ping does not test individual services.
Check your understanding
- Which ICMP messages does
pingsend and receive? - Give two reasons a host might not respond to a ping even though it is online.

