Get the App
SLTechnology News&Howtos  ›  Servers  › 

Basic operation of ping command

Shulou Source: shulou.com Published: 2022-06-03 04:15:15 11月12日 Update

Ping command is one of the most commonly used commands in daily network management and maintenance.

The basic principles of the ping command

The Ping command works using the ICMP protocol, and ICMP is the Internet control message protocol used to pass control messages between the host and the router. The Ping command takes advantage of two types of ICMP control messages: "echo request" (echo request) and "echo reply" (echo reply).

For example, execute the ping command on host A, and the target host is B. The "echo request" control message will be sent on host A, and host B will send back "echo reply" control message after receiving it correctly, so as to determine whether the two parties can communicate normally. Its working principle is shown in figure 1.

If you can ping host B on host A, the information displayed on host An is the "echo reply" returned from host B. If you cannot ping, the message displayed on host An is an error message generated by the system itself.

On Windows systems, by default, four echo request messages are sent each time the ping command is executed, each with a packet size of 32 bytes. If everything is all right, you should be able to receive four echo reply messages with the same size of 32 bytes. The format is as follows:

Reply from... (IP): bytes=32 time

Tags: Hosts commands data messages gateways prompts systems routes errors situations networks failures destinations routers problems controls messages computers jobs differences Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno NVidia MySQL OPPO Reno MariaDB Shulou Tech Info