The TORQUE toolkit documentation

Using the tools

A short explanation of how to use the four tools follows. If you need more complete instructions, you can have a look at the MANUAL file inside the source code archive or use any of the tools with the --help option.

tpathExtract
tmakeGraph
tdiffGraph
tviewGraph

Back to main page


tpathExtract

Top of the page

tpathExtract is the tool for extracting AS paths from a BGP table dump. This tool takes as input a raw BGP table, that is one resulting from the execution of the show ip bgp command on a telnet looking glass router; you do not need to change it by removing comments and/or headers: the tool should do that for you. The output is a plain list of AS paths, that are derived from the last field (AS path) of each of the routes in the BGP table.

Beyond doing this, the program can also perform some elaborations on the paths themselves. Basically, it can analyze them and filter out/correct those paths that have a particular characteristic. Such characteristics include the presence of cycles in the paths (which can derive from configuration errors), the presence of prepending and so on.

The following is the possible layout of a BGP table dump:

spawn telnet route-views.oregon-ix.net
Trying 198.32.162.100...^M
Connected to route-views.oregon-ix.net.^M
Escape character is '^]'.^M

######################################################################

route-views.oregon-ix.net -- Oregon Exchange BGP Route Viewer

route views data is archived on http://archive.routeviews.org

This hardware is part of a grant from Cisco Systems.

Please contact help@routeviews.org if you have questions or
comments about this service, its use, or if you might be able to
contribute your view.

This router has views of the full routing table from several ASes.
The list of ASes is documented under "Current Participants" on
http://www.routeviews.org/.

#######################################################################

route-views.oregon-ix.net>term len 512
route-views.oregon-ix.net>sh ip bgp
BGP table version is 1505710, local router ID is 198.32.162.100
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal
Origin codes: i - IGP, e - EGP, ? - incomplete

   Network          Next Hop            Metric LocPrf Weight Path
*> 2.0.0.0          167.142.3.6                            0 5056 701 3491 20485 5547 ?
*  3.0.0.0          203.194.0.5                            0 9942 1 7018 80 i
*                   217.75.96.60                           0 16150 8434 3257 1239 7018 80 i
*                   213.200.87.254          80             0 3257 1239 7018 80 i
*                   144.228.241.81  4294967294             0 1239 7018 80 i
*                   204.42.253.253                         0 267 2914 7018 80 i
*                   209.123.12.51                          0 8001 7018 80 i
*                   129.250.0.11            47             0 2914 7018 80 i
*                   216.140.14.186        1974             0 6395 7018 80 i
*                   216.140.8.59             3             0 6395 7018 80 i
...

If you use tpathExtract with such an input, what you get is the following:

5056 701 3491 20485 5547
9942 1 7018 80
16150 8434 3257 1239 7018 80
3257 1239 7018 80
1239 7018 80
267 2914 7018 80
8001 7018 80
2914 7018 80
6395 7018 80
6395 7018 80
...

or, with the --group option:

669     9942 1
664     16150 8434 3257 1239 1
626     267 2914 1
664     3257 1239 1
665     8001 15036 16631 174 1
2040    6395 1
622     11608 2914 1
681     1221 4637 1
679     19092 701 1
1250    2914 1
1       12956 3356 1
679     6066 701 1
2714    4513 701 1
679     14608 701 1
...

that is, each path appears with the number of occurrences in the BGP table, which, if you want, can be completed with a list of the prefixes that have been announced over each path (--group and --prefixes=show options):

669     9942 1  4.0.0.0 24.96.0.0/17 63.244.0.0/16 63.246.224.0/20 ...
664     16150 8434 3257 1239 1  4.0.0.0 24.96.0.0/17 63.244.0.0/16 ...
626     267 2914 1      4.0.0.0 24.96.0.0/17 63.244.0.0/16 63.246.224.0/20 ...
664     3257 1239 1     4.0.0.0 24.96.0.0/17 63.244.0.0/16 63.246.224.0/20 ...
665     8001 15036 16631 174 1  4.0.0.0 24.96.0.0/17 63.244.0.0/16 ...
2040    6395 1  4.0.0.0 4.0.0.0 4.0.0.0 24.96.0.0/17 24.96.0.0/17 ...
622     11608 2914 1    4.0.0.0 24.96.0.0/17 63.244.0.0/16 63.246.224.0/20 ...
681     1221 4637 1     4.0.0.0 24.96.0.0/17 63.244.0.0/16 63.246.224.0/20 ...
...

The last output has been generated using the following command line:

$ tpathExtract --group --prefixes=show oix-full-snapshot-2003-03-27-0600.dat

It is also possible to label the paths with letters that identify their properties ('P' for paths with prepending, 'I' for incomplete paths, etc.). For a complete list of such tags and some more information about usage and options, either look at the MANUAL file (included with the source code) or use the --help option.

The software is quite robust to format mismatches in the input file, which include carriage returns within a route or misalignments of the fields (both occurring when the network/netmask field is too large).


tmakeGraph

Top of the page

This tool takes as input a set of files containing various types of information and builds a graph according to these information. The output is an ASCII file that represents the graph itself. Its format is quite complex, but you should not worry about this, because you do not need to directly deal with it. The generated graph can be saved to a file for further processing through the other tools, like already explained.

You can build the graph on the basis of different kinds of information. The minimal input consists of a file to get the nodes from; then, you can specify files containing edges, edge directions (which are only applied to existing edges), some special edge weights and so on. Each of these files can be provided in different formats (for a complete list of recognized formats, please consult the MANUAL file or the online help). The so called special weights are the path covering and the IP covering; the first one is the number of paths traversing the edge being considered, while the second one is the number of IP addresses that have been announced over it.

Just to make a simple example, here is how to build an unoriented graph whose nodes are Autonomous Systems got from a list of AS paths and whose edges represent adjacencies of the ASs within the paths:

$ tmakeGraph --file:nep pathList -o graph
tmakeGraph 1.0
Reading nodes, edges file (step 1 of 1)
`pathList'
[****************************************]  (100.0 %)
Saving graph to file...

And here is how the contents of the generated file look like (if you want to exactly know their meaning, please read the FILE_FORMAT text file included with the source code distribution):

TGR
1
pathList

15045
31227
1
2
3
4
6
7
8
9
11
12
13
14
16
17
18
20
...
28844
28849
28852
28855
28863
1 3 0 0 0 0 0 0
1 23 0 0 0 0 0 0
1 32 0 0 0 0 0 0
1 57 0 0 0 0 0 0
1 63 0 0 0 0 0 0
1 70 0 0 0 0 0 0
1 71 0 0 0 0 0 0
1 90 0 0 0 0 0 0
...

Please notice that by addressing the orientation of an edge we refer to the fact that the edge has been assigned a commercial relationship (i.e., an unoriented edge has not been assigned a direction/relationship at all), while the direction is the type of relationship itself (a directed edge represents a customer-provider relationship and an undirected - but oriented! - one represents a peering one; no other relationships are supported).


tdiffGraph

Top of the page
Once you have generated all the graphs that you need, you can compare them by using this tool. Essentially, it supports four working modes:

The diagram above makes no difference among these kinds of graphs, so by "differential graph" we address any kind of graph that has been created using this tool.


tviewGraph

Top of the page

This module provides you with the capability of analyzing the graphs that have been produced using any of the other tools. Such analysis includes the possibility to count nodes/edges within single (strongly) connected components or in the whole graph, the ability to list them together with their properties (i.e., edges directions and weights), and that of building distributions over some characteristics of the graph itself. The tool can both consider simple graphs (that is, neither differential/multi-differential nor complementary) and any kind of differential graph (produced with the tdiffGraph tool). According to the type of graph that is being analyzed, some information can or can not be significant; for example, those concerning the stability of edge directions are senseless if the input graph is not a multi-differential one.

The tool can either accept a script file as input or provide an interactive command-line interface. The set of commands is very simple, but it allows to perform all the above mentioned operations and some more. For a full list of available commands and of their syntax, just start the program with no arguments: the command line prompt tgv> will appear; then, just type help <command name> for information about the syntax and effect of that command, or just help for a list of commands.

Below you can see an example of a tviewGraph interactive session:

tviewGraph 1.0
Interactive mode; type `help' to get a list of available commands
tvg> load diff.graph
tvg> show graph information
Graph file: diff.graph
Graph type: (multi)differential
Graph comment:
Graph has been generated using 84 files:
 oix-full-snapshot-2003-03-25-0000/final.graph
 oix-full-snapshot-2003-03-25-0200/final.graph
 oix-full-snapshot-2003-03-25-0400/final.graph
 oix-full-snapshot-2003-03-25-0600/final.graph
 oix-full-snapshot-2003-03-25-0800/final.graph
 oix-full-snapshot-2003-03-25-1000/final.graph
...
tvg> show graph nodes
15150
tvg> show graph edges
32534
tvg> show anycc nodes
Connected components are 1
         1 CCs with      15150 nodes
Index of the first largest CC: 1
Index of the first smallest CC: 1
tvg> show anycc edges
Connected components are 1
         1 CCs with      32534 edges
Index of the first largest CC: 1
Index of the first smallest CC: 1
tvg> show anycc index
CC          1 has      15150 nodes and      32534 edges
tvg> dump graph differences
    1 --- 3         84     0    84.0    <--: 84       -->: 0        <->: 0        ---: 0
    1 --- 23        84     0    84.0    <--: 84       -->: 0        <->: 0        ---: 0
    1 --- 32        84     0    84.0    <--: 84       -->: 0        <->: 0        ---: 0
    1 --- 57        84     0    84.0    <--: 84       -->: 0        <->: 0        ---: 0
    1 --- 63        84     0    84.0    <--: 84       -->: 0        <->: 0        ---: 0
    1 --- 70        84     0    84.0    <--: 84       -->: 0        <->: 0        ---: 0
    1 --- 71        84     0    84.0    <--: 0        -->: 84       <->: 0        ---: 0
    1 --- 90        84     0    84.0    <--: 84       -->: 0        <->: 0        ---: 0
    1 --- 103       84     0    84.0    <--: 84       -->: 0        <->: 0        ---: 0
...
tvg> show graph differences attendances
       303 edges appeared in          1 graphs
       113 edges appeared in          2 graphs
        72 edges appeared in          3 graphs
        57 edges appeared in          4 graphs
        45 edges appeared in          5 graphs
        31 edges appeared in          6 graphs
        31 edges appeared in          7 graphs
        34 edges appeared in          8 graphs
        24 edges appeared in          9 graphs
        28 edges appeared in         10 graphs
        37 edges appeared in         11 graphs
        15 edges appeared in         12 graphs
        13 edges appeared in         13 graphs
...

Back to main page

This page is being maintained by Massimo Rimondini (rimondin@dia.uniroma3.it)
Last update: Oct 15th, 2004