annotate doc/ucis.ano/bgp_graph/readme.txt @ 1037:d956fda85e70 draft

[db/dom/ano/freeanons/ns/a.ns.d3v11.ano] moving mirror
author d3v11 <d3v11@d3v11.ano>
date Mon, 15 Oct 2012 00:21:50 +0000
parents 3a26ef01c0fb
children 763bc3e5837f
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
29
159a026a8bb1 Added bgp graph readme
ivo <ivo@UFO-Net.nl>
parents:
diff changeset
1 These scripts can be used to graph the BGP peering connections in a network using the BGP protocol.
159a026a8bb1 Added bgp graph readme
ivo <ivo@UFO-Net.nl>
parents:
diff changeset
2
159a026a8bb1 Added bgp graph readme
ivo <ivo@UFO-Net.nl>
parents:
diff changeset
3 Some of the scripts will communicate with the BGP software, another script can be used to export the obtained information to a .dot file, which can then be converted to a graph file using graphviz. The scripts can run on different machines, and it is recommended to use routing information from multiple routes, to obtain an accurate view of the network.
159a026a8bb1 Added bgp graph readme
ivo <ivo@UFO-Net.nl>
parents:
diff changeset
4
159a026a8bb1 Added bgp graph readme
ivo <ivo@UFO-Net.nl>
parents:
diff changeset
5 Depending on the BGP software, one of the following scripts must be used to acquire the data:
480
3a26ef01c0fb Just fixing a type-o. ;-) YW, Ivo.
Anonymous Coward <nobody@nowhere>
parents: 29
diff changeset
6 - bgp_path_list_bird.sh (or .php) for the bird routing daemon
29
159a026a8bb1 Added bgp graph readme
ivo <ivo@UFO-Net.nl>
parents:
diff changeset
7 - bgp_path_list_quagga.sh (or .php) for the quagga/zebra routing daemon
159a026a8bb1 Added bgp graph readme
ivo <ivo@UFO-Net.nl>
parents:
diff changeset
8 - bgp_path_list_xml.php to convert existing dn42/diac42 .xml data
159a026a8bb1 Added bgp graph readme
ivo <ivo@UFO-Net.nl>
parents:
diff changeset
9
159a026a8bb1 Added bgp graph readme
ivo <ivo@UFO-Net.nl>
parents:
diff changeset
10 All these scripts will send their output to the stdout, so you either have to pipe them to another script, or redirect their output to a file (examples below).
159a026a8bb1 Added bgp graph readme
ivo <ivo@UFO-Net.nl>
parents:
diff changeset
11
159a026a8bb1 Added bgp graph readme
ivo <ivo@UFO-Net.nl>
parents:
diff changeset
12 Inside the scripts are a few configuration options. You should configure your local AS number (mynode/LOCALNODE variable) for proper operation. You may also change authentication parameters, for the quagga script.
159a026a8bb1 Added bgp graph readme
ivo <ivo@UFO-Net.nl>
parents:
diff changeset
13
159a026a8bb1 Added bgp graph readme
ivo <ivo@UFO-Net.nl>
parents:
diff changeset
14 To create the graph, you will need the path_list_to_dot.php script, this script expects the collected path data on STDIN, and will send the DOT-data to STDOUT (examples below). The DOT-data can be sent to one of the graphviz utilities (the dot command often performs best).
159a026a8bb1 Added bgp graph readme
ivo <ivo@UFO-Net.nl>
parents:
diff changeset
15
159a026a8bb1 Added bgp graph readme
ivo <ivo@UFO-Net.nl>
parents:
diff changeset
16 EXAMPLES
159a026a8bb1 Added bgp graph readme
ivo <ivo@UFO-Net.nl>
parents:
diff changeset
17
159a026a8bb1 Added bgp graph readme
ivo <ivo@UFO-Net.nl>
parents:
diff changeset
18 Graphing one single local bird instance
159a026a8bb1 Added bgp graph readme
ivo <ivo@UFO-Net.nl>
parents:
diff changeset
19 $ ./bgp_path_list_bird.sh | ./path_list_to_dot.php | dot -T png -o graph.png
159a026a8bb1 Added bgp graph readme
ivo <ivo@UFO-Net.nl>
parents:
diff changeset
20
159a026a8bb1 Added bgp graph readme
ivo <ivo@UFO-Net.nl>
parents:
diff changeset
21 Graphing one single quagga instance
159a026a8bb1 Added bgp graph readme
ivo <ivo@UFO-Net.nl>
parents:
diff changeset
22 $ ./bgp_path_list_quagga.sh | ./path_list_to_dot.php | dot -T png -o graph.png
159a026a8bb1 Added bgp graph readme
ivo <ivo@UFO-Net.nl>
parents:
diff changeset
23
159a026a8bb1 Added bgp graph readme
ivo <ivo@UFO-Net.nl>
parents:
diff changeset
24 Graphing data from one local bird instance and one quagga instance
159a026a8bb1 Added bgp graph readme
ivo <ivo@UFO-Net.nl>
parents:
diff changeset
25 $ ./bgp_path_list_bird.sh > /tmp/paths.txt
159a026a8bb1 Added bgp graph readme
ivo <ivo@UFO-Net.nl>
parents:
diff changeset
26 $ ./bgp_path_list_quagga.sh >> /tmp/paths.txt
159a026a8bb1 Added bgp graph readme
ivo <ivo@UFO-Net.nl>
parents:
diff changeset
27 $ ./path_list_to_dot.php < /tmp/paths.txt | dot -T png -o graph.png
159a026a8bb1 Added bgp graph readme
ivo <ivo@UFO-Net.nl>
parents:
diff changeset
28
159a026a8bb1 Added bgp graph readme
ivo <ivo@UFO-Net.nl>
parents:
diff changeset
29 You can combine data from as many routers as you like. More is better, because it will make the graph more accurate.
159a026a8bb1 Added bgp graph readme
ivo <ivo@UFO-Net.nl>
parents:
diff changeset
30
159a026a8bb1 Added bgp graph readme
ivo <ivo@UFO-Net.nl>
parents:
diff changeset
31 Or, in one single line:
159a026a8bb1 Added bgp graph readme
ivo <ivo@UFO-Net.nl>
parents:
diff changeset
32 $ (./bgp_path_list_bird.sh; ./bgp_path_list_quagga.sh) | ./path_list_to_dot.php < /tmp/paths.txt | dot -T png -o graph.png
159a026a8bb1 Added bgp graph readme
ivo <ivo@UFO-Net.nl>
parents:
diff changeset
33
159a026a8bb1 Added bgp graph readme
ivo <ivo@UFO-Net.nl>
parents:
diff changeset
34 Graphing a remote quagga instance using http:
159a026a8bb1 Added bgp graph readme
ivo <ivo@UFO-Net.nl>
parents:
diff changeset
35 $ wget http://remotehost/bgp_path_list_quagga.php -O - | ./path_list_to_dot.php < /tmp/paths.txt | dot -T png -o graph.png
159a026a8bb1 Added bgp graph readme
ivo <ivo@UFO-Net.nl>
parents:
diff changeset
36
159a026a8bb1 Added bgp graph readme
ivo <ivo@UFO-Net.nl>
parents:
diff changeset
37 Alternatively, you can use a cron job on the server to periodically update a static data file.
159a026a8bb1 Added bgp graph readme
ivo <ivo@UFO-Net.nl>
parents:
diff changeset
38
159a026a8bb1 Added bgp graph readme
ivo <ivo@UFO-Net.nl>
parents:
diff changeset
39 Graphing a remote instance using netcat:
159a026a8bb1 Added bgp graph readme
ivo <ivo@UFO-Net.nl>
parents:
diff changeset
40 server$ ./bgp_path_list_bird.sh | nc -l -p 9876
159a026a8bb1 Added bgp graph readme
ivo <ivo@UFO-Net.nl>
parents:
diff changeset
41 client$ nc remotehost 9876 | ./path_list_to_dot.php < /tmp/paths.txt | dot -T png -o graph.png
159a026a8bb1 Added bgp graph readme
ivo <ivo@UFO-Net.nl>
parents:
diff changeset
42
159a026a8bb1 Added bgp graph readme
ivo <ivo@UFO-Net.nl>
parents:
diff changeset
43 You can also use inetd/xinetd on the server side for a more permanent solution.
159a026a8bb1 Added bgp graph readme
ivo <ivo@UFO-Net.nl>
parents:
diff changeset
44
159a026a8bb1 Added bgp graph readme
ivo <ivo@UFO-Net.nl>
parents:
diff changeset
45
480
3a26ef01c0fb Just fixing a type-o. ;-) YW, Ivo.
Anonymous Coward <nobody@nowhere>
parents: 29
diff changeset
46 Be creative!