Buffl

Basic Linux Networking and Networking Utilities

as
von abdullah S.

5. The ping Command


Purpose: Test network connectivity to a host

How it Works:

  1. Sends ICMP ECHO_REQUEST packets to target

  2. Target responds with ICMP ECHO_RESPONSE

  3. Measures round-trip time

Basic Commands:

ping google.com # Ping until stopped (Ctrl+C to stop) ping -c 4 google.com # Send only 4 packets

Output Explained:

PING google.com (142.250.80.46): 56 data bytes 64 bytes from 142.250.80.46: icmp_seq=0 ttl=116 time=12.3 ms 64 bytes from 142.250.80.46: icmp_seq=1 ttl=116 time=11.8 ms 64 bytes from 142.250.80.46: icmp_seq=2 ttl=116 time=12.1 ms

Line by Line:

  • First line: What you're pinging and its resolved IP

  • 64 bytes: Size of response packet

  • from 142.250.80.46: IP responding

  • icmp_seq=0: Sequence number (counts packets)

  • ttl=116: Time To Live (hops remaining before packet dies)

  • time=12.3 ms: Round-trip time in milliseconds

Statistics Summary:

--- google.com ping statistics --- 4 packets transmitted, 4 received, 0% packet loss

round-trip min/avg/max/stddev = 11.8/12.1/12.3/0.2 ms

What This Tells You:

  • Transmitted: Packets sent

  • Received: Packets that came back

  • Packet loss: Percentage lost (higher = network problems)

  • min/avg/max: Fastest/average/slowest times

  • stddev: Consistency of response times

Interpreting Results:

  • Replies received: Network path is working

  • Request timeout: No response (firewall blocking, host down, network issue)

  • High packet loss: Network instability

  • High/variable times: Network congestion or distance

Use Cases:

  • Quick connectivity test

  • Measure latency

  • Detect packet loss

  • Troubleshoot network issues

  • Verify host is up and reachable


Author

abdullah S.

Informationen

Zuletzt geändert