Ping


Contents


Introduction and Overview

In order to debug the connectivity of hosts using the Internet protocols, the ICMP Echo request can be used to ascertain if a host is available and the quality of the connection between us and it. The Ping issues these request and displays the results.


*Commands


*Ping

Send ICMP ECHO_REQUEST packets to network hosts
Syntax
*Ping [-c <count>] [-d] [-f] [-i <wait>] [-l <preload>] [-n] [-p <pattern>] [-q] [-R] [-r] [-s <packetsize>] [-v] <host>
Parameters
-c <count>- Stop after sending (and receiving) count ECHO_RESPONSE packets.
-d - Set the SO_DEBUG option on the socket being used.
-f - Flood ping. 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 backspace is printed. This provides a rapid display of how many packets are being dropped. This can be very hard on a network and should be used with caution.
-i <wait>- Wait wait seconds between sending each packet. The default is to wait for one second between each packet. This option is incompatible with the -f option.
-l <preload>- If preload is specified, ping sends that many packets as fast as possible before falling into its normal mode of behaviour.
-n - Numeric output only. No attempt will be made to lookup symbolic names for host addresses.
-p <pattern>- You may specify up to 16 'pad' bytes to fill out the packet you send. This is useful for diagnosing data-dependent problems in a network. For example, '-p ff' will cause the sent packet to be filled with all ones.
-q - Quiet output. Nothing is displayed except the summary lines at startup and when finished.
-R - Record route. Includes the RECORD_ROUTE option in the ECHO_REQUEST packet and displays the route buffer on returned packets. Note that the IP header is only large enough for nine such routes. Many hosts ignore or discard this option.
-r - Bypass the normal routing tables and send directly to a host on an attached network. If the host is not on a directly-attached network, an error is returned. This option can be used to ping a local host through an interface that has no route through it.
-s <packetsize>- Specifies the number of data bytes to be sent. The default is 56, which translates into 64 ICMP data bytes when combined with the 8 bytes of ICMP header data.
-v - Verbose output. ICMP packets other than ECHO_RESPONSE that are received are listed.
<host>- Host name to ping.
Use

The Ping command is used to identify the network connectivity of a host. Echo requests are sent to a remote host. The host will the respond to these requests if it is able, returning them to the initiating host. The time taken for these replies to arrive (and existance of them) indicates the time for packets to travel between hosts and how good the network connection between them is.

Example
*Ping 192.168.0.1
Related APIs
None

Document information

Maintainer(s): RISCOS Ltd <developer@riscos.com>
History:
RevisionDateAuthorChanges
1ROLInitial version
Disclaimer:

Copyright © Pace Micro Technolgy plc, 2002.
Portions copyright © RISCOS Ltd, 2002.
Published by RISCOS Limited.
No part of this publication may be reproduced or transmitted, in any form or by any means, electronic, mechanical, photocopying, recording or otherwise, or stored in any retrieval system of any nature, without the written permission of the copyright holder and the publisher, application for which shall be made to the publisher.