johnwmyers.com

My personal blog for Technology and Web

Ping command explained

| 0 comments

Ping command, what is it?

The Ping command is a great little utility tool with a simple command-line interface that serves for network diagnosing or, more precisely said – to probe a particular host or IP address (IPv4 address or IPv6 address) and see if there is a connection to it. 

With the Ping command, you are sending packets of data using the ICMP (internet control message protocol) from your device to a target. The packets will be 4 by default, each with a 32-byte size, and you will get the time it took each of them to reach the target. Another useful part of the statistics is that you will get minimum, maximum, and average time (in milliseconds) for the road. An interesting detail is that you will see a percentage of lost packets. You will also get the IP address of the target.

How does Ping command work?

In short, the ping command sends packets of data from your device to a target, waits for the packets to bounce, and see the statistics when they come back. 

You can use it, no matter what system you are using. It is built-in in Windows, Linux, macOS, BSD, ChromeOS, or another. You can even use it with a Terminal emulation application on Android or iOS. 

For what can you use the Ping command?

Use it to see the connectivity between you and another point on the network – IP address or hostname. That way, you see if the target is reachable, if it is experiencing downtime or if the connectivity with that target is really struggling. 

A common use of the ping command is to see if a website is up and running and how long does it take for the pings to arrive. If the value is too high, that means bad connectivity, and you should see if there is a way to fix it. 

How to use the Ping command like a pro?

It is easy to use. Open the Terminal or the Command Prompt on your computer, write “ping hostname / IP address”, and press enter. That’s it. 

ping domain.com

ping 56.78.98.43 

It is not hard to master the Ping command. You can learn to use the additional options and create more specific probes. You can edit the number of pings, trace the route, wait longer or shorter for the responses, use IPv6 or IPv4, and more. 

To see the full list of options for your Linux or macOS computer, write the following in the Terminal application: 

ping -h

The options that you will see for Linux and macOS are:

-aThe “a” is for audio. You will hear a sound when it arrives. 
-bThe “b” is for broadcast IP address.
-BThe “B” blocks the changing of the source IP address.
-c (count)The “c” is for the count of pings to send.
-fThe “f” is for flood with pings.
-i (interval)The “i” is for an interval between pings.
-I (interface address) Source IP address to interface IP address.
-1 (reload)Number of pings without waiting for replies.
-nThe “n” is for hostname in the result.
-qFor a short answer.
-T (ttl)TTL.
-vVerbose output.
-VShows the version of ping.
-w (deadline)After how many seconds to stop the ping command.
-W (timeout)Waiting period (in seconds) for a response. 

To see the full list of options for your Windows computer, write the following in the Command Prompt application:
ping -?
The options that you will see for Windows are:

-tNon-stop pinging.
-aIP address to hostname resolving.
-nThe “n” is for the number of pings to send.
-lSend the size of the buffer.
-fStop fragmentation. 
-iTTL.
-vNot working anymore.
-rTrace the route (IPv4).
-sStamp each hop with time (IPv4)
-jLoose source route along host-list (IPv4).
-kStrict source route along host-list (IPv4).
-wWaiting period (in seconds) for a response. 
-RTrace the route (IPv6).
-SSource address.
-cRouter compartment identifier.
-pPing Hyper-V network.
-4IPv4.
-6IPv6.

Leave a Reply

Required fields are marked *.