Demystifying the use of the Ping command

  

The ping command seems to be inscrutable. It seems to be a command that the master of the computer can do. In fact, this is not the case. Xiaobian today takes everyone to reveal the ping command.

ping [-t] [-a] [-n count] [-l length] [-f] [-i ttl] [-v tos] [-r count] [-s count] [ ,null,null,3],-j computer-list] │ [-k computer-list] [-w timeout] destination-list

Options:

-t Ping the specified host until stopped.To see statistics and continue - type Control-Break;To stop - type Control-C.

Never ping the local host until you press Control-C.

There are no special tricks for this feature, but it can be used with other parameters and will be mentioned below.

-a Resolve addresses to hostnames.

Analyze the name of the computer NetBios.

Example: C:\\>ping -a 192.168.1.21

Pinging iceblood.yofor.com [192.168.1.21] with 32 bytes of data:

Reply from 192.168.1.21: bytes=32 time<10ms TTL=254

Reply from 192.168.1.21: bytes=32 time<10ms TTL=254

Reply from 192.168.1.21: bytes=32 time< ;10ms TTL=254

Reply from 192.168.1.21: bytes=32 time<10ms TTL=254

Ping statistics for 192.168.1.21:

Packets: Sent = 4 , Received = 4, Lost = 0 (0% loss), Approximate round trip times in milli-seconds:

Minimum = 0ms, Maximum = 0ms, Average = 0ms

From above The computer NetBios that knows the IP address of 192.168.1.21 is called iceblood.yofor.com.

-n count Number of echo requests to send.

Send the number of Echo packets specified by count.

By default, only four packets are sent. This command can be used to define the number of packets sent. It is useful for measuring network speed. For example, I want to test the return of sending 50 packets. What is the average time, the fastest time, and the slowest time can be known by:

C:\\>ping -n 50 202.103.96.68

Pinging 202.103. 96.68 with 32 bytes of data:

Reply from 202.103.96.68: bytes=32 time=50ms TTL=241

Reply from 202.103.96.68: bytes=32 time=50ms TTL=241< Br>

Reply from 202.103.96.68: bytes=32 time=50ms TTL=241

Request timed out.

………………

Reply from 202.103.96.68: bytes=32 time=50ms TTL=241

Reply from 202.103.96.68: bytes=32 time=50ms TTL=241

Ping statistics for 202.103 .96.68:

Packets: Sent = 50, Received = 48, Lost = 2 (4% loss), Approximate round trip in milli-seconds:< Br>

Minimum = 40ms, Maximum = 51ms, Average = 46ms

From the above I can know that in the process of sending 50 packets to 202.103.96.68, 48 are returned, two of which For the unknown reason, the return speed of these 48 packets is 40ms, the slowest is 51ms, and the average speed is 46ms.

-l size Send buffer size.

Defines the echo packet size.

In the default case, the size of the packet sent by Windows ping is 32byt. We can also define its own size, but there is a size limit, which is only 65500byt. Maybe someone will ask why. To limit to 65500byt, because the Windows series of systems have a security hole (and perhaps other systems) is that when the packet sent to the other party is greater than or equal to 65532, the other party is very likely to block the machine, so Microsoft to solve This security vulnerability then limits the size of the ping packet. Although Microsoft has made this limitation, this parameter is still very powerful with other parameters. For example, we can implement an aggressive command by matching the -t parameter: (The following is dangerous, only use For testing, do not apply it to other people's machines, otherwise you will be at your own risk.)

C:\\>ping -l 65500 -t 192.168.1.21

Pinging 192.168.1.21 with 65500 bytes of Data:

Reply from 192.168.1.21: bytes=65500 time<10ms TTL=254

Reply from 192.168.1.21: bytes=65500 time<10ms TTL=254

………………

Copyright © Windows knowledge All Rights Reserved