Ritesh’s Technical Blog

The Ping Command

Posted on: July 31, 2008

The Ping Command

The ping (Packet Internet Groper) is used to send ICMP (Internet Control Message

Protocol) packets from one host to another. Ping transmits packets using the ICMP

ECHO_REQUEST command and expects an ICMP ECHO_REPLY. Ping is the primary TCP/IP command used to troubleshoot connectivity, reachability, and name resolution.


ping [-t] [-a] [-n Count] [-l Size] [-f] [-i TTL] [-v TOS] [-r Count] [-s Count] [{-j HostList | -k HostList}] [-w Timeout] [TargetName]


t Ping the specifed host until interrupted.

a Resolve addresses to hostnames.

n count Number of echo requests to send.

l size Send buffer size.

f Set Don’t Fragment flag in packet.

i TTL Time To Live.

v TOS Type Of Service.

r count Record route for count hops.

s count Timestamp for count hops.

j host-list Loose source route along host-list.

k host-list Strict source route along host-list.

w timeout Timeout in milliseconds to wait for each reply.


The following example shows ping command output:

C:\>pimg example.microsoft.com

Pinging example.microsoft.com [] with 32 bytes of data:

Reply from bytes=32 time=101ms TTL=124

Reply from bytes=32 time=100ms TTL=124

Reply from bytes=32 time=120ms TTL=124

Reply from bytes=32 time=120ms TTL=124

To pingthe destination and resolve to its host name, type:

ping -a

To ping the destination with 10 Echo Request messages, each of which has a Data field of 1000 bytes, type:

ping-n 10 -l 1000

To ping the destination and record the route for 4 hops, type:

ping-r 4

To ping the destination and specify the loose source route of, type:

ping -j


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s


Blog Stats

  • 55,263 hits
%d bloggers like this: