Skip to main content

Ping command in networking

Ping is a computer network administration software utility used to test the reachability of a host on  network. (means you are reachable to that host or not by using ping command)

when you are pinging any host what actually happen.

it will send normally 4 packets to other host which you want to ping .

if your are using ipv4 then packet is as below.

IPv4 Datagram
 Bits 0–7Bits 8–15Bits 16–23Bits 24–31
Header
(20 bytes)
Version/IHLType of serviceLength
Identificationflags and offset
Time To Live (TTL)ProtocolHeader Checksum
Source IP address
Destination IP address
ICMP Header
(8 bytes)
Type of messageCodeChecksum
Header Data
ICMP Payload
(optional)
Payload Data
Source: wikipedia.com
If you are using ipv6 then packet is as below.





IPv6 Datagram
 Bits 0–3Bits 4–7Bits 8–11Bits 12–15Bits 16–23Bits 24–31
Header
(40 bytes)
VersionTraffic ClassFlow Label
Payload LengthNext HeaderHop Limit
Source Address
Destination Address
ICMP6 Header
(8 bytes)
Type of messageCodeChecksum
Header Data
ICMP6 Payload
(optional)
Payload Data
























Source:Wikipedia.com


Function: Send ICMP ECHO_REQUEST to network hosts




Protocol used : ICMP ( ICMP protocol should allowed in Firewall)

ICMP : UseInternet Control Message Protocol

Example:



Ping IPAdress or web address

ping 10.0.0.1


$ ping -c 5 www.example.com
PING www.example.com (93.184.216.34): 56 data bytes
64 bytes from 93.184.216.34: icmp_seq=0 ttl=56 time=11.632 ms
64 bytes from 93.184.216.34: icmp_seq=1 ttl=56 time=11.726 ms
64 bytes from 93.184.216.34: icmp_seq=2 ttl=56 time=10.683 ms
64 bytes from 93.184.216.34: icmp_seq=3 ttl=56 time=9.674 ms
64 bytes from 93.184.216.34: icmp_seq=4 ttl=56 time=11.127 ms

--- www.example.com ping statistics ---
5 packets transmitted, 5 packets received, 0.0% packet loss
round-trip min/avg/max/stddev = 9.674/10.968/11.726/0.748 ms                                               

The ping utility was written by Mike Muuss in December 1983 as a tool to troubleshoot problems in an IP network.

Ping is a very essential command to troubleshooting and diagnosis

Error indications 

In cases of no response from the target host, most implementations display either nothing or periodically print notifications about timing out. Possible ping results indicating a problem include the following:
H, !N or !P – host, network or protocol unreachable S – source route failed F – fragmentation needed U or !W – destination network/host unknown I – source host is isolated A – communication with destination network administratively prohibited Z – communication with destination host administratively prohibited Q – for this ToS the destination network is unreachable T – for this ToS the destination host is unreachable X – communication administratively prohibited V – host precedence violation C – precedence cutoff in effect

In case of error, the target host or an intermediate router sends back an ICMP error message, for example "host unreachable" or "TTL exceeded in transit". In addition, these messages include the first eight bytes of the original message (in this case header of the ICMP echo request, including the quench value), so the ping utility can match responses to originating queries.
 
References:
https://en.wikipedia.org/wiki/Ping_(networking_utility)
https://www.lifewire.com/ping-command-2618099

Comments

Post a Comment

Popular posts from this blog

Windows Very Important Command

 Robocopy also is known as Robust File Copy Command. By using Robocopy Windows Command  Line utility we can copy files, directories and even drives too from one location to another location. Robocopy is a Windows command-line tool used for file and folder Replication.

Install Printer Windows 7

Installing  windows printer driver automatically(Built in driver) Set Windows Update to automatically download driver software Open the Windows Device Installation Settings and confirm that your computer is set to automatically download driver software. 1.      Search Windows for change device installation, and then click the  Change device installation settings  Control Panel setting in the list of results. Device Installation Settings window displays. 1.      Select the  Yes  option, and then click  Save Changes . Figure : Example of selecting the Yes option Install Printer Windows 7 Step 2: Connect your printer to the computer Connect your printer to the computer with a USB cable or through your local network so Windows can detect your printer during the print driver installation. -------------------------------------------------------------------