Ping is a frequently used utility used to determine whether a local host can exchange (send and receive) data packets with another host. Based on the returned information, we can infer whether the TCP/IP parameter is set correctly and whether the operation is normal. Note that successfully performing one or two exchanges with another host does not indicate that the TCP/IP configuration is correct, we must exchange data between a large number of local hosts and remote hosts to ensure the correctness of TCP/IP.
To put it simply, Ping is a test program. If Ping runs correctly, we can basically eliminate faults in the network access layer, Nic, MODEM input/output lines, cables, and routers, this reduces the scope of the problem. However, Ping can also be used as a DDOS (Denial of Service Attack) tool by someone with ulterior motives to customize the size and endless high-speed transmission of the datagram, for example, many large websites are paralyzed by hackers who use hundreds of computers that can access the Internet at high speed to send a large number of Ping data packets.
According to the default settings, the Ping command on Windows sends four ICMP (inter-network control packet protocol) Send back requests, each 32 bytes of data, if everything is normal, we should be able to receive four replies. Ping can display the time between sending a return request and returning a return response in milliseconds. If the response time is short, the datagram does not have to pass through too many routers or network connections. Ping can also display the TTL value. We can use the TTL value To estimate how many routers the data packet has passed: the start value of the TTL at the source location (that is, a 2th percentile value that is slightly greater than the returned TTL)-the TTL value returned. For example, if the returned TTL value is 119, the initial TTL value of the outbound data packet from the source address is 128, and the source point to the target location must pass 9 vro network segments (128-119 ); if the returned TTL value is 246, the start value of TTL is 256, and the source and target locations must pass through nine vro network segments.
1. Typical order of network faults detected by Ping
Under normal circumstances, when we use the Ping command to find the problem or check the network running status, we need to use many Ping commands. If all of them are running correctly, we can believe that the basic connectivity and configuration parameters are correct. If some Ping commands fail, it can also specify where to locate the problem. The following describes a typical detection sequence and possible faults:
· Ping 127.0.0.1
The Ping Command is sent to the IP address software of the local computer, which never exits. If this is not done, it indicates that the installation or running of TCP/IP has some basic problems.
· Ping the local IP Address
This command is sent to the IP address configured by our computer. Our computer should always respond to this Ping command. If it does not exist, it indicates that there is a problem with the local configuration or installation. When this problem occurs, the LAN user must disconnect the network cable and then resend the command. If this command is correct after the network cable is disconnected, it indicates that the same IP address may be configured on the other computer.
· Ping other IP addresses in the LAN
This command should leave our computer, go through the nic and network cable to other computers, and then return. If you receive a response, the NIC and carrier in the local network are running correctly. However, if you receive 0 replies, it indicates the subnet mask (code that separates the network part of the IP address from the host part during subnet division) incorrect or the NIC configuration is incorrect or the cable system is faulty.
· Ping the gateway IP Address
If the command is correct, it indicates that the Gateway Router in the LAN is running and can respond.
· Ping a remote IP Address
If you receive four responses, the default gateway is successfully used. A dial-up Internet user can successfully access the Internet (but it is not ruled out that the ISP's DNS may be faulty ).
· Ping localhost
Localhost is a reserved network name for the system. It is an alias of 127.0.0.1. Every computer that is too computer can convert the name to this address. If this is not done, the host file (/Windows/host) is faulty.
· Ping www.xxx.com (for example, www.yesky.com)
Ping www.xxx.com for this domain name. If the DNS server fails, the IP address of the DNS server is incorrectly configured or the DNS server is faulty (for dial-up Internet users, some ISPs do not need to set DNS servers ). By the way, we can also use this command to convert domain names to IP addresses.
If all the Ping commands listed above can run properly, we can basically rest assured that the local and remote communication functions of our computers can be implemented. However, the success of these commands does not mean that all our network configurations are normal. For example, some subnet mask errors may not be detected using these methods.
2. Ping Command Parameters
· Ping IP-t
Run the Ping command on the IP address until the IP address is interrupted by Ctrl + C.
· Ping IP-l 3000
The Data Length in the Ping command is 3000 bytes instead of the default 32 bytes.
· Ping IP-n
Run the Ping command for a specified number of times.