Flylib.com

Books Software

 
 
 

Traceroute


Traceroute

Traceroute is most commonly used to troubleshoot connectivity issues. If all you know is that you can't get to host D from host A, traceroute will show you whether the connectivity loss exists at one of the intermediate routers—B or C or elsewhere. Note that traceroute works at Layer 3 and is most commonly implemented for IP using UDP.

In the first set of packets sent, the time-to-live (TTL) field is set to 1 and the port number is set to a port that is not likely to be valid, most commonly 33434. The consequence of setting TTL to 1 is that the first node receiving this packet will decrement the TTL, notice that the TTL is now 0, drop the packet, and return an ICMP timeout message. The TTL and port numbers are increased by one for each subsequent set of packets until either the TTL hits a maximum or the desired remote host is reached. Therefore, one link in the path to the destination will be discovered per packet.

Traceroute determines that the destination has been reached when it receives an ICMP destination port unreachable message. Note that you are actually discovering the path that the ICMP timeout messages are taking when they come back. In most cases, this will be the same as the forward path, but not always.

Most traceroute implementations will send several packets with the same TTL and port, and then increment the TTL and port for the next set of packets to assist in the discovery of alternate routes or lossy connections.

An example of using traceroute is to trace the path from one router to another. Figure 8-1 contains an example network. Starting from the router chelliot-isdn and tracing the route to nms-comm1, the results are shown in Example 8-1.

Figure 8-1. Example Network for Traceroute

graphics/08fig01.gif

Example 8-1 Results of a traceroute.
chelliot-isdn#

traceroute nms-comm1

Type escape sequence to abort.
Tracing the route to nms-comm1 (171.68.118.221)

  1 rtp-isdn (171.68.116.65) 28 msec 28 msec 28 msec
  2 rtp-telascon-gw2 (161.44.0.99) 32 msec 28 msec 28 msec
  3 rtp-hardwood-gw1 (161.44.0.12) 56 msec 32 msec 28 msec
  4 nms-comm1 (171.68.118.221) 32 msec *  40 msec
chelliot-isdn#

By default, Cisco IOS devices repeat the traceroute for each TTL three times, as indicated by the three time measurements on each line of the output. Notice that the last line has an asterisk instead of the middle time measurement. This is because Cisco routers limit the rate of ICMP destination unreachable messages it outputs. Therefore, the second message is dropped before the destination sends it back.


Terminal Emulators

Terminal emulators are used for many purposes in network management, including user access to network devices. Obviously, access is useful for configuring and troubleshooting devices. There are also times when information or operations on network devices are not available through SNMP and scripts must be written to access this information or capability through terminal access.

Telnet is the traditional way of obtaining terminal emulation access to network devices. Cisco IOS devices also support remote shell, or rsh.

Cisco IOS software provides two methods for obtaining terminal emulation access in a secure manner: Secure Shell (SSH) and IP Security (IPSec) with Virtual Private Networks (VPN). SSH, which devices are just starting to support, provides much greater security for the connection than Telnet. Cisco IOS devices started supporting SSH in 12.0(5)S. Cisco Catalyst devices don't support SSH as of software version 5.2.

IPSec with VPN provides a standards-based method to implement security and includes the capability to secure a terminal emulation session. Cisco IOS devices started supporting IPSec with VPN in IOS 12.0(5)T.

If a program or script needs to obtain information through a terminal session, it needs to be able to watch for prompts from the device and enter commands at the right time and speed so that they are recognized by the device and do not overrun any input buffers. Such a capability is commonly known as an Expect script, after the Expect language written over the TK/TCL programming language. Expect-like libraries are available for PERL, Java, C, as well as the original TK/TCL program.

See Example 19-9 in Chapter 19, "Frequently Asked Questions," for an example of an Expect script written in PERL.