Network+ Study Guide

Ping is the most basic TCP/IP utility and is included with most TCP/ IP stacks for most platforms. Windows 95/98 and NT are no exceptions. In most cases, Ping is a command-line utility (although there have been some GUI implementations). You use the Ping utility for two primary purposes:

The syntax is:

ping <hostname or IP address>

If you ping any station that has an IP address, the ICMP that is part of that host’s TCP/IP stack will respond to the request. This ICMP test and response might look something like this:

ping 204.153.163.2 Pinging 204.153.163.2 with 32 bytes of data: Reply from 204.153.163.2: bytes=32 time<10ms TTL=128 Reply from 204.153.163.2: bytes=32 time=1ms TTL=128 Reply from 204.153.163.2: bytes=32 time<10ms TTL=128 Reply from 204.153.163.2: bytes=32 time<10ms TTL=128

Because you receive a reply from the destination station (204.153.163.2 in this case), you know that you can reach the host and that it is responding to basic IP requests.

Most versions of Ping work in the same fashion, although there are some switches you can use to specify certain information—for example, the number of packets to send, how big a packet to send, and so on. If you are running the Windows 95/98 or NT command-line versions of Ping, use the –? switch to display a list of the available switches, like so:

ping -?

Table 4.4 lists and describes some of the most common switches for the Windows 95/98 and NT Ping utility.

Table 4.4: Windows Ping Utility Switches

Switch

Description

–?

Displays a list of switches that can be used with Ping.

–a

Resolves the pinged address to a host name simultaneously.

–n #

Pings the specified host multiple times (the number of times is specified by the number, #).

–t

Pings the host continually until you press Ctrl+C.

–r #

Records the route taken during the Ping hops. Requires a number (#) to indicate the number of hops to record. Similar to the tracert command (discussed later in this chapter).

Tip 

You can ping your local TCP/IP interface by typing ping 127.0.0.1 or ping localhost. Both addresses represent the local interface.

Категории