Pathcollect (service)

From NixNodes wiki
Jump to: navigation, search

This service introduces an easy way for DN42 users to post AS path data from their respective networks and collect the accumulated path info from any network posting here. It aims to provide graph builders with as much AS path data from DN42 as possible. HTTP POST is used to upload data to the server, this provides network operators with an easy way to periodically send paths using curl and cronie on a linux system.

How to send path updates locally from a linux router:

To execute periodically, the below commands can simply be put into crontab directly, or written to a script;

  • Using absolute paths to vtysh/birdc commands in cronie might be a good idea; if executing the command directly, change to reflect the correct path
  • Change 'as=' value in curl -F argument to your AS number

Quagga

vtysh -c 'show ip bgp ipv4 unicast paths'|cut -f 3- -d ' '|egrep '^[0-9 ]*$'|sort -n|uniq|curl --insecure -F 'pdata=<-' -F 'as=<ASN>' https://nixnodes.dn42/dn42/routedump

BIRD

  • Overwrite '(table_name)' to reflect the correct bird routing table
birdc 'show route table <name> all'|grep BGP\.as_path|egrep -o '[0-9]+ [0-9 ]+'|sort -n|uniq|curl --insecure -F 'pdata=<-' -F 'as=<ASN>' https://nixnodes.dn42/dn42/routedump
birdc6 'show route table <name> all'|grep BGP\.as_path|egrep -o '[0-9]+ [0-9 ]+'|sort -n|uniq|curl --insecure -F 'pdata=<-' -F 'as=<ASN>' -F '6=1' https://nixnodes.dn42/dn42/routedump

Please check the output before sending for the first time (remove curl part), these are just examples. There's no guarantee these examples will work on your particular system. Extract the paths any way you wish, as long as its done properly and if you aren't sure, ask. Recommended POST frequency is once every 5-15 minutes. Data older than 20 minutes is automatically removed.

If not running a linux router, or not able to send directly from the router itself, one can capture the path data and feed it to the webserver any way one sees fit, following below format (without brackets):

Value input in 'as' field is automatically prepent to each line of 'pdata', to disable this, add 'nop=1' to the query. If using curl, add argument -F "nop=1" to the command.

How to retrive data (using pquery)

Filter options

  • include=AS1,AS2,.. - output only data from listed AS
  • exclude=AS1,AS2,.. - exclude any data from listed AS

Other options

  • browser - browser compatible output
  • links - output network connections in simple AS-AS form
  • aslist - output active autonomous systems list
  • nodesd3js - output links in json format, suitable for use with the D3 javascript library

Examples

  • Recieve from all except:
curl --insecure https://nixnodes.net/dn42/pquery?exclude=76103,76105
  • Recieve only from:
curl --insecure https://nixnodes.net/dn42/pquery?include=76103,76105
  • Get links data:
https://nixnodes.net/dn42/pquery?links