.. _bgp-user-guide-operational-state:
Operational State
=================
The OpenDaylight BGP implementation provides a set of APIs (described below), that give its operational state refreshed periodically, by default every 5 seconds.
The following APIs describe what is available starting with how to change the default refresh rate.
.. contents:: Contents
:depth: 2
:local:
Operational State Configuration
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
**URL:** ``/restconf/config/bgp-state-config:bgp-state-config``
**Method:** ``PUT``
**Content-Type:** ``application/xml``
**Request Body:**
.. code-block:: xml
:linenos:
:emphasize-lines: 3
operationalState
1
@line 3: Time in seconds between operational state update.
BGP RIB Operational State
^^^^^^^^^^^^^^^^^^^^^^^^^
**URL:** ``/restconf/operational/openconfig-network-instance:network-instances/network-instance/global-bgp/openconfig-network-instance:protocols/protocol/openconfig-policy-types:BGP/bgp-example/bgp/global/state``
**Method:** ``GET``
**Content-Type:** ``application/xml``
**Response Body:**
.. code-block:: xml
:linenos:
65000
192.0.2.2
0
0
@line 2: AS number of the remote peer.
@line 3: The unique protocol instance identifier.
@line 4: Total number of Paths installed on RIB (Loc-RIB)
@line 5: Total number of Prefixes installed on RIB (Loc-RIB)
BGP RIB Families Operational State
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
**URL:** ``/restconf/operational/openconfig-network-instance:network-instances/network-instance/global-bgp/openconfig-network-instance:protocols/protocol/openconfig-policy-types:BGP/bgp-example/bgp/global/afi-safis``
**Method:** ``GET``
**Content-Type:** ``application/xml``
**Response Body:**
.. code-block:: xml
:linenos:
:emphasize-lines: 3,5,6
x:IPV4-UNICAST
0
0
x:IPV6-UNICAST
0
0
....
@line 3: Family Identifier.
@line 5: Total number of Paths installed on RIB (Loc-RIB) per specific family.
@line 6: Total number of Prefixes installed on RIB (Loc-RIB) per specific family.
BGP Neighbors Operational State
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
**URL:** ``/restconf/operational/openconfig-network-instance:network-instances/network-instance/global-bgp/openconfig-network-instance:protocols/protocol/openconfig-policy-types:BGP/bgp-example/bgp/neighbors``
**Method:** ``GET``
**Content-Type:** ``application/xml``
**Response Body:**
.. code-block:: xml
:linenos:
:emphasize-lines: 3
192.0.2.1
.....
192.0.2.2
.....
@line 3: IP address of the remote BGP peer. Also serves as an unique identifier of a neighbor in a list of neighbors.
BGP Neighbor Operational State
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.. note:: Supported Capabilities only provided when session has been established.
**URL:** ``/restconf/operational/openconfig-network-instance:network-instances/network-instance/global-bgp/openconfig-network-instance:protocols/protocol/openconfig-policy-types:BGP/bgp-example/bgp/neighbors/neighbor/127.0.0.2/state``
**Method:** ``GET``
**Content-Type:** ``application/xml``
**Response Body:**
.. code-block:: xml
:linenos:
:emphasize-lines: 2,3,4,7,8,11,12
ESTABLISHED
x:ASN32
x:MPBGP
0
0
4
0
@line 2: Session status
@line 3-4: BGP capabilities supported ( ASN32 / MPBGP / ROUTE_REFRESH / GRACEFUL_RESTART / ADD_PATHS)
@line 7: Total count of Update Messages sent
@line 8: Total count of Notification Messages sent
@line 11: Total count of Update Messages received
@line 12: Total count of Notification Messages received
BGP Neighbor Families Operational State
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
**URL:** ``/restconf/operational/openconfig-network-instance:network-instances/network-instance/global-bgp/openconfig-network-instance:protocols/protocol/openconfig-policy-types:BGP/bgp-example/bgp/neighbors/neighbor/192.0.2.1/afi-safis``
**Method:** ``GET``
**Content-Type:** ``application/xml``
**Response Body:**
.. code-block:: xml
:linenos:
:emphasize-lines: 3,5,7,9,10,11,12,13
x:IPV4-UNICAST
false
true
true
true
180
true
x:IPV6-UNICAST
false
true
true
true
100
true
@line 3: Family Identifier.
@line 5: True if family is advertized by peer.
@line 7: Graceful Restart Operational State per specific family.
@line 9: True if the peer supports graceful restart.
@line 10: True if peer supports Long-Lived graceful restart.
@line 11: True if we supports Long-Lived graceful restart.
@line 12: Value of Long-Lived stale timer in seconds for specific family
@line 13: True if we support graceful restart.
BGP Neighbor Family Operational State
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.. note:: Prefixes state is only provided once session is established.
**URL:** ``/restconf/operational/openconfig-network-instance:network-instances/network-instance/global-bgp/openconfig-network-instance:protocols/protocol/openconfig-policy-types:BGP/bgp-example/bgp/neighbors/neighbor/192.0.2.1/afi-safis/afi-safi/openconfig-bgp-types:IPV4%2DUNICAST``
**Method:** ``GET``
**Content-Type:** ``application/xml``
**Response Body:**
.. code-block:: xml
:linenos:
:emphasize-lines: 2,4,6,7,8
x:IPV4-UNICAST
true
3
0
3
true
true
true
180
true
@line 2: Family Identifier.
@line 4: True if family is advertized to and by peer.
@line 6: Total count of prefixes advertized by peer and installed (effective-rib-in).
@line 7: Total count of prefixes advertized to peer (adj-rib-out).
@line 8: Total count of prefixes advertized by peer (adj-rib-in).
BGP Neighbor Timers Operational State
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.. note:: State is only provided once session is established.
**URL:** ``/restconf/operational/openconfig-network-instance:network-instances/network-instance/global-bgp/openconfig-network-instance:protocols/protocol/openconfig-policy-types:BGP/bgp-example/bgp/neighbors/neighbor/192.0.2.1/timers``
**Method:** ``GET``
**Content-Type:** ``application/xml``
**Response Body:**
.. code-block:: xml
:linenos:
:emphasize-lines: 3,4
180
1580676
@line 3: The negotiated hold-time for the BGP session in seconds.
@line 4: Session duration since establishment in timeticks (hundredths of a second).
BGP Neighbor Transport Operational State
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.. note:: State is only provided once session is established.
**URL:** ``/restconf/operational/openconfig-network-instance:network-instances/network-instance/global-bgp/openconfig-network-instance:protocols/protocol/openconfig-policy-types:BGP/bgp-example/bgp/neighbors/neighbor/192.0.2.1/transport``
**Method:** ``GET``
**Content-Type:** ``application/xml``
**Response Body:**
.. code-block:: xml
:linenos:
:emphasize-lines: 3,4,5
127.0.0.2
44718
1790
@line 3: IP address of the remote BGP peer.
@line 4: Port of the remote BGP peer.
@line 5: Local port.
BGP Neighbor Error Handling Operational State
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.. note:: State is only provided once session is established.
.. note:: Error handling not supported yet. Planned for Carbon.
**URL:** ``/restconf/operational/openconfig-network-instance:network-instances/network-instance/global-bgp/openconfig-network-instance:protocols/protocol/openconfig-policy-types:BGP/bgp-example/bgp/neighbors/neighbor/192.0.2.1/error-handling``
**Method:** ``GET``
**Content-Type:** ``application/xml``
**Response Body:**
.. code-block:: xml
:linenos:
:emphasize-lines: 3
0
@line 3: The number of BGP UPDATE messages for which the treat-as-withdraw mechanism has been applied based on
erroneous message contents
BGP Neighbor Graceful Restart Operational State
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.. note:: Graceful Restart not supported yet. Planned for Carbon.
**URL:** ``/restconf/operational/openconfig-network-instance:network-instances/network-instance/global-bgp/openconfig-network-instance:protocols/protocol/openconfig-policy-types:BGP/bgp-example/bgp/neighbors/neighbor/192.0.2.1/graceful-restart``
**Method:** ``GET``
**Content-Type:** ``application/xml``
**Response Body:**
.. code-block:: xml
:linenos:
:emphasize-lines: 3,4,5,6
false
false
5
BILATERAL
@line 3: This flag indicates whether the remote neighbor is currently in the process of restarting, and hence
received routes are currently stale.
@line 4: This flag indicates whether the local neighbor is currently restarting. The flag is unset after all NLRI
have been advertised to the peer, and the End-of-RIB (EOR) marker has been unset.
@line 5: The period of time (advertised by the peer) in seconds that the peer expects a restart of a BGP session to take.
@line 6: Mode of Graceful Restart operation, depending on family support advertising to peer and receiving from peer can be HELPER-ONLY (only remote peers support some families), REMOTE-HELPER (only we advertise support), BILATERAL (two-side support).
BGP Peer Groups Operational State
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
**URL:** ``/restconf/operational/openconfig-network-instance:network-instances/network-instance/global-bgp/openconfig-network-instance:protocols/protocol/openconfig-policy-types:BGP/bgp-example/peer-groups``
**Method:** ``GET``
**Content-Type:** ``application/xml``
**Response Body:**
.. code-block:: xml
:linenos:
:emphasize-lines: 3,5,6
application-peers
0
0
@line 3: Peer Group Identifier.
@line 5: At this moment the cost for count path under effect-rib-in is to high. Therefore the value is the same as total prefixes.
@line 6: Total Prefixes installed under by peers pertaining to this peer group (effective-rib-in).
This count doesn't differentiate repeated prefixes.
CLI
---
BGP Karaf Console (odl-bgpcep-bgp-cli) provides a CLI feature to read operational state per RIB, Neighbor and Peer Group.
.. code-block:: bash
:linenos:
opendaylight-user@root> bgp:operational-state -rib example-bgp-rib
.. code-block:: bash
:linenos:
opendaylight-user@root> bgp:operational-state -rib example-bgp-rib -neighbor 192.0.2.1
.. code-block:: bash
:linenos:
opendaylight-user@root> bgp:operational-state -rib -peer-group application-peers