Examining your Network with Commands

Ping


PING is used to check for a response from another computer on the network. It can tell you a great deal of information about the status of the network and the computers you are communicating with.Ping returns different responses depending on the computer in question. The responses are similar depending on the options used.Ping uses IP to request a response from the host. It does not use TCP.It takes its name from a submarine sonar search - you send a short sound burst and listen for an echo - a ping - coming back.In an IP network, `ping' sends a short data burst - a single packet - and listens for a single packet in reply. Since this tests the most basic function of an IP network (delivery of single packet), it's easy to see how you can learn a lot from some `pings'.To stop ping, type control-c. This terminates the program and prints out a nice summary of the number of packets transmitted, the number received, and the percentage of packets lost, plus the minimum, average, and maximum round-trip times of the packets.



Sample ping session

PING localhost (127.0.0.1): 56 data bytes64 bytes

from 127.0.0.1: icmp_seq=0 ttl=255 time=2 ms

64 bytes from 127.0.0.1: icmp_seq=1 ttl=255 time=2 ms

64 bytes from 127.0.0.1: icmp_seq=2 ttl=255 time=2 ms

64 bytes from 127.0.0.1: icmp_seq=3 ttl=255 time=2 ms

64 bytes from 127.0.0.1: icmp_seq=4 ttl=255 time=2 ms

64 bytes from 127.0.0.1: icmp_seq=5 ttl=255 time=2 ms

64 bytes from 127.0.0.1: icmp_seq=6 ttl=255 time=2 ms

64 bytes from 127.0.0.1: icmp_seq=7 ttl=255 time=2 ms

64 bytes from 127.0.0.1: icmp_seq=8 ttl=255 time=2 ms

64 bytes from 127.0.0.1: icmp_seq=9 ttl=255 time=2 ms

localhost ping statistics

10 packets transmitted, 10 packets received, 0% packet lossround-trip min/avg/max = 2/2/2 msmeikro$

The Time To Live (TTL) field can be interesting. The main purpose of this is so that a packet doesn't live forever on the network and will eventually die when it is deemed "lost." But for us, it provides additional information. We can use the TTL to determine approximately how many router hops the packet has gone through. In this case it's 255 minus N hops, where N is the TTL of the returning Echo Replies. If the TTL field varies in successive pings, it could indicate that the successive reply packets are going via different routes, which isn't a great thing.The time field is an indication of the round-trip time to get a packet to the remote host. The reply is measured in milliseconds. In general, it's best if round-trip times are under 200 milliseconds. The time it takes a packet to reach its destination is called latency. If you see a large variance in the round-trip times (which is called "jitter"), you are going to see poor performance talking to the host.

0 comments:

Post a Comment