You are on page 1of 8

INFORMATION SHEET 3.2.

Check operation of network services

LEARNING OBJECTIVE/S:

After reading this information sheet, you must be able to:

1. Identify what is a network service.


2. Identify how ping operates, its process and how to use it.

Ping Command

 The ping command is a Command Prompt command used to test the


ability of the source computer to reach a specified destination computer.
 The ping command is usually used as a simple way to verify that a
computer can communicate over the network with another computer or
network device.
 The ping command operates by sending Internet Control Message
Protocol (ICMP) Echo Request messages to the destination computer and
waiting for a response.

Ping Command Syntax

ping [-t] [-a] [-n count] [-l size] [-f] [-i TTL] [-v TOS] [-r count] [-s count] [-


w timeout] [-R] [-S srcaddr] [-p] [-4] [-6] target [/?]
Ping Command Options
Item Explanation
-t Using this option will ping the target until you force it to stop
by using Ctrl+C.
-a This ping command option will resolve, if possible,
the hostname of an IP address target.
-n count This option sets the number of ICMP Echo Requests to send,
from 1 to 4294967295. The ping command will send 4 by
default if -n isn't used.
-l size Use this option to set the size, in bytes, of the echo request
packet from 32 to 65,527. The ping command will send a 32-
byte echo request if you don't use the -l option.
-f Use this ping command option to prevent ICMP Echo Requests
from being fragmented by routers between you and the target.
The -f option is most often used to troubleshoot Path
Maximum Transmission Unit (PMTU) issues.
-i TTL This option sets the Time to Live (TTL) value, the maximum of
which is 255.
-v TOS This option allows you to set a Type of Service (TOS) value.
Beginning in Windows 7, this option no longer functions but
still exists for compatibility reasons.
-r count Use this ping command option to specify the number
of hops between your computer and the target computer or
device that you'd like to be recorded and displayed. The
maximum value for count is 9, so use the tracert
command instead if you're interested in viewing all the hops
between two devices.
-s count Use this option to report the time, in Internet Timestamp
format, that each echo request is received and echo reply is
sent. The maximum value for count is 4, meaning that only the
Ping Command Options
first four hops can be time stamped.
-w timeout Specifying a timeout value when executing the ping command
adjusts the amount of time, in milliseconds, that ping waits for
each reply. If you don't use the -w option, the default timeout
value of 4000 is used, which is 4 seconds.
-R This option tells the ping command to trace the round trip
path.
-S srcaddr Use this option to specify the source address.
-p Use this switch to ping a Hyper-V Network
Virtualization provider address.
-4 This forces the ping command to use IPv4 only but is only
necessary if target is a hostname and not an IP address.
-6 This forces the ping command to use IPv6 only but as with
the -4 option, is only necessary when pinging a hostname.
target This is the destination you wish to ping, either an IP address or
a hostname.
/? Use the help switch with the ping command to show detailed
help about the command's several options.

The -f, -v, -r, -s, -j, and -k options work when pinging IPv4 addresses only.


The -R and -S options only work with IPv6.
How to Use Ping

We’re going to use the Windows Command Prompt in our example here. But
you can also use the ping command in Windows PowerShell, or in the Terminal
app on macOS or any Linux distro. Once you get to use the actual command, it
works the same everywhere.

1. In Windows, hit Windows+R. In the Run window, type “cmd” into the
search box, and then hit Enter.

2. At the prompt, type “ping” along with the URL or IP address you want to
ping, and then hit Enter. In the image below, we’re pinging
www.howtogeek.com and getting a normal response.
1. That response shows the URL you’re pinging.

2. The IP address associated with that URL.

3. The size of the packets being sent on the first line.

4. The next four lines show the replies from each individual packet.

5. The time (in milliseconds) it took for the response and the time-to-live
(TTL) of the packet, which is the amount of time that must pass before
the packet is discarded.

At the bottom, you’ll see a summary that shows how many packets were sent
and received, as well as the minimum, maximum, and average response time.

And in the next image, we’re pinging the router on our local network using its
IP address. We’re also getting a normal response from it.

When the ping tool does not get a response from whatever devices you’re
pinging, it lets you know that, too.
And that’s how to use ping at its most basic. Of course, like most commands,
there are some advanced switches you can use to make it behave a bit
differently. For example, you can have it keep pinging a destination until you
stop the command, specify the number of times you want it to ping, set how
often it should ping, and more. But unless you’re doing some very specific
types of troubleshooting, you won’t need to worry much about those advanced
switches.

If you’re curious about them, though, just type “ping /?” at the Command
Prompt to see a list.
So, What Can You Do With Ping?

Now that you know how to use the command, here are some interesting things
you can do with it:

1. Ping a URL (like www.howtogeek.com) or IP address to see if you can


reach an internet destination. If you get a successful response, you know
that all the networking devices between you and that destination are
working, including the network adapter in your computer, your router, and
whatever devices exist on the internet between your router and the
destination. And if you’re interested in exploring those routes further, you
can use another networking tool named tracert to do just that.
2. Ping a URL to resolve its IP address. If you want know the IP address for a
particular URL, you can ping the URL. The ping tool shows you right at the
top the IP address it’s working with.
3. Ping your router to see if you can reach it. If you can’t successfully ping
an internet location, you can then try pinging your router. A successful
response lets you know that your local network is working okay, and that
the problem reaching the internet location is somewhere out of your control.
4. Ping your loopback address (127.0.0.1). If you can’t successfully ping your
router, but your router appears to be turned on and working, you can try
pinging what’s known as a loopback address. That address is always
127.0.0.1, and pinging it successfully lets you know that the network
adapter on your computer (and the networking software in your OS) is
working properly.

References:

1. https://www.lifewire.com/ping-command-2618099
2. https://www.howtogeek.com/355664/how-to-use-ping-to-test-your-
network/

You might also like