.. _bgp-user-guide-topology-provider:
Topology Provider
=================
This section provides an overview of the BGP topology provider service.
It shows how to configure and use all available BGP topology providers.
Providers are building topology view of BGP routes stored in local BGP speaker's Loc-RIB.
Output topologies are rendered in a form of standardised IETF network topology model.
.. contents:: Contents
:depth: 2
:local:
Inet Reachability Topology
^^^^^^^^^^^^^^^^^^^^^^^^^^
Inet reachability topology exporter offers a mapping service from IPv4/6 routes to network topology nodes.
Configuration
'''''''''''''
Following example shows how to create a new instance of IPv4 BGP topology exporter:
**URL:** ``/restconf/config/network-topology:network-topology``
**Method:** ``POST``
**Content-Type:** ``application/xml``
**Request Body:**
.. code-block:: xml
:linenos:
:emphasize-lines: 2,4,6
bgp-example-ipv4-topologybgp-example
@line 2: An identifier for a topology.
@line 4: Used to identify type of the topology. In this case BGP IPv4 reachability topology.
@line 6: A name of the local BGP speaker instance.
-----
The topology exporter instance can be removed in a following way:
**URL:** ``/restconf/config/network-topology:network-topology/topology/bgp-example-ipv4-topology``
**Method:** ``DELETE``
-----
Following example shows how to create a new instance of IPv6 BGP topology exporter:
**URL:** ``/restconf/config/network-topology:network-topology``
**Method:** ``POST``
**Content-Type:** ``application/xml``
**Request Body:**
.. code-block:: xml
bgp-example-ipv6-topologybgp-example
Usage
'''''
Operational state of the topology can be verified via REST:
**URL:** ``/restconf/operational/network-topology:network-topology/topology/bgp-example-ipv4-topology``
**Method:** ``GET``
**Response Body:**
.. code-block:: xml
:linenos:
:emphasize-lines: 8,11
bgp-example-ipv4-topologytrue10.10.1.110.0.0.10/32
@line 8: The identifier of a node in a topology. Its value is mapped from route's NEXT_HOP attribute.
@line 11: The IP prefix attribute of the node. Its value is mapped from routes's destination IP prefix.
BGP Linkstate Topology
^^^^^^^^^^^^^^^^^^^^^^
BGP linkstate topology exporter offers a mapping service from BGP-LS routes to network topology nodes and links.
Configuration
'''''''''''''
Following example shows how to create a new instance of linkstate BGP topology exporter:
**URL:** ``/restconf/config/network-topology:network-topology``
**Method:** ``POST``
**Content-Type:** ``application/xml``
**Request Body:**
.. code-block:: xml
bgp-example-linkstate-topologybgp-example
Usage
'''''
Operational state of the topology can be verified via REST.
A sample output below represents a two node topology with two unidirectional links interconnecting those nodes.
**URL:** ``/restconf/operational/network-topology:network-topology/topology/bgp-example-linkstate-topology``
**Method:** ``GET``
**Response Body:**
.. code-block:: xml
bgp-example-linkstate-topologytruebgpls://IsisLevel2:1/type=node&as=65000&domain=673720360&router=0000.0000.0040bgpls://IsisLevel2:1/type=tp&ipv4=203.20.160.4040.40.40.40/3210203.20.160.0/2410node140.40.40.4040.40.40.40MDAwMDAwMDAwMDY0bgpls://IsisLevel2:1/type=node&as=65000&domain=673720360&router=0000.0000.0039bgpls://IsisLevel2:1/type=tp&ipv4=203.20.160.3939.39.39.39/3210203.20.160.0/2410node239.39.39.3939.39.39.39MDAwMDAwMDAwMDg3bgpls://IsisLevel2:1/type=node&as=65000&domain=673720360&router=0000.0000.0039bgpls://IsisLevel2:1/type=tp&ipv4=203.20.160.39bgpls://IsisLevel2:1/type=link&local-as=65000&local-domain=673720360&local-router=0000.0000.0040&remote-as=65000&remote-domain=673720360&remote-router=0000.0000.0039&ipv4-iface=203.20.160.40&ipv4-neigh=203.20.160.391001250000.012500.0012500.0012500.0112500.0212500.0312500.0412500.0512500.0612500.07bgpls://IsisLevel2:1/type=node&as=65000&domain=673720360&router=0000.0000.0040bgpls://IsisLevel2:1/type=tp&ipv4=203.20.160.40bgpls://IsisLevel2:1/type=link&local-as=65000&local-domain=673720360&local-router=0000.0000.0039&remote-as=65000&remote-domain=673720360&remote-router=0000.0000.0040&ipv4-iface=203.20.160.39&ipv4-neigh=203.20.160.401001250000.012500.0012500.0012500.0112500.0212500.0312500.0412500.0512500.0612500.07
BGP Network Topology Configuration Loader
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
BGP Network Topology Configuration Loader allows user to define static initial configuration for a BGP protocol instance.
This service will detect the creation of new configuration files following the pattern "network-topology-*.xml" under the path "etc/opendaylight/bgpcep".
Once the file is processed, the defined configuration will be available from the configuration Data Store.
.. note:: If the BGP topology instance is already present, no update or configuration will be applied.
**PATH:** ``etc/opendaylight/bgpcep/network-topology-config.xml``
.. code-block:: xml
example-ipv4-topologyexample-bgp-ribexample-ipv6-topologyexample-bgp-ribexample-linkstate-topologyexample-bgp-rib