Let’s start with an example to check the connection to the google.com host. To do this, we just need to type in a terminal ping google.com, but because the program will not stop the ping alone we have to do stop it manually. To do this we must use the keyboard shortcut Ctrl + C.
Code language: CSS (css)
# Ping command ping google.com
Analyzing the result we find that google.com responds with IP address 188.8.131.52, ttl (time to live) the life of the packets in hops (routers) are possible 119 more, time: the response time for which the packet arrives is between 3ms and 4ms which is relatively good – but the most important information is actually hidden after we stop the program and it shows us the brief statistics:
--- google.com ping statistics --- 7 packets transmitted, 7 packets received, 0.0% packet loss round-trip min/avg/max/stddev = 3.864/4.207/4.720/0.291 ms
Which means that to google.com we have 7 sent, 7 received and 0 lost packets for the time of 4.207ms notice, it’s a matter of miles seconds !!!
Ping can actually be started by using various command line options that allow special modes of operation, such as specifying the size of packets sent, possible hops, number of packets, sending speed and much more. Ping is a fundamental program in network administration without which the lives of people who maintain networks would be much more complicated.
Let’s also do an example of ping with ping -n -c 4 -i 10 google.com options
Here in this example -n ignores the DNS naming system, -c 4 sends only four packets -i 10 sends packets every 10 seconds.
One of the cool tricks in ping is when a system administrator suspects that there are “bottlenecks” in the network. By “bottlenecks” we mean that in a normal test ping sends about 64 bytes of packet size and may not show any loss or long response time in milliseconds, but if the packet size increases to, for example, 20,000 bytes, the packet it becomes very large and much more difficult to process than routers. Thus, increasing the packet size increases the response time. The comparison between them system administrator analyzes the state of the network and more precisely the quality of the connection to a particular host (which is often confused with speed)
Here is a clear example of how from 1.4 millisecond the same router to which a large packet of 25,000 bytes is sent begins to respond to an average of 2.5milliseconds. Also not to be underestimated is the difference in the values of 3/4/10 milliseconds, “pattern” of the router’s responses which is a clear sign of instability, ie poor quality of the connection.
In conclusion, ping is a program that every administrator should know.