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``
18 **RFC8040 URL:** ``/rests/data/bgp-state-config:bgp-state-config``
26 **Content-Type:** ``application/xml``
34 <bgp-state-config xmlns="urn:opendaylight:params:xml:ns:yang:controller:config">
35 <config-name xmlns="urn:opendaylight:params:xml:ns:yang:bgp-state-config">operationalState</config-name>
36 <timer xmlns="urn:opendaylight:params:xml:ns:yang:bgp-state-config">1</timer>
39 @line 3: Time in seconds between operational state update.
45 **Content-Type:** ``application/json``
55 "config-name": "operationalState",
60 @line 4: Time in seconds between operational state update.
62 BGP RIB Operational State
63 ^^^^^^^^^^^^^^^^^^^^^^^^^
65 **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``
73 **Content-Type:** ``application/xml``
79 :emphasize-lines: 2,3,4,5
81 <state xmlns="urn:opendaylight:params:xml:ns:yang:bgp:openconfig-extensions">
83 <router-id>192.0.2.2</router-id>
84 <total-paths>0</total-paths>
85 <total-prefixes>0</total-prefixes>
88 @line 2: AS number of the remote peer.
90 @line 3: The unique protocol instance identifier.
92 @line 4: Total number of Paths installed on RIB (Loc-RIB)
94 @line 5: Total number of Prefixes installed on RIB (Loc-RIB)
98 **Content-Type:** ``application/json``
104 :emphasize-lines: 3,4,5,6
107 "bgp-openconfig-extensions:state": {
109 "router-id": "192.0.2.2",
115 @line 3: AS number of the remote peer.
117 @line 4: The unique protocol instance identifier.
119 @line 5: Total number of Paths installed on RIB (Loc-RIB)
121 @line 6: Total number of Prefixes installed on RIB (Loc-RIB)
123 BGP RIB Families Operational State
124 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
126 **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``
134 **Content-Type:** ``application/xml``
140 :emphasize-lines: 3,5,6
142 <afi-safis xmlns="urn:opendaylight:params:xml:ns:yang:bgp:openconfig-extensions">
144 <afi-safi-name xmlns:x="http://openconfig.net/yang/bgp-types">x:IPV4-UNICAST</afi-safi-name>
146 <total-paths>0</total-paths>
147 <total-prefixes>0</total-prefixes>
151 <afi-safi-name xmlns:x="http://openconfig.net/yang/bgp-types">x:IPV6-UNICAST</afi-safi-name>
153 <total-paths>0</total-paths>
154 <total-prefixes>0</total-prefixes>
160 @line 3: Family Identifier.
162 @line 5: Total number of Paths installed on RIB (Loc-RIB) per specific family.
164 @line 6: Total number of Prefixes installed on RIB (Loc-RIB) per specific family.
168 **Content-Type:** ``application/json``
174 :emphasize-lines: 5,7,8
177 "bgp-openconfig-extensions:afi-safis": {
180 "afi-safi-name": "openconfig-bgp-types:IPV4-UNICAST",
185 "afi-safi-name": "openconfig-bgp-types:IPV6-UNICAST",
195 @line 5: Family Identifier.
197 @line 7: Total number of Paths installed on RIB (Loc-RIB) per specific family.
199 @line 8: Total number of Prefixes installed on RIB (Loc-RIB) per specific family.
201 BGP Neighbors Operational State
202 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
204 **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``
212 **Content-Type:** ``application/xml``
220 <neighbors xmlns="urn:opendaylight:params:xml:ns:yang:bgp:openconfig-extensions">
222 <neighbor-address>192.0.2.1</neighbor-address>
226 <neighbor-address>192.0.2.2</neighbor-address>
231 @line 3: IP address of the remote BGP peer. Also serves as an unique identifier of a neighbor in a list of neighbors.
235 **Content-Type:** ``application/json``
244 "bgp-openconfig-extensions:neighbors": {
247 "neighbor-address": "192.0.2.1"
250 "neighbor-address": "192.0.2.2"
256 @line 5: IP address of the remote BGP peer. Also serves as an unique identifier of a neighbor in a list of neighbors.
258 BGP Neighbor Operational State
259 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
261 .. note:: Supported Capabilities only provided when session has been established.
263 **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``
271 **Content-Type:** ``application/xml``
277 :emphasize-lines: 2,3,4,7,8,11,12
279 <state xmlns="urn:opendaylight:params:xml:ns:yang:bgp:openconfig-extensions">
280 <session-state>ESTABLISHED</session-state>
281 <supported-capabilities xmlns:x="http://openconfig.net/yang/bgp-types">x:ASN32</supported-capabilities>
282 <supported-capabilities xmlns:x="http://openconfig.net/yang/bgp-types">x:MPBGP</supported-capabilities>
286 <NOTIFICATION>0</NOTIFICATION>
290 <NOTIFICATION>0</NOTIFICATION>
295 @line 2: Session status
297 @line 3-4: BGP capabilities supported ( ASN32 / MPBGP / ROUTE_REFRESH / GRACEFUL_RESTART / ADD_PATHS)
299 @line 7: Total count of Update Messages sent
301 @line 8: Total count of Notification Messages sent
303 @line 11: Total count of Update Messages received
305 @line 12: Total count of Notification Messages received
309 **Content-Type:** ``application/json``
315 :emphasize-lines: 3,4,7,10,11,14,15
318 "bgp:openconfig-extensions:state": {
319 "session-state": "ESTABLISHED",
320 "supported-capabilities": [
321 "openconfig-bgp-types:ASN32",
322 "openconfig-bgp-types:MPBGP"
337 @line 3: Session status
339 @line 4-7: BGP capabilities supported ( ASN32 / MPBGP / ROUTE_REFRESH / GRACEFUL_RESTART / ADD_PATHS)
341 @line 10: Total count of Update Messages sent
343 @line 11: Total count of Notification Messages sent
345 @line 14: Total count of Update Messages received
347 @line 15: Total count of Notification Messages received
349 BGP Neighbor Families Operational State
350 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
352 **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``
360 **Content-Type:** ``application/xml``
366 :emphasize-lines: 3,5,7,9,10,11,12,13
368 <afi-safis xmlns="urn:opendaylight:params:xml:ns:yang:bgp:openconfig-extensions">
370 <afi-safi-name xmlns:x="http://openconfig.net/yang/bgp-types">x:IPV4-UNICAST</afi-safi-name>
372 <active>false</active>
376 <received>true</received>
377 <ll-received>true</ll-received>
378 <ll-advertised>true</ll-advertised>
379 <ll-stale-timer>180</ll-stale-timer>
380 <advertised>true</advertised>
385 <afi-safi-name xmlns:x="http://openconfig.net/yang/bgp-types">x:IPV6-UNICAST</afi-safi-name>
387 <active>false</active>
391 <received>true</received>
392 <ll-received>true</ll-received>
393 <ll-advertised>true</ll-advertised>
394 <ll-stale-timer>100</ll-stale-timer>
395 <advertised>true</advertised>
401 @line 3: Family Identifier.
403 @line 5: True if family is advertized by peer.
405 @line 7: Graceful Restart Operational State per specific family.
407 @line 9: True if the peer supports graceful restart.
409 @line 10: True if peer supports Long-Lived graceful restart.
411 @line 11: True if we supports Long-Lived graceful restart.
413 @line 12: Value of Long-Lived stale timer in seconds for specific family
415 @line 13: True if we support graceful restart.
419 **Content-Type:** ``application/json``
425 :emphasize-lines: 5,7,9,11,12,13,14,15
428 "bgp-openconfig-extensions:afi-safis": {
431 "afi-safi-name": "openconfig-bgp-types:IPV4-UNICAST",
435 "graceful-restart": {
439 "ll-advertised": true,
440 "ll-stale-timer": 180,
446 "afi-safi-name": "openconfig-bgp-types:IPV6-UNICAST",
450 "graceful-restart": {
454 "ll-advertised": true,
455 "ll-stale-timer": 100,
464 @line 5: Family Identifier.
466 @line 7: True if family is advertized by peer.
468 @line 9: Graceful Restart Operational State per specific family.
470 @line 11: True if the peer supports graceful restart.
472 @line 12: True if peer supports Long-Lived graceful restart.
474 @line 13: True if we supports Long-Lived graceful restart.
476 @line 14: Value of Long-Lived stale timer in seconds for specific family
478 @line 15: True if we support graceful restart.
480 BGP Neighbor Family Operational State
481 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
483 .. note:: Prefixes state is only provided once session is established.
485 **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``
493 **Content-Type:** ``application/xml``
499 :emphasize-lines: 2,4,6,7,8
501 <afi-safi xmlns="urn:opendaylight:params:xml:ns:yang:bgp:openconfig-extensions">
502 <afi-safi-name xmlns:x="http://openconfig.net/yang/bgp-types">x:IPV4-UNICAST</afi-safi-name>
504 <active>true</active>
506 <installed>3</installed>
508 <received>3</received>
513 <received>true</received>
514 <ll-received>true</ll-received>
515 <ll-advertised>true</ll-advertised>
516 <ll-stale-timer>180</ll-stale-timer>
517 <advertised>true</advertised>
522 @line 2: Family Identifier.
524 @line 4: True if family is advertized to and by peer.
526 @line 6: Total count of prefixes advertized by peer and installed (effective-rib-in).
528 @line 7: Total count of prefixes advertized to peer (adj-rib-out).
530 @line 8: Total count of prefixes advertized by peer (adj-rib-in).
534 **Content-Type:** ``application/json``
540 :emphasize-lines: 3,5,8,9,10
543 "bgp-openconfig-extensions:afi-safi": [
545 "afi-safi-name": "openconfig-bgp-types:IPV4-UNICAST",
554 "graceful-restart": {
558 "ll-advertised": true,
559 "ll-stale-timer": 180,
567 @line 3: Family Identifier.
569 @line 5: True if family is advertized to and by peer.
571 @line 8: Total count of prefixes advertized by peer and installed (effective-rib-in).
573 @line 9: Total count of prefixes advertized to peer (adj-rib-out).
575 @line 10: Total count of prefixes advertized by peer (adj-rib-in).
577 BGP Neighbor Timers Operational State
578 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
580 .. note:: State is only provided once session is established.
582 **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``
590 **Content-Type:** ``application/xml``
596 :emphasize-lines: 3,4
598 <timers xmlns="urn:opendaylight:params:xml:ns:yang:bgp:openconfig-extensions">
600 <negotiated-hold-time>180</negotiated-hold-time>
601 <uptime>1580676</uptime>
605 @line 3: The negotiated hold-time for the BGP session in seconds.
607 @line 4: Session duration since establishment in timeticks (hundredths of a second).
611 **Content-Type:** ``application/json``
617 :emphasize-lines: 4,5
620 "bgp:openconfig-extensions:timers": {
622 "negotiated-hold-time": 180,
628 @line 4: The negotiated hold-time for the BGP session in seconds.
630 @line 5: Session duration since establishment in timeticks (hundredths of a second).
632 BGP Neighbor Transport Operational State
633 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
635 .. note:: State is only provided once session is established.
637 **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``
645 **Content-Type:** ``application/xml``
651 :emphasize-lines: 3,4,5
653 <transport xmlns="urn:opendaylight:params:xml:ns:yang:bgp:openconfig-extensions">
655 <remote-address>127.0.0.2</remote-address>
656 <remote-port>44718</remote-port>
657 <local-port>1790</local-port>
661 @line 3: IP address of the remote BGP peer.
663 @line 4: Port of the remote BGP peer.
669 **Content-Type:** ``application/json``
675 :emphasize-lines: 4,5,6
678 "bgp:openconfig-extensions:transport": {
680 "remote-address": "127.0.0.2",
681 "remote-port": 44718,
687 @line 4: IP address of the remote BGP peer.
689 @line 5: Port of the remote BGP peer.
693 BGP Neighbor Error Handling Operational State
694 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
696 .. note:: State is only provided once session is established.
697 .. note:: Error handling not supported yet. Planned for Carbon.
699 **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``
707 **Content-Type:** ``application/xml``
715 <error-handling xmlns="urn:opendaylight:params:xml:ns:yang:bgp:openconfig-extensions">
717 <erroneous-update-messages>0</erroneous-update-messages>
721 @line 3: The number of BGP UPDATE messages for which the treat-as-withdraw mechanism has been applied based on
722 erroneous message contents
726 **Content-Type:** ``application/json``
735 "bgp-openconfig-extensions:error-handling": {
737 "erroneous-update-messages": 0
742 @line 4: The number of BGP UPDATE messages for which the treat-as-withdraw mechanism has been applied based on
743 erroneous message contents
745 BGP Neighbor Graceful Restart Operational State
746 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
748 .. note:: Graceful Restart not supported yet. Planned for Carbon.
750 **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``
758 **Content-Type:** ``application/xml``
764 :emphasize-lines: 3,4,5,6
766 <graceful-restart xmlns="urn:opendaylight:params:xml:ns:yang:bgp:openconfig-extensions">
768 <peer-restarting>false</peer-restarting>
769 <local-restarting>false</local-restarting>
770 <peer-restart-time>5</peer-restart-time>
771 <mode>BILATERAL</mode>
775 @line 3: This flag indicates whether the remote neighbor is currently in the process of restarting, and hence
776 received routes are currently stale.
778 @line 4: This flag indicates whether the local neighbor is currently restarting. The flag is unset after all NLRI
779 have been advertised to the peer, and the End-of-RIB (EOR) marker has been unset.
781 @line 5: The period of time (advertised by the peer) in seconds that the peer expects a restart of a BGP session to take.
783 @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).
787 **Content-Type:** ``application/json``
793 :emphasize-lines: 4,5,6,7
796 "bgp-openconfig-extensions:graceful-restart": {
798 "peer-restarting": false,
799 "local-restarting": false,
800 "peer-restart-time": 0,
801 "mode": "HELPER-ONLY"
806 @line 4: This flag indicates whether the remote neighbor is currently in the process of restarting, and hence
807 received routes are currently stale.
809 @line 5: This flag indicates whether the local neighbor is currently restarting. The flag is unset after all NLRI
810 have been advertised to the peer, and the End-of-RIB (EOR) marker has been unset.
812 @line 6: The period of time (advertised by the peer) in seconds that the peer expects a restart of a BGP session to take.
814 @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).
816 BGP Peer Groups Operational State
817 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
819 **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``
827 **Content-Type:** ``application/xml``
833 :emphasize-lines: 3,5,6
837 <peer-group-name>application-peers</peer-group-name>
839 <total-paths>0</total-paths>
840 <total-prefixes>0</total-prefixes>
845 @line 3: Peer Group Identifier.
847 @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.
849 @line 6: Total Prefixes installed under by peers pertaining to this peer group (effective-rib-in).
850 This count doesn't differentiate repeated prefixes.
854 **Content-Type:** ``application/json``
860 :emphasize-lines: 4,6,7
865 "peer-group-name": "application-peers",
874 @line 4: Peer Group Identifier.
876 @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.
878 @line 7: Total Prefixes installed under by peers pertaining to this peer group (effective-rib-in).
879 This count doesn't differentiate repeated prefixes.
884 BGP Karaf Console (odl-bgpcep-bgp-cli) provides a CLI feature to read operational state per RIB, Neighbor and Peer Group.
889 opendaylight-user@root> bgp:operational-state -rib example-bgp-rib
894 opendaylight-user@root> bgp:operational-state -rib example-bgp-rib -neighbor 192.0.2.1
899 opendaylight-user@root> bgp:operational-state -rib -peer-group application-peers