PING - History, Definition, Working, Application, Usages in linux and windows
History of its existence
Originally PING was a package of network diagnosis tool which is used to test the performance of ARPANET. The modern PING program that we use is actually named after the sound of "ping" (in old movies when something found on sonar radar it sounds like "ping"). The PING is written by Mike Muuss in December 1983.
What is PING?
PING or Packet InterNet Groper is one of the most versatile and widely used diagnostic tools. Ping is used to verifying that a data packet is capable of being distributed to an address without errors. The literal word "ping" means to get notice of someone. Here we will describe the untold story of millions of pings flashing back and forth between computers on the Internet.
This program contains facilities to send various kinds of probe packets, including ICMP Echo messages, process the reply and record elapsed times and other information in a data file, as well as produce real-time snapshot histograms and traces.
How PING works
The PING program works in ICMP protocol. Its functionalities are much like a sonar echolocation.
- A probe packet is sent to target machine containing ICMP ECHO_REQUEST.
- In response target then sends back the ECHO_REPLY packet.
The IP 127.0.0.1 is a special address which is your HOST machine. This address is also known as the loopback address. PING-ing loopback address indicates you NIC is working correctly. As it is your local machine it will get a reply instantaneously. But, the response time increases as the number of hops between two computer increases. The network congestion, network speed etc. are other parameters to consider.
As we can see PING is doing many tasks, because of that load of the network increases. That's why it is not recommended to use during normal operations or from automated scripts.
Application of PING:
- It is used for network testing, measurement, and management.
- It is used primarily for manual fault isolation.
- PING is used to check if a machine or device is online or accessible.
- PING can be used to determine the IP address of a target device.
- By PING-ing from few different locations, one can determine the availability of a website.
- Comparative PING results can be used to optimize the network
PING In Linux
ping [-q] [-v] [-t TTL] [-c Count] [-i Wait] [-W timeout] [-s PacketSize] <HOST_NAME>
- -q --> [Quite] Output will show only at start and end.
- -v --> [Verbose] All packets and response will be shown.
- -t --> [Time to Live] Set the IP time to live.
- -c --> [Count] How many packets will be sent.
- -i --> [Isolation] Number of seconds difference between two packets.
- -W --> [Wait] Time to wait for a response.
- -s --> [Size] The size of each packet.
PING In Windows
ping [-t] [-a] [-n count] [-l size] [-i TTL] [-w timeout] [-4] [-6] <HOST_NAME>
- -t --> [Termination] User have to terminate the ping manually using ctrl+c
- -n --> [number] How many packets will be sent.
- -l --> [Length] The size of each packet.
- -i --> [Time to Live] Set the IP time to live.
- -w --> [Wait] Time to wait for a response.
- -4 --> [IPv4] Force using IPv4.
- -6 --> [IPv6] Force using IPv6.
Online PING Websites:
If PING command is not working on your computer for firewall restrictions or others, you can always use online sites like this:
PING Security issues
- A PING with a fake source address ("spoofing"), can make a target machine send relatively large packets to another host.
- It might protect the attacker against identification.
- PING request can yield information about the internal structure of a network.
- A malformed Ping request can crash a machine (the "ping of death") [FIXED].
- Worms from the previous era would ping first and then probe. Blocking ping would stop spreading.
This article is greatly influenced by `Living In the internet`