Home Everything related to Internet, Programming and Technology

How to continuously ping on Windows CMD or PowerShell

When we need to use the PING command, it is usually to inspect the performance or stability of our network, or it could also be because we want to see the latency between our equipment and a remote server or computer. But whatever the case if we use it in Windows, with any version this command from the console, example: ping google.com, will only make 4 requests to the domain or IP address, even with PowerShell.

Run ping command continuously

If we talk about Linux when we execute the ping command, it doesn't stop until we force it with CTRL + C. But when you need this to happen in Windows for continuous scanning, the solution is to use the command as below with the -t attribute:

ping -t google.com

In this way the requests will not stop, a continuous ping will be achieved until we force it to stop with a keyboard combination. Although it is very simple, sometimes we forget it, but with constant use we will learn it and we will not have problems with the command stopping fast.

powershell ping parameter t google

If instead of constantly pinging we only want it to do a certain number of times we use the -n parameter, this limits the number of packets sent. The following example limits it to 100 packages.

ping -n 100 google.com

In this case, only 100 requests will be sent to Google domain. In any case we can use either the classic Windows terminal or the more modern PowerShell terminal since the command is the same.

powershell ping parameter n google

Stop command execution

To stop ping use the key combination:

CTRL + C

stop ping

If we don't stop the command with the above combination, the stats won't show up, so simply closing the window isn't the best idea if we need them.

How else can we use this parameter?

  • In the case of monitoring, if we run the command throughout the day, in the end we can stop it and check if there is any network problem.
  • In other cases we can use it to see at what time or on which days there is more congestion of our Internet connection or any Network.
  • We can diagnose our local network and detect if the problem is in our local network or if it is our provider's fault in case of Internet failures.
  • It is the easiest way to know if a server is available within our local network or on the Internet.
  • We can diagnose DNS indirectly, because if the ping command to a domain does not resolve to an IP address it could indicate DNS problems.

What do the statistics refer to when stopping execution?

Firstly, it shows us the IP address, followed by the number of UDP packets that were sent and of those few that were received. In case one is not received it is called a lost package. In the case of a good connection always or 99% of the time it must be zero.

Times are in milliseconds (0.001 seconds = 1 millisecond):

  • minimum: Refers to what was the shortest response time of a package sent during the entire execution of the command.
  • maximum: This is the maximum time that any package takes without counting lost packages.
  • mean: It is the average of all the times until finishing the execution.

Regarding the information of the packages, if 5 packages are sent, the ideal is to receive 5 packages, otherwise they count as lost packages and the latter means that we send a signal, but we do not receive a response from the server. If the percentage of lost packets is greater than 0% it could indicate connection problems on our part or on the part of the server. In some cases that we do not receive a response does not mean that we do not have a connection to the server, this could be because many servers or IP addresses have the ICMP protocol blocked. What we have to do to verify is simply try another server or send the ping from another computer on a different network.

Categories

Comments

© 2021 ImperioWeb.net Todos los derechos reservados.