What is Ping? | How to Ping on Windows 10, Linux, and macOS

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? | How to Ping on Windows 10, Linux, and macOS

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.

Protocol Format

List of allowed control messages:

0 – Echo Reply
1 – Reserved
2 – Reserved
3 – Destination Unreachable
4 – Source Quench
5 – Redirect Message
6 – Alternate Host Address
7 – Reserved
8 – Echo Request
9 – Router Announcement
10 – Router Request
11 – Time Out
12 – Parameter Problem
13 – Timestamp
14 – Timestamp Response
15 – Request for Information
16 – Information Response
17 – Request for Address Mask
18 – Address Mask Response
19 – Reserved for security
20-29 – Reserved for robustness experiments
30 – Traceroute
31 – Datagram Conversion Error
32 – Mobile Host Redirection
33 – IPv6
34 – IPv6
35 – Mobile Registration Request
36 – Mobile Registration response
37 – Domain Name Request
38 – Domain Name Response
39 – SKIP Discovery Algorithm Protocol
40 – Photuris, Security Bugs
41-255 – Reserved

For a complete list of ICMP parameters, you can browse the list published by IANA.

How to Use Ping

After explaining what the ping protocol is, let’s examine how to use it.

You can use Ping using the CMD command prompt on Windows XP, Windows 7, Windows 8, Windows 8.1, and Windows 10. To use it step by step, follow the steps below.

   Step 1

First, hold down the Windows key on your system, press R and open Run.

Windows Run

   Step 2

In the Run window, type cmd in the Open field and click the OK button.

Running Command Prompt

   Step 3

When the CMD command prompt runs, it looks like the following image.


   Step 4

To ping the IP address of your ADSL modem, type ping 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:

  1. When the target machine is Down, you will receive an error of the Destination Host Unreachable.
  2. If an error occurs in the TCP/IP configuration of the target machine, you will receive the Destination Host Unreachable error.
  3. You will receive a Destination Host Unreachable error when it finds the target network but cannot find the target client.

Destination Host Unreachable

   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 network, but you cannot ping a client on the 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:

  1. When the target is Down, you receive a Request Timed Out error.
  2. 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.
  3. If there is a Firewall installed on the target, you receive a Request Timed Out error because it blocks ICMP packets.

Request Timed Out

   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.

Testing a Website

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.

Testing on Linux

You can also do this by using the name of a website on Linux.

Testing on Ubuntu

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.

Configuring Packet Size

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.

Starting Terminal in macOS

After opening the terminal, you can ping the IP address continuously using the command ping

Testing on macOS

You can only add [-c + number] to ping the web site to an IP address or a number of times you specify.

Ping -c

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.

macOS Network Utility

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.

How to Use Network Utility in macOS

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.

   Final Word

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!

   Related Articles

♦ How to Enable DHCP
♦ How to Change DNS
♦ How to Disable Windows Defender
Ping Parameters
♦ How to Clear DNS Cache

Add a Comment

Your email address will not be published.