What is PING and How to Use it? Learn it with 7 Examples


Ping is probably the most used networking instructions.

In lately’s article, you’ll be told what it is, how to use it, on-line ping gear, and some sensible examples.

To start with, let’s see what ping is. Ping is a Terminal / Shell command application used as a easy method to check {that a} device has web get entry to and can keep in touch with different computer systems or community gadgets.

Probably the most purposes of the ping command are :

  • Take a look at community connectivity: native community, web
  • Troubleshoot community interface card
  • Take a look at DNS identify solution problems

Maximum operative methods like Home windows, macOS, and Linux have Ping pre-installed, however we’ll head into the set up procedure during the article.

Possibly, you’ve noticed ping in standard conversations, as an example, “I’ll ping you after I’m performed with the paintings”. In not unusual language, ping merely way a message despatched from a pc to any other.

Ping Utilization

To test you could have ping put in, stir up a terminal (macOS, Linux) or command urged (Home windows), and sort “ping –assist”. Usually, you must see one thing like this.

When you get a assist segment with a listing of flags to use, you’re excellent to cross. In some Linux distributions like Ubuntu, you will have hassle as a result of ping isn’t put in via default. In Ubuntu, you’ll be able to set up ping with:

sudo apt set up iputils-ping

In a different way to check ping is put in on your machine could be the usage of which, that returns the trail of any binary put in on your machine:

which ping

# /usr/bin/ping  # My outcome

Now that you’ll be able to use ping with no drawback, it’s time to be told its elementary utilization.

The ping command connects to any host to be had, whether or not on your native community or over the web. That host can also be any other laptop, server, router, or perhaps a printer.

Ping accepts one argument, which is the internet or IP deal with you’re attempting to attach to. As an example, we’ll take a look at to attach to geekflare.com.

$ ping geekflare.com

Take note the “$” signal way we’re the usage of a bash shell; in Powershell (Home windows), it could be “>”. You must most effective reproduction the command and no longer the greenback signal.

After typing the above command, you must see one thing like the next:

PING geekflare.com (104.27.118.115) 56(84) bytes of information.
64 bytes from 104.27.118.115 (104.27.118.115): icmp_seq=1 ttl=57 time=64.1 ms
64 bytes from 104.27.118.115 (104.27.118.115): icmp_seq=2 ttl=57 time=71.4 ms

First, it signifies the area identify we’re attempting to attach to and its IP deal with inside parenthesis. Then, it sends packets of bytes of information (generally 64) to the specified vacation spot. To forestall the ping command, simply press Ctrl + C.

When you have a solid web connection (which I’m positive you do because you’re studying this), you must get a message equivalent to the only under:

--- geekflare.com ping statistics ---
3 packets transmitted, 3 won, 0% packet loss, time 10192ms

This message presentations the statistics of the pinging procedure you probably did to a website identify or IP deal with. As you’ll be able to see, ping despatched 3 packets of information, and it won they all. That suggests each your web connection and the website hosting carrier that serves the IP deal with is operating completely.

That very same procedure happens while you discuss with a internet web page, you (your browser) ship packets of information with a request, the DNS (area identify carrier) translate the area identify to an actual IP deal with, and then the host transmits the content material of the web page again to us. In fact, we’re skipping numerous issues, however this is simply a proof a couple of easy community interplay.

As a pro-tip, anytime you wish to have a listing of the to be had flags, you’ll be able to name its handbook web page with guy or the –assist flag.

guy ping
# Handbook web page
ping --help
# Assist flag

IPv6 vs. IPv4

The arena is operating out of IP addresses, and in consequence, we’re beginning to put into effect IPv6 (Web Protocol model 6).

In a while defined, IPv4 is the core IP protocol that runs the internet. It makes use of a 32-bit IP deal with, together with a numeric-dot notation. As an example, Google’s primary IP deal with is 8.8.8.8IPv4 has been right here since 1981, and it’s the standard protocol we’re used to seeing.

Then again, IPv6 is any other IP protocol that solves the issue of having out of deal with. If IPv4 has up to 4.3 billion mixtures, IPv6 can have 340 trillion trillion trillion IP addresses.

Right here is an instance of an IPv6 deal with: 2001:db8:3333:4444:5555:6666:7777:8888.

In different phrases, we’ll be transitioning to IPv6 addresses in the following couple of years as a result of each IOF (web of items) software and upcoming web pages will want new addresses.

Ping already helps IPv6 addresses, and in some Linux distributions, you’ll be able to to find an unique command, (*7*)ping6, for them.

Then again, the easiest way to ping an IPv6 deal with is the usage of the -6 flag.

Right here’s an instance:

ping -6 2001:db8:3333:4444:5555:6666:7777:8888

In case your community doesn’t enhance IPv6 but, don’t concern. IPv6 adaption has been rising ginormously lately.

Google statistic of IPv6 adoption worldwide
IPv6 expanding enhance

Use the IPv6 trying out software to take a look at in case your web page helps it.

On-line Ping Services and products

Ping most effective utilization isn’t to decide should you’re in a position to achieve a selected server, but additionally to get the latency (time that it takes ping to obtain a reaction) of your request to a server. On-line ping gear permit you to acquire a lot more knowledge concerning the ping processes like

Then again, should you’re having a foul time with your connectivity or simply need to check out your server latency from other places international, a web-based Ping software is your best option.

Take a look at our unfastened on-line ping software, and carry out pings from London, Mumbai, and Oregon. The usage of this software, you’ll get essential knowledge like packet loss and the utmost and minimal time it takes to get a reaction out of your server.

Geekflare's PING online tool result page

Command Examples

Let’s check and see probably the most incessantly used examples of this networking software.

#1. Test Your Web connection

This may occasionally appear evident, however you’ll be able to take a look at you could have get entry to to the Web via pinging (the motion of the usage of ping) a cast goal host like google.com.

ping google.com

When you don’t get any reaction, it’s most likely your Web connection isn’t operating correctly.

#2. Ship a Made up our minds Quantity of Pings

One drawback chances are you’ll stumble upon should you’re the usage of a Unix device is that ping sends packets of information indefinitely.  With the flag -c (rely), you’ll be able to specify the collection of pings you wish to have to make. As an example, if you wish to have to ping precisely thrice, you could possibly do.

ping -c 3 geekflare.com

Be aware: This doesn’t happen in Home windows the place ping sends most effective 4 knowledge packets

You’ll use this flag to ship just a ping request and show the IP deal with of the vacation spot you’re attempting to achieve.

ping -c 1 google.com

#3. Ping a Server Inside of an Period

You’ll set an period of seconds between sending every packet. The default period is one 2nd, however you’ll be able to regulate it with the -i flag.

ping -i 3 geekflare.com

#4. Ping localhost

You’ll ping any IPv4 deal with; therefore, you’re in a position to ping your localhost the usage of both the localhost label or the IP deal with 127.0.0.1.

ping localhost
# works fantastic
ping 127.0.0.1
# works fantastic too

Ping received’t cross thru a bodily community interface however thru a digital loopback.

#5. Pinging a Broadcast

You’ll use the -b flag to ship requests to a broadcast deal with. As an example, you’ll be able to ping all of the gadgets on your native community with the next command.

ping -b 255.255.255.255

#6. Ship a Particular Packet Measurement

Relying in your wishes, you’ll be able to exchange the packet dimension of your ping the usage of the -s flag with the collection of bytes you wish to have to ship.

ping -s 70 google.com

Be aware that some requests would possibly not paintings should you ship a large dimension packet.

#7. Flood ping

The -f flag sends ping requests as speedy as your laptop and community can. Because the minimum ping period allowed to the consumer is 200ms, you will have to run it as a superuser with the command sudo.

ping -f google.com
PING google.com (142.250.78.142) 56(84) bytes of information.
ping: can't flood; minimum period allowed for consumer is 200ms

sudo ping -f -c 1000 google.com
# Forestall after 1000 pings
--- google.com ping statistics ---
1000 packets transmitted, 1000 won, 0% packet loss, time 11158ms

As you’ll be able to see, I used the rely flag to prevent sending requests as soon as it hit 1000 instances (realize how it most effective took 11 seconds).

Be aware: Be extraordinarily cautious the usage of “flood ping” since you’ll want to motive a DoS (denial of carrier) to the server you’re pinging. The one state of affairs you should utilize this is to check your server in high-intensity environments.

Conclusion

A ping is a device nearly as previous because the Web itself. With it, you’ll be able to decide whether or not you could have an energetic web connection or no longer and check should you’re in a position to achieve internet servers or different networking gadgets.

Don’t overlook to use our PING check software, alongside with our complete toolbox, to check your web site.

Related Articles

Leave a Reply

Your email address will not be published.

Back to top button