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 region_topology.pl 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 region_topology.pl
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 http://www.slac.stanford.edu/~cottrell/rviz.gif
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):
- tempdot-DRC-to-Africa.txt, this is the dot file that provides the node relationships. It is of the form:
- rawtraceroutes-DRC-to-Africa.txt, this is the raw traceroute data measu4red, for example a series of traceroutes of the form:
- 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 hostip.info, 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.
- Correct traceroute number in raw file, currently it is always 1 [Done 8/30/07].
- Correct nodes (routers mainly) identified like n0x9435b80, tried deleting in dot file but more complex (9/15/07)
- Some routers identified by ip address but should be name
- Fix the legend or whatever it is [Done 8/30/07]
- Many end countries have no node [Done 8/30/07]
- Add unique traceroute number to end node
- Some end nodes are ellipses, should only be rectangles: Akbar
- For Africa there are some end countries such as CH, NO that are not in Africa [Done 8/30/07]
- Can we include the RTT in the end node [Drop probably not very useful and a lot of work]?
- Can we color the links by the RTT [Drop 8/30/07]?
- Some countries (e.g. SN for Africa) have no name
- Why for Kinshasa router server in DRC (CD) is it labelled CG (Congo) [Understood]?
- 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
- Need to allow replacement with Hostip.info see for example http://www.maxmind.com/app/geolitecountry and http://www.maxmind.com/app/geolitecity (Akbar will do 8/9/07): Akbar.
- Look at how to disambiguate horizontal lines:
- Write script to remove the subgraph clusters while retaining the country names.
- Play with the ranksep (which increases the vertical separation)
- Randomly color edges: Akbar
- Need to update the documentation,
- Indicate how to interpret the topology graph [Done Les 9/1/07]
- The information on debugging seems to need attention [Done Les 9/15/07].
- Reduce the width needed [Done Les 8/23/07]
- 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].