Skip to end of metadata
Go to start of metadata


This script generates topology graphs of traceroute data of a particular region/group of countries in the Guthrie database. You need to provide either the name of the traceroute server that you will use to do the traceroute or specify a file containing the raw traceroutes. In the absence of these arguments the program does traceroutes from the current machine.

Visualizing topology graphs can be very useful for seeing and demonstrating how direct or indirect routing is between countries (often routing between  countries close to one another in  developing regions can go via Europe or the US). It is also useful to discover hosts whose location is not properly known.

An example from running
245cottrell@pinger:~/bin/projects/topology/trunk/unit_tests>perl -d is shown here:


In order to install the software from svn follow these steps:

  • Create a new directory at the location where you want to install the software.

Now cd into the myprojects directory and download the iepm,topology and pinger projects using svn, by issuing the following commands:

Running the Program

  • First you need to cd into the $HOME/myprojects/topology/trunk/unit_tests/. I am assuming that you created the myprojects in your home directory. In case there was another location, replace $HOME with that location.
  • Next set the PERL5LIB environment variable for the system libraries. Once again if the location of your myprojects directory is different replace $HOME with that location.
    • setenv PERL5LIB $HOME/myprojects/topology/trunk/lib:$HOME/myprojects/iepm/trunk/lib
  • Finally you can run the program by simply running the script

If you run the script with --help or without any options it gives you the usage. The following options need to be provided:

  • The target nodes for the topology graph may be specified to the program in a variety of ways. Only one of the following must be specified.
    • A region in PingER which case you must provide the --region switch followed by the exact name of the region in PingER.
    • A country in PingER in which case you must provide the --country switch followed by the exact name of the country in PingER.
    • A file containing a list of target host names followed by ip addresses seperated by commas (e.g. beacons.txt). This is specified using the --hostfilelist switch.
    • A file containing a list of raw traceroutes to a set of target nodes. This can be provided by the --file swtich followed by the path of the file containing the traceroutes. This option is provided because the program automatically saves raw traceroutes in a text file and in case the graph is to be redrawn, the raw traceroutes can be provided to the program so that the time consuming task of actually performing the traceroutes can be avoided.
  • The source node for the graph is by default the current machine. In case you want to change that you must specify the complete address of the traceroute server using the switch --tracerouteserver. An example is given in the usage above. In case you are using a tracerouteserver you should also provide the name of the tracerouteserver (e.g. TENET ) using the --from switch. This helps in naming the graph files.
  • The detail of the graph i.e. whether to show the intermediates nodes or only list the countries must be provided. It can be specified using the --detail switch followed by either 'country' or 'all'
  • The --endnodes switch is optional and indicates whether you want to draw the endnodes or not. It has values of 'on' or 'off' and the default value is 'off'
  • The --basepath switch is also optional and is used for providing the directory where you want to generate the graphs and rawtraceroute files. The default is the current directory. The file will have the name $basepath/graph-for-$file where $file is the name associated with region|group|country.

To assist in debugging problems the script also produces an annotated file:

  • In case you specify --region, --country or --group the name of the file generated will be annotated traceroutes-$FROM-to-$REGIONNAME.txt. Here the $REGIONNAME is the name of the region, country or group in pinger that you specified and $FROM will have a value if you specify it using --from field. The same will be the case for graphs and rawtraceroutes.
  • In case you specify --file or --hostfilelist the name of the file generated will be annotatedtraceroutes-$FROM-to-$FILENAME.txt. Here the $FILENAME is the name of the file specified in the --file or --hostfilelist and $FROM once again has a value if you specify the --from field. 
  • The annotated traceroute currently works if all the nodes are in the linked list of objects. If you specify --detail as 'country' then the objects are collapsed to only country objects and the relevant information is not there.

Creating the gif file from the dot file

To create the gif file from the dot file use

 This will read input file tempdot-SaoPaolo-to-Latin_merica.txt and create output gif file ~cottrell/public_html/rviz.gif. Ignore the error message.  In the above case you will be able to view the output at


By default the topology gif file is placed in the current working directory with the name graph-<from>to<region|group|country>.gif.  Where <from> is the value in the --from option, <region|group|country> is the value in the --region | --group or -country option. For example if called with:

then the topology gif file has the name:  graph-DRC-to-Africa.gif. If the --basepath option is specified then rather than placing the file in the current working directory it is placed in the directory specified by basepath. For example if called with:

then the file will appear at ~cottrell/public_html/graph-DRC-to-Africa.gif.  The output of this file is a graph with end nodes in rectangles, routers in ellipses and directed edges between the nodes.

It also creates three other files (for example):

  1. tempdot-DRC-to-Africa.txt, this is the dot file that provides the node relationships. It is of the form:
  2. rawtraceroutes-DRC-to-Africa.txt, this is the raw traceroute data measu4red, for example a series of traceroutes of the form:
  3. annotatedtraceroutes-DRC-to-Africa.txt, which contain annotation information from the individual traceroutes, for example:


Accurately locating the routers can be difficult. We use Geo IP Tool as the default. We also looked carefully at, however it provides locations for fewer hosts and is not more accurate for our purposes. Both systems use databases and are not very complete/accurate for router interfaces. We are also developing TULIP to provide Geolocation using ping RTTs. It is a very valuable check on suspicious locations provided by the database methods. When we find the locations of hosts for which database methods provide the wrong countries, we provide a simple lookup table with the preferred countries.

Improvements/Bugs etc.

  1. Correct traceroute number in raw file, currently it is always 1 [Done 8/30/07].
  2. Correct nodes (routers mainly) identified like n0x9435b80, tried deleting in dot file but more complex (9/15/07)
  3. Some routers identified by ip address but should be name
  4. Fix the legend or whatever it is [Done 8/30/07]
  5. Many end countries have no node [Done 8/30/07]
  6. Add unique traceroute number to end node
  7. Some end nodes are ellipses, should only be rectangles: Akbar
  8. For Africa there are some end countries such as CH, NO that are not in Africa [Done 8/30/07]
  9. Can we include the RTT in the end node [Drop probably not very useful and a lot of work]?
  10. Can we color the links by the RTT [Drop 8/30/07]?
  11. Some countries (e.g. SN for Africa) have no name
  12. Why for Kinshasa router server in DRC (CD) is it labelled CG (Congo) [Understood]?
  13. Add as a comment the landmark, userid, executing host, name & path of executing script, date  to raw and annotated traceroute data (Les is working on 9/1/07): Les
  14. Need to allow replacement with see for example and (Akbar will do 8/9/07): Akbar.
  15. Look at how to disambiguate horizontal lines:
    1. Write script to remove the subgraph clusters while retaining the country names.
    2. Play with the ranksep (which increases the vertical separation)
    3. Randomly color edges: Akbar
  16. Need to update the documentation,
    1. Indicate how to interpret  the topology graph [Done Les 9/1/07]
    2. The information on debugging seems to need attention [Done Les 9/15/07].
    3. Reduce the width needed [Done Les 8/23/07]
  17. Does not correctly show end country, in the example below the route is identified from BR to UY but it should be BR to PE. Since the tracveroute terminates before Peru it does not find the end country [Done 8/30/07].
  • No labels