PINGER: Verify Any-to-Any IP Connectivity  (pinger)

Top  Previous  Next

The pinger program is a utility that performs pings from a Cisco Router to any IP Address.  The script will cycle through a list of routers and perform pings from each router in a list.  In addition, the pings can be sent with different source IP addresses.  Note, the source IP address must be a valid interface IP Address on the router that is in an UP/UP condition.  If the interface is not in an UP/UP condition, the script will not perform the pings using that source IP Address.  The special keyword “default” can also be specified as a source IP address.  In this case the router software will use the interface IP address, where the ping packet exits, for the source IP address.

 

Program Name: pinger

 

Script Argument

Description

-sf <filename>

Input variable file which tells the program which routers the pings will be performed from, the source IP addresses to use for the pings and the addresses to ping.  The sample template filename is pinger_template.txt (REQUIRED)

-pinfo

Print Info.  This option tells the script to print out (and log) informational messages as to source/destination pairs for pings that were successful.  Be default, only messages for pings that have failed are written to the displays and log file.

-nokey

Dont prompt user for encryption key when using encrypted password file.  (OPTIONAL)

-ssh

Use Secure Shell when accessing routers.  Do NOT use with -pw option. (OPTIONAL)

-pw <filename>

Login/Password File.  (OPTIONAL)

-log <filename>

Save detailed trace file to a name other than the default file name.  (OPTIONAL)

-ulog

Unique Log file.  Save detailed trace log file to a Unique filename automatically created by script. Filename will be in format of scriptname_timestamp.log. (OPTIONAL)

 

 

The ping source/destination pairs that will be sent are controlled by the variables in the input file (-sf <filename>).  This file is in TCL format and contains two TCL list variables; TOPO_LIST and PING_LIST.  The TOPO_LIST variable lists the routers along with the source IP Addresses that will be used for the pings.  The PING_LIST variable contains the list of IP Addresses that will be pinged. 

 

Below shows a sample entry for the TOPO_LIST variable:

 

lappend TOPO_LIST [list nj1 "64.145.25.3" "64.32.127.132"]

 

The first item in the list “nj1” is the router that the pings will be performed from.  The script will actually telnet into this router.  This must be an IP Address or a name that can be resolved through DNS.  If the -pw <password_file> option is used, then this IP Address/Name must also be defined in the password_file.  (Note, they must match exactly [case sensitive]).  The second and third arguments are the source IP addresses that will be used for the pings.

 

Below shows a sample entry for the PING_LIST variable:

 

lappend PING_LIST [list "200.32.127.138" "ny2 l0"]

 

The first item in the list “200.32.127.138” is the IP Address that will be pinged.  The second item in the list, “ny2 10” is an informational comment about that IP Address.  This comment is also printed out in the error log if a ping fails to this IP Address.

 

Below is a sample file that will be used to describe the flow of the program in relation to the input file.  Note, the line that starts with a “#” will not be used.

 

lappend TOPO_LIST [list ny2 "10.134.132.4" "200.32.127.138" “default”]
lappend TOPO_LIST [list cny3 "172.33.1.1" "10.134.132.1"]
lappend TOPO_LIST [list ca1 "10.31.240.253" "200.42.59.16" "10.31.29.1”
 
lappend PING_LIST [list "10.145.25.1" "????"]
#lappend PING_LIST [list "10.145.25.3" "nj1 eth"]
lappend PING_LIST [list "10.126.4.102" "nj1 eth"]
lappend PING_LIST [list "10.126.5.103" "nj2 eth"]
lappend PING_LIST [list "10.126.6.252" "cnj5 eth"]

 

 

1.Telnet to router “ny2”
2.Ping each of the IP addresses in the PING_LIST using 10.134.132.4 as the source IP address.
3.Ping each of the IP addresses in the PING_LIST using 200.32.127.138 as the source IP address.
4.Ping each of the IP addresses in the PING_LIST using the source IP Address that the router chooses to insert.  More specifically, this is the IP Address of the interface that the packet leaves from.
5.Telnet to router “cny3”
6.Ping each of the IP addresses in the PING_LIST using 172.33.1.1 as the source IP address.
7.Ping each of the IP addresses in the PING_LIST using 10.134.132.1 as the source IP address.
8.Telnet to router “ca1”
9.Ping each of the IP addresses in the PING_LIST using 10.31.240.253 as the source IP address.
10.Ping each of the IP addresses in the PING_LIST using 200.42.59.16 as the source IP address.
11.Ping each of the IP addresses in the PING_LIST using 10.31.29.1 as the source IP address.

 

There is one additional variable in the input file to control the speed at which successive pings are generated from any one router.   The variable is PING_DELAY_INTERVAL and is defined in milliseconds.  If a script input file is setup to have a router generate pings to 100 different destinations, a delay (equal to the PING_DELAY_INTERVAL) will be inserted before each new ping destination.  This variable was added because results have shown that low-end routers may experience a CPU spike because the script is cycling through the pings extremely fast resulting in a lot of telnet based traffic.  The exact processes that cause the CPU to spike are the vty exec (i.e. telnet session) and IP Traffic.  Putting in a 250ms delay will limit the spike, caused by the script, to between 20-25%.  A 500ms delay will limit the spike to about 10%.  (Note, these results are based on a Cisco 1700 series router and do not include CPU utilization for other processes on the router.)  For higher end routers this should be less of an issue. Also, if each router is sending to a low number of ping destinations (10 or under), this should be non-issue.

 

A sample input file is provided (pinger_template.txt).  If the end-user installation instructions were followed (Section 3.2.2), this sample template file should be in the same directory where you run the scripts from. (Note, for MS Windows, the installation utility automatically copies this template file to the C:\Program Files\net-sense\userdata directory.)

 

Sample Command: The following command will run the pinger utility using the information contained in the file ping_southeast.txt.  The script will not prompt the user for passwords because the passwords are being read in from the logins.txt file (-pw option).

 

pinger -pw logins.txt sf ping_southeast.txt