Table of Contents
What is Ping
Ping is a very simple but effective command. Having this command in your arsenal will be very helpful. You can use a ping command for checking your internet connection to a specific website. Also, how much it takes time to connect to the server. As you can see ping has a very basic functionality in the world of the internet, probably every gamer and computer geek knows about this command. Today, in this short tutorial you will get to know about ping command and how it works.
How does Ping work
The concept of ping comes from the sonic of a bat. Like bat ping command also sends echo to certain target and then receive reply echo. If because of any network issue sender does not receive a reply echo then the computer shows an error. With this ping command also records the time between echo packet sent and then received. Let the user know, how strong the internet connection he/she has with a certain server. If your country is blocking some websites and you ping those websites then it will give you an error.
These techniques are for educational purposes. If you want to get familiarized with the ping command you can check to google IP address by ipconfig command of CMD. So by this, you can ping google server. Enjoy!
How to use Ping
The easiest way to use ping is to write ping in command prompt and domain name or IP address you want to ping.
It was easy. Right?? Now we dive into this deep so by default ping command sends 4 packets and bytes of data. Thanks to the option we can change this and you will be introduced to all the options which can modify the ping command.
By default, the ping command sends 4 packets and then waits to receive those 4 packets. If one of the packet losses to network issues then it will show this information under the lost heading.
With this, it also shows time information for sent packets like what was minimum time, maximum time and the average time packets took for a round trip.
So if you are an advance user or want to know more about networking you can use options for command prompt commands. For using these options we have proper syntax for that which is
ping option IP/domain name
|-w||time out to wait for each reply|
|-i||time to live|
|-a||resolve addresses to hostnames|
|-n||number of echo requests to send|
|-l||send buffer size|
The first option we have is -w. By this, we can change waiting time for each reply and the default value is 4000. If we change this value to 2000 then time to wait for the packet will be less than default value and any packet did not reach back in time than it will consider as a lost packet.
ping -w 2000 www.google.com
The second option is -i which translates to a time to live for each packet. We can change this value in the range from 1 to 255. Please remember sometimes due to DNS this time to live value does not change because of the cache.
ping -i 255 www.google.com
Thirdly, we have the option of -a, it resolves addresses to host. Like if your connection has any obstacle to other servers it will try to help with that issue.
ping -a www.google.com
The fourth option we have -n and it is one of the important options out there. The default value is 4, every ping command sends 4 data packets. You can experiment by sending more data packets or less to have deep insights about how is your connectivity to a certain server.
ping -n 10 www.google.com
Lastly, we have the option of controlling how much data in one packet we want to send. For this, we use -l and a default value for this 32 bytes. By sending more buffer size we can have a better idea of how strong is a connection or how much latency is there.
ping -l 64 www.google.com
These are basic options for the ping command. There are some other options which are only suited for some devices and with a special internet connection. You can know more about them by typing this command in command prompt.
How to interpret Ping results
Now we know how to use the ping command with its different option and you must be realizing that why we did this or what use this ping command has to me.
Firstly, by pinging google we can know its IP address. Secondly, we can know the time for the round trip of every data packet we sent. So less time it took means we have a better connection to a Google server. Thirdly it tells us about any data packet lost due to any networking issue. Rule of thumb is less time means better internet connection.
I hope you will find this short tutorial about the Ping command helpful. You can also check the blog on networking commands of CMD. Apart from networking if you are interested in knowing the basic commands of command prompt click here.