# BGP Tests

BGP tests operate on the lowest fabric of the internet - the [BGP routing](https://en.wikipedia.org/wiki/Border_Gateway_Protocol) layer. Relevant BGP routing data is collected from ThousandEyes-provided BGP Monitors (a.k.a. "Public BGP Monitors"), from BGP peers that you connect to our infrastructure - the so-called [Private BGP Monitors](https://docs.thousandeyes.com/product-documentation/thousandeyes-basics/inside-out-bgp-visibility), or both at the same time. Collected data is presented as [BGP Route Visualization](https://docs.thousandeyes.com/product-documentation/internet-and-wan-monitoring/tests/bgp-tests/using-the-bgp-route-visualization-view), a view that presents information in a cohesive manner, pointing out relevant events on the timeline and in the ASN graph. A BGP test also offers the ability to include prefixes covered by target prefix.

To get started with creating BGP tests, check out this short interactive tutorial: [Creating a BGP Test](https://demo.thousandeyes.com/s/PHYdHq).

ThousandEyes ingests BGP routing data from dozens of global BGP collectors and automatically integrates that visibility as a configurable layer under service, network, and path visualization layers. ThousandEyes supports private and public BGP monitors, as well as our own in-house BGP monitors. Private BGP monitors are monitors you have configured to report BGP data directly from your routers. Public BGP monitors report routing data provided from [RIPE RIS](https://www.ripe.net/analyse/internet-measurements/routing-information-service-ris/) and ThousandEyes' BGP monitors. ThousandEyes BGP monitors are configured and supported by ThousandEyes.

When you specify a service URL in a test, layered BGP tests automatically track reachability and path changes for any relevant prefix. When you use an IP address as the target for a test, the ThousandEyes platform monitors the relevant internet-routed prefix. You can also create specific BGP monitoring for a prefix, and can alert on hijacks and leaks.

The BGP Updates table offers real-time insights into BGP routing through a comprehensive, data-rich table interface. It features real-time BGP message streaming, advanced filtering options including RPKI Status and up to 30 days of historical data, and a unified view of monitored prefixes supported by a global network of BGP monitors. This tool enhances anomaly detection, traffic engineering verification, and security by providing precise details on routing changes, BGP Communities propagation, and RPKI Status filtering.

The BGP Route Visualization displays an autonomous system-by-autonomous system view of the nodes in the path from the BGP monitors to the target. To learn more about using the *BGP Route Visualization View*, see [Using the BGP Route Visualization View](https://docs.thousandeyes.com/product-documentation/tests/bgp-tests/using-the-bgp-route-visualization-view).

ThousandEyes also detects if announced routes have valid RPKI ROAs. To learn more about RPKI, see [BGP RPKI](https://docs.thousandeyes.com/product-documentation/tests/bgp-tests/rpki).

## Autonomous System (AS) Data Sources

An autonomous system (AS) is an interconnected network or collection of IP networks and routers managed by a single organization. Autonomous systems are essential for the Border Gateway Protocol (BGP) because they enable the construction of the internet routing tables. To enhance the accuracy and richness of AS data, ThousandEyes sources names and related metadata from datasets maintained by internet registries and other publicly available resources.

ThousandEyes shows autonomous system numbers in **BGP Route Visualization**, the **BGP Updates** table, and other BGP and path views. BGP reachability data (updates, paths, and timelines) comes from the public BGP monitors, private BGP monitors, and ThousandEyes BGP monitors described earlier on this page. Datasets used to enrich AS information include:

* [**BGP.Tools**](https://bgp.tools/)
* **APNIC Pty Ltd** ([APNIC](https://www.apnic.net/)): (C) APNIC Pty/Ltd.
* **Center for Applied Internet Data Analysis (CAIDA):** The [CAIDA AS Relationships Dataset](https://www.caida.org/catalog/datasets/as-relationships/), described in CAIDA’s public dataset catalog.
* **RIPE NCC**

  The [RIPE Routing Information Service (RIS)](https://www.ripe.net/analyse/internet-measurements/routing-information-service-ris/) is a RIPE NCC service. With the help of network operators all over the world, RIS employs a globally distributed set of Remote Route Collectors (RRCs), typically located at internet exchange points, to collect and store internet routing data. Volunteers peer with the RRCs using the BGP protocol, and RIS stores the update and withdraw messages. RIS data can be accessed via:

  * **RIPEstat**: A single interface for querying information about internet number resources. RIPEstat uses individual widgets to display routing and other information.
  * **RIS Live**: A real-time BGP streaming API that allows server-side filtering of BGP messages by prefix or autonomous system.
  * **RIS Raw Data**: Available for each route collector, with state dumps and batches of updates made available periodically.
  * **RISwhois**: Searches the latest RIS data for details of an IP address using a plaintext whois-style interface. It is useful when querying RIS data using scripts.

  This approach enables ThousandEyes to maintain comprehensive and up-to-date ASN provider information to support BGP-related insights and monitoring.

  ![RIPE NCC logo](/files/glD7uQHb7OLuAjLaJ7po)

## Typical BGP Test Use Cases

* Ensure network prefix reachability from multiple BGP vantage points on the internet.
* Detect and alert on BGP route leaks or BGP route hijacking.
* Validate and alert on active DDoS mitigation measures.
* Monitor presence and activity of multiple upstream network providers.
* Alert on unexpected path changes, unexpected upstream ASNs, route flapping, etc.

## Example BGP Test Results

The following figure is showing BGP path change detected by the St. Petersburg public BGP Monitor, where the network path through ASN20485 is replaced by a path through ASN9002:

![](/files/-M5xtOOMZ8XzKi2CGI9J)

## Manually Configuring BGP Tests

* **Test Type**: BGP
* **Test Name**: This optional parameter gives the test a label. When no label is provided, then the value in the **Prefix** field will be used. A test name cannot exceed 255 characters.
* **Prefix**: A BGP prefix and prefix length in CIDR notation (dotted-quad network address, a slash, then integer netmask).
* **Include covered prefixes**: When this box is checked, provide test results for covered prefixes of the netblock in the **Prefix** field.
* **Public BGP Monitors**: This option button allows you to choose whether ThousandEyes' public BGP Monitors should be used for monitoring target prefixes.
* **Private BGP Monitors**: This drop-down box allows you to select which private BGP Monitors should be used for monitoring target prefixes.

Note that some monitors are IPv4 monitors and some are IPv6 monitors. Tests with IPv4 targets will display only IPv4 monitors in the BGP Path Visualization; similarly, tests with IPv6 targets display only IPv6 monitors in the BGP Path Visualization.

* **Alerts**: When the **Enable** box is checked, the Alert Rules selected in drop-down list will be active for the test. You can select Alert Rules with the drop-down list, and create, modify and delete alert rules with the **Edit Alert Rules** link.

### BGP Test Outputs

BGP tests provide the following views:

* **BGP Route Visualization** displays an autonomous system-by-autonomous system view of the nodes in the path from the monitors to the target, along with routing and geographical information about each node and link between nodes.
* **BGP Updates** offers real-time insights into BGP routing through a comprehensive, data-rich table interface, including real-time BGP message streaming, advanced filtering options including RPKI Status and up to 30 days of historical data, and a unified view of monitored prefixes supported by a global network of BGP monitors.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.thousandeyes.com/product-documentation/tests/bgp-tests.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
