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:** ``/rests/data/bgp-state-config:bgp-state-config``
24 **Content-Type:** ``application/xml``
32 <bgp-state-config xmlns="urn:opendaylight:params:xml:ns:yang:controller:config">
33 <config-name xmlns="urn:opendaylight:params:xml:ns:yang:bgp-state-config">operationalState</config-name>
34 <timer xmlns="urn:opendaylight:params:xml:ns:yang:bgp-state-config">1</timer>
37 @line 3: Time in seconds between operational state update.
43 **Content-Type:** ``application/json``
53 "config-name": "operationalState",
58 @line 4: Time in seconds between operational state update.
60 BGP RIB Operational State
61 ^^^^^^^^^^^^^^^^^^^^^^^^^
63 **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``
71 **Content-Type:** ``application/xml``
77 :emphasize-lines: 2,3,4,5
79 <state xmlns="urn:opendaylight:params:xml:ns:yang:bgp:openconfig-extensions">
81 <router-id>192.0.2.2</router-id>
82 <total-paths>0</total-paths>
83 <total-prefixes>0</total-prefixes>
86 @line 2: AS number of the remote peer.
88 @line 3: The unique protocol instance identifier.
90 @line 4: Total number of Paths installed on RIB (Loc-RIB)
92 @line 5: Total number of Prefixes installed on RIB (Loc-RIB)
96 **Content-Type:** ``application/json``
102 :emphasize-lines: 3,4,5,6
105 "bgp-openconfig-extensions:state": {
107 "router-id": "192.0.2.2",
113 @line 3: AS number of the remote peer.
115 @line 4: The unique protocol instance identifier.
117 @line 5: Total number of Paths installed on RIB (Loc-RIB)
119 @line 6: Total number of Prefixes installed on RIB (Loc-RIB)
121 BGP RIB Families Operational State
122 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
124 **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``
132 **Content-Type:** ``application/xml``
138 :emphasize-lines: 3,5,6
140 <afi-safis xmlns="urn:opendaylight:params:xml:ns:yang:bgp:openconfig-extensions">
142 <afi-safi-name xmlns:x="http://openconfig.net/yang/bgp-types">x:IPV4-UNICAST</afi-safi-name>
144 <total-paths>0</total-paths>
145 <total-prefixes>0</total-prefixes>
149 <afi-safi-name xmlns:x="http://openconfig.net/yang/bgp-types">x:IPV6-UNICAST</afi-safi-name>
151 <total-paths>0</total-paths>
152 <total-prefixes>0</total-prefixes>
158 @line 3: Family Identifier.
160 @line 5: Total number of Paths installed on RIB (Loc-RIB) per specific family.
162 @line 6: Total number of Prefixes installed on RIB (Loc-RIB) per specific family.
166 **Content-Type:** ``application/json``
172 :emphasize-lines: 5,7,8
175 "bgp-openconfig-extensions:afi-safis": {
178 "afi-safi-name": "openconfig-bgp-types:IPV4-UNICAST",
183 "afi-safi-name": "openconfig-bgp-types:IPV6-UNICAST",
193 @line 5: Family Identifier.
195 @line 7: Total number of Paths installed on RIB (Loc-RIB) per specific family.
197 @line 8: Total number of Prefixes installed on RIB (Loc-RIB) per specific family.
199 BGP Neighbors Operational State
200 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
202 **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``
210 **Content-Type:** ``application/xml``
218 <neighbors xmlns="urn:opendaylight:params:xml:ns:yang:bgp:openconfig-extensions">
220 <neighbor-address>192.0.2.1</neighbor-address>
224 <neighbor-address>192.0.2.2</neighbor-address>
229 @line 3: IP address of the remote BGP peer. Also serves as an unique identifier of a neighbor in a list of neighbors.
233 **Content-Type:** ``application/json``
242 "bgp-openconfig-extensions:neighbors": {
245 "neighbor-address": "192.0.2.1"
248 "neighbor-address": "192.0.2.2"
254 @line 5: IP address of the remote BGP peer. Also serves as an unique identifier of a neighbor in a list of neighbors.
256 BGP Neighbor Operational State
257 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
259 .. note:: Supported Capabilities only provided when session has been established.
261 **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``
269 **Content-Type:** ``application/xml``
275 :emphasize-lines: 2,3,4,7,8,11,12
277 <state xmlns="urn:opendaylight:params:xml:ns:yang:bgp:openconfig-extensions">
278 <session-state>ESTABLISHED</session-state>
279 <supported-capabilities xmlns:x="http://openconfig.net/yang/bgp-types">x:ASN32</supported-capabilities>
280 <supported-capabilities xmlns:x="http://openconfig.net/yang/bgp-types">x:MPBGP</supported-capabilities>
284 <NOTIFICATION>0</NOTIFICATION>
288 <NOTIFICATION>0</NOTIFICATION>
293 @line 2: Session status
295 @line 3-4: BGP capabilities supported ( ASN32 / MPBGP / ROUTE_REFRESH / GRACEFUL_RESTART / ADD_PATHS)
297 @line 7: Total count of Update Messages sent
299 @line 8: Total count of Notification Messages sent
301 @line 11: Total count of Update Messages received
303 @line 12: Total count of Notification Messages received
307 **Content-Type:** ``application/json``
313 :emphasize-lines: 3,4,7,10,11,14,15
316 "bgp:openconfig-extensions:state": {
317 "session-state": "ESTABLISHED",
318 "supported-capabilities": [
319 "openconfig-bgp-types:ASN32",
320 "openconfig-bgp-types:MPBGP"
335 @line 3: Session status
337 @line 4-7: BGP capabilities supported ( ASN32 / MPBGP / ROUTE_REFRESH / GRACEFUL_RESTART / ADD_PATHS)
339 @line 10: Total count of Update Messages sent
341 @line 11: Total count of Notification Messages sent
343 @line 14: Total count of Update Messages received
345 @line 15: Total count of Notification Messages received
347 BGP Neighbor Families Operational State
348 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
350 **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``
358 **Content-Type:** ``application/xml``
364 :emphasize-lines: 3,5,7,9,10,11,12,13
366 <afi-safis xmlns="urn:opendaylight:params:xml:ns:yang:bgp:openconfig-extensions">
368 <afi-safi-name xmlns:x="http://openconfig.net/yang/bgp-types">x:IPV4-UNICAST</afi-safi-name>
370 <active>false</active>
374 <received>true</received>
375 <ll-received>true</ll-received>
376 <ll-advertised>true</ll-advertised>
377 <ll-stale-timer>180</ll-stale-timer>
378 <advertised>true</advertised>
383 <afi-safi-name xmlns:x="http://openconfig.net/yang/bgp-types">x:IPV6-UNICAST</afi-safi-name>
385 <active>false</active>
389 <received>true</received>
390 <ll-received>true</ll-received>
391 <ll-advertised>true</ll-advertised>
392 <ll-stale-timer>100</ll-stale-timer>
393 <advertised>true</advertised>
399 @line 3: Family Identifier.
401 @line 5: True if family is advertized by peer.
403 @line 7: Graceful Restart Operational State per specific family.
405 @line 9: True if the peer supports graceful restart.
407 @line 10: True if peer supports Long-Lived graceful restart.
409 @line 11: True if we supports Long-Lived graceful restart.
411 @line 12: Value of Long-Lived stale timer in seconds for specific family
413 @line 13: True if we support graceful restart.
417 **Content-Type:** ``application/json``
423 :emphasize-lines: 5,7,9,11,12,13,14,15
426 "bgp-openconfig-extensions:afi-safis": {
429 "afi-safi-name": "openconfig-bgp-types:IPV4-UNICAST",
433 "graceful-restart": {
437 "ll-advertised": true,
438 "ll-stale-timer": 180,
444 "afi-safi-name": "openconfig-bgp-types:IPV6-UNICAST",
448 "graceful-restart": {
452 "ll-advertised": true,
453 "ll-stale-timer": 100,
462 @line 5: Family Identifier.
464 @line 7: True if family is advertized by peer.
466 @line 9: Graceful Restart Operational State per specific family.
468 @line 11: True if the peer supports graceful restart.
470 @line 12: True if peer supports Long-Lived graceful restart.
472 @line 13: True if we supports Long-Lived graceful restart.
474 @line 14: Value of Long-Lived stale timer in seconds for specific family
476 @line 15: True if we support graceful restart.
478 BGP Neighbor Family Operational State
479 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
481 .. note:: Prefixes state is only provided once session is established.
483 **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``
491 **Content-Type:** ``application/xml``
497 :emphasize-lines: 2,4,6,7,8
499 <afi-safi xmlns="urn:opendaylight:params:xml:ns:yang:bgp:openconfig-extensions">
500 <afi-safi-name xmlns:x="http://openconfig.net/yang/bgp-types">x:IPV4-UNICAST</afi-safi-name>
502 <active>true</active>
504 <installed>3</installed>
506 <received>3</received>
511 <received>true</received>
512 <ll-received>true</ll-received>
513 <ll-advertised>true</ll-advertised>
514 <ll-stale-timer>180</ll-stale-timer>
515 <advertised>true</advertised>
520 @line 2: Family Identifier.
522 @line 4: True if family is advertized to and by peer.
524 @line 6: Total count of prefixes advertized by peer and installed (effective-rib-in).
526 @line 7: Total count of prefixes advertized to peer (adj-rib-out).
528 @line 8: Total count of prefixes advertized by peer (adj-rib-in).
532 **Content-Type:** ``application/json``
538 :emphasize-lines: 3,5,8,9,10
541 "bgp-openconfig-extensions:afi-safi": [
543 "afi-safi-name": "openconfig-bgp-types:IPV4-UNICAST",
552 "graceful-restart": {
556 "ll-advertised": true,
557 "ll-stale-timer": 180,
565 @line 3: Family Identifier.
567 @line 5: True if family is advertized to and by peer.
569 @line 8: Total count of prefixes advertized by peer and installed (effective-rib-in).
571 @line 9: Total count of prefixes advertized to peer (adj-rib-out).
573 @line 10: Total count of prefixes advertized by peer (adj-rib-in).
575 BGP Neighbor Timers Operational State
576 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
578 .. note:: State is only provided once session is established.
580 **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``
588 **Content-Type:** ``application/xml``
594 :emphasize-lines: 3,4
596 <timers xmlns="urn:opendaylight:params:xml:ns:yang:bgp:openconfig-extensions">
598 <negotiated-hold-time>180</negotiated-hold-time>
599 <uptime>1580676</uptime>
603 @line 3: The negotiated hold-time for the BGP session in seconds.
605 @line 4: Session duration since establishment in timeticks (hundredths of a second).
609 **Content-Type:** ``application/json``
615 :emphasize-lines: 4,5
618 "bgp:openconfig-extensions:timers": {
620 "negotiated-hold-time": 180,
626 @line 4: The negotiated hold-time for the BGP session in seconds.
628 @line 5: Session duration since establishment in timeticks (hundredths of a second).
630 BGP Neighbor Transport Operational State
631 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
633 .. note:: State is only provided once session is established.
635 **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``
643 **Content-Type:** ``application/xml``
649 :emphasize-lines: 3,4,5
651 <transport xmlns="urn:opendaylight:params:xml:ns:yang:bgp:openconfig-extensions">
653 <remote-address>127.0.0.2</remote-address>
654 <remote-port>44718</remote-port>
655 <local-port>1790</local-port>
659 @line 3: IP address of the remote BGP peer.
661 @line 4: Port of the remote BGP peer.
667 **Content-Type:** ``application/json``
673 :emphasize-lines: 4,5,6
676 "bgp:openconfig-extensions:transport": {
678 "remote-address": "127.0.0.2",
679 "remote-port": 44718,
685 @line 4: IP address of the remote BGP peer.
687 @line 5: Port of the remote BGP peer.
691 BGP Neighbor Error Handling Operational State
692 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
694 .. note:: State is only provided once session is established.
695 .. note:: Error handling not supported yet. Planned for Carbon.
697 **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``
705 **Content-Type:** ``application/xml``
713 <error-handling xmlns="urn:opendaylight:params:xml:ns:yang:bgp:openconfig-extensions">
715 <erroneous-update-messages>0</erroneous-update-messages>
719 @line 3: The number of BGP UPDATE messages for which the treat-as-withdraw mechanism has been applied based on
720 erroneous message contents
724 **Content-Type:** ``application/json``
733 "bgp-openconfig-extensions:error-handling": {
735 "erroneous-update-messages": 0
740 @line 4: The number of BGP UPDATE messages for which the treat-as-withdraw mechanism has been applied based on
741 erroneous message contents
743 BGP Neighbor Graceful Restart Operational State
744 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
746 .. note:: Graceful Restart not supported yet. Planned for Carbon.
748 **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``
756 **Content-Type:** ``application/xml``
762 :emphasize-lines: 3,4,5,6
764 <graceful-restart xmlns="urn:opendaylight:params:xml:ns:yang:bgp:openconfig-extensions">
766 <peer-restarting>false</peer-restarting>
767 <local-restarting>false</local-restarting>
768 <peer-restart-time>5</peer-restart-time>
769 <mode>BILATERAL</mode>
773 @line 3: This flag indicates whether the remote neighbor is currently in the process of restarting, and hence
774 received routes are currently stale.
776 @line 4: This flag indicates whether the local neighbor is currently restarting. The flag is unset after all NLRI
777 have been advertised to the peer, and the End-of-RIB (EOR) marker has been unset.
779 @line 5: The period of time (advertised by the peer) in seconds that the peer expects a restart of a BGP session to take.
781 @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).
785 **Content-Type:** ``application/json``
791 :emphasize-lines: 4,5,6,7
794 "bgp-openconfig-extensions:graceful-restart": {
796 "peer-restarting": false,
797 "local-restarting": false,
798 "peer-restart-time": 0,
799 "mode": "HELPER-ONLY"
804 @line 4: This flag indicates whether the remote neighbor is currently in the process of restarting, and hence
805 received routes are currently stale.
807 @line 5: This flag indicates whether the local neighbor is currently restarting. The flag is unset after all NLRI
808 have been advertised to the peer, and the End-of-RIB (EOR) marker has been unset.
810 @line 6: The period of time (advertised by the peer) in seconds that the peer expects a restart of a BGP session to take.
812 @line 7: 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).
814 BGP Peer Groups Operational State
815 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
817 **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``
825 **Content-Type:** ``application/xml``
831 :emphasize-lines: 3,5,6
835 <peer-group-name>application-peers</peer-group-name>
837 <total-paths>0</total-paths>
838 <total-prefixes>0</total-prefixes>
843 @line 3: Peer Group Identifier.
845 @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.
847 @line 6: Total Prefixes installed under by peers pertaining to this peer group (effective-rib-in).
848 This count doesn't differentiate repeated prefixes.
852 **Content-Type:** ``application/json``
858 :emphasize-lines: 4,6,7
863 "peer-group-name": "application-peers",
872 @line 4: Peer Group Identifier.
874 @line 6: At this moment the cost for count path under effect-rib-in is to high. Therefore the value is the same as total prefixes.
876 @line 7: Total Prefixes installed under by peers pertaining to this peer group (effective-rib-in).
877 This count doesn't differentiate repeated prefixes.
882 BGP Karaf Console (odl-bgpcep-bgp-cli) provides a CLI feature to read operational state per RIB, Neighbor and Peer Group.
887 opendaylight-user@root> bgp:operational-state -rib example-bgp-rib
892 opendaylight-user@root> bgp:operational-state -rib example-bgp-rib -neighbor 192.0.2.1
897 opendaylight-user@root> bgp:operational-state -rib -peer-group application-peers