The Ping Command

.
I’d say the ping and traceroute commands are the simplest yet the most powerful commands in network troubleshooting. It comes very useful while isolating network hardware problems and incompatible configurations.

Ping (Packet InterNet Grouper) works by sending ICMP “echo request” packets to the target host and listening for ICMP “echo response” replies. Ping estimates the round-trip time, generally in milliseconds, and records any packet loss, and displays a summary.

ping 127.0.0.1 - This command pings the loopback address and verify the TCP/IP configuration.
ping IP_address_of_local_host - This veries that the local computer is added to the network correctly
ping IP_address_of_default_gateway - This command verify that the default gateway is functioning and that you can communicate with a local host on the local network.
ping IP_address_of_remote_host - You can ping the IP address of the remote host to verify that you can communicate through a router.

Shown below is a picture perfect scene. everything is ok in this ping reply.

Microsoft Windows XP [Version 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.
C:\Documents and Settings\home>ping comp1
Pinging comp1.homenet.com [10.161.133.26] with 32 bytes of data:

Reply from 10.161.133.26: bytes=32 time<1ms ttl="127">
Reply from 10.161.133.26: bytes=32 time<1ms ttl="127">
Reply from 10.161.133.26: bytes=32 time<1ms ttl="127">
Reply from 10.161.133.26: bytes=32 time<1ms ttl="127">

Ping statistics for 10.161.133.26: Packets: Sent = 4, Received = 4, Lost = 0 (0% loss), Approximate round trip times in milli-seconds: Minimum = 0ms, Maximum = 0ms, Average = 0ms

as you can see, the packet loss is 0% which means that the communication is healthy. This may not be the case all the time, but then the ping reply can give you a lot of information regarding the network. Since it's almost 3 in the morning, I'll write about it in the next post - hopefully :)

Check out these Ping command prefixes, they are extremely useful. You will get the below mentioned list by typing the following command ping /? in the command line.

ping -t a.b.c.d - This command keeps pinging the IP address a.b.c.d until you give the break command Ctrl+C. Its useful when you have to see the effect on connectivity in realtime while doing some changes.
ping -a a.b.c.d - This command resolves IP address to host names. Put in the IP address and you will get the host name of the system.
ping -n 20 a.b.c.d - This command can be used to send 20 (or any number of) echo request to a particular IP.
Similarly there are others which are less used compared the above three.
-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.

That's all for now. Gotta catch some sleep ;)

Digg ThisAdd To Del.icio.us Add To Furl Add To Reddit Fav This With Technorati Add To Yahoo MyWeb Add To Newsvine Add To Google Bookmarks Add To Bloglines Add To Ask Add To Windows Live Add To Slashdot Stumble This

No comments: