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.

Syntax

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

Switches:

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.

Examples

The following example shows ping command output:

C:\>pimg example.microsoft.com

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

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

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

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

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

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

ping -a 10.0.99.221

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

ping-n 10 -l 1000 10.0.99.221

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

ping-r 4 10.0.99.221

To ping the destination 10.0.99.221 and specify the loose source route of 10.12.0.1-10.29.3.1-10.1.44.1, type:

ping -j 10.12.0.1 10.29.3.1 10.1.44.1 10.0.99.221

Advertisements

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

Archives

Blog Stats

  • 55,044 hits
%d bloggers like this: