C.W.K.
Stream
Lesson 01 of 13 · published

ping

~12 min · ping, icmp, rtt, packet-loss

Level 0Pinger
0 XP0/101 lessons0/12 achievements
0/150 XP to next level150 XP to go0% complete

The simplest "is it alive" check

ping sends ICMP Echo Request packets and measures how long the Echo Reply takes to come back. It answers two questions at once: is the host reachable, and how fast is the round-trip. Despite being the oldest network tool in the kit, it's still the very first thing to reach for when something feels off.

Reading the output

Each reply line gives you four numbers worth knowing:

  • icmp_seq — sequence number; gaps indicate packet loss.
  • ttl — Time To Live; counts down by 1 at every router. A high TTL implies few hops; a low one implies many.
  • time — round-trip in milliseconds; lower is faster.
  • packet loss % — at the summary line; 0 % is good, 1–2 % is borderline, more is a real problem.

When ping lies

Some hosts and firewalls block ICMP. A failing ping doesn't always mean the host is dead — it might just be configured to ignore. Pair it with nc -zv host port on a service port (22, 443) when you need to confirm reachability beyond "will it answer pings."

Code

Daily ping recipes·bash
# Standard — Ctrl+C to stop
ping google.com

# Send exactly N packets
ping -c 4 192.168.1.1

# Probe MTU/fragmentation with a specific packet size
ping -s 1472 -D 192.168.1.1   # 1472 + 28 = 1500 (standard MTU)
ping -s 8972 -D 192.168.1.1   # 8972 + 28 = 9000 (jumbo frames, Track 7)

# Flood ping (root only) — useful for stress, not casual use
sudo ping -f 192.168.1.1

External links

Exercise

Run ping -c 5 1.1.1.1 and note the average RTT and any loss. Then ping -c 5 your-gateway-IP — should be sub-millisecond on a wired LAN, ~5 ms on Wi-Fi. Then ping -c 5 google.com — note the difference. The gap between gateway and Google is your ISP path.

Progress

Progress is local-only — sign in to sync across devices.
Spotted a bug or have feedback on this page?Report an Issue

Comments 0

🔔 Reply notifications (sign in)
Sign inPlease sign in to comment.

No comments yet — be the first.