Friday, March 19, 2021

How Does PING Work

What is ping?

Ping is a software utility program. Ping is a simple computer network software utility used to test and verity the reachability/connectivity of a host on a Internet Protocol (IP) Network.
It works by sending packets from the source to the destination host which if it is accessible through the IP network, then sends packets back.
The source host then analyses the reply packets to determine if the destination host is reachable and calculates statistics of packet traversing the network.

Ping operates by means of Internet Control Message Protocol (ICMP) packets. Pining involves sending an ICMP echo request to target host and waiting for an ICMP echo reply. The program reports error, packet loss, and min-max round trip times.


Ping Security Concerns:

  • ping flood: A Denial-of-Service attack (DoS), where an attacker tries to overwhelm the target systems by sending ping requests as fast as possible.
  • ping sweep: Sends ping requests to multiple addresses to obtain a list of all hosts on a network.
  • ping spoofing: The attacker captures echo request packets meant for some other network device based on the IP address. Then the attacker sends back echo reply messages pretending to have the IP address in question. The victim is from now on communicating with the third party network device and not the original one. This is especially problematic when ping is used for discovering devices on the network.

Ping Command:

Ping Command Syntax

ping [-t] [-a] [-n count] [-l size] [-f] [-i TTL] [-v TOS] [-r count] [-s count] [-w timeout] [-R] [-S srcaddr] [-p] [-4] [-6target [/?]

Ping Command Options
ItemExplanation
-tUsing this option will ping the target until you force it to stop by using Ctrl+C.
-aThis ping command option will resolve, if possible, the hostname of an IP address target.
-n countThis option sets the number of ICMP Echo Requests to send, from 1 to 4294967295. The ping command will send 4 by default if -n isn't used.
-l sizeUse this option to set the size, in bytes, of the echo request packet from 32 to 65,527. The ping command will send a 32-byte echo request if you don't use the -l option.
-fUse this ping command option to prevent ICMP Echo Requests from being fragmented by routers between you and the target. The -f option is most often used to troubleshoot Path Maximum Transmission Unit (PMTU) issues.
-i TTLThis option sets the Time to Live (TTL) value, the maximum of which is 255.
-v TOSThis option allows you to set a Type of Service (TOS) value. Beginning in Windows 7, this option no longer functions but still exists for compatibility reasons.
-r countUse this ping command option to specify the number of hops between your computer and the target computer or device that you'd like to be recorded and displayed. The maximum value for count is 9, so use the tracert command instead if you're interested in viewing all the hops between two devices.
-s countUse this option to report the time, in Internet Timestamp format, that each echo request is received and echo reply is sent. The maximum value for count is 4, meaning that only the first four hops can be time stamped.
-w timeoutSpecifying a timeout value when executing the ping command adjusts the amount of time, in milliseconds, that ping waits for each reply. If you don't use the -w option, the default timeout value of 4000 is used, which is 4 seconds.
-RThis option tells the ping command to trace the round trip path.
-S srcaddrUse this option to specify the source address.
-pUse this switch to ping a Hyper-V Network Virtualization provider address.
-4This forces the ping command to use IPv4 only but is only necessary if target is a hostname and not an IP address.
-6This forces the ping command to use IPv6 only but as with the -4 option, is only necessary when pinging a hostname.
targetThis is the destination you wish to ping, either an IP address or a hostname.
/?Use the help switch with the ping command to show detailed help about the command's several options.


How Does Traceroute Work and Example's of using traceroute command

  If you are working as a network administrator, system administrator, or in any system operations team, then you might have already ...