In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-06 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/02 Report--
preface
Ping is a commonly used tool in our work. We often say ping this ip address to see if the network is open. But ping has a lot of other features besides the simple ones we often use. If you get it, let's explore it.
Ping is a commonly used tool in network detection. Ping works at the application layer of TCP/IP network architecture. It mainly sends ICMP (Internet Message Control Protocol) Echo request messages to specific target hosts to test whether the target can be reached and understand its relevant status. Of course, if ping does not reach the target host, it does not mean that the network is unreachable. It may be that the target host firewall prohibits ping or the kernel prohibits ping.
ICMP is a protocol that integrates error and control and is used to transmit error messages and message control messages. It is interdependent with IP protocol: IP protocol uses ICMP when sending an error or control message, while ICMP uses IP to deliver messages. ICMP ping is to send ICMP information message to the target host, the target host replies ICMP information message or error message, ping program according to the received ICMP message, to know whether the target host can be reached.
linux ping
All systems default to ping, and you can use man to see how ping is used.
1. syntax
The syntax of ping is very simple, and anyone who works with computers will use it.
ping [option parameters] [destination ip address or domain name]
2. output
Output as follows
First line: domain name and ip of target host. The second and third lines: icmp_seq, ping sequence, increasing from 1, if the number is not increasing in order, it means packet loss;ttl, remaining ttl (time to live), life cycle;time, response time, the smaller the number, the faster the connection speed. Fifth row: number of packets sent, number of packets returned, packet loss rate, ping time. Line 6: Minimum, maximum, average response time and native hardware elapsed time. 3. parameters
Ping has many parameter options, such as the parameters we usually use, -c, -b, -i, -s. There are many parameters, but we rarely use them.
-A Adaptive ping, which determines the ping speed according to the ping packet round-trip time. The default is 1s for a return packet.
-b Allow ping broadcast addresses.
-B does not allow ping to change the source address of the packet header.
-c(count) Specifies the number of pings.
-d Use Socket's SO_DEBUG feature, which is essentially not used by the Linux kernel.
-f Large ping, limit ping. If no interval is given, it sets the interval to 0 and outputs packets at the rate they return or hundreds per second, whichever is greater. Only superusers can set will to 0.
-i(interval) Specifies the interval between sending each packet, only superusers can set interval values less than 0.2 seconds.
-I(interface address) Specifies the interface of the network card. The parameter can be IP address or device name. This option is required when ping IPv6 link-local addresses.
-l(preload) If preload is specified, ping sends many packets without waiting for a reply. Only superusers can select more than 3 preloads.
-n numeric display, does not convert ip addresses to host names.
-p(pattern) specifies the hexadecimal content of the pad packet, and can specify up to 16 "pad" bytes to pad the packet sent. Useful when diagnosing data-related problems in a network, for example-p ff will cause the entire packet to fill up.
-q Silent output, does not display the execution process, only displays the result.
-r Ignore normal routing tables and send packets directly to the remote host. Returns an error if the host is not on a directly connected network. If the-I option is still used, this option can be used to ping the local host over an interface that has no route.
-R records the routing process of ipv4 ping. Please note that due to the limitation of IP header, only 9 routes can be recorded at most, and others will be ignored.
-s(packetsize) Specifies the number of bytes of data to send. The default is 56, which translates to 64 ICMP data bytes when combined with 8 bytes of ICMP header data.
-t(ttl) Specifies the TTL lifetime of the packet.
-M(hint) Sets the mtu (Maximum Transmission Unit) fragmentation policy. Can be set to, do: prohibit fragmentation, even if the packet is dropped;want: fragmentation when the packet is too large;dont: do not set the fragmentation flag (DF flag).
-v Detailed output.
-w(deadline) Specifies an exit time in seconds, regardless of how many packets are sent or received before ping exits. In this case, ping will keep sending packets until the deadline expires or the count probe ends or some error notification from the network.
W(timeout) Time to wait for a response, in seconds. This option affects only the timeout of any response, otherwise ping will wait two RTTs.
-V Displays the version of ping.
4. examples
View ping version
The requested URL/home/rainbowhy/Desktop/was not found on this server.
One ping per 0.2s, 5 pings total
Using the 1024 byte packet ping, -s parameter, the maximum value for windows is 65500, and the maximum value for linux is 65507
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
View [root@3 ~] # lsblk-fNAME FSTYPE LABEL UUID MOUNTPOI through the lsblk command
© 2024 shulou.com SLNews company. All rights reserved.