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.

Operational State Configuration

URL: /rests/data/bgp-state-config:bgp-state-config

Method: PUT

Content-Type: application/xml

Request Body:

1<bgp-state-config xmlns="urn:opendaylight:params:xml:ns:yang:controller:config">
2    <config-name xmlns="urn:opendaylight:params:xml:ns:yang:bgp-state-config">operationalState</config-name>
3    <timer xmlns="urn:opendaylight:params:xml:ns:yang:bgp-state-config">1</timer>
4</bgp-state-config>

@line 3: Time in seconds between operational state update.

BGP RIB Operational State

URL: /rests/data/openconfig-network-instance:network-instances/network-instance=global-bgp/openconfig-network-instance:protocols/protocol=openconfig-policy-types:BGP/bgp-example/bgp/global/state?content=nonconfig

Method: GET

Content-Type: application/xml

Response Body:

1<state xmlns="urn:opendaylight:params:xml:ns:yang:bgp:openconfig-extensions">
2    <as>65000</as>
3    <router-id>192.0.2.2</router-id>
4    <total-paths>0</total-paths>
5    <total-prefixes>0</total-prefixes>
6</state>

@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: /rests/data/openconfig-network-instance:network-instances/network-instance=global-bgp/openconfig-network-instance:protocols/protocol=openconfig-policy-types:BGP/bgp-example/bgp/global/afi-safis?content=nonconfig

Method: GET

Content-Type: application/xml

Response Body:

 1<afi-safis xmlns="urn:opendaylight:params:xml:ns:yang:bgp:openconfig-extensions">
 2    <afi-safi>
 3        <afi-safi-name xmlns:x="http://openconfig.net/yang/bgp-types">x:IPV4-UNICAST</afi-safi-name>
 4        <state>
 5            <total-paths>0</total-paths>
 6            <total-prefixes>0</total-prefixes>
 7        </state>
 8    </afi-safi>
 9    <afi-safi>
10        <afi-safi-name xmlns:x="http://openconfig.net/yang/bgp-types">x:IPV6-UNICAST</afi-safi-name>
11        <state>
12            <total-paths>0</total-paths>
13            <total-prefixes>0</total-prefixes>
14        </state>
15    </afi-safi>
16    ....
17</afi-safis>

@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: /rests/data/openconfig-network-instance:network-instances/network-instance=global-bgp/openconfig-network-instance:protocols/protocol=openconfig-policy-types:BGP/bgp-example/bgp/neighbors?content=nonconfig

Method: GET

Content-Type: application/xml

Response Body:

 1<neighbors xmlns="urn:opendaylight:params:xml:ns:yang:bgp:openconfig-extensions">
 2    <neighbor>
 3        <neighbor-address>192.0.2.1</neighbor-address>
 4        .....
 5    </neighbor>
 6    <neighbor>
 7        <neighbor-address>192.0.2.2</neighbor-address>
 8        .....
 9    </neighbor>
10</neighbors>

@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: /rests/data/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?content=nonconfig

Method: GET

Content-Type: application/xml

Response Body:

 1<state xmlns="urn:opendaylight:params:xml:ns:yang:bgp:openconfig-extensions">
 2    <session-state>ESTABLISHED</session-state>
 3    <supported-capabilities xmlns:x="http://openconfig.net/yang/bgp-types">x:ASN32</supported-capabilities>
 4    <supported-capabilities xmlns:x="http://openconfig.net/yang/bgp-types">x:MPBGP</supported-capabilities>
 5    <messages>
 6        <sent>
 7            <UPDATE>0</UPDATE>
 8            <NOTIFICATION>0</NOTIFICATION>
 9        </sent>
10        <received>
11            <UPDATE>4</UPDATE>
12            <NOTIFICATION>0</NOTIFICATION>
13        </received>
14    </messages>
15</state>

@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: /rests/data/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?content=nonconfig

Method: GET

Content-Type: application/xml

Response Body:

 1<afi-safis xmlns="urn:opendaylight:params:xml:ns:yang:bgp:openconfig-extensions">
 2     <afi-safi>
 3         <afi-safi-name xmlns:x="http://openconfig.net/yang/bgp-types">x:IPV4-UNICAST</afi-safi-name>
 4         <state>
 5             <active>false</active>
 6         </state>
 7         <graceful-restart>
 8            <state>
 9                <received>true</received>
10                <ll-received>true</ll-received>
11                <ll-advertised>true</ll-advertised>
12                <ll-stale-timer>180</ll-stale-timer>
13                <advertised>true</advertised>
14            </state>
15        </graceful-restart>
16     </afi-safi>
17     <afi-safi>
18         <afi-safi-name xmlns:x="http://openconfig.net/yang/bgp-types">x:IPV6-UNICAST</afi-safi-name>
19         <state>
20             <active>false</active>
21         </state>
22         <graceful-restart>
23            <state>
24                <received>true</received>
25                <ll-received>true</ll-received>
26                <ll-advertised>true</ll-advertised>
27                <ll-stale-timer>100</ll-stale-timer>
28                <advertised>true</advertised>
29            </state>
30        </graceful-restart>
31     </afi-safi>
32</afi-safis>

@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: /rests/data/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?content=nonconfig

Method: GET

Content-Type: application/xml

Response Body:

 1<afi-safi xmlns="urn:opendaylight:params:xml:ns:yang:bgp:openconfig-extensions">
 2    <afi-safi-name xmlns:x="http://openconfig.net/yang/bgp-types">x:IPV4-UNICAST</afi-safi-name>
 3    <state>
 4        <active>true</active>
 5        <prefixes>
 6            <installed>3</installed>
 7            <sent>0</sent>
 8            <received>3</received>
 9        </prefixes>
10    </state>
11    <graceful-restart>
12        <state>
13            <received>true</received>
14            <ll-received>true</ll-received>
15            <ll-advertised>true</ll-advertised>
16            <ll-stale-timer>180</ll-stale-timer>
17            <advertised>true</advertised>
18        </state>
19    </graceful-restart>
20</afi-safi>

@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: /rests/data/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?content=nonconfig

Method: GET

Content-Type: application/xml

Response Body:

1<timers xmlns="urn:opendaylight:params:xml:ns:yang:bgp:openconfig-extensions">
2    <state>
3        <negotiated-hold-time>180</negotiated-hold-time>
4        <uptime>1580676</uptime>
5    </state>
6</timers>

@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: /rests/data/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?content=nonconfig

Method: GET

Content-Type: application/xml

Response Body:

1<transport xmlns="urn:opendaylight:params:xml:ns:yang:bgp:openconfig-extensions">
2    <state>
3        <remote-address>127.0.0.2</remote-address>
4        <remote-port>44718</remote-port>
5        <local-port>1790</local-port>
6    </state>
7</transport>

@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: /rests/data/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?content=nonconfig

Method: GET

Content-Type: application/xml

Response Body:

1<error-handling xmlns="urn:opendaylight:params:xml:ns:yang:bgp:openconfig-extensions">
2    <state>
3        <erroneous-update-messages>0</erroneous-update-messages>
4    </state>
5</error-handling>

@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: /rests/data/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?content=nonconfig

Method: GET

Content-Type: application/xml

Response Body:

1<graceful-restart xmlns="urn:opendaylight:params:xml:ns:yang:bgp:openconfig-extensions">
2    <state>
3        <peer-restarting>false</peer-restarting>
4        <local-restarting>false</local-restarting>
5        <peer-restart-time>5</peer-restart-time>
6        <mode>BILATERAL</mode>
7    </state>
8</graceful-restart>

@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: /rests/data/openconfig-network-instance:network-instances/network-instance=global-bgp/openconfig-network-instance:protocols/protocol=openconfig-policy-types:BGP/bgp-example/peer-groups?content=nonconfig

Method: GET

Content-Type: application/xml

Response Body:

1<peer-groups>
2    <peer-group>
3        <peer-group-name>application-peers</peer-group-name>
4        <state>
5            <total-paths>0</total-paths>
6            <total-prefixes>0</total-prefixes>
7        </state>
8    </peer-group>
9</peer-groups>

@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.

1opendaylight-user@root> bgp:operational-state -rib example-bgp-rib
1opendaylight-user@root> bgp:operational-state -rib example-bgp-rib -neighbor 192.0.2.1
1opendaylight-user@root> bgp:operational-state -rib -peer-group application-peers