Network-related study tools command: ping

  Ping is an Internet Explorer package for testing of network connections and programs. Ping is a work in TCP / IP network architecture in a service order application layer, mainly to send ICMP Echo Request packet, if the purpose of the test stand up and understand about their status to a particular destination host. Here we discuss the main windows of the ping command.

The basic format 1.windows the ping command

  Enter the command line ping / to view as?:

  Which, target_name (ie, destination address) can be both URl, it may also be an IP address.

 

Works 2.ping command

  Ping command operates using ICMP protocol, ICMP is a sub-protocol TCP / IP protocol suite, for passing control messages between IP hosts, routers. ICMP Ping command using the two types of control message: "echo request" (echo request), "echo reply" (echo reply).

  Assuming that the ping command on the host A, the goal is to host B. First, the Ping command to build a fixed format ICMP request packet, then the ICMP protocol along with the destination address of the packet to the IP layer with the protocol layer protocol IP address as the destination address to be received, the local IP address as source address, plus some additional control information to construct an IP packet, and finds the physical address (MAC address) corresponding to the destination address in a mapping table, be given to the data link layer. The latter building a data frame, the IP layer destination address is transmitted over the physical address, the source address is the physical address of the machine, but also some additional control information, based on Ethernet media access rules, transfer them out.

  After the host B receives the data frame, it first checks the destination address and the physical address of the machine and contrast, if they meet, the receiver; otherwise discarded. After checking the received packet, the IP packet extracted from the frame, according to the IP layer protocol machine. Similarly, the IP layer checks, extracting the useful information to the ICMP protocol, the latter after processing, immediately build an ICMP echo packet to the host A, the host A and the process sends an ICMP request packet to the host B exactly.

  Thus, if the host A host B can receive the response packet, it means to go between two hosts, return path are normal, the presence of a physical communication path. But if there is no response is received it does not mean that there is no communication. For example, almost all personal firewall software, by default, is not allowed the machine to other machines Ping, the general practice is to come from outside the ICMP request packets filtered out.

 

 3.windows response information in the ping command

  In the Windows system, by default, the ping command will be sent every four "Echo Request" message, each message packet size is 32 bytes, if all goes well, should likewise be able to receive four 32 byte-sized "echo reply" message. as the picture shows:

  By echoing the response time can be roughly inferred speed, the longer the data transfer time is elapsed, the slower speed. Echo Reply in the "TTL", ie the lifetime of the packet. Each system of its data packet to be transmitted is assigned an initial value of a TTL, by default, Windows XP system 128, Win7 system 64, 64 or 255 of the Linux system. Packet Each time through the route, the TTL value must subtract 1, so by the TTL value, we both can probably be deduced operating systems other host used, they can infer how many times after routing during transmission of data packets.

 

4. ping command to the network fault

Ping command using the correct test sequence to the greatest extent possible faults detected:

ping127.0.0.1-- the Ping command is sent to the local computer's IP software, the command will never withdraw from the computer. If you do not do this, it means that there are some fundamental issues TCP / IP installation or operation.

Native IP-- ping command is sent to the IP address configuration of your computer, your computer should always make a response to the Ping command, if not, then the local configuration or installation problems. When this problem occurs, LAN users disconnect the network cable, and then resend the command. If the cable is disconnected, this command is correct, it means that another computer may be configured with the same IP address.

ping局域网内其他IP——这个命令应该离开你的计算机,经过网卡及网络电缆到达其他计算机,再返回。收到回送应答表明本地网络中的网卡和载体运行正确。但如果收到0个回送应答,那么表示子网掩码(进行子网分割时,将IP地址的网络部分与主机部分分开的代码)不正确或网卡配置错误或电缆系统有问题。

ping网关IP——这个命令如果应答正确,表示局域网中的网关路由器正在运行并能够做出应答。

ping远程IP——如果收到4个应答,表示成功的使用了缺省网关。对于拨号上网用户则表示能够成功的访问Internet(但不排除ISP的DNS会有问题)。

ping localhost——localhost是个操作系统的网络保留名,它是127.0.0.1的别名,每台计算机都应该能够将该名字转换成该地址。如果没有做到这一条,则表示主机文件(/Windows/host)中存在问题。

ping www.baidu.com——对这个域名执行Ping命令,你的计算机必须先将域名转换成IP地址,通常是通过DNS服务器。如果这里出现故障,则表示DNS服务器的IP地址配置不正确或DNS服务器有故障。

Guess you like

Origin www.cnblogs.com/qianzhusong/p/11953789.html