What is ping command?
Ping (stands for Packet Internet groper) is a popular command line tool to check network related issue. Every OS has this inbuilt. And basically, it tells you how long does it take for a “data packet” to travel from your computer to a server and back to your computer. More time it takes, slower is your connection.
How does it work?
Think of it like a sonar. When you ping any server, you send the echo request (ICMP) to the target. And based on the time it took and the amount of the data that came back, you can test the reliability and speed of your connection.
Here is how you use Ping
1. Open command prompt.
If you are new to command prompt then first check out my post on different ways to open command prompt. To open the terminal on mac type in terminal in the spotlight, while linux user can use the shortcut ctrl + alt+ T.
2. Once you see the cmd or terminal window, try the following command.
a. ping localhost
This will display your computer’s name and whether you system is able to receive and send information. You will notice the time it took for sending and receiving data packets is less than 1ms. This is because we are communication to same device.
This is rarely useful but something you should know.
b. ping google.com
This one extremely useful and usually used. If this command fails i.e. there is no response from the server. Then it means either the website is down or your internet.
Now, why ping google? Well, you can ping other websites as well, but since it’s extremely rare that Google’s servers are down or slow, pinging them is the preferred way to test internet connectivity.
Detail Analysis
174.194.36.32 – IP-address of Google.com (ping is also helpful to quickly find IP address of any website)
Lost 0% – It means the ping was successful and your internet is up. No packet was lost.
Avg time = 109 mili sec– if the avg time is less than 100, the connection is Ok and over 1000 is very slow. Though, this is a bit of generalization. It can give you a good idea but it’s defiantly not a holy grail.
Destination unreachable – It probably means that there is no route b/w your computer and destination website. Problem with your network device or internet is down from your ISP
Request timed out – Means no response was received for the given packet. Possibly a slow internet connection.
For more ping option type ping and hit enter.
Ping option
If you want to ping the target continuously use the time (-t) parameter. To escape the loop use ctrl +c for both Mac and Windows.
Example ping google.com –t
If you want to send more or less than 4 requests, use -n followed by no of the count.
Example ping google.com –n 10
[Side note]
Windows sent four packets by default while MAC sent unlimited packets. To stop them in between use CTRL +C. Very useful.
If you want to send a packet data other than 32 bytes (default) use –l followed by numbers of bytes.
Example ping google.com –l 64
It not necessary that every host reply to your ping request. Sometimes pinging website like MSN and Microsoft return an error. Even tough your internet connection is good.
Ping (stands for Packet Internet groper) is a popular command line tool to check network related issue. Every OS has this inbuilt. And basically, it tells you how long does it take for a “data packet” to travel from your computer to a server and back to your computer. More time it takes, slower is your connection.
How does it work?
Think of it like a sonar. When you ping any server, you send the echo request (ICMP) to the target. And based on the time it took and the amount of the data that came back, you can test the reliability and speed of your connection.
Here is how you use Ping
1. Open command prompt.
If you are new to command prompt then first check out my post on different ways to open command prompt. To open the terminal on mac type in terminal in the spotlight, while linux user can use the shortcut ctrl + alt+ T.
2. Once you see the cmd or terminal window, try the following command.
a. ping localhost
This will display your computer’s name and whether you system is able to receive and send information. You will notice the time it took for sending and receiving data packets is less than 1ms. This is because we are communication to same device.
This is rarely useful but something you should know.
b. ping google.com
This one extremely useful and usually used. If this command fails i.e. there is no response from the server. Then it means either the website is down or your internet.
Now, why ping google? Well, you can ping other websites as well, but since it’s extremely rare that Google’s servers are down or slow, pinging them is the preferred way to test internet connectivity.
Detail Analysis
174.194.36.32 – IP-address of Google.com (ping is also helpful to quickly find IP address of any website)
Lost 0% – It means the ping was successful and your internet is up. No packet was lost.
Avg time = 109 mili sec– if the avg time is less than 100, the connection is Ok and over 1000 is very slow. Though, this is a bit of generalization. It can give you a good idea but it’s defiantly not a holy grail.
Destination unreachable – It probably means that there is no route b/w your computer and destination website. Problem with your network device or internet is down from your ISP
Request timed out – Means no response was received for the given packet. Possibly a slow internet connection.
For more ping option type ping and hit enter.
Ping option
If you want to ping the target continuously use the time (-t) parameter. To escape the loop use ctrl +c for both Mac and Windows.
Example ping google.com –t
If you want to send more or less than 4 requests, use -n followed by no of the count.
Example ping google.com –n 10
[Side note]
Windows sent four packets by default while MAC sent unlimited packets. To stop them in between use CTRL +C. Very useful.
If you want to send a packet data other than 32 bytes (default) use –l followed by numbers of bytes.
Example ping google.com –l 64
It not necessary that every host reply to your ping request. Sometimes pinging website like MSN and Microsoft return an error. Even tough your internet connection is good.
No comments:
Post a Comment