-
Notifications
You must be signed in to change notification settings - Fork 5
/
README.txt
67 lines (45 loc) · 1.98 KB
/
README.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
1. Download topology from
http://www.cs.washington.edu/research/networking/rocketfuel
And create an edge file which has all edges in the topology. Each
line consists of "A<space>B" where A and B are neighbours in the
topology.
We have some sample edges in the INET topology graph here:
inet-edges.txt
2. Download BGP prefixes from
http://routeviews.org/bgpdata/2013.08/RIBS/
3. Download bgpparser from irl.cs.ucla.edu/software/bgpparser.html
Compile and get the bin/bgpparser executable.
4. Extract all prefixes from the RIB file:
bin/bgpparser -f rib.20130801.0000 | \
grep PREFIX | \
sed -e 's/PREFIX//g' -e 's/<//g' -e 's|/>||g' -e 's/>//g' | \
awk '{ print $1 }' > allprefixes.txt
This can take a while....
5. Uniq them:
cat allprefixes.txt | uniq > unique-prefixes.txt
You don't need to sort before doing uniq because the prefixes are
lexicographically sorted.
6. Create the routing table for each router:
python create-ribs.py --prefixes unique-prefixes.txt \
--topo inet-edges.txt \
--dir topo \
--rib inet-ribs.csv \
--log \
--routes routes
It will create one file routes in the current directory to cache the
all-pairs shortest path computation. These routes were computed using
Floyd-Warshall shortest path.
Inside tmp-dir, the script will create a txt file for each router that
contains the prefixes that is owned by the router. One prefix per
line in ip/len format.
It will also generate dir/routes.csv with the following format:
<source router>,<dest router>,<next hop router>,<metric>
where metric is the length of the shortest path to the destination
router (neighbours have length 1).
To generate ribs with the following format:
<Dest IP Prefix>,<Local Router>,<Remote Router>
We basically do the following:
For each src in inet/routes.csv, construct rib-$src.csv as follows:
For each dst in (src,dst) load all prefixes from inet/$dst.txt
Insert prefix,dst into the rib-$src.txt
This will be output to inet-ribs.csv.