services/Route-Collector.md
... ...
@@ -0,0 +1,127 @@
1
+# Global Route Collector
2
+
3
+The Global Route Collector (GRC) provides a real time view of routing and peering across DN42 and can be used to generate maps, stats or just query how routes are being propagated across the network.
4
+
5
+Technically the GRC is a [bird](https://bird.network.cz/) instance that anyone can peer with, it imports all routes whilst exporting none and provides a number of interfaces for querying the route data.
6
+
7
+Data from the GRC is used to generate some of the DN42 Maps (see the [[Internal Services|/internal/Internal-Services]] page).
8
+
9
+## Peering with the collector
10
+
11
+The collector uses the dynamic peering capability in Bird2 to allow anyone to peer with it without any new server side configuration being required. The collector relies on users peering with it across the network so the more peers the better and the more comprehensive the collector data will be.
12
+
13
+||Details|
14
+|:--|:--|
15
+| ASN | AS4242422602 |
16
+| Hostname | collector.dn42 |
17
+| IPv4 Address | 172.20.129.4 |
18
+| IPv6 Address | fd42:4242:2601:ac12::1 |
19
+
20
+### BGP Configuration
21
+
22
+ - Unlike normal DN42 peerings, you must enable multihop to peer with the collector
23
+ - The collector supports Multiprotocol BGP, so you don't need to configure separate IPv4 and IPv6 sessions
24
+ - Please enable the Add Paths BGP extension to export all available routes
25
+
26
+Example bird2 config:
27
+
28
+```text
29
+protocol bgp ROUTE_COLLECTOR
30
+{
31
+ local as ***YOUR_ASN***;
32
+ neighbor fd42:4242:2601:ac12::1 as 4242422602;
33
+
34
+ # enable multihop as the collector is not locally connected
35
+ multihop;
36
+
37
+ ipv4 {
38
+ # export all available paths to the collector
39
+ add paths tx;
40
+
41
+ # import/export filters
42
+ import none;
43
+ export filter {
44
+ # export all valid routes
45
+ if ( is_valid_network() && source ~ [ RTS_STATIC, RTS_BGP ] )
46
+ then {
47
+ accept;
48
+ }
49
+ reject;
50
+ };
51
+ };
52
+
53
+ ipv6 {
54
+ # export all available paths to the collector
55
+ add paths tx;
56
+
57
+ # import/export filters
58
+ import none;
59
+ export filter {
60
+ # export all valid routes
61
+ if ( is_valid_network_v6() && source ~ [ RTS_STATIC, RTS_BGP ] )
62
+ then {
63
+ accept;
64
+ }
65
+ reject;
66
+ };
67
+ };
68
+}
69
+```
70
+
71
+
72
+## Querying the collector
73
+
74
+### Looking Glass
75
+
76
+The collector runs a looking glass based on [bird-lg-go](https://github.com/xddxdd/bird-lg-go).
77
+
78
+ - [https://lg.collector.dn42/](https://lg.collector.dn42/)
79
+
80
+### MRT Dumps
81
+
82
+[MRT Dumps](https://tools.ietf.org/html/rfc6396) are produced by the collector every 10 minutes. Bird produces MRT dumps corresponding to tables, so two separate dumps are created, one for IPv4 (master4) and one for IPv6 (master6). The 10 minutes dumps are available for one week before being reduced down to one a day.
83
+
84
+ - [https://mrt.collector.dn42](https://mrt.collector.dn42)
85
+
86
+The latest dumps can always be found at the following URLs:
87
+
88
+ - [https://mrt.collector.dn42/master4_latest.mrt.bz2](https://mrt.collector.dn42/master4_latest.mrt.bz2)
89
+ - [https://mrt.collector.dn42/master6_latest.mrt.bz2](https://mrt.collector.dn42/master6_latest.mrt.bz2)
90
+
91
+### Prometheus Metrics
92
+
93
+The collector runs [bird_exporter](https://github.com/czerwonk/bird_exporter) and prometheus style metrics are available at the following URL:
94
+
95
+ - [http://collector.dn42:9324/metrics](http://collector.dn42:9324/metrics)
96
+
97
+### SSH Interface
98
+
99
+The collector bird instance can be queried directly using a birdc shell.
100
+
101
102
+
103
+```sh
104
105
+------------------------------------
106
+* DN42 Global Route Collector *
107
+------------------------------------
108
+* http://collector.dn42/
109
+
110
+This service provides a bird2 shell
111
+for querying the route collector
112
+
113
+Be nice, access is logged and
114
+abuse will not be tolerated
115
+------------------------------------
116
+BIRD burble-2.0.8-210322-1-ge6133456 ready.
117
+Access restricted
118
+bird> show route count
119
+bird> 297441 of 297441 routes for 502 networks in table master4
120
+286007 of 286007 routes for 427 networks in table master6
121
+1437 of 1437 routes for 1437 networks in table dn42_roa4
122
+1231 of 1231 routes for 1231 networks in table dn42_roa6
123
+Total: 586116 of 586116 routes for 3597 networks in 4 tables
124
+bird>
125
+
126
+```
127
+