The z/OS UNIX ping command sends an echo request to a foreign node (remote host) to determine whether the node is accessible.
>>-ping--+-+------------+-- host_name-+------------------------>< | '-| Option |-' | +- -h------------------------+ '- -?------------------------' Option .---------------------. V | |----+-----------------+-+--------------------------------------| +- -A-+-ipv4-+----+ | '-ipv6-' | | .-1----. | +- -c-+------+----+ | '-echo-' | +- -i interface---+ | .-256---. | +- -l-+-------+---+ | '-bytes-' | +- -n-------------+ +- -P-+-yes----+--+ | '-ignore-' | +- -p tcpname-----+ +- -s srcip-------+ | .-10------. | +- -t-+---------+-+ | '-seconds-' | '- -v-------------'
If the host_name value is specified as a host name (not an IP address), the command invokes the resolver to obtain an IP address for the host name. The command uses the first IP address that is returned by the resolver. Use the -A option to specify whether the command requests only IPv4 or only IPv6 IP addresses from the resolver. If you do not specify the -A option, the -i and -s options can also be used to determine whether the command requests only IPv4 or only IPv6 IP addresses from the resolver. If neither -A, -i, or -s options are specified, the command does not request a specific type of IP address from the resolver and IPv4 and IPv6 IP addresses can be returned by the resolver.
When using IPv6 link-local addresses, you can provide scope information with the IP address or host name. To specify scope information, add a percent character (%) after the host_name value, followed by the scope information (usually an interface name). See the examples that follow for an example of using the command with scope information. For a more complete explanation about the use of scope information, see the support for scope information in the z/OS Communications Server: IPv6 Network and Application Design Guide.
If the -A option is not specified see the description of the host_name parameter for information on how the host_name value is resolved to an IP address.
Restriction: If you specify the -v parameter, you cannot specify the value 0 for the -c parameter.
If the destination host is specified as a host name and the -A option is not specified, the address type of the interface value is used to determine whether the host name is resolved to an IPv4 or IPv6 IP address.
Restriction:
Ping #n needs fragmentation at: ipaddress
Ping #n needs fragmentation at: host_name (ipaddress)
Ping #n needs fragmentation at: ipaddress (ipaddress)
You can use the -n parameter to request that the Ping command display only the host name and its IP address of the host, without resolving it to a host name.
If the host returned the next-hop MTU size in the ICMP/ICMPv6 message, then this MTU size is also displayed: Next-hop MTU size is nnnnn
If the MTU size is not displayed, you can use the Length parameter to vary the size of the echo request packet, in order to determine the MTU of the network.
MULTIPATH PERPACKET considerations: When the MULTIPATH PERPACKET option is in effect and equal-cost routes are configured to the Ping destination host, the smallest MTU value of all the equal-cost routes is used as the largest packet size that can be sent, even if some of the equal-cost routes could support a larger packet size.
The tcpname is an 8-byte procedure name that is used to start the TCP/IP. When the S member.identifier method of starting TCP/IP is used, the value specified for identifier must be used as tcpname. When this option is not specified and z/OS UNIX is configured for CINET, the CINET Prerouter selects the TCP/IP stack to which the request is routed.
If the destination host is specified as a host name and the -A option is not specified, the address type of the srcip value is used to determine whether the host name should be resolved to an IPv4 or IPv6 IP address.
Restriction: You cannot specify scope information for the source IP address.
If you do not specify the -v and -c parameters, then the default count of echo requests is 1. If you specify the -v parameter without the -c parameter, then the default value is 3. If you specify both the -v and -c parameters, then the number of echo requests is the value specified in the -c parameter.
Restriction: If you specify the value 0 for the -c parameter, you cannot specify the -v parameter.
See the examples that follow for the format of Ping command output when the -v parameter is specified. See the responses that follow for an explanation of the fields that are used in the verbose information.ping mvs098
CS V2R1: Pinging host mvs098 (9.67.113.11)
Ping #1 response took 0.002 seconds.
ping linuxipv62.tcp
CS V2R1: Pinging host linuxipv62.tcp.raleigh.ibm.com
at IPv6 address 2001:0db8::1:9:67:114:44
Ping #1 response took 0.002 seconds.
ping -c 4 -l 2500 -P ignore hosta
CS V2R1: Pinging host hosta.test.ibm.com (9.42.99.99)
Ping #1 needs fragmentation at: hoste.test.ibm.com 9.42.22.22
Ping #2 response took 0.002 seconds.
Ping #3 response took 0.001 seconds.
Ping #4 needs fragmentation at: hoste.test.ibm.com 9.42.22.22
ping -v hosta
CS V2R1: Pinging host hosta.test.ibm.com (9.56.99.99)
with 256 bytes of ICMP data
Ping #1 from 9.56.99.99: bytes=264 seq=1 ttl=51 time=1.08 ms
Ping #2 from 9.56.99.99: bytes=264 seq=2 ttl=51 time=1.35 ms
Ping #3 from 9.56.99.99: bytes=264 seq=3 ttl=51 time=1.58 ms
Ping statistics for hosta.test.ibm.com (9.56.99.99)
Packets: Sent=3, Received=3, Lost=0 (0% loss)
Approximate round trip times in milliseconds:
Minimum=1.08 ms, Maximum=1.58 ms, Average=1.34 ms, StdDev=0.26 ms
IPv4
with the parameters -v, -l,
and -P with value of ignore but with the
Ping failures (timeout and fragmentation needed errors) ping -v -l 2500 -P ignore hosta
CS V2R1: Pinging host hosta.test.ibm.com (9.56.99.99)
with 2500 bytes of ICMP data
Ping #1 needs fragmentation at: hoste.test.ibm.com (9.56.22.22)
Ping #2 timed out
Ping #3 timed out
Ping statistics for hosta.test.ibm.com (9.56.99.99)
Packets: Sent=3, Received=0, Lost=3 (100% loss)
ping -c 4 -l 3000 -P ignore -n hostipv6
CS V2R1: Pinging host hostipv6.raleigh.ibm.com
at IPv6 address 50c9:c2d4:0:5:9:6b00:111a:1
Ping #1 needs fragmentation at: 50c9:c2d4:0:3:9:6b00:111a:250e
Next-hop MTU size is 1500
Ping #2 response took 0.002 seconds.
Ping #3 response took 0.001 seconds.
Ping #4 needs fragmentation at: 50c9:c2d4:0:3:9:6b00:111a:250e
Next-hop MTU size is 1500
ping -c 4 -l 3000 -P yes -n hostipv6
CS V2R1: Pinging host hostipv6.raleigh.ibm.com
at IPv6 address 50c9:c2d4:0:5:9:6b00:111a:1
Ping #1 needs fragmentation at: hoste.test.ibm.com (50c9:c2d4:0:3:9:6b00:111a:250e)
Next-hop MTU size is 1500
Ping #2 needs fragmentation at: local.host (50c9:c2d4:0:6:1:6b00:111a:0001)
Next-hop MTU size is 1500
Ping #3 needs fragmentation at: local.host (50c9:c2d4:0:6:1:6b00:111a:0001)
Next-hop MTU size is 1500
Ping #4 needs fragmentation at: local.host (50c9:c2d4:0:6:1:6b00:111a:0001)
Next-hop MTU size is 1500
ping -c 5 -l 8944 -v hostipv6
CS V2R1: Pinging host hostipv6.raleigh.ibm.com
at IPv6 address 50c9:c2d4:0:5:9:6b00:111a:1
with 8944 bytes of ICMP data
Ping #1 from 50c9:c2d4:0:5:9:6b00:111a:1: bytes=8952 seq=1 hoplim=51 time=1.71 ms
Ping #2 from 50c9:c2d4:0:5:9:6b00:111a:1: bytes=8952 seq=2 hoplim=51 time=1.52 ms
Ping #3 from 50c9:c2d4:0:5:9:6b00:111a:1: bytes=8952 seq=3 hoplim=51 time=1.78 ms
Ping #4 from 50c9:c2d4:0:5:9:6b00:111a:1: bytes=8952 seq=4 hoplim=51 time=1.88 ms
Ping #5 from 50c9:c2d4:0:5:9:6b00:111a:1: bytes=8952 seq=5 hoplim=51 time=2.25 ms
Ping statistics for hostipv6.raleigh.ibm.com
at IPv6 address 50c9:c2d4:0:5:9:6b00:111a:1
Packets: Sent=5, Received=5, Lost=0 (0% loss)
Approximate round trip times in milliseconds:
Minimum=1.52 ms, Maximum=2.25 ms, Average=1.83 ms, StdDev=0.24 ms
IPv6
with the -c , -l ,
and -v parameters specified, but with mixed
Ping results (success and failure). ping -c 5 -l 8944 -v hostipv6
CS V2R1: Pinging host hostipv6.raleigh.ibm.com
at IPv6 address 50c9:c2d4:0:5:9:6b00:111a:1
with 8944 bytes of ICMP data
Ping #1 timed out
Ping #2 from 50c9:c2d4:0:5:9:6b00:111a:1: bytes=8952 seq=2 hoplim=5 1 time=1.51 ms
Ping #3 from 50c9:c2d4:0:5:9:6b00:111a:1: bytes=8952 seq=3 hoplim=51 time=1.68 ms
Ping #4 timed out
Ping #5 from 50c9:c2d4:0:5:9:6b00:111a:1: bytes=8952 seq=5 hoplim=5 1 time=1.64 ms
Ping statistics for hostipv6.raleigh.ibm.com
at IPv6 address 50c9:c2d4:0:5:9:6b00:111a:1
Packets: Sent=5, Received=3, Lost=2 (40% loss)
Approximate round trip times in milliseconds:
Minimum=1.51 ms, Maximum=1.68 ms, Average=1.61 ms, StdDev=0.10 ms
ping fe80::12:1:2%mpc6221
CS V2R1: Pinging host FE80::12:1:2%MPC6221
at IPv6 address fe80::12:1:2
Ping #1 response took 0.001 seconds.
Response description:
The Ping command displays one response output line for every echo request packet that is sent. The default response output line displays the number of elapsed seconds for the echo reply that was received and the number of bytes that were sent for the data portion of the echo request packet.