ping Command Purpose Sends an echo request to a network host. Syntax ping [ -d] [ -n ] [ -q ] [ -r] [ -v] [ -R ] [ -c Count ] [ -f | -i Wait ] [ -l Preload ] [ -p Pattern ] [ -s PacketSize ] Host [ Packet- Size [ Count ] ] Description The /usr/sbin/ping command sends an Internet Control Message Pro- tocol (ICMP) ECHO_REQUEST to obtain an ICMP ECHO_RESPONSE from a host or gateway. The ping command is useful for: * Determining the status of the network and various foreign hosts. * Tracking and isolating hardware and software problems. * Testing, measuring, and managing networks. If the host is operational and on the network, it responds to the echo. Each echo request contains an Internet Protocol (IP) and ICMP header, followed by a timeval structure, and enough bytes to fill out the packet. The default is to continuously send echo requests until an Interrupt is received (Ctrl-C). The ping command sends one datagram per second and prints one line of output for every response received. The ping command cal- culates round-trip times and packet loss statistics, and displays a brief summary on completion. The ping command completes when the program times out or on receipt of a SIGINT signal. The Host parameter is either a valid host name or Internet address. By default, the ping command will continue to send echo requests to the display until an Interrupt is received (Ctrl-C). The In- terrupt key can be changed by using the stty command. Because of the load that continuous echo requests can place on the system, repeated requests should be used primarily for prob- lem isolation. Flags -c Count Specifies the number of echo requests, as indicated by the Count variable, to be sent (and received). -d Starts socket-level debugging. -f Specifies flood-ping option. The -f flag "floods" or outputs packets as fast as they come back or one hundred times per second, whichever is more. For every ECHO_REQUEST sent, a . (period) is printed, while for every ECHO_REPLY received, a back- space is printed. This provides a rapid display of how many packets are being dropped. Only the root user may use this op- tion. Note: This can be very hard on a network and should be used with caution. Flood pinging the broadcast address is not permitted. The -f flag is incompatible with the -i Wait flag. -i Wait Waits the number of seconds specified by the Wait vari- able between the sending of each packet. The default is to wait for one second between each packet. This option is incompatible with the -f flag. -l Preload Sends the number of packets specified by the Preload variable as fast as possible before falling into normal mode of behavior (one per second). -n Specifies numeric output only. No attempt is made to look up symbolic names for host addresses. -p Pattern Specifies up to 16 ``pad'' bytes to fill out the pack- et you send. This is useful for diagnosing data-dependent prob- lems in a network. For example, -p ff fills the packet with all 1's. -q Specifies quiet output. Nothing is displayed except the sum- mary lines at startup time and when finished. -r Bypasses the routing tables and sends directly to a host on an attached network. If the Host is not on a directly connected network, the ping command generates an error message. This op- tion can be used to ping a local host through an interface that no longer has a route through it. -R Specifies record route option. The -R flag includes the RECORD_ROUTE option in the ECHO_REQUEST packet and displays the route buffer on returned packets. Note: The IP header is only large enough for nine such routes. Also, many hosts and gateways ignore this option. -s PacketSize Specifies the number of data bytes to be sent. The default is 56, which translates into 64 ICMP data bytes when com- bined with the 8 bytes of ICMP header data. -v Requests verbose output, which lists ICMP packets that are re- ceived in addition to echo responses. Parameters PacketSize Specifies the number of data bytes to be sent. The default is 56, which translates into 64 ICMP data bytes when com- bined with the 8 bytes of ICMP header data. This parameter is included for compatibility with previous versions of the ping command. Count Specifies the number of echo requests to be sent (and re- ceived). This parameter is included for compatibility with pre- vious versions of the ping command. Examples 1. To check the network connection to host canopus and specify the number of echo requests to send, enter: ping -c 5 canopus OR ping canopus 56 5 Information similar to the following is displayed: PING canopus.austin.century.com: (128.116.1.5): 56 data bytes 64 bytes from 128.116.1.5: icmp_seq=0 ttl=255 time=2 ms 64 bytes from 128.116.1.5: icmp_seq=1 ttl=255 time=2 ms 64 bytes from 128.116.1.5: icmp_seq=2 ttl=255 time=3 ms 64 bytes from 128.116.1.5: icmp_seq=3 ttl=255 time=2 ms 64 bytes from 128.116.1.5: icmp_seq=4 ttl=255 time=2 ms ----canopus.austin.century.com PING Statistics---- 5 packets transmitted, 5 packets received, 0% packet loss round-trip min/avg/max = 2/2/3 ms 2. To get information about host lear and start socket-level de- bugging, enter: ping -d lear Information similar to the following is displayed: PING lear.austin.century.com: (128.114.4.18) 56 data bytes 64 bytes from 128.114.4.18: icmp_seq=0 ttl=255 time=6 ms 64 bytes from 128.114.4.18: icmp_seq=1 ttl=255 time=17 ms 64 bytes from 128.114.4.18: icmp_seq=2 ttl=255 time=6 ms 64 bytes from 128.114.4.18: icmp_seq=3 ttl=255 time=6 ms 64 bytes from 128.114.4.18: icmp_seq=4 ttl=255 time=6 ms \^C ----lear.austin.century.com PING Statistics ---- 5 packets transmitted, 5 packets received, 0% packet loss round-trip min/avg/max = 6/8/17 ms Note: The output is repeated until an Interrupt (Ctrl-C) is re- ceived. 3. To obtain information about host opus and specify the number of data bytes to be sent, enter: ping -s 2000 opus OR ping opus 2000 Information similar to the following is displayed: PING opus.austin.century.com: (129.35.34.234): 2000 data bytes 2008 bytes from 129.35.34.234: icmp_seq=0 ttl=255 time=20 ms 2008 bytes from 129.35.34.234: icmp_seq=1 ttl=255 time=19 ms 2008 bytes from 129.35.34.234: icmp_seq=2 ttl=255 time=20 ms 2008 bytes from 129.35.34.234: icmp_seq=3 ttl=255 time=20 ms 2008 bytes from 129.35.34.234: icmp_seq=4 ttl=255 time=20 ms 2008 bytes from 129.35.34.234: icmp_seq=5 ttl=255 time=19 ms 2008 bytes from 129.35.34.234: icmp_seq=6 ttl=255 time=19 ms \^C ----opus.austin.century.com PING Statistics---- 7 packets transmitted, 7 packets received, 0% packet loss round-trip min/avg/max = 19/19/20 ms Note: The output is repeated until an Interrupt (Ctrl-C) is re- ceived. 4. To invoke the flood-ping option to host stlopnor, enter: ping -f stlopnor Information similar to the following is displayed: Ping stlopnor.austin.century.com: (129.35.34.234): 56 data bytes .\^C ----stlopnor.austin.century.com PING Statistics ---- 1098 packets transmitted, 1097 packets received, 0% packet loss round-trip min/avg/max = 4/4/11 Note: The flood-ping output continues until an Interrupt (Ctrl-C) is received. 5. To specify an interval of five seconds between packets sent to host opus, enter: ping -i5 opus Information similar to the following is displayed: PING opus.austin.century.com: (129.35.34.234): 56 data bytes 64 bytes from 129.35.34.234: icmp_seq=0 ttl=255 time=5 ms 64 bytes from 129.35.34.234: icmp_seq=1 ttl=255 time=5 ms 64 bytes from 129.35.34.234: icmp_seq=2 ttl=255 time=6 ms \^C ----opus.austin.century.com PING Statistics---- 3 packets transmitted, 3 packets received, 0% packet loss round-trip min/avg/max = 5/5/6 ms Note: The output is repeated until an Interrupt (Ctrl-C) is re- ceived. 6. To send the number of packets specified by the Preload vari- able as fast as possible before falling into normal mode of behavior to host opus, enter: ping -l 10 opus Information similar to the following is displayed: PING opus.austin.century.com: (129.35.34.234): 56 data bytes 64 bytes from 129.35.34.234: icmp_seq=0 ttl=255 time=9 ms 64 bytes from 129.35.34.234: icmp_seq=1 ttl=255 time=11 ms 64 bytes from 129.35.34.234: icmp_seq=2 ttl=255 time=16 ms 64 bytes from 129.35.34.234: icmp_seq=3 ttl=255 time=22 ms 64 bytes from 129.35.34.234: icmp_seq=4 ttl=255 time=26 ms 64 bytes from 129.35.34.234: icmp_seq=5 ttl=255 time=27 ms 64 bytes from 129.35.34.234: icmp_seq=6 ttl=255 time=30 ms 64 bytes from 129.35.34.234: icmp_seq=7 ttl=255 time=31 ms 64 bytes from 129.35.34.234: icmp_seq=8 ttl=255 time=33 ms 64 bytes from 129.35.34.234: icmp_seq=9 ttl=255 time=35 ms 64 bytes from 129.35.34.234: icmp_seq=10 ttl=255 time=36 ms 64 bytes from 129.35.34.234: icmp_seq=11 ttl=255 time=6 ms 64 bytes from 129.35.34.234: icmp_seq=12 ttl=255 time=6 ms 64 bytes from 129.35.34.234: icmp_seq=13 ttl=255 time=6 ms 64 bytes from 129.35.34.234: icmp_seq=14 ttl=255 time=7 ms 64 bytes from 129.35.34.234: icmp_seq=15 ttl=255 time=6 ms \^C ----opus.austin.century.com PING Statistics---- 16 packets transmitted, 16 packets received, 0% packet loss round-trip min/avg/max = 6/19/36 ms Note: The output is repeated until an Interrupt (Ctrl-C) is re- ceived. 7. To diagnose data-dependent problems in a network, enter: ping -p ff opus This command sends packets with a pad-pattern of all 1's to host opus. Information similar to the following is displayed: PATTERN: 0xff PING opus.austin.century.com: (129.35.34.234): 56 data bytes 64 bytes from 129.35.34.234: icmp_seq=0 ttl=255 time=5 ms 64 bytes from 129.35.34.234: icmp_seq=1 ttl=255 time=5 ms 64 bytes from 129.35.34.234: icmp_seq=2 ttl=255 time=5 ms 64 bytes from 129.35.34.234: icmp_seq=3 ttl=255 time=6 ms 64 bytes from 129.35.34.234: icmp_seq=4 ttl=255 time=5 ms \^C ----opus.austin.century.com PING Statistics---- 5 packets transmitted, 5 packets received, 0% packet loss round-trip min/avg/max = 5/5/6 ms Note: The output is repeated until an Interrupt (Ctrl-C) is re- ceived. 8. To specify quiet output, enter: ping -q bach Only summary information similar to the following is displayed: PING bach.austin.century.com: (129.35.34.234): 56 data bytes \^C ----bach.austin.century.com PING Statistics---- 5 packets transmitted, 5 packets received, 0% packet loss round-trip min/avg/max = 5/5/8 ms Note: Although not displayed, the output of packets continues un- til an Interrupt (Ctrl-C) is received. Implementation Specifics This command is part of the TCP/IP Facility in Network Facilities in Base Operating System (BOS) Runtime. Related Information Network Overview in AIX Version 3.2 System Management Guide: Communications and Networks. The ifconfig command, netstat command. ================================================================= ================================================================= ping Subcommand for the xgmon Command Purpose Checks whether a host on a network is responding to a ping query. Syntax ping HostName Description The ping library command sends a packet to a specified host name or Internet Protocol address on the network. If the host is up, it replies with a response packet. If the hosts responds, the xgmon program displays the round-trip time of the packet in milliseconds. Otherwise, a message indi- cating no response is displayed. Implementation Specifics This library command is part of Simple Network Management Proto- col Manager in Network Management. Related Information The ping_all subcommand List of Network Manager Commands in AIX Version 3.2 System Management Guide: Communications and Networks. Creating xgmon Library Commands, Understanding the xgmon Pro- gramming Utility in AIX Version 3.2 Communication Programming Concepts. How to Use Library Commands, Working with the Topology Display Window, xgmon Overview for Network Managers in AIX Version 3.2 System Management Guide: Communications and Networks. ================================================================= ================================================================= ping Function Purpose Sends an Internet Control Message Protocol (ICMP) ECHO request to the specified host. Syntax (int) ping (HostName) string HostName; Description In the xgmon program, the ping function sends an ICMP ECHO re- quest to the named host. The HostName parameter can be either the host name or an Internet Protocol (IP) address in dot nota- tion. Parameters HostName Specifies the text name or IP address (in dot notation) of the host to be queried. This parameter must be a string data type. Return Values If a reply is not received, the return value is -1; otherwise, the return value is the number of milliseconds elapsed between the sending of the request and the arrival of the response. Implementation Specifics This intrinsic function is part of Simple Network Management Pro- tocol (SNMP) Manager in Network Management. Suggested Reading Prerequisite Information Understanding the Structure of xgmon Library Programs, Using Intrinsic Functions, and xgmon Overview for Programmers in AIX Version 3.2 Communications Programming Concepts. Related Information The ping subcommand, ping_all subcommand. List of Network Manager Programming References, How to Create xgmon Intrinsic Functions, How to Create xgmon Library Commands in AIX Version 3.2 Communications Programming Concepts.