BGP Data - Working with High Cardinality Data

In this tutorial, we will explore a high cardinality data using the BGP public data set of the University of Oregon Route Views Archive Project.

Not reflective of actual performance: This data set is quite large and the compute that it is running on has been sized down for demonstration purposes. If you are interested in exploring BGP data with more compute power, please contact Hydrolix Sales.

BGP, or Border Gateway Protocol RFC4271, is the protocol that makes the Internet work. It does this by enabling data routing on the Internet. The Internet is a network of networks; it’s broken up into hundreds of thousands of smaller networks known as autonomous systems (AS). Each of these networks is essentially a large pool of routers run by a single organization. Autonomous system numbers, or ASNs, are an easy way to identify and configure networks and routing.

  • 16-bit ASN -- 0 to 65535
  • 32-bit ASN -- 65536 to 4294967285

image

BGP Autonomous System Path

The BGP AS path is a well-known, mandatory attribute, which means that it is present for all prefixes exchanged between BGP neighbors. When a BGP router sends out an update to a neighbor in a different autonomous system (i.e., an external or eBGP neighbor), it adds its own AS number to the front (left side) of the AS path. So the AS path lists all the ASes that need to be traversed to reach the location where the prefix that the path is attached to is advertised from. As such, a traceroute should encounter those same ASes.

For example - The AS_PATH attribute AS777, AS3232, AS9843247, AS23242

image

In the following example, the AS Path is 22652 9002 57717 204655 208410 57717 6939 39737 62380 6663 3257 3356 33891 57717 204655 208410

BGP4MP,12/01/19 00:00:52,A,45.61.0.85,22652,45.142.195.0/24,22652 9002 57717 204655 208410 57717 6939 39737 62380 6663 3257 3356 33891 57717 204655 208410,IGP,route-views2.oregon-ix.net

University of Oregon Route Views Project

The University's Route Views project was originally conceived as a tool for Internet operators to obtain real-time BGP information about the global routing system from the perspectives of several different backbones and locations around the Internet.

The RouteViews project collected 20 years of quagga bgpd data from route-views2.oregon-ix.net. The original data available at http://archive.routeviews.org/ is available as Quagga BGP RIB files. The RouteViews project makes full routing information base (RIB) dumps of data available every 2 hours (UTC time), and provides updates every 15 minutes. These files are compressed in .bz2 format. Data for each monitor we display can be found on the RouteViews site, in the location shown by the table at the bottom of this page.

Extracting the data files

The BGP data consists of 91,305,937,190 Records - min(timestamp) 2001-12-25 13:52:40 and max(timestamp) 2020-04-01 00:00:46. The original data size was not available, however this data GZIP'ed was 726 GB, and in HDX format it is 250 GB.

To review raw BGP data, The data first needs to be parsed. bgpdump was used for this, which provides human-readable data from the raw BGP information.

Installing and using BGPdump

Find compiled versions of bgpdump for OSX or Ubuntu Linux.

bgpdump -m outputs data in the following column order:

  • BGP Protocol
  • timestamp (in epoch format)
  • W/A/B (withdrawal/announcement/routing table)
  • Peer IP (address of the monitor)
  • Peer ASN (ASN of the monitor)
  • Prefix
  • ASPath
  • Origin Protocol (typically always IGP)
  • IX (host route added by Hydrolix)

The following command was used to extract and ingest the data:

$ bgpdump -m rib.20140801.0000.bz2
2014-08-07 13:49:42 [info] logging to syslog

The output looks like this:

TABLE_DUMP2|1406851200|B|198.129.33.85|293|1.0.0.0/24|293 15169|IGP|198.129.33.85|0|0||NAG||
TABLE_DUMP2|1406851200|B|89.149.178.10|3257|1.0.0.0/24|3257 15169|IGP|89.149.178.10|0|10|3257:8012 3257:30016 3257:50001 3257:54900 3257:54901|NAG||
Ingest Schema (Tranform)

Click arrow to expand

{
    "name": "route-views.amsix_transform",
    "type": "csv",
    "table": "{{table_uuid}}",
    "settings": {
        "compression": "gzip",
        "format_details": {
            "skip_head": 1,
            "delimiter": "\t"
        },
        "output_columns": [
            {
                "name": "BGP_Protocol",
                "datatype": {
                    "type": "string",
                    "source": { "from_input_index": 0 }                  
                }
            },
            {
                "name": "timestamp",
                "datatype": {
                    "type": "epoch",
                  	"primary" : true,
                    "format": "seconds",
                    "source": { "from_input_index": 1 }                  
                }
            },
            {
                "name": "WAB",
                "datatype": {
                    "type": "string",
                    "source": { "from_input_index": 2 }                  
                }
            },
            {
                "name": "Peer_IP",
                "datatype": {
                    "type": "string",
                    "source": { "from_input_index": 3 }                  
                }
            },
            {
                "name": "Peer_ASN",
                "datatype": {
                    "type": "string",
                    "index" : false,
                    "source": { "from_input_index": 4 }                  
                }
            },
            {
                "name": "Prefix",
                "datatype": {
                    "type": "string",
                    "source": { "from_input_index": 5 }                  
                }
            },
            {
                "name": "ASPath",
                "datatype": {
                    "type": "string",
                    "source": { "from_input_index": 6 }                  
                }
            },
            {
                "name": "Origin_Protocol",
                "datatype": {
                    "type": "string",
                    "source": { "from_input_index": 7 }                  
                }
            },
            {
                "name": "Next_Hop",
                "datatype": {
                    "type": "string",
                    "source": { "from_input_index": 8 }                  
                }
            },
            {
                "name": "LocalPref",
                "datatype": {
                    "type": "string",
                    "source": { "from_input_index": 9 }                  
                }
            },
            {
                "name": "MED",
                "datatype": {
                    "type": "string",
                    "source": { "from_input_index": 10 }                  
                }
            },
            {
                "name": "Community_strings",
                "datatype": {
                    "type": "string",
                    "source": { "from_input_index": 11 }                  
                }
            },
            {
                "name": "Atomic_Aggregator",
                "datatype": {
                    "type": "string",
                    "source": { "from_input_index": 12 }                  
                }
            },
            {
                "name": "Aggregator",
                "datatype": {
                    "type": "string",
                    "source": { "from_input_index": 13 }                  
                }
            },
            {
                "name": "IX",
                "datatype": {
                    "type": "string",
                    "virtual": true,
                    "default": "route-views.amsix",
                }
            }
        ]
    }
}

IX: List of Unique Values

Click arrow to expand

route-views.amsix
route-views.chicago
route-views.chile
route-views.eqix
route-views.flix
route-views.fortaleza.routeviews.org
route-views.gorex
route-views.isc
route-views.jinx
route-views.kixp
route-views.linx
route-views.napafrica
route-views.nwax
route-views.perth
route-views.rio.routeviews.org
route-views.saopaulo
route-views.sfmix.routeviews.org
route-views.sg
route-views.soxrs.routeviews.org
route-views.sydney
route-views.telxatl
route-views.wide
route-views6
route-views3
route-views2.saopaulo
route-views4
route-views2.oregon-ix.net