1 .. _bgp-user-guide-operational-state:
6 The OpenDaylight BGP implementation provides a set of APIs (described below), that give its operational state refreshed periodically, by default every 5 seconds.
7 The following APIs describe what is available starting with how to change the default refresh rate.
13 Operational State Configuration
14 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
16 **URL:** ``/restconf/config/bgp-state-config:bgp-state-config``
20 **Content-Type:** ``application/xml``
28 <bgp-state-config xmlns="urn:opendaylight:params:xml:ns:yang:controller:config">
29 <config-name xmlns="urn:opendaylight:params:xml:ns:yang:bgp-state-config">operationalState</config-name>
30 <timer xmlns="urn:opendaylight:params:xml:ns:yang:bgp-state-config">1</timer>
33 @line 3: Time in seconds between operational state update.
35 BGP RIB Operational State
36 ^^^^^^^^^^^^^^^^^^^^^^^^^
38 **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``
42 **Content-Type:** ``application/xml``
49 <state xmlns="urn:opendaylight:params:xml:ns:yang:bgp:openconfig-extensions">
51 <router-id>192.0.2.2</router-id>
52 <total-paths>0</total-paths>
53 <total-prefixes>0</total-prefixes>
56 @line 2: AS number of the remote peer.
58 @line 3: The unique protocol instance identifier.
60 @line 4: Total number of Paths installed on RIB (Loc-RIB)
62 @line 5: Total number of Prefixes installed on RIB (Loc-RIB)
64 BGP RIB Families Operational State
65 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
67 **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``
71 **Content-Type:** ``application/xml``
77 :emphasize-lines: 3,5,6
79 <afi-safis xmlns="urn:opendaylight:params:xml:ns:yang:bgp:openconfig-extensions">
81 <afi-safi-name xmlns:x="http://openconfig.net/yang/bgp-types">x:IPV4-UNICAST</afi-safi-name>
83 <total-paths>0</total-paths>
84 <total-prefixes>0</total-prefixes>
88 <afi-safi-name xmlns:x="http://openconfig.net/yang/bgp-types">x:IPV6-UNICAST</afi-safi-name>
90 <total-paths>0</total-paths>
91 <total-prefixes>0</total-prefixes>
97 @line 3: Family Identifier.
99 @line 5: Total number of Paths installed on RIB (Loc-RIB) per specific family.
101 @line 6: Total number of Prefixes installed on RIB (Loc-RIB) per specific family.
103 BGP Neighbors Operational State
104 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
106 **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``
110 **Content-Type:** ``application/xml``
118 <neighbors xmlns="urn:opendaylight:params:xml:ns:yang:bgp:openconfig-extensions">
120 <neighbor-address>192.0.2.1</neighbor-address>
124 <neighbor-address>192.0.2.2</neighbor-address>
129 @line 3: IP address of the remote BGP peer. Also serves as an unique identifier of a neighbor in a list of neighbors.
131 BGP Neighbor Operational State
132 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
134 .. note:: Supported Capabilities only provided when session has been established.
136 **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``
140 **Content-Type:** ``application/xml``
146 :emphasize-lines: 2,3,4,7,8,11,12
148 <state xmlns="urn:opendaylight:params:xml:ns:yang:bgp:openconfig-extensions">
149 <session-state>ESTABLISHED</session-state>
150 <supported-capabilities xmlns:x="http://openconfig.net/yang/bgp-types">x:ASN32</supported-capabilities>
151 <supported-capabilities xmlns:x="http://openconfig.net/yang/bgp-types">x:MPBGP</supported-capabilities>
155 <NOTIFICATION>0</NOTIFICATION>
159 <NOTIFICATION>0</NOTIFICATION>
164 @line 2: Session status
166 @line 3-4: BGP capabilities supported ( ASN32 / MPBGP / ROUTE_REFRESH / GRACEFUL_RESTART / ADD_PATHS)
168 @line 7: Total count of Update Messages sent
170 @line 8: Total count of Notification Messages sent
172 @line 11: Total count of Update Messages received
174 @line 12: Total count of Notification Messages received
176 BGP Neighbor Families Operational State
177 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
179 .. note:: Graceful Restart not supported yet. Planned for Carbon.
182 **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``
186 **Content-Type:** ``application/xml``
192 :emphasize-lines: 3,5,7,9,10
194 <afi-safis xmlns="urn:opendaylight:params:xml:ns:yang:bgp:openconfig-extensions">
196 <afi-safi-name xmlns:x="http://openconfig.net/yang/bgp-types">x:IPV4-UNICAST</afi-safi-name>
198 <active>false</active>
202 <received>false</received>
203 <advertised>false</advertised>
208 <afi-safi-name xmlns:x="http://openconfig.net/yang/bgp-types">x:IPV6-UNICAST</afi-safi-name>
210 <active>false</active>
214 <received>false</received>
215 <advertised>false</advertised>
221 @line 3: Family Identifier.
223 @line 5: True if family is advertized by peer.
225 @line 7: Graceful Restart Operational State per specific family.
227 @line 9: True if the peer supports graceful restart.
229 @line 10: True if we support graceful restart.
231 BGP Neighbor Family Operational State
232 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
234 .. note:: Prefixes state is only provided once session is established.
235 .. note:: Graceful Restart not supported yet. Planned to be implemented in Carbon.
237 **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``
241 **Content-Type:** ``application/xml``
247 :emphasize-lines: 2,4,6,7,8
249 <afi-safi xmlns="urn:opendaylight:params:xml:ns:yang:bgp:openconfig-extensions">
250 <afi-safi-name xmlns:x="http://openconfig.net/yang/bgp-types">x:IPV4-UNICAST</afi-safi-name>
252 <active>true</active>
254 <installed>3</installed>
256 <received>3</received>
261 <received>false</received>
262 <advertised>false</advertised>
267 @line 2: Family Identifier.
269 @line 4: True if family is advertized to and by peer.
271 @line 6: Total count of prefixes advertized by peer and installed (effective-rib-in).
273 @line 7: Total count of prefixes advertized to peer (adj-rib-out).
275 @line 8: Total count of prefixes advertized by peer (adj-rib-in).
277 BGP Neighbor Timers Operational State
278 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
280 .. note:: State is only provided once session is established.
282 **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``
286 **Content-Type:** ``application/xml``
292 :emphasize-lines: 3,4
294 <timers xmlns="urn:opendaylight:params:xml:ns:yang:bgp:openconfig-extensions">
296 <negotiated-hold-time>180</negotiated-hold-time>
297 <uptime>1580676</uptime>
301 @line 3: The negotiated hold-time for the BGP session in seconds.
303 @line 4: Session duration since establishment in timeticks (hundredths of a second).
305 BGP Neighbor Transport Operational State
306 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
308 .. note:: State is only provided once session is established.
310 **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``
314 **Content-Type:** ``application/xml``
320 :emphasize-lines: 3,4,5
322 <transport xmlns="urn:opendaylight:params:xml:ns:yang:bgp:openconfig-extensions">
324 <remote-address>127.0.0.2</remote-address>
325 <remote-port>44718</remote-port>
326 <local-port>1790</local-port>
330 @line 3: IP address of the remote BGP peer.
332 @line 4: Port of the remote BGP peer.
336 BGP Neighbor Error Handling Operational State
337 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
339 .. note:: State is only provided once session is established.
340 .. note:: Error handling not supported yet. Planned for Carbon.
342 **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``
346 **Content-Type:** ``application/xml``
354 <error-handling xmlns="urn:opendaylight:params:xml:ns:yang:bgp:openconfig-extensions">
356 <erroneous-update-messages>0</erroneous-update-messages>
360 @line 3: The number of BGP UPDATE messages for which the treat-as-withdraw mechanism has been applied based on
361 erroneous message contents
363 BGP Neighbor Graceful Restart Operational State
364 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
366 .. note:: Graceful Restart not supported yet. Planned for Carbon.
368 **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``
372 **Content-Type:** ``application/xml``
378 :emphasize-lines: 3,4,5
380 <graceful-restart xmlns="urn:opendaylight:params:xml:ns:yang:bgp:openconfig-extensions">
382 <peer-restart-time>0</peer-restart-time>
383 <peer-restarting>false</peer-restarting>
384 <local-restarting>false</local-restarting>
388 @line 3: The period of time (advertised by the peer) that the peer expects a restart of a BGP session to take.
390 @line 4: This flag indicates whether the remote neighbor is currently in the process of restarting, and hence
391 received routes are currently stale.
393 @line 5: This flag indicates whether the local neighbor is currently restarting. The flag is unset after all NLRI
394 have been advertised to the peer, and the End-of-RIB (EOR) marker has been unset.
396 BGP Peer Groups Operational State
397 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
399 **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``
403 **Content-Type:** ``application/xml``
409 :emphasize-lines: 3,5,6
413 <peer-group-name>application-peers</peer-group-name>
415 <total-paths>0</total-paths>
416 <total-prefixes>0</total-prefixes>
421 @line 3: Peer Group Identifier.
423 @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.
425 @line 6: Total Prefixes installed under by peers pertaining to this peer group (effective-rib-in).
426 This count doesn't differentiate repeated prefixes.
431 BGP Karaf Console (odl-bgpcep-bgp-cli) provides a CLI feature to read operational state per RIB, Neighbor and Peer Group.
436 opendaylight-user@root> bgp:operational-state -rib example-bgp-rib
441 opendaylight-user@root> bgp:operational-state -rib example-bgp-rib -neighbor 192.0.2.1
446 opendaylight-user@root> bgp:operational-state -rib -peer-group application-peers