1.11 Testing and Troubleshooting Routes

The two most predominant tools that can be used for testing and troubleshooting routes or reachability are:

ping and traceroute.

1.11.1 The ping Command

The ping command, which is included as a part of the TCP/IP protocol suite, is supported at the user and privileged exec modes. In user mode, you must specify an IP address or a host name, if the host name can be resolved to an IP address, with the ping command. The ping command tests the round-trip path to and from a target. In privileged mode, you must enter a protocol, a target IP address, a repeat count, datagram size, and a timeout in seconds.

Generally, the syntax for the ping command is:

ping -s ip_address [ packet_size] [ packet_count]

Parameters for the ping Command

Parameter Purpose
- s Causes ping to send one datagram per second, printing one line of output for every response received. The ping command does not return any output when no response is received.
ip_address The IP address or IP alias of the host.
packet_size This optional parameter represents the number of bytes in a packet, from 1 to 2000 bytes, with a default of 56 bytes. The actual packet size is eight bytes larger because the switch adds header information.
packet_count This optional parameter represents the number of packets to send.

1.11.2 The traceroute Command

The traceroute command was introduced with the release 10.0 of Cisco IOS and can be used to find the route between IP devices. The traceroute command can be executed in user and privileged exec modes, but in privileged exec mode, you can use the extended traceroute, which is more flexible and informative. Initially, traceroute was available only for the IP protocol but since release 12.0 of Cisco IOS, traceroute is also available for IPX. This command can be very useful in troubleshooting by determining where along a particular network path a particular problem might be as the traceroute command displays a hop-by-hop path through an IP network from the switch to a specific destination host. The syntax for the traceroute command is:

traceroute [ -n ] [- w wait_time ] [ -i ] [ -m max_ttl ]

[ -p dest_port ] [ -q nqueries ] [ -t tos ] ip_address [ data_size ]

Parameters for the traceroute Command

Parameter Description
-n Prevents traceroute from performing a DNS lookup for each hop on the path. Only numerical IP addresses are printed.
-w wait_time Specifies the amount of time that traceroute will wait for an ICMP response message. The allowed range for wait time is 1 to 300 seconds; the default is 5.
initial_ttl Causes traceroute to send ICMP datagrams with a TTL value equal to initial_ttd instead of the default TTL of 1. This causes traceroute to skip processing for hosts that are less than initial_ttl hops away.
-m max_ttl Specifies the maximum TTL value for outgoing ICMP datagrams. The allowed range is 1 to 255; the default value is 30.

-p dest_port

Specifies the base UDP destination port number used in traceroute datagrams. This value is incremented each time a datagram is sent. The allowed range is 1 to 65535; the default base port is 33434.

-q nqueries

Specifies the number of datagrams to send for each TTL value. The allowed range is 1 to 1000; the default is 3.

-t tos

Specifies the TOS to be set in the IP header of the outgoing datagrams. The allowed range is 0 to 255; the default is 0.

ip address

IP alias or IP address in dot notation of the destination host.

Data size

Number of bytes, in addition to the default of 40 bytes, of the outgoing datagrams. The allowed range is 0 to 1420; the default is 0.