Ping is a very frequently used utility that determines whether a local host can exchange (send and receive) datagrams with another host. Based on the information returned, we can infer whether the TCP/IP parameters are set correctly and run correctly. It is important to note that the success of one or two datagram exchanges with another host does not mean that TCP/IP configuration is correct, we must perform a large number of local host and remote host datagram Exchange to ensure the correctness of TCP/IP.
Simply put, Ping is a test program, if the ping is correct, we can generally exclude the network access layer, NIC, modem input and output lines, cables and routers, and so on the fault, thereby reducing the scope of the problem. But because you can customize the size of the datagram sent and the endless high-speed send, ping is also used as a tool for DDoS (denial of service attacks) by some people with ulterior motives, such as many large Web sites that have been paralyzed by hackers using hundreds of of computers with high-speed access to the Internet to send a large number of consecutive ping datagrams.
By default, the ping command running on Windows sends 4 ICMP (Inter-network Control Message Protocol) loopback requests, each 32-byte data, and if everything works, we should be able to get 4 loopback responses. The ping can display the amount of time between sending a loopback request and returning an echo response in milliseconds. If the response time is short, it means that datagrams do not have to pass too many routers or network connections faster. Ping also displays the TTL (Time to live) value, and we can calculate the number of routers that the packet has passed through the TTL value: The source location TTL start value (that is, the number of a 2 of a power that returns a TTL slightly larger)-Returns the TTL value. For example, if you return a TTL value of 119, you can count the TTL starting value from the source address to be 128, and the source to the destination from 9 router network segments (128-119); If you return the TTL value of 246,ttl The starting value is 256, The source location to the target site is routed through 9 router segments.
1. Check the typical order of network faults through Ping
Normally, when we use the ping command to find the problem or verify the operation of the network, we need to use a lot of ping commands, and if all is running correctly, we can believe that basic connectivity and configuration parameters are OK, and if some ping commands fail, It can also indicate where to look for problems. Here is a typical detection sequence and the corresponding possible failure:
Ping 127.0.0.1
This ping command is sent to the local computer's IP software, which never exits the computer. If this is not done, there are some basic problems with the installation or operation of TCP/IP.
Ping Native IP
This command is sent to the IP address that is configured on our computer, and our computer should always answer the ping command, and if not, there is a problem with the local configuration or installation. When this problem occurs, the LAN user disconnects the network cable and then sends the command again. If this command is correct after a network cable is disconnected, another computer may be configured with the same IP address.
ping other IP in LAN
This command should leave our computer, pass the NIC and network cable to other computers, and then return. Receiving a loopback response indicates that the NIC and carrier on the local network are running correctly. However, if 0 loopback responses are received, the subnet mask (the code that separates the network portion of the IP address from the host part when the subnet is split) is incorrect or the NIC is misconfigured or the cabling system is faulty.
Ping Gateway IP
This command, if answered correctly, indicates that the gateway router in the LAN is running and can respond.
Ping Remote IP
If 4 replies are received, the default gateway is successfully used. For dial-up users, the Internet can be accessed successfully (but not excluding the ISP's DNS).
Ping localhost
LocalHost is a system-reserved network name, which is an alias for 127.0.0.1, and every computer should be able to convert that name to that address. Failure to do so indicates a problem in the host file (/windows/host).
Ping www.xxx.com (e.g. www.yesky.com Tenkine)
Ping www.xxx.com address for this domain name, usually through a DNS server if there is a failure, the DNS server's IP address is configured incorrectly or the DNS server is faulty (some ISPs do not need to set up a DNS server for dial-up users). By the way, we can also use this command to realize the conversion function of domain name to IP address.
If all of the ping commands listed above are working correctly, then our ability to communicate locally and remotely to our computers can be largely reassuring. However, the success of these commands does not mean that all of our network configurations are fine, for example, some subnet mask errors may not be detected by these methods.
2, Ping the common parameters of the command options
Ping Ip–t
Ping the IP address continuously until it is interrupted by the user with Ctrl + C.
Ping Ip-l 3000
Specifies that the ping command has a data length of 3000 bytes instead of the default 32 bytes.
Ping Ip–n
Performs a specific number of ping commands.
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.