Chapter 35: Bash ping

What does ping actually do? (super simple first)

ping = checks if another computer/device/server is reachable over the network and measures how long it takes for a message to go there and come back.

Think of it like this:

  • You shout “Hello!” from your house to your friend’s house across the street.
  • If he shouts “Hi!” back → he’s alive/reachable.
  • You count how many seconds it took for the sound to go and come back → that’s the round-trip time (latency).

In networking, ping sends small test packets (called ICMP Echo Request) to an IP address or domain name, and waits for ICMP Echo Reply.

If you get replies → the destination is alive and network path is working. If no reply → either destination is down, firewall is blocking, or network problem.

Why do we use ping? (real reasons you will use it daily)

  • Check if your internet is working
  • See if a website/server is down (YouTube not loading? ping youtube.com)
  • Measure latency (delay) – very important for gaming, video calls, trading apps
  • Find if problem is in your Wi-Fi, ISP, or far-away server
  • Test DNS (if ping 8.8.8.8 works but ping google.com fails → DNS issue)
  • Quick network troubleshooting (most first step when something is slow/offline)

1. Basic usage (try right now!)

Bash

Example output you might see:

text

Press Ctrl+C to stop (otherwise it runs forever).

2. Understand every line (very important!)

Line / Part What it means Good value example When to worry
PING google.com (142.250.77.206) Domain → resolved IP 142.250.77.206 If no IP → DNS broken
64 bytes from … icmp_seq=1 Received packet size + sequence number icmp_seq=1,2,3… Missing seq = loss
ttl=117 Time To Live (how many hops left before packet dies) 50–120 typical Very low = many hops
time=18.2 ms Round Trip Time (latency) – how long packet took to go & come back < 50 ms = excellent >150 ms = laggy
— statistics — Summary after Ctrl+C
4 packets transmitted, 4 received How many sent vs received 100% received Any loss = problem
0% packet loss Percentage of packets that never came back 0–1% = good >5–10% = unstable
rtt min/avg/max/mdev Round-trip times: min, average, max, standard deviation (jitter) avg < 50 ms, mdev < 5 High mdev = unstable connection

3. Most useful options (you’ll use these 90% of time)

Bash

4. Real-life examples you will use daily (Hyderabad style)

  • Internet not working? Start here:
    Bash
  • BGMI / COD laggy? Check latency:
    Bash
  • Website not opening?
    Bash
  • Check your router is alive:
    Bash
  • Test Wi-Fi stability (packet loss):
    Bash

5. Quick cheat-sheet table

Goal Command example What to look for
Basic check (4 packets) ping -c 4 google.com 0% loss, avg <50 ms
Test internet connection ping -c 4 8.8.8.8 Reliable IP test
Check DNS resolution ping google.com vs ping 8.8.8.8 If IP works but name fails → DNS
Measure gaming latency ping -c 10 server-ip-or-domain avg <60 ms ideal
Check router ping 192.168.1.1 -c 4 First troubleshooting step
Test for packet loss ping -c 100 8.8.8.8 loss % should be 0–1%
Fast continuous test ping -i 0.2 8.8.8.8 Watch for sudden jumps

6. Pro tips & common gotchas

  • Firewall blocks ping → many servers (especially cloud) block ICMP → 100% loss doesn’t always mean down (try curl google.com instead)
  • High latency on mobile data → normal (Jio/Airtel 4G/5G often 30–100 ms)
  • Packet loss >5% → bad Wi-Fi, faulty cable, ISP issue, or overloaded network
  • mdev high (jitter) → unstable connection (video call will stutter)
  • Alternative modern tool: mtr (combines ping + traceroute)
    Bash

Now open your terminal and try these 3 right now:

Bash

Tell me:

  • What’s your average time to 8.8.8.8? (e.g. 22 ms)
  • Any packet loss?

Or ask:

  • “Why does ping youtube.com work but website not opening?”
  • “How to ping from phone?”
  • “What is good ping for BGMI / Free Fire?”

We’ll troubleshoot together! 😄

You may also like...

Leave a Reply

Your email address will not be published. Required fields are marked *