Ping (Packet Internet Groper) is a utility used to verify that a network data packet successfully transmits to the destination. You can also use it to check the network connection of a computer on the network or any device connected to the network.
What is Ping? and What Does it Do?
Ping abbreviated from Packet InterNet Groper. Briefly, it uses to test network problems. You can test the connection by pinging a device that connected to the network and has an IP address. For example; You can check the network connection by pinging a computer or server on a LAN or WAN.
Ping was developed in 1983 by Mike Muss. This protocol checks the network connection by sending packets of 32 bytes to the destination. For example, if you ping the server at a nearby location, the reaction time (ms) value will be low. But when you ping the server at a remote location, the reaction time value will be high.
This protocol sends an Echo Request packet to the destination using the Internet Control Message Protocol (ICMP) protocol and waits to receive the Echo-Reply packet. If a client on the network receives an Echo-Reply packet for the Echo Request packet it sends, the connection will be successful.
What is ICMP?
ICMP (Internet Control Message Protocol) is the sub-protocol for error reporting and control of the Internet Protocol (IP). Therefore, it is used, for example, to send error messages stating that a particular service is not available or a router or host cannot be found.
ICMP differs from the purposes of TCP and UDP because it is not usually used directly by user applications on the network. The only exception is the Ping and Traceroute tool, which sends Echo ICMP request messages to determine whether a host is available, the time it takes for packets to travel to and from that host, and the number of hosts passing through it.
How Does It Work?
ICMP is part of the IP protocol package and is as defined in RFC 792. ICMP messages are commonly created in response to errors in IP Datagrams or for diagnostics and routing. The ICMP version for IPv4 is also known as ICMPv4. IPv6 has the equivalent ICMPv6 protocol. ICMP messages are created at the network layer level. IP encloses the appropriate ICMP message with a new IP header (to receive response messages from the original host sending) and transmits the resulting datagram as usual.
For example, each router transmitting an IP datagram should reduce the TTL (time to live) area of the IP header by one unit; If the TTL reaches 0, an ICMP “Time to Live to Transmit” message is sent to the source of the datagram. Each ICMP message is encapsulated directly in a single IP datagram and therefore does not guarantee ICMP transmission. Although ICMP messages are included in standard IP datagrams, ICMP messages are processed as a special case of normal IP processing, such as IP IP protocol processing. In most cases, it is necessary to check the content of the ICMP message and send the appropriate error message to the application that created the original IP packet requesting the ICMP message to be sent.
The benefit of the ICMP protocol is to check if a packet reaches its destination when it expires. That is, it is used to process error and control messages required for network systems, its original source is detected with them, thereby preventing or correcting the perceived problem.
Most common network utilities are based on ICMP messages. The traceroute command is implemented by transmitting UDP datagrams with special TTL IP fields in the header and searching for “Time to Live in Transit” and “Destination Unreachable” messages created in response. A ping tool is implemented using ICMP “Echo request” and “Echo reply” messages.
First, hold down the Windows key on your system, press R and open Run.
In the Run window, type cmd in the Open field and click the OK button.
When the CMD command prompt runs, it looks like the following image.
To ping the IP address of your ADSL modem, type ping 192.168.1.1 on the CMD and press Enter. Your default gateway IP address here may be different.
If the test is successful as in the image below, you have a connection to your ADSL modem on your network.
The output (0% loss) reports that the packets were transmitted smoothly. Bytes=32 indicates that Ping sends a 32 Byte packet by default.
Step 5 | What is Destination Host Unreachable?
When you ping a downed client on the network, you will receive the Destination Host Unreachable message. The main reasons for the Destination Machine Unreachable message are:
When the target machine is Down, you will receive an error of the Destination Host Unreachable.
If an error occurs in the TCP/IP configuration of the target machine, you will receive the Destination Host Unreachable error.
You will receive a Destination Host Unreachable error when it finds the target network but cannot find the target client.
Step 6 | What is Request Timed Out?
When you ping a client that is not on the same network, you will receive a Request Time Out error. For example, if you successfully ping all clients on the 192.168.1.0/24 network, but you cannot ping a client on the 192.168.2.0/24 network and receive a Request Time Out error, this means that you cannot access the destination at all.
The main reasons for Request Time Out error are:
When the target is Down, you receive a Request Timed Out error.
If the target client is certain but still cannot ping, you will get a Request Timeout error on the Router due to the Routing protocol error.
If there is a Firewall installed on the target, you receive a Request Timed Out error because it blocks ICMP packets.
Step 7 | How to Ping a Website
Pinging a website is very easy. The purpose of testing the link to the website is to check that it is online. Likewise, open the CMD command prompt and after specifying a website you want to ping, type the following command and press Enter.
If you look at the image below, you can see that the website can be accessed successfully.
How to Ping on Linux
It is very easy on Linux-based operating systems such as Ubuntu, Fedora, Linux Mint, Debian, Kali Linux. And it is the same process you do on Windows systems.
In Linux/Ubuntu, open the Terminal by pressing Ctrl + Alt + T together. In Terminal, perform the following command.
As you can see in the image below, the connection test on Ubuntu will be continuous.
You can also do this by using the name of a website on Linux.
Another example is to determine the number of packages. You can specify the number of packets to send to the destination by adding [-c number] to the command.
How to Ping on MacOS
There are two different methods to ping on macOS Sierra / macOS High Sierra running on MacBook or iMac. The first method is to use Terminal on macOS. The second method is to use macOS’s Network Utility tool.
To ping via Terminal on macOS, first, open the Terminal. Press the Windows Key + Space Key together to open the Terminal. Type the terminal in the search box to find and run the program.
After opening the terminal, you can ping the IP address continuously using the command ping 192.168.1.1.
You can only add [-c + number] to ping the web site to an IP address or a number of times you specify.
You can also test the connection to an IP address or website using the Network Utility on macOS. Type network utility in the search box and find and open the program.
Click on the Ping tab and fill in the required fields as shown in the image below and use the Ping command with the Network Utility.
Update (June 19, 2018): By following the steps above, you can ping any website or IP address on macOS Mojave 10.14 and test the network connection!
Pinging on Windows ⇒ Video
You can watch the video below to test connectivity on Windows operating systems and also subscribe to our YouTube channel to support us.
Pinging on Linux ⇒ Video
You can watch the video below to test the connection on Linux / Ubuntu.
Pinging on macOS ⇒ Video
You can watch the video below to test your connection on macOS Sierra / macOS High Sierra.
In this article, after giving information about what Ping protocol is, we examined the use of Ping on Windows, Linux, and macOS operating systems. Thanks for following us!