Ping command tips detailed Windows ping command knowledge Daquan

Source: Internet
Author: User

Windows ping command for most computer enthusiasts are not unfamiliar, through the ping IP can know whether the network is unblocked or network transmission quality, is the network technician commonly used detection network command, most friends to ping command know not much, Next this article will be with you to learn more about ping and ping command advanced skills, and so on, if you think this article is good, remember the collection Oh, perhaps the future useful to the time! What is the 4m speed? What is the 4m broadband download speed?

Basic usage of ping presumably everyone will, know that it is not worth the high-level usage of the ping command? As in the following:ping command Knowledge ping command how it works
ping [-t] [-a] [-N Count] [-l length] [-f] [-i TTL] [-v TOS] [-R Count] [-s count] [-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.
Keep pinging the local host until you press CONTROL-C. (www.pc841.comPC configuration)
There is no special technique for this feature, but it can be used in conjunction with other parameters, which are mentioned below.
-a Resolve addresses to hostnames.
Resolves the computer NetBIOS name.
Example: C:\>ping-a 192.168.1.21
Pinging iceblood.yofor.com [192.168.1.21] with + 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 the above you can know that the computer with IP 192.168.1.21 NetBIOS name is iceblood.yofor.com.
-N count number of ECHO requests to send.
Sends the number of ECHO packets specified by count.
By default, usually only send four packets, through this command can define the number of sent, it is very helpful to measure the network speed, such as I want to test the average time to send 50 packets return, the fastest time is how much, the slowest time can be learned through the following:
C:\>ping-n 50 202.103.96.68
Pinging 202.103.96.68 with + 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
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 = Received = Lost = 2 (4% loss), approximate round trip times in Milli-seconds:
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 were returned, two of which were lost due to unknown reasons, the fastest return in 48 packets is 40ms, the slowest is 51ms, the average speed is 46ms.
-L size Send buffer size.
Defines the ECHO packet size.

principle:

Assuming that host A's IP address is 192.168.1.1, and Host B's IP address is 192.168.1.2, all within the same subnet, what happens when you run Ping 192.168.1.2 on host a?

First, the ping command constructs a fixed-format ICMP request packet, which is then passed by the ICMP protocol to the IP layer protocol with the address "192.168.1.2" (like ICMP, which is actually a set of processes running in the background), and the IP layer protocol will address " 192.168.1.2 "As the destination address, the native IP address as the source address, plus some other control information, build an IP packet, And in a mapping table to find out the corresponding physical address of IP address 192.168.1.2 (also called MAC address, familiar with the network card configuration of friends will not be unfamiliar, this is the Data Link layer protocol to build the data link layer of the transmission Unit-the frame required), together with the data link layer. The latter constructs a data frame, the destination address is the IP layer passed over the physical address, the source address is the physical address of the machine, but also to attach some control information, according to the media access rules of Ethernet, transfer them out.

When Host B receives this data frame, it first checks its destination address and compares it with the physical address of the machine, if it is met, it is received; After receiving check the data frame, the IP packet is extracted from the frame and handed to the IP layer protocol of the machine. Similarly, after the IP layer is checked, the useful information is extracted to the ICMP protocol, which after processing, immediately constructs an ICMP reply packet, sent to host A, its process and host a sends the ICMP request packet to Host B exactly the same.

From the ping work process, we can know that host a received a Host B, a response packet, the two hosts between the go, back path is normal. That is, it is normal whether from host A to Host B, or from Host B to host A. So, what causes can only be unilaterally to ping pass?

One, the installation of a personal firewall

In a shared-Internet-connected machine, most of the hosts that serve as servers are installed with personal firewall software for security reasons, while other machines that are clients are typically not installed. Almost all personal firewall software, by default, does not allow other machines to ping the machine. It is common practice to filter out ICMP request packets from the outside, but it does not impose any restrictions on native ICMP request packets and from external ICMP response messages. This way, when you ping other machines from the computer, there is no problem if the network is healthy. However, if you ping the machine from another machine, even if the network is all right, there will be a "timeout no answer" error. Most of the single-directional ping-pass phenomena originate from this. The solution is also very simple, according to your own use of different types of firewalls, adjust the corresponding settings.

Second, error setting IP address

Under normal circumstances, a host should have a network card, an IP address, or multiple network cards, multiple IP addresses (these addresses must be in a different IP subnet). But for the use of computers in public places, especially internet cafes, many people hand miscellaneous, which do not have "explorers." Once two computers also appeared this one-direction ping, after careful examination, found one of the computer's "Dial-up network adapter" (equivalent to a soft card) in the TCP/IP settings, set a network card IP address on the same subnet IP address, so in the IP layer protocol, This host has two different interfaces in the same network segment. When you ping other machines from this host, there is a problem:
(1) The host does not know which network interface The packet is sent to, because there are two network interfaces connected to the same network segment;
(2) The host does not know which address to use as the source address of the packet. Therefore, from this host to Ping other machines, the IP layer protocol will not be processed, after the timeout, Ping will give a "timeout no answer" error message. However, when the host is ping from other hosts, the request packet from the specific network card, ICMP only need to simply swap the purpose, the source address, and change some flags, the ICMP reply packet can be sent smoothly, the other host will be able to successfully ping this machine.

Introduction here believe that we have a more detailed understanding of the ping command, for the ping command we commonly used to detect network signal transmission and reception in the LAN detection, network speed detection, 3 can also determine whether the network has a fault, etc. For frequent contact with the network of Friends Ping command is often required to use the command.

Ping command tips detailed Windows ping command knowledge Daquan

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.