Ping is a command under Windows, Unix and Linux systems. Ping also belongs to a communication protocol and is part of the TCP/IP protocol. You can use the "ping" command to check whether the network is connected, which can help us analyze and determine network faults. The following article will introduce you to some commonly used ping commands.
#The ping command is usually used to check network availability. The ping command can send a test packet to a network address to see if there is a response from the network address and count the response time to test the network.
The principle of ping:
Send a data packet of a certain length to the specified network address. According to the agreement, if the specified network address exists, the same will be returned. Of course, if the data packet is not returned within a specific time, it is a "timeout" and it will be considered that the specified network address does not exist.
ICMP protocol is sent through IP protocol, which is a connectionless and unreliable data packet protocol. In Unix/Linux, the serial number starts counting from 0 and increases in sequence. The ICMP sequence number of the Windows ping program is irregular.
ICMP protocol data packet in actual transmission: 20-byte IP header, 8-byte ICMP header, 1472 bytes 38 bytes.
ICMP message format: IP header (20 bytes) 8-bit type 8-bit code 16 checksum (different types and codes have different formats).
Usage of ping command
ping [-t] [-a] [-n count] [-l size] [-f] [-i TTL] [-v TOS] [-r count] [-s count] [[-j host-list] | [-k host-list]][-w timeout] [-R] [-S srcaddr] [-4] [-6] target_name
In the "Run" option in the start menu, enter "cmd" to open the cmd command window; enter Ping without parameters or ping /? to display Ping Command help:
Detailed explanation of ping command:
-t: Ping the specified computer until interrupted.
-a : Resolve the address into a computer name.
-n count: Send the number of ECHO packets specified by count. The default value is 4.
-l size : Send an ECHO packet containing the amount of data specified by size. Default is 32 bytes; maximum value is 65,527.
-f : Send the "do not fragment" flag in the packet. The packet will not be fragmented by the gateway on the route.
-i ttl: Set the "Time to Live" field to the value specified by ttl.
-r count : Record the routes for outgoing and return packets in the "Record Route" field. count can specify a minimum of 1 and a maximum of 9 computers.
-s count :Specify the timestamp of the number of hops specified by count.
-j host-list: Route packets using the computer list specified by host-list. Contiguous computers can be separated by intermediate gateways (routing sparse sources) The maximum number of IPs allowed is 9.
-k host-list: Route packets using the computer list specified by host-list. Contiguous computers cannot be separated by intermediate gateways (Route Strict Source) The maximum number of IPs allowed is 9.
-w timeout: Specify the timeout interval in milliseconds.
destination-list: Specify the remote computer to ping.
The above is the detailed content of Detailed explanation of commonly used ping commands. For more information, please follow other related articles on the PHP Chinese website!

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

PhpStorm Mac version
The latest (2018.2.1) professional PHP integrated development tool

DVWA
Damn Vulnerable Web App (DVWA) is a PHP/MySQL web application that is very vulnerable. Its main goals are to be an aid for security professionals to test their skills and tools in a legal environment, to help web developers better understand the process of securing web applications, and to help teachers/students teach/learn in a classroom environment Web application security. The goal of DVWA is to practice some of the most common web vulnerabilities through a simple and straightforward interface, with varying degrees of difficulty. Please note that this software

SublimeText3 Chinese version
Chinese version, very easy to use

SecLists
SecLists is the ultimate security tester's companion. It is a collection of various types of lists that are frequently used during security assessments, all in one place. SecLists helps make security testing more efficient and productive by conveniently providing all the lists a security tester might need. List types include usernames, passwords, URLs, fuzzing payloads, sensitive data patterns, web shells, and more. The tester can simply pull this repository onto a new test machine and he will have access to every type of list he needs.

Dreamweaver Mac version
Visual web development tools
