Introduction

The ping is a command-line tool that is available in all operating systems that have network connectivity. When you use the pin command, it sends a request to the particular device you are trying to contact on the network. When the ping is successful, the device sends back a response to the originating computer like an echo. 

For those asking, what is ping? the idea and term come from the sonar technology used in naval ships and submarine. In sonar terminology, a ping is a literal sound wave that is audible. It is sent out from the sonar device to find objects underwater. When the sound hits an object, it bounces back to the sonar pick up as an echo. Using the timing and direction of this ping sound wave, the location and distance of the object underwater can be determined. 

  1. How does Ping work?
  2. Ping message format
  3. The Ping utility
  4. Ping switches and variables
  5. How to use Ping

1. How does Ping work?

The ping function utilizes the computer’s echo request and works within the Internet Control Message Protocol (ICMP), which is a basic component of any IP network. When you issue a ping command, an echo-request packet is sent to the address of the specific computer on the network. The ping command, by default, sends multiple echo requests, generally four or five. The result of the echo request is displayed and shows a number of things such as whether the request got a successful response, the time it took for the response and other statistics about round trip times and packet loss. 

2. Ping message format

Here is what the echo request structure looks like: 

Byte 0Byte 1Byte 2Byte 3
Type (8 = IPv4, ICMP; 128 = IPv6, ICMP6)CodeHeader Checksum
IdentifierSequence Number
Payload

The echo reply will include the exact payload received

Byte 0Byte 1Byte 2Byte 3
Type (0 = IPv4, ICMP; 129 = IPv6, ICMP6)CodeHeader Checksum
IdentifierSequence Number
Payload 

3. The Ping utility

Every operating system that has a network comes with the ping utility. Although the echo request and reply are Internet Control Message Protocol messages, different manufacturers have a slightly varying implementation of the ping utility. In its most basic form, the ping command and a destination are sufficient to run the ping utility.  

4. Ping switches and variables

To allow for greater customization of default settings when it is used in particular instances, there are a number of switches available for the ping command. However, it’s essential to note that there is a lack of consistency on different platforms. While windows has “n” (number), Unix has “c” (count), that’s used to set the number of pings to be sent. These are some ping command switches examples: 

Number (count): This allows you to set the number of pings or echo requests to be sent.  The default number of pings is four on Windows OS, and Unix systems use five. 

Timeout: This sets the wait time for the utility after the ping is sent to get a reply from the destination. The default value for Windows systems is 4000 milliseconds or 4 seconds. 

Size: This switch controls the size of the ping packet. The windows default value is 32 bytes, while it is 64 bytes for Linux systems. 

Until Stopped: Allows the pings to keep going until stopped by the user. 

5. How to use Ping

The ping command is highly useful for a function that seems so trivial. Being a command-line utility, it finds use in a number of scripts where it is run and recorded for different purposes. Here are some uses of Ping: 

Troubleshooting: Pings are the first way to confirm if computers have an active connection or not or whether the connection is broken. A series of pings are used to find and fix problems. 

Discovery: Pings can be used as a fast tool to discover all the devices connected to the network. Since all devices on a network respond to it, an admin can find all devices actively connected. 

Monitoring: Pings are used to monitor the availability of devices on a network routinely. It is a form of very basic polling for all devices in a network without needed any extra software. 

  • Security

Pings are quite often used by hackers to find out all the systems that might be connected to a network, where they are, whether the machine is running and more. This information can be used to mount an attack. Therefore many firewalls are set to block pings from untrusted networks. 

Conclusion

Pings are a very basic command-line utility that is used to locate all the systems connected to a network. Pings work by sending small echo request packets to a specified computer and wait for the echo reply packet. Pings can yield information about computers in the network, such as where they are located, which operating system it is running and so on. 

Jigsaw Academy’s Postgraduate Certificate Program In Cloud Computing brings Cloud aspirants closer to their dream jobs. The joint-certification course is 6 months long and is conducted online and will help you become a complete Cloud Professional.

ALSO READ

SHARE