Get the App
SLTechnology News&Howtos  ›  Servers  › 

How to use the ping command under linux

Shulou Source: shulou.com Published: 2022-06-01 17:10:29 09月29日 Update

This article mainly explains "the use of ping commands under linux". The content of the explanation is simple and clear, and it is easy to learn and understand. Please follow the editor's train of thought to study and learn "the use of ping commands under linux".

The ping command is generally used to detect network connectivity and disconnection, also known as delay, the greater the value, the slower the speed PING (PacketInternetGrope), the Internet packet explorer, the program used to test the number of network connections.

Ping sends an ICMP echo request message to the destination and reports whether it has received the desired ICMP echo reply. It is a command used to check whether the network is open or the speed of the network connection.

Principle: all machines on the network have a unique and definite IP address. If we send a packet to the target IP address, the other party will return a packet of the same size. According to the returned data packet, we can determine the existence of the target host and preliminarily judge the operating system of the target host.

II. The work flow of ping

1. Within the same network segment

Ping

Host A-> Host B

ICMP request packet

Look up the ARP cache table on the local machine (host A) to find the IP of host B and its corresponding MAC

If no mapping between host B's IP and its MAC is found, an arp request broadcast is sent

After receiving the arp request packet, host B replies with an arp reply packet (which contains native MAC).

Host A

Tags: Address host information command network packet local machine data check flag route problem interface broadcast configuration mode variable byte time gateway Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Redmi NVidia vpn MariaDB OPPO Reno