Ping Command | ICMP Protocol
Ping command in computer network
The Ping command is a simple network troubleshooting tool that helps us check whether a destination is reachable. It uses the ICMP protocol and, when executed, measures the round-trip time (RTT) between the request and the response in milliseconds (ms), also known as latency.
However, a destination may be online and working properly while its firewall blocks ICMP traffic, preventing it from responding to Ping requests.
However, a destination may be online and working properly while its firewall blocks ICMP traffic, preventing it from responding to Ping requests.
ping [Options] destination
This is the general structure of the ping command
for example, we pinged the Google domain which indicates that the destination is accessible to us
Reply from: Destination IP
Bytes: ICMP data size
Time: Round-trip duration
Ttl: The TTL value indicates the remaining lifetime of a packet
each router along the path decrements this value by one
Ttl os detection: linux < 100 < windows < 200 < router
Request timed out: The issue stems from the firewall or the destination being inactive
Destination host unreachable | Destination net unreachable: Problem with routing
General failure: The issue lies with the system's network configuration
Ttl expired in transit: TTL has reached zero, and the packet's lifespan has ended
Unknown host: The problem is with the DNS
ping -s [Bytes] destinationBy specifying the size of the ICMP data packet (in bytes) during a ping, one can examine network behavior across different packet sizes; for instance, small pages may load, while large pages might load only partially
ping -t [Num] destinationThe TTL (Time to Live) value represents the lifetime of a packet within a network
As the packet travels from source to destination, this value decreases by one each time it passes through a router
If the value reaches zero, the router discards the packet and sends an error message back to the sourceFor instance, if the TTL is set to 1, the packet's lifetime expires at the first router (which is typically the default gateway), and an error message is returned to the sourceSimilarly, if the value is set to 2, the packet's lifetime expires at the second router along the pathIn this way, by manually changing the TTL value in the ping command, one can perform a traceroute-like operation to identify the IP addresses of the routers along the path from source to destination
ping -I [Source ip or Inteface] destinationIf you have multiple network interfaces, you can choose which one to use for the ping operationAlternatively, you can specify a source IP addressIn this case, the destination host will send its response back to the specified source IP addressNote that the source IP address must already be assigned to one of your network interfacesIn this example, we have configured the system to use a specific source IP address when pinging Google
ping -f destinationFlooding a target with a large number of ping requests can overwhelm its resources and potentially disrupt its availability This is a DoS attack
ping -6 destinationUsing IPv6








Comments
Post a Comment