Understanding the Ping Command

Andrew
IPSearch.io
4 min read
Understanding the Ping Command
The ping command is a fundamental tool used across devices of various operating systems. In this article we are going to deep dive into the ping command and discuss how it can be used and what options exists when executing the command from Windows, MacOS, and Linux operating systems.

The ping command is used by IT professionals and everyday home users to test the connectivity between two points in a network. Understanding how the ping command works and how to execute it will give you another tool towards troubleshoot network issues or testing responsiveness to a device or website.

Ping stands from "Packet Internet Grouper" and it sends ICMP (Internet Control Message Protocol) echo request packets to a host and waits for a response. The RTT (Round Trip Time) is outputted along size the host IP, time to live (ttl), and packet size.

Ping Syntax​

The command is funtamentally the same across all operating systems. You start with the ping command, followed by the options, and finish with the destination.

Bash:
ping [options] destination

Ping Options:​

The ping command has different options that can be applied across Windows, MacOS, and Linux systems. To add an option you simple enter the option before the destination. For example, you would enter the command ping -n 100 ipsearch.io if you wanted to send exactly 100 echo requests to IPSearch.io from a Windows operating system.

You can use more than one option per command as well. For example, you would enter ping -c 5 -i 10 ipsearch.io if you wanted to send 5 echo request to ipsearch.io and wait 10 seconds before each request from a MacOS or Linux computer.

Windows Ping Options:​

To access the ping help on Windows you use the ping /? command.

OptionsOption Description
-tPing the specified host until stopped. To stop, use Ctrl+C.
-aResolve addresses to hostnames.
-n count Send a specified number of echo requests.
-l sizeSend buffer size.
-fSet Don't Fragment flag in packet (IPv4-only).
-iSet Time To Live.
-wSet timeout in milliseconds to wait for each reply.

Linux/macOS Ping Options:​

To access the ping help on MacOS you use the man ping command.

OptionsOption Description
-c countStop after sending (and receiving) count ECHO_RESPONSE packets.
-i intervalWait interval seconds between sending each packet.
-s packet sizeSpecifies the number of data bytes to be sent.
-t ttlSet Time to Live.
-W timeoutTime to wait for a response, in seconds.
-AAdaptive ping. Interpacket interval adapts to round-trip time.
-qQuiet output. Only summary lines at startup time and completion.
-LSuppress loopback of multicast packetson multicast address.

If you have any questions or commands about this article then please leave a comment or post in our forums.
 

Comments (0)

Trending

Back
Top