4 This guide contains information on how to use OpenDaylight Border Gateway Protocol (BGP) plugin.
5 The user should learn about BGP basic concepts, supported capabilities, configuration and usage.
13 This section provides high-level overview of the Border Gateway Protocol, OpenDaylight implementation and BGP usage in SDN era.
15 .. contents:: Contents
19 Border Gateway Protocol
20 ^^^^^^^^^^^^^^^^^^^^^^^
21 The Border Gateway Protocol (BGP) is an inter-Autonomous System (AS) routing protocol.
22 The primary role of the BGP is an exchange of routes among other BGP systems.
23 The route is an unit of information which pairs destination (IP address prefix) with attributes to the path with the destination.
24 One of the most interesting attributes is a list of ASes that the route traversed - essential when avoiding loop routing.
25 Advertised routes are stored in the Routing Information Bases (RIBs). Routes are later used to forward packets, stored in Routing Table for this purpose.
26 The main advantage of the BGP over other routing protocols is its scalability, thus it has become the standardized Internet routing protocol (Internet is a set of ASes).
30 However BGP evolved long time before SDN was born, it plays a significant role in many SDN use-cases.
31 Also, continuous evolution of the protocol brings extensions that are very well suited for SDN.
32 Nowadays, BGP can carry various types of routing information - L3VPN, L2VPN, IP multicast, linkstate, etc.
33 Here is a brief list of software-based/legacy-network technologies where BGP-based SDN solution get into an action:
35 * SDN WAN - WAN orchestration and optimization
36 * SDN router - Turns switch into an Internet router
37 * Virtual Route Reflector - High-performance server-based BGP Route Reflector
38 * SDX - A Software Defined Internet Exchange controller
39 * Large-Scale Data Centers - BGP Data Center Routing, MPLS/SR in DCs, DC interconnection
40 * DDoS mitigation - Traffic Filtering distribution with BGP
42 OpenDaylight BGP plugin
43 ^^^^^^^^^^^^^^^^^^^^^^^
44 The OpenDaylight controller provides an implementation of BGP (RFC 4271) as a south-bound protocol plugin.
45 The implementation renders all basic *BGP speaker capabilities*:
47 * inter/intra-AS peering
52 The plugin's **north-bound API** (``REST``/``Java``) provides to user:
54 * fully dynamic runtime standardized BGP configuration
55 * read-only access to all RIBs
56 * read-write programmable RIBs
57 * read-only reachability/linkstate topology view
59 .. note:: The BGP plugin is NOT a virtual router - does not construct Routing Tables, nor forward traffic.
61 List of supported capabilities
62 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
63 In addition to the base protocol implementation, the plugin provides many extensions to BGP, all based on IETF standards.
65 * `RFC4271 <https://tools.ietf.org/html/rfc4271>`_ - A Border Gateway Protocol 4 (BGP-4)
66 * `RFC4456 <https://tools.ietf.org/html/rfc4456>`_ - BGP Route Reflection: An Alternative to Full Mesh Internal BGP (IBGP)
67 * `RFC1997 <https://tools.ietf.org/html/rfc1997>`_ - BGP Communities Attribute
68 * `RFC4360 <https://tools.ietf.org/html/rfc4360>`_ - BGP Extended Communities Attribute
69 * `RFC4486 <https://tools.ietf.org/html/rfc4486>`_ - Subcodes for BGP Cease Notification Message
70 * `RFC5492 <https://tools.ietf.org/html/rfc5492>`_ - Capabilities Advertisement with BGP-4
71 * `RFC5004 <https://tools.ietf.org/html/rfc5004>`_ - Avoid BGP Best Path Transitions from One External to Another
72 * `RFC6286 <https://tools.ietf.org/html/rfc6286>`_ - Autonomous-System-Wide Unique BGP Identifier for BGP-4
73 * `RFC6793 <https://tools.ietf.org/html/rfc6793>`_ - BGP Support for Four-Octet Autonomous System (AS) Number Space
74 * `RFC7311 <https://tools.ietf.org/html/rfc7311>`_ - The Accumulated IGP Metric Attribute for BGP
75 * `RFC5668 <https://tools.ietf.org/html/rfc5668>`_ - 4-Octet AS Specific BGP Extended Community
76 * `draft-ietf-idr-link-bandwidth <https://tools.ietf.org/html/draft-ietf-idr-link-bandwidth-06>`_ - BGP Link Bandwidth Extended Community
77 * `draft-ietf-idr-bgp-extended-messages <https://tools.ietf.org/html/draft-ietf-idr-bgp-extended-messages-13>`_ - Extended Message support for BGP
78 * `RFC4760 <https://tools.ietf.org/html/rfc4760>`_ - Multiprotocol Extensions for BGP-4
79 * `RFC7752 <https://tools.ietf.org/html/rfc7752>`_ - North-Bound Distribution of Link-State and TE Information using BGP
80 * `draft-gredler-idr-bgp-ls-segment-routing-ext <https://tools.ietf.org/html/draft-gredler-idr-bgp-ls-segment-routing-ext-03>`_ - BGP Link-State extensions for Segment Routing
81 * `draft-ietf-idr-bgpls-segment-routing-epe <https://tools.ietf.org/html/draft-ietf-idr-bgpls-segment-routing-epe-05>`_ - Segment Routing Egress Peer Engineering BGP-LS Extensions
82 * `RFC5575 <https://tools.ietf.org/html/rfc5575>`_ - Dissemination of Flow Specification Rules
83 * `RFC7674 <http://tools.ietf.org/html/rfc7674>`_ - Clarification of the Flowspec Redirect Extended Community
84 * `draft-ietf-idr-flow-spec-v6 <https://tools.ietf.org/html/draft-ietf-idr-flow-spec-v6-07>`_ - Dissemination of Flow Specification Rules for IPv6
85 * `draft-ietf-idr-flowspec-redirect-ip <https://tools.ietf.org/html/draft-ietf-idr-flowspec-redirect-ip-00>`_ - BGP Flow-Spec Redirect to IP Action
86 * `RFC3107 <https://tools.ietf.org/html/rfc3107>`_ - Carrying Label Information in BGP-4
87 * `draft-ietf-idr-bgp-prefix-sid <https://tools.ietf.org/html/draft-ietf-idr-bgp-prefix-sid-03>`_ - Segment Routing Prefix SID extensions for BGP
88 * `RFC4364 <https://tools.ietf.org/html/rfc4364>`_ - BGP/MPLS IP Virtual Private Networks (VPNs)
89 * `RFC4659 <https://tools.ietf.org/html/rfc4659>`_ - BGP-MPLS IP Virtual Private Network (VPN) Extension for IPv6 VPN
90 * `RFC7432 <https://tools.ietf.org/html/rfc7432>`_ - BGP MPLS-Based Ethernet VPN
91 * `draft-ietf-bess-evpn-overlay <https://tools.ietf.org/html/draft-ietf-bess-evpn-overlay-04>`_ - A Network Virtualization Overlay Solution using EVPN
92 * `draft-ietf-bess-evpn-vpws <https://tools.ietf.org/html/draft-ietf-bess-evpn-vpws-07>`_ - VPWS support in EVPN
93 * `RFC7911 <https://tools.ietf.org/html/rfc7911>`_ - Advertisement of Multiple Paths in BGP
94 * `RFC2918 <https://tools.ietf.org/html/rfc2918>`_ - Route Refresh Capability for BGP-4
98 This section explains how to install BGP plugin.
100 1. Install BGP feature - ``odl-bgpcep-bgp``.
101 Also, for sake of this sample, it is required to install RESTCONF.
102 In the Karaf console, type command:
104 .. code-block:: console
106 feature:install odl-restconf odl-bgpcep-bgp
108 2. The BGP plugin contains a default configuration, which is applied after the feature starts up.
109 One instance of BGP plugin is created (named *example-bgp-rib*), and its presence can be verified via REST:
111 **URL:** ``/restconf/operational/bgp-rib:bgp-rib``
119 <bgp-rib xmlns="urn:opendaylight:params:xml:ns:yang:bgp-rib">
121 <id>example-bgp-rib</id>
128 Basic Configuration & Concepts
129 ------------------------------
130 The following section shows how to configure BGP basics, how to verify functionality and presents essential components of the plugin.
131 Next samples demonstrate the plugin's runtime configuration capability.
132 It shows the way to configure the plugin via REST, using standardized OpenConfig BGP APIs.
134 .. contents:: Contents
140 This tree illustrates the BGP RIBs organization in datastore.
142 .. code-block:: console
147 +--ro peer* [peer-id]
148 | +--ro peer-id peer-id
149 | +--ro peer-role peer-role
150 | +--ro simple-routing-policy? simple-routing-policy
151 | +--ro supported-tables* [afi safi]
152 | | +--ro afi identityref
153 | | +--ro safi identityref
154 | | +--ro send-receive? send-receive
156 | | +--ro tables* [afi safi]
157 | | +--ro afi identityref
158 | | +--ro safi identityref
160 | | | +--ro uptodate? boolean
162 | +--ro effective-rib-in
163 | | +--ro tables* [afi safi]
164 | | +--ro afi identityref
165 | | +--ro safi identityref
167 | | | +--ro uptodate? boolean
170 | +--ro tables* [afi safi]
171 | +--ro afi identityref
172 | +--ro safi identityref
174 | | +--ro uptodate? boolean
177 +--ro tables* [afi safi]
178 +--ro afi identityref
179 +--ro safi identityref
181 | +--ro uptodate? boolean
184 Protocol Configuration
185 ^^^^^^^^^^^^^^^^^^^^^^
186 As a first step, a new protocol instance needs to be configured.
187 It is a very basic configuration conforming with RFC4271.
189 **URL:** ``/restconf/config/openconfig-network-instance:network-instances/network-instance/global-bgp/openconfig-network-instance:protocols``
193 **Content-Type:** ``application/xml``
199 :emphasize-lines: 2,7,8
201 <protocol xmlns="http://openconfig.net/yang/network-instance">
202 <name>bgp-example</name>
203 <identifier xmlns:x="http://openconfig.net/yang/policy-types">x:BGP</identifier>
204 <bgp xmlns="urn:opendaylight:params:xml:ns:yang:bgp:openconfig-extensions">
207 <router-id>192.0.2.2</router-id>
214 @line 2: The unique protocol instance identifier.
216 @line 7: BGP Identifier of the speaker.
218 @line 8: Local autonomous system number of the speaker. Note that, OpenDaylight BGP implementation supports four-octet AS numbers only.
222 The new instance presence can be verified via REST:
224 **URL:** ``/restconf/operational/bgp-rib:bgp-rib/rib/bgp-example``
232 :emphasize-lines: 3,4
234 <rib xmlns="urn:opendaylight:params:xml:ns:yang:bgp-rib">
238 <afi xmlns:x="urn:opendaylight:params:xml:ns:yang:bgp-types">x:ipv4-address-family</afi>
239 <safi xmlns:x="urn:opendaylight:params:xml:ns:yang:bgp-types">x:unicast-subsequent-address-family</safi>
240 <ipv4-routes xmlns="urn:opendaylight:params:xml:ns:yang:bgp-inet"></ipv4-routes>
242 <uptodate>true</uptodate>
248 @line 3: Loc-RIB - Per-protocol instance RIB, which contains the routes that have been selected by local BGP speaker's decision process.
250 @line 4: The BGP-4 supports carrying IPv4 prefixes, such routes are stored in *ipv4-address-family*/*unicast-subsequent-address-family* table.
255 BGP uses TCP as its transport protocol, by default listens on port 179. OpenDaylight BGP plugin is configured to listen on port *1790*, due to
256 privileged ports restriction for non-root users.
257 One of the workarounds is to use port redirection. In case other port is desired to be used instead, we can reconfigure it.
259 Here is a sample of bgp port listening re-configuration:
261 **URL:** ``/restconf/config/odl-bgp-peer-acceptor-config:bgp-peer-acceptor-config/default``
265 **Content-Type:** ``application/xml``
271 :emphasize-lines: 3,4
273 <bgp-peer-acceptor-config xmlns="urn:opendaylight:params:xml:ns:yang:odl-bgp-peer-acceptor-config">
274 <config-name>default</config-name>
275 <binding-address>0.0.0.0</binding-address>
276 <binding-port>1791</binding-port>
277 </bgp-peer-acceptor-config>
279 @line 3: Binding address: By default is 0.0.0.0, so it is not a mandatory field.
281 @line 4: Binding Port: Port were BGP Server will listen.
285 To exchange routing information between two BGP systems (peers), it is required to configure a peering on both BGP speakers first.
286 This mean that each BGP speaker has a white list of neighbors, representing remote peers, with which the peering is allowed.
287 The TCP connection is established between two peers and they exchange messages to open and confirm the connection parameters followed by routes exchange.
289 Here is a sample basic neighbor configuration:
291 **URL:** ``/restconf/config/openconfig-network-instance:network-instances/network-instance/global-bgp/openconfig-network-instance:protocols/protocol/openconfig-policy-types:BGP/bgp-example/bgp/neighbors``
295 **Content-Type:** ``application/xml``
301 :emphasize-lines: 3,4
303 <neighbor xmlns="urn:opendaylight:params:xml:ns:yang:bgp:openconfig-extensions">
304 <neighbor-address>192.0.2.1</neighbor-address>
307 <hold-time>90</hold-time>
308 <connect-retry>10</connect-retry>
313 <remote-port>179</remote-port>
314 <passive-mode>false</passive-mode>
318 <peer-type>INTERNAL</peer-type>
322 @line 2: IP address of the remote BGP peer. Also serves as an unique identifier of a neighbor in a list of neighbors.
324 @line 5: Proposed number of seconds for value of the Hold Timer. Default value is **90**.
326 @line 6: Time interval in seconds between attempts to establish session with the peer. Effective in active mode only. Default value is **30**.
328 @line 11: Remote port number to which the local BGP is connecting. Effective in active mode only. Default value **179**.
330 @line 12: Wait for peers to issue requests to open a BGP session, rather than initiating sessions from the local router. Default value is **false**.
332 @line 16: Explicitly designate the peer as internal or external. Default value is **INTERNAL**.
336 Once the remote peer is connected and it advertised routes to local BGP system, routes are stored in peer's RIBs.
337 The RIBs can be checked via REST:
339 **URL:** ``/restconf/operational/bgp-rib:bgp-rib/rib/bgp-example/peer/bgp:%2F%2F192.0.2.1``
347 :emphasize-lines: 8,13,35,40,62,66
349 <peer xmlns="urn:opendaylight:params:xml:ns:yang:bgp-rib">
350 <peer-id>bgp://192.0.2.1</peer-id>
352 <afi xmlns:x="urn:opendaylight:params:xml:ns:yang:bgp-types">x:ipv4-address-family</afi>
353 <safi xmlns:x="urn:opendaylight:params:xml:ns:yang:bgp-types">x:unicast-subsequent-address-family</safi>
355 <peer-role>ibgp</peer-role>
358 <afi xmlns:x="urn:opendaylight:params:xml:ns:yang:bgp-types">x:ipv4-address-family</afi>
359 <safi xmlns:x="urn:opendaylight:params:xml:ns:yang:bgp-types">x:unicast-subsequent-address-family</safi>
360 <ipv4-routes xmlns="urn:opendaylight:params:xml:ns:yang:bgp-inet">
363 <prefix>10.0.0.10/32</prefix>
373 <global>10.10.1.1</global>
379 <uptodate>true</uptodate>
385 <afi xmlns:x="urn:opendaylight:params:xml:ns:yang:bgp-types">x:ipv4-address-family</afi>
386 <safi xmlns:x="urn:opendaylight:params:xml:ns:yang:bgp-types">x:unicast-subsequent-address-family</safi>
387 <ipv4-routes xmlns="urn:opendaylight:params:xml:ns:yang:bgp-inet">
390 <prefix>10.0.0.10/32</prefix>
400 <global>10.10.1.1</global>
406 <uptodate>true</uptodate>
412 <afi xmlns:x="urn:opendaylight:params:xml:ns:yang:bgp-types">x:ipv4-address-family</afi>
413 <safi xmlns:x="urn:opendaylight:params:xml:ns:yang:bgp-types">x:unicast-subsequent-address-family</safi>
414 <ipv4-routes xmlns="urn:opendaylight:params:xml:ns:yang:bgp-inet"></ipv4-routes>
415 <attributes></attributes>
420 @line 8: **Adj-RIB-In** - Per-peer RIB, which contains unprocessed routes that has been advertised to local BGP speaker by the remote peer.
422 @line 13: Here is the reported route with destination *10.0.0.10/32* in Adj-RIB-In.
424 @line 35: **Effective-RIB-In** - Per-peer RIB, which contains processed routes as a result of applying inbound policy to Adj-RIB-In routes.
426 @line 40: Here is the reported route with destination *10.0.0.10/32*, same as in Adj-RIB-In, as it was not touched by import policy.
428 @line 62: **Adj-RIB-Out** - Per-peer RIB, which contains routes for advertisement to the peer by means of the local speaker's UPDATE message.
430 @line 66: The peer's Adj-RIB-Out is empty as there are no routes to be advertise from local BGP speaker.
434 Also the same route should appeared in Loc-RIB now:
436 **URL:** ``/restconf/operational/bgp-rib:bgp-rib/rib/bgp-example/loc-rib/tables/bgp-types:ipv4-address-family/bgp-types:unicast-subsequent-address-family/ipv4-routes``
444 :emphasize-lines: 4,6,8,11,14
446 <ipv4-routes xmlns="urn:opendaylight:params:xml:ns:yang:bgp-inet">
449 <prefix>10.0.0.10/32</prefix>
459 <global>10.10.1.1</global>
465 @line 4: **Destination** - IPv4 Prefix Address.
467 @line 6: **AS_PATH** - mandatory attribute, contains a list of the autonomous system numbers through that routing information has traversed.
469 @line 8: **ORIGIN** - mandatory attribute, indicates an origin of the route - **ibgp**, **egp**, **incomplete**.
471 @line 11: **LOCAL_PREF** - indicates a degree of preference for external routes, higher value is preferred.
473 @line 14: **NEXT_HOP** - mandatory attribute, defines IP address of the router that should be used as the next hop to the destination.
477 There are much more attributes that may be carried along with the destination:
479 **BGP-4 Path Attributes**
481 * **MULTI_EXIT_DISC** (MED)
482 Optional attribute, to be used to discriminate among multiple exit/entry points on external links, lower number is preferred.
491 * **ATOMIC_AGGREGATE**
492 Indicates whether AS_SET was excluded from AS_PATH due to routes aggregation.
499 Optional attribute, contains AS number and IP address of a BGP speaker which performed routes aggregation.
504 <as-number>65000</as-number>
505 <network-address>192.0.2.2</network-address>
509 Optional attribute, used to store optional attributes, unrecognized by a local BGP speaker.
513 <unrecognized-attributes>
514 <partial>true</partial>
515 <transitive>true</transitive>
517 <value>0101010101010101</value>
518 </unrecognized-attributes>
520 **Route Reflector Attributes**
523 Optional attribute, carries BGP Identifier of the originator of the route.
528 <originator>41.41.41.41</originator>
532 Optional attribute, contains a list of CLUSTER_ID values representing the path that the route has traversed.
537 <cluster>40.40.40.40</cluster>
541 Optional attribute, may be used for policy routing.
546 <as-number>65000</as-number>
547 <semantics>30740</semantics>
550 **Extended Communities**
553 Identifies one or more routers that may receive a route.
557 <extended-communities>
558 <transitive>true</transitive>
560 <global-administrator>192.0.2.2</global-administrator>
561 <local-administrator>123</local-administrator>
563 </extended-communities>
564 <extended-communities>
565 <transitive>true</transitive>
566 <as-4-route-target-extended-community>
567 <as-4-specific-common>
568 <as-number>65000</as-number>
569 <local-administrator>123</local-administrator>
570 </as-4-specific-common>
571 </as-4-route-target-extended-community>
572 </extended-communities>
576 Identifies one or more routers that injected a route.
580 <extended-communities>
581 <transitive>true</transitive>
583 <global-administrator>192.0.2.2</global-administrator>
584 <local-administrator>123</local-administrator>
586 </extended-communities>
587 <extended-communities>
588 <transitive>true</transitive>
589 <as-4-route-origin-extended-community>
590 <as-4-specific-common>
591 <as-number>65000</as-number>
592 <local-administrator>123</local-administrator>
593 </as-4-origin-common>
594 </as-4-route-target-extended-community>
595 </extended-communities>
599 Carries the cost to reach external neighbor.
603 <extended-communities>
604 <transitive>true</transitive>
605 <link-bandwidth-extended-community>
606 <bandwidth>BH9CQAA=</bandwidth>
607 </link-bandwidth-extended-community>
608 </extended-communities>
611 Optional attribute, carries accumulated IGP metric.
622 .. note:: When the remote peer disconnects, it disappear from operational state of local speaker instance and advertised routes are removed too.
624 External peering configuration
625 ''''''''''''''''''''''''''''''
626 An example above provided configuration for internal peering only.
627 Following configuration sample is intended for external peering:
629 **URL:** ``/restconf/config/openconfig-network-instance:network-instances/network-instance/global-bgp/openconfig-network-instance:protocols/protocol/openconfig-policy-types:BGP/bgp-example/bgp/neighbors``
633 **Content-Type:** ``application/xml``
641 <neighbor xmlns="urn:opendaylight:params:xml:ns:yang:bgp:openconfig-extensions">
642 <neighbor-address>192.0.2.3</neighbor-address>
644 <peer-type>EXTERNAL</peer-type>
645 <peer-as>64999</peer-as>
649 @line 5: AS number of the remote peer.
651 Route reflector configuration
652 '''''''''''''''''''''''''''''
653 The local BGP speaker can be configured with a specific *cluster ID*.
654 Following example adds the cluster ID to the existing speaker instance:
656 **URL:** ``/restconf/config/openconfig-network-instance:network-instances/network-instance/global-bgp/openconfig-network-instance:protocols/protocol/openconfig-policy-types:BGP/bgp-example/bgp/global/config``
660 **Content-Type:** ``application/xml``
669 <router-id>192.0.2.2</router-id>
671 <route-reflector-cluster-id>192.0.2.1</route-reflector-cluster-id>
674 @line 4: Route-reflector cluster id to use when local router is configured as a route reflector.
675 The *router-id* is used as a default value.
679 Following configuration sample is intended for route reflector client peering:
681 **URL:** ``/restconf/config/openconfig-network-instance:network-instances/network-instance/global-bgp/openconfig-network-instance:protocols/protocol/openconfig-policy-types:BGP/bgp-example/bgp/neighbors``
685 **Content-Type:** ``application/xml``
693 <neighbor xmlns="urn:opendaylight:params:xml:ns:yang:bgp:openconfig-extensions">
694 <neighbor-address>192.0.2.4</neighbor-address>
696 <peer-type>INTERNAL</peer-type>
700 <route-reflector-client>true</route-reflector-client>
705 @line 8: Configure the neighbor as a route reflector client. Default value is *false*.
707 MD5 authentication configuration
708 ''''''''''''''''''''''''''''''''
709 The OpenDaylight BGP implementation is supporting TCP MD5 for authentication.
710 Sample configuration below shows how to set authentication password for a peer:
712 **URL:** ``/restconf/config/openconfig-network-instance:network-instances/network-instance/global-bgp/openconfig-network-instance:protocols/protocol/openconfig-policy-types:BGP/bgp-example/bgp/neighbors``
716 **Content-Type:** ``application/xml``
724 <neighbor xmlns="urn:opendaylight:params:xml:ns:yang:bgp:openconfig-extensions">
725 <neighbor-address>192.0.2.5</neighbor-address>
727 <auth-password>topsecret</auth-password>
731 @line 4: Configures an MD5 authentication password for use with neighboring devices.
733 Simple Routing Policy configuration
734 '''''''''''''''''''''''''''''''''''
735 The OpenDaylight BGP implementation is supporting *Simple Routing Policy*.
736 Sample configuration below shows how to set *Simple Routing Policy* for a peer:
738 **URL:** ``/restconf/config/openconfig-network-instance:network-instances/network-instance/global-bgp/openconfig-network-instance:protocols/protocol/openconfig-policy-types:BGP/bgp-example/bgp/neighbors``
742 **Content-Type:** ``application/xml``
750 <neighbor xmlns="urn:opendaylight:params:xml:ns:yang:bgp:openconfig-extensions">
751 <neighbor-address>192.0.2.7</neighbor-address>
753 <simple-routing-policy>learn-none</simple-routing-policy>
757 @line 4: *Simple Routing Policy*:
759 * ``learn-none`` - routes advertised by the peer are not propagated to Effective-RIB-In and Loc-RIB
760 * ``announce-none`` - routes from local Loc-RIB are not advertised to the peer
762 .. note:: Existing neighbor configuration can be reconfigured (change configuration parameters) anytime.
763 As a result, established connection is dropped, peer instance is recreated with a new configuration settings and connection re-established.
765 .. note:: The BGP configuration is persisted on OpendDaylight shutdown and restored after the re-start.
767 BGP Application Peer and programmable RIB
768 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
769 The OpenDaylight BGP implementation also supports routes injection via *Application Peer*.
770 Such peer has its own programmable RIB, which can be modified by user.
771 This concept allows user to originate new routes and advertise them to all connected peers.
773 Application Peer configuration
774 ''''''''''''''''''''''''''''''
775 Following configuration sample show a way to configure the *Application Peer*:
777 **URL:** ``/restconf/config/openconfig-network-instance:network-instances/network-instance/global-bgp/openconfig-network-instance:protocols/protocol/openconfig-policy-types:BGP/bgp-example/bgp/neighbors``
781 **Content-Type:** ``application/xml``
787 :emphasize-lines: 2,4
789 <neighbor xmlns="urn:opendaylight:params:xml:ns:yang:bgp:openconfig-extensions">
790 <neighbor-address>10.25.1.9</neighbor-address>
792 <peer-group>application-peers</peer-group>
796 @line 2: IP address is uniquely identifying *Application Peer* and its programmable RIB. Address is also used in local BGP speaker decision process.
798 @line 4: Indicates that peer is associated with *application-peers* group. It serves to distinguish *Application Peer's* from regular neighbors.
802 The *Application Peer* presence can be verified via REST:
804 **URL:** ``/restconf/operational/bgp-rib:bgp-rib/rib/bgp-example/peer/bgp:%2F%2F10.25.1.9``
812 :emphasize-lines: 3,8
814 <peer xmlns="urn:opendaylight:params:xml:ns:yang:bgp-rib">
815 <peer-id>bgp://10.25.1.9</peer-id>
816 <peer-role>internal</peer-role>
819 <afi xmlns:x="urn:opendaylight:params:xml:ns:yang:bgp-types">x:ipv4-address-family</afi>
820 <safi xmlns:x="urn:opendaylight:params:xml:ns:yang:bgp-types">x:unicast-subsequent-address-family</safi>
821 <ipv4-routes xmlns="urn:opendaylight:params:xml:ns:yang:bgp-inet"></ipv4-routes>
823 <uptodate>false</uptodate>
829 <afi xmlns:x="urn:opendaylight:params:xml:ns:yang:bgp-types">x:ipv4-address-family</afi>
830 <safi xmlns:x="urn:opendaylight:params:xml:ns:yang:bgp-types">x:unicast-subsequent-address-family</safi>
831 <ipv4-routes xmlns="urn:opendaylight:params:xml:ns:yang:bgp-inet"></ipv4-routes>
832 <attributes></attributes>
837 @line 3: Peer role for *Application Peer* is *internal*.
839 @line 8: Adj-RIB-In is empty, as no routes were originated yet.
841 .. note:: There is no Adj-RIB-Out for *Application Peer*.
845 Next example shows how to inject a route into the programmable RIB.
847 **URL:** ``/restconf/config/bgp-rib:application-rib/10.25.1.9/tables/bgp-types:ipv4-address-family/bgp-types:unicast-subsequent-address-family/bgp-inet:ipv4-routes``
851 **Content-Type:** ``application/xml``
857 <ipv4-route xmlns="urn:opendaylight:params:xml:ns:yang:bgp-inet">
859 <prefix>10.0.0.11/32</prefix>
869 <global>10.11.1.1</global>
876 Now the injected route appears in *Application Peer's* RIBs and in local speaker's Loc-RIB:
878 **URL:** ``/restconf/operational/bgp-rib:bgp-rib/rib/bgp-example/peer/bgp:%2F%2F10.25.1.9``
888 <peer xmlns="urn:opendaylight:params:xml:ns:yang:bgp-rib">
889 <peer-id>bgp://10.25.1.9</peer-id>
890 <peer-role>internal</peer-role>
893 <afi xmlns:x="urn:opendaylight:params:xml:ns:yang:bgp-types">x:ipv4-address-family</afi>
894 <safi xmlns:x="urn:opendaylight:params:xml:ns:yang:bgp-types">x:unicast-subsequent-address-family</safi>
895 <ipv4-routes xmlns="urn:opendaylight:params:xml:ns:yang:bgp-inet">
898 <prefix>10.0.0.11/32</prefix>
908 <global>10.11.1.1</global>
914 <uptodate>false</uptodate>
920 <afi xmlns:x="urn:opendaylight:params:xml:ns:yang:bgp-types">x:ipv4-address-family</afi>
921 <safi xmlns:x="urn:opendaylight:params:xml:ns:yang:bgp-types">x:unicast-subsequent-address-family</safi>
922 <ipv4-routes xmlns="urn:opendaylight:params:xml:ns:yang:bgp-inet">
925 <prefix>10.0.0.11/32</prefix>
935 <global>10.11.1.1</global>
940 <attributes></attributes>
945 @line 9: Injected route is present in *Application Peer's* Adj-RIB-In and Effective-RIB-In.
949 **URL:** ``/restconf/operational/bgp-rib:bgp-rib/rib/bgp-example/loc-rib/tables/bgp-types:ipv4-address-family/bgp-types:unicast-subsequent-address-family/ipv4-routes``
959 <ipv4-routes xmlns="urn:opendaylight:params:xml:ns:yang:bgp-inet">
962 <prefix>10.0.0.10/32</prefix>
972 <global>10.11.1.1</global>
978 <prefix>10.0.0.10/32</prefix>
988 <global>10.10.1.1</global>
994 @line 2: The injected route is now present in Loc-RIB along with a route (destination *10.0.0.10/32*) advertised by remote peer.
998 This route is also advertised to the remote peer (*192.0.2.1*), hence route appears in its Adj-RIB-Out:
1000 **URL:** ``/restconf/operational/bgp-rib:bgp-rib/rib/bgp-example/peer/bgp:%2F%2F192.0.2.1/adj-rib-out/tables/bgp-types:ipv4-address-family/bgp-types:unicast-subsequent-address-family/bgp-inet:ipv4-routes``
1008 <ipv4-route xmlns="urn:opendaylight:params:xml:ns:yang:bgp-inet">
1009 <path-id>0</path-id>
1010 <prefix>10.0.0.11/32</prefix>
1020 <global>10.11.1.1</global>
1027 The injected route can be modified (i.e. different path attribute):
1029 **URL:** ``/restconf/config/bgp-rib:application-rib/10.25.1.9/tables/bgp-types:ipv4-address-family/bgp-types:unicast-subsequent-address-family/bgp-inet:ipv4-routes/ipv4-route/10.0.0.11%2F32/0``
1033 **Content-Type:** ``application/xml``
1039 <ipv4-route xmlns="urn:opendaylight:params:xml:ns:yang:bgp-inet">
1040 <path-id>0</path-id>
1041 <prefix>10.0.0.11/32</prefix>
1051 <global>10.11.1.2</global>
1058 The route can be removed from programmable RIB in a following way:
1060 **URL:** ``/restconf/config/bgp-rib:application-rib/10.25.1.9/tables/bgp-types:ipv4-address-family/bgp-types:unicast-subsequent-address-family/bgp-inet:ipv4-routes/ipv4-route/10.0.0.11%2F32/0``
1062 **Method:** ``DELETE``
1066 Also it is possible to remove all routes from a particular table at once:
1068 **URL:** ``/restconf/config/bgp-rib:application-rib/10.25.1.9/tables/bgp-types:ipv4-address-family/bgp-types:unicast-subsequent-address-family/bgp-inet:ipv4-routes/``
1070 **Method:** ``DELETE``
1074 Consequently, route disappears from programmable RIB, *Application Peer's* RIBs, Loc-RIB and peer's Adj-RIB-Out (UPDATE message with prefix withdrawal is send).
1076 .. note:: Routes stored in programmable RIB are persisted on OpendDaylight shutdown and restored after the re-start.
1078 BGP Protocol Configuration Loader
1079 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1081 BGP Protocol Configuration Loader allows user to define static initial configuration for a BGP protocol instance.
1082 This service will detect the creation of new configuration files following the pattern "protocols-*.xml" under the path "etc/opendaylight/bgp".
1083 Once the file is processed, the defined configuration will be available from the configuration Data Store.
1085 .. note:: If the BGP instance is already present, no update or configuration will be applied.
1087 When installing BGP an example will be provided and a default configuration loaded.
1089 **PATH:** ``etc/opendaylight/bgp/protocols-config.xml``
1093 <protocols xmlns="http://openconfig.net/yang/network-instance">
1095 <name>example-bgp-rib</name>
1096 <identifier xmlns:x="http://openconfig.net/yang/policy-types">x:BGP</identifier>
1097 <bgp xmlns="urn:opendaylight:params:xml:ns:yang:bgp:openconfig-extensions">
1100 <router-id>192.0.2.2</router-id>
1102 <!-- if cluster-id is not present, it's value is the same as bgp-id -->
1103 <!-- <route-reflector-cluster-id>192.0.2.3</route-reflector-cluster-id> -->
1104 <!-- <read-only-limit>120</read-only-limit>-->
1108 <afi-safi-name xmlns:x="http://openconfig.net/yang/bgp-types">x:IPV4-UNICAST</afi-safi-name>
1109 <!--Advertise N Paths
1110 <receive>true</receive>
1111 <send-max>2</send-max>-->
1114 <afi-safi-name xmlns:x="http://openconfig.net/yang/bgp-types">x:IPV6-UNICAST</afi-safi-name>
1117 <afi-safi-name xmlns:x="http://openconfig.net/yang/bgp-types">x:IPV4-LABELLED-UNICAST</afi-safi-name>
1120 <afi-safi-name xmlns:x="http://openconfig.net/yang/bgp-types">x:IPV6-LABELLED-UNICAST</afi-safi-name>
1123 <afi-safi-name xmlns:x="http://openconfig.net/yang/bgp-types">x:L3VPN-IPV4-UNICAST</afi-safi-name>
1126 <afi-safi-name xmlns:x="http://openconfig.net/yang/bgp-types">x:L3VPN-IPV6-UNICAST</afi-safi-name>
1129 <afi-safi-name xmlns:x="http://openconfig.net/yang/bgp-types">x:L2VPN-EVPN</afi-safi-name>
1132 <afi-safi-name>LINKSTATE</afi-safi-name>
1135 <afi-safi-name>IPV4-FLOW</afi-safi-name>
1138 <afi-safi-name>IPV6-FLOW</afi-safi-name>
1141 <afi-safi-name>IPV4-L3VPN-FLOW</afi-safi-name>
1144 <afi-safi-name>IPV6-L3VPN-FLOW</afi-safi-name>
1148 <neighbors xmlns="urn:opendaylight:params:xml:ns:yang:bgp:openconfig-extensions">
1149 <neighbor xmlns="urn:opendaylight:params:xml:ns:yang:bgp:openconfig-extensions">
1150 <neighbor-address>192.0.2.1</neighbor-address>
1152 <peer-type>INTERNAL</peer-type>
1153 <peer-as>64496</peer-as>
1157 <remote-port>179</remote-port>
1158 <passive-mode>true</passive-mode>
1163 <hold-time>180</hold-time>
1164 <connect-retry>10</connect-retry>
1169 <route-reflector-client>false</route-reflector-client>
1174 <afi-safi-name xmlns:x="http://openconfig.net/yang/bgp-types">x:IPV4-UNICAST</afi-safi-name>
1175 <!--Advertise N Paths
1176 <receive>true</receive>
1177 <send-max>0</send-max>-->
1180 <afi-safi-name xmlns:x="http://openconfig.net/yang/bgp-types">x:IPV6-UNICAST</afi-safi-name>
1183 <afi-safi-name xmlns:x="http://openconfig.net/yang/bgp-types">x:IPV4-LABELLED-UNICAST</afi-safi-name>
1186 <afi-safi-name xmlns:x="http://openconfig.net/yang/bgp-types">x:IPV6-LABELLED-UNICAST</afi-safi-name>
1189 <afi-safi-name xmlns:x="http://openconfig.net/yang/bgp-types">x:L3VPN-IPV4-UNICAST</afi-safi-name>
1192 <afi-safi-name xmlns:x="http://openconfig.net/yang/bgp-types">x:L3VPN-IPV6-UNICAST</afi-safi-name>
1195 <afi-safi-name xmlns:x="http://openconfig.net/yang/bgp-types">x:L2VPN-EVPN</afi-safi-name>
1198 <afi-safi-name>LINKSTATE</afi-safi-name>
1201 <afi-safi-name>IPV4-FLOW</afi-safi-name>
1204 <afi-safi-name>IPV6-FLOW</afi-safi-name>
1207 <afi-safi-name>IPV4-L3VPN-FLOW</afi-safi-name>
1210 <afi-safi-name>IPV6-L3VPN-FLOW</afi-safi-name>
1214 <neighbor xmlns="urn:opendaylight:params:xml:ns:yang:bgp:openconfig-extensions">
1215 <neighbor-address>192.0.2.6</neighbor-address>
1217 <peer-group>application-peers</peer-group>
1227 .. figure:: ./images/bgpcep/bgp-pipeline.png
1230 BGP pipeline - routes re-advertisement.
1232 .. figure:: ./images/bgpcep/bgp-app-pipeline.png
1233 :alt: BGP Application Peer pipeline.
1235 BGP applcaition peer pipeline - routes injection.
1239 * `A Border Gateway Protocol 4 (BGP-4) <https://tools.ietf.org/html/rfc4271>`_
1240 * `BGP Route Reflection <https://tools.ietf.org/html/rfc4456>`_
1241 * `BGP Communities Attribute <https://tools.ietf.org/html/rfc1997>`_
1242 * `BGP Support for Four-Octet Autonomous System (AS) Number Space <https://tools.ietf.org/html/rfc6793>`_
1243 * `The Accumulated IGP Metric Attribute for BGP <https://tools.ietf.org/html/rfc7311>`_
1244 * `4-Octet AS Specific BGP Extended Community <https://tools.ietf.org/html/rfc5668>`_
1245 * `BGP Link Bandwidth Extended Community <https://tools.ietf.org/html/draft-ietf-idr-link-bandwidth-06>`_
1246 * `Use of BGP for Routing in Large-Scale Data Centers <https://tools.ietf.org/html/rfc7938>`_
1250 The BGP-4 allows to carry IPv4 specific information only.
1251 The basic BGP Multiprotocol extension brings *Unicast* Subsequent Address Family (SAFI) - intended to be used for IP unicast forwarding.
1252 The combination of IPv4 and IPv6 Address Family (AF) and Unicast SAFI is essential for Internet routing.
1253 The IPv4 Unicast routes are interchangeable with BGP-4 routes, as they can carry the same type of routing information.
1255 .. contents:: Contents
1261 This section shows a way to enable IPv4 and IPv6 Unicast family in BGP speaker and peer configuration.
1265 To enable IPv4 and IPv6 Unicast support in BGP plugin, first configure BGP speaker instance:
1267 **URL:** ``/restconf/config/openconfig-network-instance:network-instances/network-instance/global-bgp/openconfig-network-instance:protocols``
1269 **Method:** ``POST``
1271 **Content-Type:** ``application/xml``
1277 <protocol xmlns="http://openconfig.net/yang/network-instance">
1278 <name>bgp-example</name>
1279 <identifier xmlns:x="http://openconfig.net/yang/policy-types">x:BGP</identifier>
1280 <bgp xmlns="urn:opendaylight:params:xml:ns:yang:bgp:openconfig-extensions">
1283 <router-id>192.0.2.2</router-id>
1288 <afi-safi-name xmlns:x="http://openconfig.net/yang/bgp-types">x:IPV4-UNICAST</afi-safi-name>
1291 <afi-safi-name xmlns:x="http://openconfig.net/yang/bgp-types">x:IPV6-UNICAST</afi-safi-name>
1300 Here is an example for BGP peer configuration with enabled IPv4 and IPv6 Unicast family.
1302 **URL:** ``/restconf/config/openconfig-network-instance:network-instances/network-instance/global-bgp/openconfig-network-instance:protocols/protocol/openconfig-policy-types:BGP/bgp-example/bgp/neighbors``
1304 **Method:** ``POST``
1306 **Content-Type:** ``application/xml``
1312 <neighbor xmlns="urn:opendaylight:params:xml:ns:yang:bgp:openconfig-extensions">
1313 <neighbor-address>192.0.2.1</neighbor-address>
1316 <afi-safi-name xmlns:x="http://openconfig.net/yang/bgp-types">x:IPV4-UNICAST</afi-safi-name>
1319 <afi-safi-name xmlns:x="http://openconfig.net/yang/bgp-types">x:IPV6-UNICAST</afi-safi-name>
1326 Following trees illustrate the BGP IP Unicast routes structures.
1330 .. code-block:: console
1334 +--ro ipv4-route* [prefix path-id]
1335 +--ro prefix inet:ipv4-prefix
1336 +--ro path-id path-id
1339 | +--ro value bgp-t:bgp-origin
1342 | +--ro as-sequence* inet:as-number
1343 | +--ro as-set* inet:as-number
1345 | +--:(ipv4-next-hop-case)
1346 | | +--ro ipv4-next-hop
1347 | | +--ro global? inet:ipv4-address
1348 | +--:(ipv6-next-hop-case)
1349 | | +--ro ipv6-next-hop
1350 | | +--ro global? inet:ipv6-address
1351 | | +--ro link-local? inet:ipv6-address
1352 | +--:(empty-next-hop-case)
1353 | +--ro empty-next-hop? empty
1354 +--ro multi-exit-disc
1357 | +--ro pref? uint32
1358 +--ro atomic-aggregate!
1360 | +--ro as-number? inet:as-number
1361 | +--ro network-address? inet:ipv4-address
1363 | +--ro as-number? inet:as-number
1364 | +--ro semantics? uint16
1365 +--ro extended-communities*
1366 | +--ro transitive? boolean
1367 | +--ro (extended-community)?
1368 | +--:(as-specific-extended-community-case)
1369 | | +--ro as-specific-extended-community
1370 | | +--ro global-administrator? short-as-number
1371 | | +--ro local-administrator? binary
1372 | +--:(inet4-specific-extended-community-case)
1373 | | +--ro inet4-specific-extended-community
1374 | | +--ro global-administrator? inet:ipv4-address
1375 | | +--ro local-administrator? binary
1376 | +--:(opaque-extended-community-case)
1377 | | +--ro opaque-extended-community
1378 | | +--ro value? binary
1379 | +--:(route-target-extended-community-case)
1380 | | +--ro route-target-extended-community
1381 | | +--ro global-administrator? short-as-number
1382 | | +--ro local-administrator? binary
1383 | +--:(route-origin-extended-community-case)
1384 | | +--ro route-origin-extended-community
1385 | | +--ro global-administrator? short-as-number
1386 | | +--ro local-administrator? binary
1387 | +--:(route-target-ipv4-case)
1388 | | +--ro route-target-ipv4
1389 | | +--ro global-administrator? inet:ipv4-address
1390 | | +--ro local-administrator? uint16
1391 | +--:(route-origin-ipv4-case)
1392 | | +--ro route-origin-ipv4
1393 | | +--ro global-administrator? inet:ipv4-address
1394 | | +--ro local-administrator? uint16
1395 | +--:(link-bandwidth-case)
1396 | | +--ro link-bandwidth-extended-community
1397 | | +--ro bandwidth netc:bandwidth
1398 | +--:(as-4-generic-spec-extended-community-case)
1399 | | +--ro as-4-generic-spec-extended-community
1400 | | +--ro as-4-specific-common
1401 | | +--ro as-number inet:as-number
1402 | | +--ro local-administrator uint16
1403 | +--:(as-4-route-target-extended-community-case)
1404 | | +--ro as-4-route-target-extended-community
1405 | | +--ro as-4-specific-common
1406 | | +--ro as-number inet:as-number
1407 | | +--ro local-administrator uint16
1408 | +--:(as-4-route-origin-extended-community-case)
1409 | | +--ro as-4-route-origin-extended-community
1410 | | +--ro as-4-specific-common
1411 | | +--ro as-number inet:as-number
1412 | | +--ro local-administrator uint16
1413 | +--:(encapsulation-case)
1414 | +--ro encapsulation-extended-community
1415 | +--ro tunnel-type encapsulation-tunnel-type
1417 | +--ro originator? inet:ipv4-address
1419 | +--ro cluster* bgp-t:cluster-identifier
1422 | +--ro metric? netc:accumulated-igp-metric
1423 +--ro unrecognized-attributes* [type]
1424 +--ro partial boolean
1425 +--ro transitive boolean
1431 .. code-block:: console
1435 +--ro ipv6-route* [prefix path-id]
1436 +--ro prefix inet:ipv6-prefix
1437 +--ro path-id path-id
1445 The IPv4 Unicast table in an instance of the speaker's Loc-RIB can be verified via REST:
1447 **URL:** ``/restconf/operational/bgp-rib:bgp-rib/rib/bgp-example/loc-rib/tables/bgp-types:ipv4-address-family/bgp-types:unicast-subsequent-address-family/ipv4-routes``
1455 <ipv4-routes xmlns="urn:opendaylight:params:xml:ns:yang:bgp-inet">
1457 <path-id>0</path-id>
1458 <prefix>193.0.2.1/32</prefix>
1468 <global>10.0.0.1</global>
1476 The IPv6 Unicast table in an instance of the speaker's Loc-RIB can be verified via REST:
1478 **URL:** ``/restconf/operational/bgp-rib:bgp-rib/rib/bgp-example/loc-rib/tables/bgp-types:ipv4-address-family/bgp-types:unicast-subsequent-address-family/ipv6-routes``
1486 <ipv6-routes xmlns="urn:opendaylight:params:xml:ns:yang:bgp-inet">
1488 <path-id>0</path-id>
1489 <prefix>2a02:b80:0:1::/64</prefix>
1499 <global>2a02:b80:0:2::1</global>
1505 .. note:: IPv4/6 routes mapping to topology nodes is supported by BGP Topology Provider.
1511 This examples show how to originate and remove IPv4 route via programmable RIB.
1512 Make sure the *Application Peer* is configured first.
1514 **URL:** ``/restconf/config/bgp-rib:application-rib/10.25.1.9/tables/bgp-types:ipv4-address-family/bgp-types:unicast-subsequent-address-family/bgp-inet:ipv4-routes``
1516 **Method:** ``POST``
1518 **Content-Type:** ``application/xml``
1524 <ipv4-route xmlns="urn:opendaylight:params:xml:ns:yang:bgp-inet">
1525 <path-id>0</path-id>
1526 <prefix>10.0.0.11/32</prefix>
1536 <global>10.11.1.1</global>
1543 To remove the route added above, following request can be used:
1545 **URL:** ``/restconf/config/bgp-rib:application-rib/10.25.1.9/tables/bgp-types:ipv4-address-family/bgp-types:unicast-subsequent-address-family/bgp-inet:ipv4-routes/ipv4-route/10.0.0.11%2F32/0``
1547 **Method:** ``DELETE``
1551 This examples show how to originate and remove IPv6 route via programmable RIB:
1553 **URL:** ``/restconf/config/bgp-rib:application-rib/10.25.1.9/tables/bgp-types:ipv6-address-family/bgp-types:unicast-subsequent-address-family/bgp-inet:ipv6-routes``
1555 **Method:** ``POST``
1557 **Content-Type:** ``application/xml``
1563 <ipv6-route xmlns="urn:opendaylight:params:xml:ns:yang:bgp-inet">
1564 <prefix>2001:db8:30::3/128</prefix>
1565 <path-id>0</path-id>
1568 <global>2001:db8:1::6</global>
1582 To remove the route added above, following request can be used:
1584 **URL:** ``/restconf/config/bgp-rib:application-rib/10.25.1.9/tables/bgp-types:ipv6-address-family/bgp-types:unicast-subsequent-address-family/bgp-inet:ipv6-routes/ipv6-route/2001:db8:30::3%2F128/0``
1586 **Method:** ``DELETE``
1590 * `Multiprotocol Extensions for BGP-4 <https://tools.ietf.org/html/rfc4760>`_
1592 IP Labeled Unicast Family
1593 -------------------------
1594 The BGP Labeled Unicast (BGP-LU) Multiprotocol extension is used to distribute a MPLS label that is mapped to a particular route.
1595 It can be used to advertise a MPLS transport path between IGP regions and Autonomous Systems.
1596 Also, BGP-LU can help to solve the Inter-domain traffic-engineering problem and can be deployed in large-scale data centers along with MPLS and Spring.
1597 In addition, IPv6 Labeled Unicast can be used to interconnect IPv6 islands over IPv4/MPLS networks using 6PE.
1599 .. contents:: Contents
1605 This section shows a way to enable IPv4 and IPv6 Labeled Unicast family in BGP speaker and peer configuration.
1609 To enable IPv4 and IPv6 Labeled Unicast support in BGP plugin, first configure BGP speaker instance:
1611 **URL:** ``/restconf/config/openconfig-network-instance:network-instances/network-instance/global-bgp/openconfig-network-instance:protocols``
1613 **Method:** ``POST``
1615 **Content-Type:** ``application/xml``
1621 <protocol xmlns="http://openconfig.net/yang/network-instance">
1622 <name>bgp-example</name>
1623 <identifier xmlns:x="http://openconfig.net/yang/policy-types">x:BGP</identifier>
1624 <bgp xmlns="urn:opendaylight:params:xml:ns:yang:bgp:openconfig-extensions">
1627 <router-id>192.0.2.2</router-id>
1632 <afi-safi-name xmlns:x="http://openconfig.net/yang/bgp-types">x:IPV4-LABELLED-UNICAST</afi-safi-name>
1635 <afi-safi-name xmlns:x="http://openconfig.net/yang/bgp-types">x:IPV6-LABELLED-UNICAST</afi-safi-name>
1644 Here is an example for BGP peer configuration with enabled IPv4 and IPv6 Labeled Unicast family.
1646 **URL:** ``/restconf/config/openconfig-network-instance:network-instances/network-instance/global-bgp/openconfig-network-instance:protocols/protocol/openconfig-policy-types:BGP/bgp-example/bgp/neighbors``
1648 **Method:** ``POST``
1650 **Content-Type:** ``application/xml``
1656 <neighbor xmlns="urn:opendaylight:params:xml:ns:yang:bgp:openconfig-extensions">
1657 <neighbor-address>192.0.2.1</neighbor-address>
1660 <afi-safi-name xmlns:x="http://openconfig.net/yang/bgp-types">x:IPV4-LABELLED-UNICAST</afi-safi-name>
1663 <afi-safi-name xmlns:x="http://openconfig.net/yang/bgp-types">x:IPV6-LABELLED-UNICAST</afi-safi-name>
1668 IP Labeled Unicast API
1669 ^^^^^^^^^^^^^^^^^^^^^^
1670 Following trees illustrate the BGP IP Labeled Unicast routes structures.
1672 IPv4 Labeled Unicast Route
1673 ''''''''''''''''''''''''''
1674 .. code-block:: console
1676 :(labeled-unicast-routes-case)
1677 +--ro labeled-unicast-routes
1678 +--ro labeled-unicast-route* [route-key path-id]
1679 +--ro route-key string
1681 | +--ro label-value? netc:mpls-label
1682 +--ro prefix? inet:ip-prefix
1683 +--ro path-id path-id
1688 IPv6 Labeled Unicast Route
1689 ''''''''''''''''''''''''''
1690 .. code-block:: console
1692 :(labeled-unicast-ipv6-routes-case)
1693 +--ro labeled-unicast-ipv6-routes
1694 +--ro labeled-unicast-route* [route-key path-id]
1695 +--ro route-key string
1697 | +--ro label-value? netc:mpls-label
1698 +--ro prefix? inet:ip-prefix
1699 +--ro path-id path-id
1705 The IPv4 Labeled Unicast table in an instance of the speaker's Loc-RIB can be verified via REST:
1707 **URL:** ``/restconf/operational/bgp-rib:bgp-rib/rib/bgp-example/loc-rib/tables/bgp-types:ipv4-address-family/bgp-labeled-unicast:labeled-unicast-subsequent-address-family/bgp-labeled-unicast:labeled-unicast-routes``
1715 <labeled-unicast-routes xmlns="urn:opendaylight:params:xml:ns:yang:bgp-labeled-unicast">
1716 <labeled-unicast-route>
1717 <path-id>0</path-id>
1718 <route-key>MAA+gRQAAA==</route-key>
1724 <global>200.10.0.101</global>
1732 <label-value>1000</label-value>
1734 <prefix>20.0.0.0/24</prefix>
1735 </labeled-unicast-route>
1736 </labeled-unicast-routes>
1742 This examples show how to originate and remove IPv4 labeled route via programmable RIB.
1743 Make sure the *Application Peer* is configured first.
1745 **URL:** ``/restconf/config/bgp-rib:application-rib/10.25.1.9/tables/bgp-types:ipv4-address-family/bgp-labeled-unicast:labeled-unicast-subsequent-address-family/bgp-labeled-unicast:labeled-unicast-routes``
1747 **Method:** ``POST``
1749 **Content-Type:** ``application/xml``
1755 <labeled-unicast-route xmlns="urn:opendaylight:params:xml:ns:yang:bgp-labeled-unicast">
1756 <route-key>label1</route-key>
1757 <prefix>1.1.1.1/32</prefix>
1758 <path-id>0</path-id>
1760 <label-value>800322</label-value>
1764 <global>199.20.160.41</global>
1774 </labeled-unicast-route>
1778 In addition, BGP-LU Spring extension allows to attach BGP Prefix SID attribute to the route, in order to signal the BGP-Prefix-SID, where the SR is applied to MPLS dataplane.
1783 <bgp-prefix-sid-tlvs>
1784 <label-index-tlv xmlns="urn:opendaylight:params:xml:ns:yang:bgp-labeled-unicast">322</label-index-tlv>
1785 </bgp-prefix-sid-tlvs>
1786 <bgp-prefix-sid-tlvs>
1787 <srgb-value xmlns="urn:opendaylight:params:xml:ns:yang:bgp-labeled-unicast">
1791 </bgp-prefix-sid-tlvs>
1796 To remove the route added above, following request can be used:
1798 **URL:** ``/restconf/config/bgp-rib:application-rib/10.25.1.9/tables/bgp-types:ipv4-address-family/bgp-labeled-unicast:labeled-unicast-subsequent-address-family/bgp-labeled-unicast:labeled-unicast-routes/bgp-labeled-unicast:labeled-unicast-route/label1/0``
1800 **Method:** ``DELETE``
1804 This examples show how to originate and remove IPv6 labeled route via programmable RIB.
1806 **URL:** ``/restconf/config/bgp-rib:application-rib/10.25.1.9/tables/bgp-types:ipv4-address-family/bgp-labeled-unicast:labeled-unicast-subsequent-address-family/bgp-labeled-unicast:labeled-unicast-ipv6-routes``
1808 **Method:** ``POST``
1810 **Content-Type:** ``application/xml``
1816 <labeled-unicast-route xmlns="urn:opendaylight:params:xml:ns:yang:bgp-labeled-unicast">
1817 <route-key>label1</route-key>
1818 <prefix>2001:db8:30::3/128</prefix>
1819 <path-id>0</path-id>
1821 <label-value>123</label-value>
1825 <global>2003:4:5:6::7</global>
1835 </labeled-unicast-route>
1839 To remove the route added above, following request can be used:
1841 **URL:** ``/restconf/config/bgp-rib:application-rib/10.25.1.9/tables/bgp-types:ipv4-address-family/bgp-labeled-unicast:labeled-unicast-subsequent-address-family/bgp-labeled-unicast:labeled-unicast-ipv6-routes/bgp-labeled-unicast:labeled-unicast-route/label1/0``
1843 **Method:** ``DELETE``
1847 * `Carrying Label Information in BGP-4 <https://tools.ietf.org/html/rfc3107>`_
1848 * `Segment Routing Prefix SID extensions for BGP <https://tools.ietf.org/html/draft-ietf-idr-bgp-prefix-sid-03>`_
1849 * `Connecting IPv6 Islands over IPv4 MPLS Using IPv6 Provider Edge Routers (6PE) <https://tools.ietf.org/html/rfc4798>`_
1850 * `BGP-Prefix Segment in large-scale data centers <https://tools.ietf.org/html/draft-ietf-spring-segment-routing-msdc-01>`_
1851 * `Egress Peer Engineering using BGP-LU <https://tools.ietf.org/html/draft-gredler-idr-bgplu-epe-06>`_
1855 The BGP/MPLS IP Virtual Private Networks (BGP L3VPN) Multiprotocol extension can be used to exchange particular VPN (customer) routes among the provider's routers attached to that VPN.
1856 Also, routes are distributed to specific VPN remote sites.
1858 .. contents:: Contents
1864 This section shows a way to enable IPv4 and IPv6 L3VPN family in BGP speaker and peer configuration.
1868 To enable IPv4 and IPv6 L3VPN support in BGP plugin, first configure BGP speaker instance:
1870 **URL:** ``/restconf/config/openconfig-network-instance:network-instances/network-instance/global-bgp/openconfig-network-instance:protocols``
1872 **Method:** ``POST``
1874 **Content-Type:** ``application/xml``
1880 <protocol xmlns="http://openconfig.net/yang/network-instance">
1881 <name>bgp-example</name>
1882 <identifier xmlns:x="http://openconfig.net/yang/policy-types">x:BGP</identifier>
1883 <bgp xmlns="urn:opendaylight:params:xml:ns:yang:bgp:openconfig-extensions">
1886 <router-id>192.0.2.2</router-id>
1891 <afi-safi-name xmlns:x="http://openconfig.net/yang/bgp-types">x:L3VPN-IPV4-UNICAST</afi-safi-name>
1894 <afi-safi-name xmlns:x="http://openconfig.net/yang/bgp-types">x:L3VPN-IPV6-UNICAST</afi-safi-name>
1903 Here is an example for BGP peer configuration with enabled IPv4 and IPv6 L3VPN family.
1905 **URL:** ``/restconf/config/openconfig-network-instance:network-instances/network-instance/global-bgp/openconfig-network-instance:protocols/protocol/openconfig-policy-types:BGP/bgp-example/bgp/neighbors``
1907 **Method:** ``POST``
1909 **Content-Type:** ``application/xml``
1915 <neighbor xmlns="urn:opendaylight:params:xml:ns:yang:bgp:openconfig-extensions">
1916 <neighbor-address>192.0.2.1</neighbor-address>
1919 <afi-safi-name xmlns:x="http://openconfig.net/yang/bgp-types">x:L3VPN-IPV4-UNICAST</afi-safi-name>
1922 <afi-safi-name xmlns:x="http://openconfig.net/yang/bgp-types">x:L3VPN-IPV6-UNICAST</afi-safi-name>
1929 Following trees illustrate the BGP IP L3VPN routes structures.
1933 .. code-block:: console
1935 :(vpn-ipv4-routes-case)
1936 +--ro vpn-ipv4-routes
1937 +--ro vpn-route* [route-key]
1938 +--ro route-key string
1940 | +--ro label-value? netc:mpls-label
1941 +--ro prefix? inet:ip-prefix
1942 +--ro path-id? path-id
1943 +--ro route-distinguisher? bgp-t:route-distinguisher
1949 .. code-block:: console
1951 :(vpn-ipv6-routes-case)
1952 +--ro vpn-ipv6-routes
1953 +--ro vpn-route* [route-key]
1954 +--ro route-key string
1956 | +--ro label-value? netc:mpls-label
1957 +--ro prefix? inet:ip-prefix
1958 +--ro path-id? path-id
1959 +--ro route-distinguisher? bgp-t:route-distinguisher
1967 The IPv4 L3VPN table in an instance of the speaker's Loc-RIB can be verified via REST:
1969 **URL:** ``/restconf/operational/bgp-rib:bgp-rib/rib/bgp-example/loc-rib/tables/bgp-types:ipv4-address-family/bgp-types:mpls-labeled-vpn-subsequent-address-family/bgp-vpn-ipv4:vpn-ipv4-routes``
1977 <vpn-ipv4-routes xmlns="urn:opendaylight:params:xml:ns:yang:bgp-vpn-ipv4">
1979 <route-key>cAXdYQABrBAALABlCgIi</route-key>
1981 <label-value>24022</label-value>
1984 <extended-communities>
1985 <transitive>true</transitive>
1986 <route-target-extended-community>
1987 <global-administrator>65000</global-administrator>
1988 <local-administrator>AAAAZQ==</local-administrator>
1989 </route-target-extended-community>
1990 </extended-communities>
1999 <global>127.16.0.44</global>
2002 <route-distinguisher>172.16.0.44:101</route-distinguisher>
2003 <prefix>10.2.34.0/24</prefix>
2009 The IPv6 L3VPN table in an instance of the speaker's Loc-RIB can be verified via REST:
2011 **URL:** ``/restconf/operational/bgp-rib:bgp-rib/rib/bgp-example/loc-rib/tables/bgp-types:ipv6-address-family/bgp-types:mpls-labeled-vpn-subsequent-address-family/bgp-vpn-ipv6:vpn-ipv6-routes``
2019 <vpn-ipv6-routes xmlns="urn:opendaylight:params:xml:ns:yang:bgp-vpn-ipv6">
2021 <route-key>mAXdcQABrBAALABlKgILgAAAAAE=</route-key>
2023 <label-value>24023</label-value>
2029 <extended-communities>
2030 <route-target-extended-community>
2031 <global-administrator>65000</global-administrator>
2032 <local-administrator>AAAAZQ==</local-administrator>
2033 </route-target-extended-community>
2034 <transitive>true</transitive>
2035 </extended-communities>
2037 <global>2a02:b80:0:2::1</global>
2044 <route-distinguisher>172.16.0.44:101</route-distinguisher>
2045 <prefix>2a02:b80:0:1::/64</prefix>
2051 This examples show how to originate and remove IPv4 L3VPN route via programmable RIB.
2052 Make sure the *Application Peer* is configured first.
2054 **URL:** ``/restconf/config/bgp-rib:application-rib/10.25.1.9/tables/bgp-types:ipv4-address-family/bgp-types:mpls-labeled-vpn-subsequent-address-family/bgp-vpn-ipv4:vpn-ipv4-routes``
2056 **Method:** ``POST``
2058 **Content-Type:** ``application/xml``
2064 <vpn-route xmlns="urn:opendaylight:params:xml:ns:yang:bgp-vpn-ipv4">
2065 <route-key>vpn1</route-key>
2067 <label-value>123</label-value>
2069 <route-distinguisher>429496729:1</route-distinguisher>
2070 <prefix>2.2.2.2/32</prefix>
2073 <global>199.20.166.41</global>
2079 <extended-communities>
2080 <route-target-extended-community>
2081 <global-administrator>65000</global-administrator>
2082 <local-administrator>AAAAZQ==</local-administrator>
2083 </route-target-extended-community>
2084 <transitive>true</transitive>
2085 </extended-communities>
2091 To remove the route added above, following request can be used:
2093 **URL:** ``/restconf/config/bgp-rib:application-rib/10.25.1.9/tables/bgp-types:ipv4-address-family/bgp-types:mpls-labeled-vpn-subsequent-address-family/bgp-vpn-ipv4:vpn-ipv4-routes/vpn-route/vpn1``
2095 **Method:** ``DELETE``
2099 * `BGP/MPLS IP Virtual Private Networks (VPNs) <https://tools.ietf.org/html/rfc4364>`_
2100 * `BGP-MPLS IP Virtual Private Network (VPN) Extension for IPv6 VPN <https://tools.ietf.org/html/rfc4659>`_
2101 * `BGP/MPLS VPN Virtual PE <https://tools.ietf.org/html/draft-ietf-bess-virtual-pe-00>`_
2105 The BGP Link-State (BGP-LS) Multiprotocol extension allows to distribute Link-State and Traffic Engineering (TE) information.
2106 This information is typically distributed by IGP routing protocols with in the network, limiting LSDB or TED visibility to the IGP area.
2107 The BGP-LS-enabled routers are capable to collect such information from networks (multiple IGP areas, inter-AS) and share with external components (i.e. OpenDaylight BGP).
2108 The information is applicable in ALTO servers and PCEs, as both need to gather information about topologies.
2109 In addition, link-state information is extended to carry segment information (Spring).
2111 .. contents:: Contents
2117 This section shows a way to enable IPv4 and IPv6 Labeled Unicast family in BGP speaker and peer configuration.
2121 To enable BGP-LS support in BGP plugin, first configure BGP speaker instance:
2123 **URL:** ``/restconf/config/openconfig-network-instance:network-instances/network-instance/global-bgp/openconfig-network-instance:protocols``
2125 **Method:** ``POST``
2127 **Content-Type:** ``application/xml``
2133 <protocol xmlns="http://openconfig.net/yang/network-instance">
2134 <name>bgp-example</name>
2135 <identifier xmlns:x="http://openconfig.net/yang/policy-types">x:BGP</identifier>
2136 <bgp xmlns="urn:opendaylight:params:xml:ns:yang:bgp:openconfig-extensions">
2139 <router-id>192.0.2.2</router-id>
2144 <afi-safi-name>LINKSTATE</afi-safi-name>
2151 Linkstate path attribute
2152 ''''''''''''''''''''''''
2153 IANA allocation for BGP-LS path attribute is TYPE 29.
2154 Some older BGP-LS implementations might still require earliest asigned allocation TYPE 99.
2155 To use TYPE = 99, you need to set value bellow to false.
2157 **URL:** ``/restconf/config/bgp-linkstate-app-config:bgp-linkstate-app-config``
2161 **Content-Type:** ``application/xml``
2167 <bgp-linkstate-app-config xmlns="urn:opendaylight:params:xml:ns:yang:controller:bgp:linkstate-app-config">
2168 <iana-linkstate-attribute-type>false</iana-linkstate-attribute-type>
2169 </bgp-linkstate-app-config>
2173 Here is an example for BGP peer configuration with enabled BGP-LS family.
2175 **URL:** ``/restconf/config/openconfig-network-instance:network-instances/network-instance/global-bgp/openconfig-network-instance:protocols/protocol/openconfig-policy-types:BGP/bgp-example/bgp/neighbors``
2177 **Method:** ``POST``
2179 **Content-Type:** ``application/xml``
2185 <neighbor xmlns="urn:opendaylight:params:xml:ns:yang:bgp:openconfig-extensions">
2186 <neighbor-address>192.0.2.1</neighbor-address>
2189 <afi-safi-name>LINKSTATE</afi-safi-name>
2194 Link-State Route API
2195 ^^^^^^^^^^^^^^^^^^^^
2196 Following tree illustrate the BGP Link-State route structure.
2198 .. code-block:: console
2200 :(linkstate-routes-case)
2201 +--ro linkstate-routes
2202 +--ro linkstate-route* [route-key]
2203 +--ro route-key binary
2204 +--ro protocol-id protocol-id
2205 +--ro identifier identifier
2206 +--ro (object-type)?
2208 | | +--ro node-descriptors
2209 | | +--ro as-number? inet:as-number
2210 | | +--ro area-id? area-identifier
2211 | | +--ro domain-id? domain-identifier
2212 | | +--ro (c-router-identifier)?
2213 | | +--:(isis-node-case)
2214 | | | +--ro isis-node
2215 | | | +--ro iso-system-id netc:iso-system-identifier
2216 | | +--:(isis-pseudonode-case)
2217 | | | +--ro isis-pseudonode
2218 | | | +--ro is-is-router-identifier
2219 | | | | +--ro iso-system-id netc:iso-system-identifier
2220 | | | +--ro psn uint8
2221 | | +--:(ospf-node-case)
2222 | | | +--ro ospf-node
2223 | | | +--ro ospf-router-id uint32
2224 | | +--:(ospf-pseudonode-case)
2225 | | +--ro ospf-pseudonode
2226 | | +--ro ospf-router-id uint32
2227 | | +--ro lan-interface ospf-interface-identifier
2229 | | +--ro local-node-descriptors
2230 | | | +--ro as-number? inet:as-number
2231 | | | +--ro area-id? area-identifier
2232 | | | +--ro domain-id? domain-identifier
2233 | | | +--ro (c-router-identifier)?
2234 | | | | +--:(isis-node-case)
2235 | | | | | +--ro isis-node
2236 | | | | | +--ro iso-system-id netc:iso-system-identifier
2237 | | | | +--:(isis-pseudonode-case)
2238 | | | | | +--ro isis-pseudonode
2239 | | | | | +--ro is-is-router-identifier
2240 | | | | | | +--ro iso-system-id netc:iso-system-identifier
2241 | | | | | +--ro psn uint8
2242 | | | | +--:(ospf-node-case)
2243 | | | | | +--ro ospf-node
2244 | | | | | +--ro ospf-router-id uint32
2245 | | | | +--:(ospf-pseudonode-case)
2246 | | | | +--ro ospf-pseudonode
2247 | | | | +--ro ospf-router-id uint32
2248 | | | | +--ro lan-interface ospf-interface-identifier
2249 | | | +--ro bgp-router-id? inet:ipv4-address
2250 | | | +--ro member-asn? inet:as-number
2251 | | +--ro remote-node-descriptors
2252 | | | +--ro as-number? inet:as-number
2253 | | | +--ro area-id? area-identifier
2254 | | | +--ro domain-id? domain-identifier
2255 | | | +--ro (c-router-identifier)?
2256 | | | | +--:(isis-node-case)
2257 | | | | | +--ro isis-node
2258 | | | | | +--ro iso-system-id netc:iso-system-identifier
2259 | | | | +--:(isis-pseudonode-case)
2260 | | | | | +--ro isis-pseudonode
2261 | | | | | +--ro is-is-router-identifier
2262 | | | | | | +--ro iso-system-id netc:iso-system-identifier
2263 | | | | | +--ro psn uint8
2264 | | | | +--:(ospf-node-case)
2265 | | | | | +--ro ospf-node
2266 | | | | | +--ro ospf-router-id uint32
2267 | | | | +--:(ospf-pseudonode-case)
2268 | | | | +--ro ospf-pseudonode
2269 | | | | +--ro ospf-router-id uint32
2270 | | | | +--ro lan-interface ospf-interface-identifier
2271 | | | +--ro bgp-router-id? inet:ipv4-address
2272 | | | +--ro member-asn? inet:as-number
2273 | | +--ro link-descriptors
2274 | | +--ro link-local-identifier? uint32
2275 | | +--ro link-remote-identifier? uint32
2276 | | +--ro ipv4-interface-address? ipv4-interface-identifier
2277 | | +--ro ipv6-interface-address? ipv6-interface-identifier
2278 | | +--ro ipv4-neighbor-address? ipv4-interface-identifier
2279 | | +--ro ipv6-neighbor-address? ipv6-interface-identifier
2280 | | +--ro multi-topology-id? topology-identifier
2282 | | +--ro advertising-node-descriptors
2283 | | | +--ro as-number? inet:as-number
2284 | | | +--ro area-id? area-identifier
2285 | | | +--ro domain-id? domain-identifier
2286 | | | +--ro (c-router-identifier)?
2287 | | | +--:(isis-node-case)
2288 | | | | +--ro isis-node
2289 | | | | +--ro iso-system-id netc:iso-system-identifier
2290 | | | +--:(isis-pseudonode-case)
2291 | | | | +--ro isis-pseudonode
2292 | | | | +--ro is-is-router-identifier
2293 | | | | | +--ro iso-system-id netc:iso-system-identifier
2294 | | | | +--ro psn uint8
2295 | | | +--:(ospf-node-case)
2296 | | | | +--ro ospf-node
2297 | | | | +--ro ospf-router-id uint32
2298 | | | +--:(ospf-pseudonode-case)
2299 | | | +--ro ospf-pseudonode
2300 | | | +--ro ospf-router-id uint32
2301 | | | +--ro lan-interface ospf-interface-identifier
2302 | | +--ro prefix-descriptors
2303 | | +--ro multi-topology-id? topology-identifier
2304 | | +--ro ospf-route-type? ospf-route-type
2305 | | +--ro ip-reachability-information? inet:ip-prefix
2307 | +--ro (address-family)?
2309 | | | +--ro ipv4-tunnel-sender-address inet:ipv4-address
2310 | | | +--ro ipv4-tunnel-endpoint-address inet:ipv4-address
2312 | | +--ro ipv6-tunnel-sender-address inet:ipv6-address
2313 | | +--ro ipv6-tunnel-endpoint-address inet:ipv6-address
2314 | +--ro tunnel-id? rsvp:tunnel-id
2315 | +--ro lsp-id? rsvp:lsp-id
2317 +--ro (link-state-attribute)?
2318 +--:(node-attributes-case)
2319 | +--ro node-attributes
2320 | +--ro topology-identifier* topology-identifier
2321 | +--ro node-flags? node-flag-bits
2322 | +--ro isis-area-id* isis-area-identifier
2323 | +--ro dynamic-hostname? string
2324 | +--ro ipv4-router-id? ipv4-router-identifier
2325 | +--ro ipv6-router-id? ipv6-router-identifier
2326 | +--ro sr-capabilities
2327 | | +--ro mpls-ipv4? boolean
2328 | | +--ro mpls-ipv6? boolean
2329 | | +--ro sr-ipv6? boolean
2330 | | +--ro range-size? uint32
2331 | | +--ro (sid-label-index)?
2332 | | +--:(local-label-case)
2333 | | | +--ro local-label? netc:mpls-label
2334 | | +--:(ipv6-address-case)
2335 | | | +--ro ipv6-address? inet:ipv6-address
2337 | | +--ro sid? uint32
2338 | +--ro sr-algorithm
2339 | +--ro algorithms* algorithm
2340 +--:(link-attributes-case)
2341 | +--ro link-attributes
2342 | +--ro local-ipv4-router-id? ipv4-router-identifier
2343 | +--ro local-ipv6-router-id? ipv6-router-identifier
2344 | +--ro remote-ipv4-router-id? ipv4-router-identifier
2345 | +--ro remote-ipv6-router-id? ipv6-router-identifier
2346 | +--ro mpls-protocol? mpls-protocol-mask
2347 | +--ro te-metric? netc:te-metric
2348 | +--ro metric? netc:metric
2349 | +--ro shared-risk-link-groups* rsvp:srlg-id
2350 | +--ro link-name? string
2351 | +--ro max-link-bandwidth? netc:bandwidth
2352 | +--ro max-reservable-bandwidth? netc:bandwidth
2353 | +--ro unreserved-bandwidth* [priority]
2354 | | +--ro priority uint8
2355 | | +--ro bandwidth? netc:bandwidth
2356 | +--ro link-protection? link-protection-type
2357 | +--ro admin-group? administrative-group
2360 | | | +--:(ospf-adj-flags-case)
2361 | | | | +--ro backup? boolean
2362 | | | | +--ro set? boolean
2363 | | | +--:(isis-adj-flags-case)
2364 | | | +--ro backup? boolean
2365 | | | +--ro set? boolean
2366 | | | +--ro address-family? boolean
2367 | | +--ro weight? weight
2368 | | +--ro (sid-label-index)?
2369 | | +--:(local-label-case)
2370 | | | +--ro local-label? netc:mpls-label
2371 | | +--:(ipv6-address-case)
2372 | | | +--ro ipv6-address? inet:ipv6-address
2374 | | +--ro sid? uint32
2375 | +--ro sr-lan-adj-ids*
2377 | | | +--:(ospf-adj-flags-case)
2378 | | | | +--ro backup? boolean
2379 | | | | +--ro set? boolean
2380 | | | +--:(isis-adj-flags-case)
2381 | | | +--ro backup? boolean
2382 | | | +--ro set? boolean
2383 | | | +--ro address-family? boolean
2384 | | +--ro weight? weight
2385 | | +--ro iso-system-id? netc:iso-system-identifier
2386 | | +--ro neighbor-id? inet:ipv4-address
2387 | | +--ro (sid-label-index)?
2388 | | +--:(local-label-case)
2389 | | | +--ro local-label? netc:mpls-label
2390 | | +--:(ipv6-address-case)
2391 | | | +--ro ipv6-address? inet:ipv6-address
2393 | | +--ro sid? uint32
2394 | +--ro peer-node-sid
2395 | | +--ro weight? weight
2396 | | +--ro (sid-label-index)?
2397 | | +--:(local-label-case)
2398 | | | +--ro local-label? netc:mpls-label
2399 | | +--:(ipv6-address-case)
2400 | | | +--ro ipv6-address? inet:ipv6-address
2402 | | +--ro sid? uint32
2403 | +--ro peer-adj-sid
2404 | | +--ro weight? weight
2405 | | +--ro (sid-label-index)?
2406 | | +--:(local-label-case)
2407 | | | +--ro local-label? netc:mpls-label
2408 | | +--:(ipv6-address-case)
2409 | | | +--ro ipv6-address? inet:ipv6-address
2411 | | +--ro sid? uint32
2412 | +--ro peer-set-sids*
2413 | +--ro weight? weight
2414 | +--ro (sid-label-index)?
2415 | +--:(local-label-case)
2416 | | +--ro local-label? netc:mpls-label
2417 | +--:(ipv6-address-case)
2418 | | +--ro ipv6-address? inet:ipv6-address
2421 +--:(prefix-attributes-case)
2422 | +--ro prefix-attributes
2424 | | x--ro up-down? bits
2425 | | +--ro is-is-up-down? boolean
2426 | | +--ro ospf-no-unicast? boolean
2427 | | +--ro ospf-local-address? boolean
2428 | | +--ro ospf-propagate-nssa? boolean
2429 | +--ro route-tags* route-tag
2430 | +--ro extended-tags* extended-route-tag
2431 | +--ro prefix-metric? netc:igp-metric
2432 | +--ro ospf-forwarding-address? inet:ip-address
2435 | | | +--:(isis-prefix-flags-case)
2436 | | | | +--ro no-php? boolean
2437 | | | | +--ro explicit-null? boolean
2438 | | | | +--ro readvertisement? boolean
2439 | | | | +--ro node-sid? boolean
2440 | | | +--:(ospf-prefix-flags-case)
2441 | | | +--ro no-php? boolean
2442 | | | +--ro explicit-null? boolean
2443 | | | +--ro mapping-server? boolean
2444 | | +--ro algorithm? algorithm
2445 | | +--ro (sid-label-index)?
2446 | | +--:(local-label-case)
2447 | | | +--ro local-label? netc:mpls-label
2448 | | +--:(ipv6-address-case)
2449 | | | +--ro ipv6-address? inet:ipv6-address
2451 | | +--ro sid? uint32
2452 | +--ro ipv6-sr-prefix
2453 | | +--ro algorithm? algorithm
2455 | | +--ro inter-area? boolean
2456 | | +--ro range-size? uint16
2458 | | +--ro (range-sub-tlv)?
2459 | | +--:(binding-sid-tlv-case)
2460 | | | +--ro weight? weight
2461 | | | +--ro (flags)?
2462 | | | | +--:(isis-binding-flags-case)
2463 | | | | | +--ro address-family? boolean
2464 | | | | | +--ro mirror-context? boolean
2465 | | | | | +--ro spread-tlv? boolean
2466 | | | | | +--ro leaked-from-level-2? boolean
2467 | | | | | +--ro attached-flag? boolean
2468 | | | | +--:(ospf-binding-flags-case)
2469 | | | | +--ro mirroring? boolean
2470 | | | +--ro binding-sub-tlvs*
2471 | | | +--ro (binding-sub-tlv)?
2472 | | | +--:(prefix-sid-case)
2473 | | | | +--ro (flags)?
2474 | | | | | +--:(isis-prefix-flags-case)
2475 | | | | | | +--ro no-php? boolean
2476 | | | | | | +--ro explicit-null? boolean
2477 | | | | | | +--ro readvertisement? boolean
2478 | | | | | | +--ro node-sid? boolean
2479 | | | | | +--:(ospf-prefix-flags-case)
2480 | | | | | +--ro no-php? boolean
2481 | | | | | +--ro explicit-null? boolean
2482 | | | | | +--ro mapping-server? boolean
2483 | | | | +--ro algorithm? algorithm
2484 | | | | +--ro (sid-label-index)?
2485 | | | | +--:(local-label-case)
2486 | | | | | +--ro local-label? netc:mpls-label
2487 | | | | +--:(ipv6-address-case)
2488 | | | | | +--ro ipv6-address? inet:ipv6-address
2489 | | | | +--:(sid-case)
2490 | | | | +--ro sid? uint32
2491 | | | +--:(ipv6-prefix-sid-case)
2492 | | | | +--ro algorithm? algorithm
2493 | | | +--:(sid-label-case)
2494 | | | | +--ro (sid-label-index)?
2495 | | | | +--:(local-label-case)
2496 | | | | | +--ro local-label? netc:mpls-label
2497 | | | | +--:(ipv6-address-case)
2498 | | | | | +--ro ipv6-address? inet:ipv6-address
2499 | | | | +--:(sid-case)
2500 | | | | +--ro sid? uint32
2501 | | | +--:(ero-metric-case)
2502 | | | | +--ro ero-metric? netc:te-metric
2503 | | | +--:(ipv4-ero-case)
2504 | | | | +--ro loose? boolean
2505 | | | | +--ro address inet:ipv4-address
2506 | | | +--:(ipv6-ero-case)
2507 | | | | +--ro loose? boolean
2508 | | | | +--ro address inet:ipv6-address
2509 | | | +--:(unnumbered-interface-id-ero-case)
2510 | | | | +--ro loose? boolean
2511 | | | | +--ro router-id? uint32
2512 | | | | +--ro interface-id? uint32
2513 | | | +--:(ipv4-ero-backup-case)
2514 | | | | +--ro loose? boolean
2515 | | | | +--ro address inet:ipv4-address
2516 | | | +--:(ipv6-ero-backup-case)
2517 | | | | +--ro loose? boolean
2518 | | | | +--ro address inet:ipv6-address
2519 | | | +--:(unnumbered-interface-id-backup-ero-case)
2520 | | | +--ro loose? boolean
2521 | | | +--ro router-id? uint32
2522 | | | +--ro interface-id? uint32
2523 | | +--:(prefix-sid-tlv-case)
2524 | | | +--ro (flags)?
2525 | | | | +--:(isis-prefix-flags-case)
2526 | | | | | +--ro no-php? boolean
2527 | | | | | +--ro explicit-null? boolean
2528 | | | | | +--ro readvertisement? boolean
2529 | | | | | +--ro node-sid? boolean
2530 | | | | +--:(ospf-prefix-flags-case)
2531 | | | | +--ro no-php? boolean
2532 | | | | +--ro explicit-null? boolean
2533 | | | | +--ro mapping-server? boolean
2534 | | | +--ro algorithm? algorithm
2535 | | | +--ro (sid-label-index)?
2536 | | | +--:(local-label-case)
2537 | | | | +--ro local-label? netc:mpls-label
2538 | | | +--:(ipv6-address-case)
2539 | | | | +--ro ipv6-address? inet:ipv6-address
2540 | | | +--:(sid-case)
2541 | | | +--ro sid? uint32
2542 | | +--:(ipv6-prefix-sid-tlv-case)
2543 | | | +--ro algorithm? algorithm
2544 | | +--:(sid-label-tlv-case)
2545 | | +--ro (sid-label-index)?
2546 | | +--:(local-label-case)
2547 | | | +--ro local-label? netc:mpls-label
2548 | | +--:(ipv6-address-case)
2549 | | | +--ro ipv6-address? inet:ipv6-address
2551 | | +--ro sid? uint32
2552 | +--ro sr-binding-sid-labels*
2553 | +--ro weight? weight
2555 | | +--:(isis-binding-flags-case)
2556 | | | +--ro address-family? boolean
2557 | | | +--ro mirror-context? boolean
2558 | | | +--ro spread-tlv? boolean
2559 | | | +--ro leaked-from-level-2? boolean
2560 | | | +--ro attached-flag? boolean
2561 | | +--:(ospf-binding-flags-case)
2562 | | +--ro mirroring? boolean
2563 | +--ro binding-sub-tlvs*
2564 | +--ro (binding-sub-tlv)?
2565 | +--:(prefix-sid-case)
2567 | | | +--:(isis-prefix-flags-case)
2568 | | | | +--ro no-php? boolean
2569 | | | | +--ro explicit-null? boolean
2570 | | | | +--ro readvertisement? boolean
2571 | | | | +--ro node-sid? boolean
2572 | | | +--:(ospf-prefix-flags-case)
2573 | | | +--ro no-php? boolean
2574 | | | +--ro explicit-null? boolean
2575 | | | +--ro mapping-server? boolean
2576 | | +--ro algorithm? algorithm
2577 | | +--ro (sid-label-index)?
2578 | | +--:(local-label-case)
2579 | | | +--ro local-label? netc:mpls-label
2580 | | +--:(ipv6-address-case)
2581 | | | +--ro ipv6-address? inet:ipv6-address
2583 | | +--ro sid? uint32
2584 | +--:(ipv6-prefix-sid-case)
2585 | | +--ro algorithm? algorithm
2586 | +--:(sid-label-case)
2587 | | +--ro (sid-label-index)?
2588 | | +--:(local-label-case)
2589 | | | +--ro local-label? netc:mpls-label
2590 | | +--:(ipv6-address-case)
2591 | | | +--ro ipv6-address? inet:ipv6-address
2593 | | +--ro sid? uint32
2594 | +--:(ero-metric-case)
2595 | | +--ro ero-metric? netc:te-metric
2596 | +--:(ipv4-ero-case)
2597 | | +--ro loose? boolean
2598 | | +--ro address inet:ipv4-address
2599 | +--:(ipv6-ero-case)
2600 | | +--ro loose? boolean
2601 | | +--ro address inet:ipv6-address
2602 | +--:(unnumbered-interface-id-ero-case)
2603 | | +--ro loose? boolean
2604 | | +--ro router-id? uint32
2605 | | +--ro interface-id? uint32
2606 | +--:(ipv4-ero-backup-case)
2607 | | +--ro loose? boolean
2608 | | +--ro address inet:ipv4-address
2609 | +--:(ipv6-ero-backup-case)
2610 | | +--ro loose? boolean
2611 | | +--ro address inet:ipv6-address
2612 | +--:(unnumbered-interface-id-backup-ero-case)
2613 | +--ro loose? boolean
2614 | +--ro router-id? uint32
2615 | +--ro interface-id? uint32
2616 x--:(te-lsp-attributes-case)
2617 +--ro te-lsp-attributes
2622 The Link-State table in a instance of the speaker's Loc-RIB can be verified via REST:
2624 **URL:** ``/restconf/operational/bgp-rib:bgp-rib/rib/bgp-example/loc-rib/tables/bgp-linkstate:linkstate-address-family/bgp-linkstate:linkstate-subsequent-address-family/linkstate-routes``
2632 <linkstate-routes xmlns="urn:opendaylight:params:xml:ns:yang:bgp-linkstate">
2636 .. note:: Link-State routes mapping to topology links/nodes/prefixes is supported by BGP Topology Provider.
2640 * `North-Bound Distribution of Link-State and Traffic Engineering (TE) Information Using BGP <https://tools.ietf.org/html/rfc7752>`_
2641 * `BGP Link-State extensions for Segment Routing <https://tools.ietf.org/html/draft-gredler-idr-bgp-ls-segment-routing-ext-03>`_
2642 * `Segment Routing BGP Egress Peer Engineering BGP-LS Extensions <https://tools.ietf.org/html/draft-ietf-idr-bgpls-segment-routing-epe-05>`_
2643 * `BGP Link-State Information Distribution Implementation Report <https://tools.ietf.org/html/draft-ietf-idr-ls-distribution-impl-04>`_
2645 Flow Specification Family
2646 -------------------------
2647 The BGP Flow Specification (BGP-FS) Multiprotocol extension can be used to distribute traffic flow specifications.
2648 For example, the BGP-FS can be used in a case of (distributed) denial-of-service (DDoS) attack mitigation procedures and traffic filtering (BGP/MPLS VPN service, DC).
2650 .. contents:: Contents
2656 This section shows a way to enable BGP-FS family in BGP speaker and peer configuration.
2660 To enable BGP-FS support in BGP plugin, first configure BGP speaker instance:
2662 **URL:** ``/restconf/config/openconfig-network-instance:network-instances/network-instance/global-bgp/openconfig-network-instance:protocols``
2664 **Method:** ``POST``
2666 **Content-Type:** ``application/xml``
2672 <protocol xmlns="http://openconfig.net/yang/network-instance">
2673 <name>bgp-example</name>
2674 <identifier xmlns:x="http://openconfig.net/yang/policy-types">x:BGP</identifier>
2675 <bgp xmlns="urn:opendaylight:params:xml:ns:yang:bgp:openconfig-extensions">
2678 <router-id>192.0.2.2</router-id>
2683 <afi-safi-name>IPV4-FLOW</afi-safi-name>
2686 <afi-safi-name>IPV6-FLOW</afi-safi-name>
2689 <afi-safi-name>IPV4-L3VPN-FLOW</afi-safi-name>
2692 <afi-safi-name>IPV6-L3VPN-FLOW</afi-safi-name>
2701 Here is an example for BGP peer configuration with enabled BGP-FS family.
2703 **URL:** ``/restconf/config/openconfig-network-instance:network-instances/network-instance/global-bgp/openconfig-network-instance:protocols/protocol/openconfig-policy-types:BGP/bgp-example/bgp/neighbors``
2705 **Method:** ``POST``
2707 **Content-Type:** ``application/xml``
2713 <neighbor xmlns="urn:opendaylight:params:xml:ns:yang:bgp:openconfig-extensions">
2714 <neighbor-address>192.0.2.1</neighbor-address>
2717 <afi-safi-name>IPV4-FLOW</afi-safi-name>
2720 <afi-safi-name>IPV6-FLOW</afi-safi-name>
2723 <afi-safi-name>IPV4-L3VPN-FLOW</afi-safi-name>
2726 <afi-safi-name>IPV6-L3VPN-FLOW</afi-safi-name>
2731 Flow Specification API
2732 ^^^^^^^^^^^^^^^^^^^^^^
2733 Following trees illustrate the BGP Flow Specification routes structure.
2735 IPv4 Flow Specification Route
2736 '''''''''''''''''''''''''''''
2737 .. code-block:: console
2739 :(flowspec-routes-case)
2740 +--ro flowspec-routes
2741 +--ro flowspec-route* [route-key path-id]
2742 +--ro route-key string
2744 | +--ro (flowspec-type)?
2747 | | +--ro op? numeric-operand
2748 | | +--ro value? uint16
2749 | +--:(destination-port-case)
2750 | | +--ro destination-ports*
2751 | | +--ro op? numeric-operand
2752 | | +--ro value? uint16
2753 | +--:(source-port-case)
2754 | | +--ro source-ports*
2755 | | +--ro op? numeric-operand
2756 | | +--ro value? uint16
2757 | +--:(icmp-type-case)
2759 | | +--ro op? numeric-operand
2760 | | +--ro value? uint8
2761 | +--:(icmp-code-case)
2763 | | +--ro op? numeric-operand
2764 | | +--ro value? uint8
2765 | +--:(tcp-flags-case)
2766 | | +--ro tcp-flags*
2767 | | +--ro op? bitmask-operand
2768 | | +--ro value? uint16
2769 | +--:(packet-length-case)
2770 | | +--ro packet-lengths*
2771 | | +--ro op? numeric-operand
2772 | | +--ro value? uint16
2775 | | +--ro op? numeric-operand
2776 | | +--ro value? dscp
2777 | +--:(fragment-case)
2778 | | +--ro fragments*
2779 | | +--ro op? bitmask-operand
2780 | | +--ro value? fragment
2781 | +--:(destination-prefix-case)
2782 | | +--ro destination-prefix? inet:ipv4-prefix
2783 | +--:(source-prefix-case)
2784 | | +--ro source-prefix? inet:ipv4-prefix
2785 | +--:(protocol-ip-case)
2786 | +--ro protocol-ips*
2787 | +--ro op? numeric-operand
2788 | +--ro value? uint8
2789 +--ro path-id path-id
2791 +--ro extended-communities*
2792 +--ro transitive? boolean
2793 +--ro (extended-community)?
2794 +--:(traffic-rate-extended-community-case)
2795 | +--ro traffic-rate-extended-community
2796 | +--ro informative-as? bgp-t:short-as-number
2797 | +--ro local-administrator? netc:bandwidth
2798 +--:(traffic-action-extended-community-case)
2799 | +--ro traffic-action-extended-community
2800 | +--ro sample? boolean
2801 | +--ro terminal-action? boolean
2802 +--:(redirect-extended-community-case)
2803 | +--ro redirect-extended-community
2804 | +--ro global-administrator? bgp-t:short-as-number
2805 | +--ro local-administrator? binary
2806 +--:(traffic-marking-extended-community-case)
2807 | +--ro traffic-marking-extended-community
2808 | +--ro global-administrator? dscp
2809 +--:(redirect-ipv4-extended-community-case)
2810 | +--ro redirect-ipv4
2811 | +--ro global-administrator? inet:ipv4-address
2812 | +--ro local-administrator? uint16
2813 +--:(redirect-as4-extended-community-case)
2814 | +--ro redirect-as4
2815 | +--ro global-administrator? inet:as-number
2816 | +--ro local-administrator? uint16
2817 +--:(redirect-ip-nh-extended-community-case)
2818 +--ro redirect-ip-nh-extended-community
2819 +--ro next-hop-address? inet:ip-address
2823 IPv6 Flow Specification Route
2824 '''''''''''''''''''''''''''''
2825 .. code-block:: console
2827 :(flowspec-ipv6-routes-case)
2828 +--ro flowspec-ipv6-routes
2829 +--ro flowspec-route* [route-key path-id]
2831 | +--ro (flowspec-type)?
2834 | | +--ro op? numeric-operand
2835 | | +--ro value? uint16
2836 | +--:(destination-port-case)
2837 | | +--ro destination-ports*
2838 | | +--ro op? numeric-operand
2839 | | +--ro value? uint16
2840 | +--:(source-port-case)
2841 | | +--ro source-ports*
2842 | | +--ro op? numeric-operand
2843 | | +--ro value? uint16
2844 | +--:(icmp-type-case)
2846 | | +--ro op? numeric-operand
2847 | | +--ro value? uint8
2848 | +--:(icmp-code-case)
2850 | | +--ro op? numeric-operand
2851 | | +--ro value? uint8
2852 | +--:(tcp-flags-case)
2853 | | +--ro tcp-flags*
2854 | | +--ro op? bitmask-operand
2855 | | +--ro value? uint16
2856 | +--:(packet-length-case)
2857 | | +--ro packet-lengths*
2858 | | +--ro op? numeric-operand
2859 | | +--ro value? uint16
2862 | | +--ro op? numeric-operand
2863 | | +--ro value? dscp
2864 | +--:(fragment-case)
2865 | | +--ro fragments*
2866 | | +--ro op? bitmask-operand
2867 | | +--ro value? fragment
2868 | +--:(destination-ipv6-prefix-case)
2869 | | +--ro destination-prefix? inet:ipv6-prefix
2870 | +--:(source-ipv6-prefix-case)
2871 | | +--ro source-prefix? inet:ipv6-prefix
2872 | +--:(next-header-case)
2873 | | +--ro next-headers*
2874 | | +--ro op? numeric-operand
2875 | | +--ro value? uint8
2876 | +--:(flow-label-case)
2878 | +--ro op? numeric-operand
2879 | +--ro value? uint32
2880 +--ro path-id path-id
2882 +--ro extended-communities*
2883 +--ro transitive? boolean
2884 +--ro (extended-community)?
2885 +--:(traffic-rate-extended-community-case)
2886 | +--ro traffic-rate-extended-community
2887 | +--ro informative-as? bgp-t:short-as-number
2888 | +--ro local-administrator? netc:bandwidth
2889 +--:(traffic-action-extended-community-case)
2890 | +--ro traffic-action-extended-community
2891 | +--ro sample? boolean
2892 | +--ro terminal-action? boolean
2893 +--:(redirect-extended-community-case)
2894 | +--ro redirect-extended-community
2895 | +--ro global-administrator? bgp-t:short-as-number
2896 | +--ro local-administrator? binary
2897 +--:(traffic-marking-extended-community-case)
2898 | +--ro traffic-marking-extended-community
2899 | +--ro global-administrator? dscp
2900 +--:(redirect-ipv6-extended-community-case)
2901 | +--ro redirect-ipv6
2902 | +--ro global-administrator? inet:ipv6-address
2903 | +--ro local-administrator? uint16
2904 +--:(redirect-as4-extended-community-case)
2905 | +--ro redirect-as4
2906 | +--ro global-administrator? inet:as-number
2907 | +--ro local-administrator? uint16
2908 +--:(redirect-ip-nh-extended-community-case)
2909 +--ro redirect-ip-nh-extended-community
2910 +--ro next-hop-address? inet:ip-address
2915 The flowspec route represents rules and an action, defined as an extended community.
2917 IPv4 Flow Specification
2918 '''''''''''''''''''''''
2919 The IPv4 Flowspec table in an instance of the speaker's Loc-RIB can be verified via REST:
2921 **URL:** ``/restconf/operational/bgp-rib:bgp-rib/rib/bgp-example/loc-rib/tables/bgp-types:ipv4-address-family/bgp-flowspec:flowspec-subsequent-address-family/bgp-flowspec:flowspec-routes``
2929 <flowspec-routes xmlns="urn:opendaylight:params:xml:ns:yang:bgp-flowspec">
2931 <path-id>0</path-id>
2932 <route-key>all packets to 192.168.0.1/32 AND from 10.0.0.2/32 AND where IP protocol equals to 17 or equals to 6 AND where port equals to 80 or equals to 8080 AND where destination port is greater than 8080 and is less than 8088 or equals to 3128 AND where source port is greater than 1024 </route-key>
2941 <extended-communities>
2942 <transitive>true</transitive>
2943 <redirect-extended-community>
2944 <local-administrator>AgMWLg==</local-administrator>
2945 <global-administrator>258</global-administrator>
2946 </redirect-extended-community>
2947 </extended-communities>
2950 <destination-prefix>192.168.0.1/32</destination-prefix>
2953 <source-prefix>10.0.0.2/32</source-prefix>
2961 <op>equals end-of-list</op>
2971 <op>equals end-of-list</op>
2977 <op>greater-than</op>
2979 </destination-ports>
2981 <op>less-than and-bit</op>
2983 </destination-ports>
2985 <op>equals end-of-list</op>
2987 </destination-ports>
2991 <op>end-of-list greater-than</op>
2998 IPv6 Flows Specification
2999 ''''''''''''''''''''''''
3000 The IPv6 Flowspec table in an instance of the speaker's Loc-RIB can be verified via REST:
3002 **URL:** ``/restconf/operational/bgp-rib:bgp-rib/rib/bgp-example/loc-rib/tables/bgp-types:ipv6-address-family/bgp-flowspec:flowspec-subsequent-address-family/bgp-flowspec:flowspec-ipv6-routes``
3010 <flowspec-ipv6-routes xmlns="urn:opendaylight:params:xml:ns:yang:bgp-flowspec">
3012 <path-id>0</path-id>
3013 <route-key>all packets to 2001:db8:31::/64 AND from 2001:db8:30::/64 AND where next header equals to 17 AND where DSCP equals to 50 AND where flow label equals to 2013 </route-key>
3022 <extended-communities>
3023 <transitive>true</transitive>
3024 <traffic-rate-extended-community>
3025 <informative-as>0</informative-as>
3026 <local-administrator>AAAAAA==</local-administrator>
3027 </traffic-rate-extended-community>
3028 </extended-communities>
3031 <destination-prefix>2001:db8:31::/64</destination-prefix>
3034 <source-prefix>2001:db8:30::/64</source-prefix>
3038 <op>equals end-of-list</op>
3044 <op>equals end-of-list</op>
3050 <op>equals end-of-list</op>
3055 </flowspec-ipv6-routes>
3057 IPv4 L3VPN Flows Specification
3058 ''''''''''''''''''''''''''''''
3059 The IPv4 L3VPN Flowspec table in an instance of the speaker's Loc-RIB can be verified via REST:
3061 **URL:** ``/restconf/operational/bgp-rib:bgp-rib/rib/bgp-example/loc-rib/tables/bgp-types:ipv4-address-family/bgp-flowspec:flowspec-l3vpn-subsequent-address-family/bgp-flowspec:flowspec-l3vpn-ipv4-routes``
3069 <flowspec-l3vpn-ipv4-routes xmlns="urn:opendaylight:params:xml:ns:yang:bgp-flowspec">
3070 <flowspec-l3vpn-route>
3071 <path-id>0</path-id>
3072 <route-key>[l3vpn with route-distinguisher 172.16.0.44:101] all packets from 10.0.0.3/32</route-key>
3078 <global>5.6.7.8</global>
3084 <extended-communities>
3085 <transitive>true</transitive>
3086 <redirect-ip-nh-extended-community>
3088 <next-hop-address>0.0.0.0</next-hop-address>
3089 </redirect-ip-nh-extended-community>
3090 </extended-communities>
3092 <route-distinguisher>172.16.0.44:101</route-distinguisher>
3094 <source-prefix>10.0.0.3/32</source-prefix>
3096 </flowspec-l3vpn-route>
3097 </flowspec-l3vpn-ipv4-routes>
3101 IPv4 Flow Specification
3102 '''''''''''''''''''''''
3103 This examples show how to originate and remove IPv4 fowspec route via programmable RIB.
3104 Make sure the *Application Peer* is configured first.
3106 **URL:** ``/restconf/config/bgp-rib:application-rib/10.25.1.9/tables/bgp-types:ipv4-address-family/bgp-flowspec:flowspec-subsequent-address-family/bgp-flowspec:flowspec-routes``
3108 **Method:** ``POST``
3110 **Content-Type:** ``application/xml``
3116 <flowspec-route xmlns="urn:opendaylight:params:xml:ns:yang:bgp-flowspec">
3117 <route-key>flow1</route-key>
3118 <path-id>0</path-id>
3120 <destination-prefix>192.168.0.1/32</destination-prefix>
3123 <source-prefix>10.0.0.1/32</source-prefix>
3127 <op>equals end-of-list</op>
3133 <op>equals end-of-list</op>
3139 <op>greater-than</op>
3141 </destination-ports>
3143 <op>and-bit less-than end-of-list</op>
3145 </destination-ports>
3149 <op>greater-than end-of-list</op>
3155 <op>equals end-of-list</op>
3161 <op>equals end-of-list</op>
3167 <op>match end-of-list</op>
3173 <op>greater-than</op>
3177 <op>and-bit less-than end-of-list</op>
3183 <op>equals end-of-list</op>
3189 <op>match end-of-list</op>
3190 <value>first</value>
3201 <extended-communities>
3203 </extended-communities>
3209 **Extended Communities**
3216 <extended-communities>
3217 <transitive>true</transitive>
3218 <traffic-rate-extended-community>
3219 <informative-as>123</informative-as>
3220 <local-administrator>AAAAAA==</local-administrator>
3221 </traffic-rate-extended-community>
3222 </extended-communities>
3224 @line 5: A rate in bytes per second, *AAAAAA==* (0) means traffic discard.
3226 * **Traffic Action**
3229 <extended-communities>
3230 <transitive>true</transitive>
3231 <traffic-action-extended-community>
3232 <sample>true</sample>
3233 <terminal-action>false</terminal-action>
3234 </traffic-action-extended-community>
3235 </extended-communities>
3238 * **Redirect to VRF AS 2byte format**
3241 <extended-communities>
3242 <transitive>true</transitive>
3243 <redirect-extended-community>
3244 <global-administrator>123</global-administrator>
3245 <local-administrator>AAAAew==</local-administrator>
3246 </redirect-extended-community>
3247 </extended-communities>
3249 * **Redirect to VRF IPv4 format**
3252 <extended-communities>
3253 <transitive>true</transitive>
3255 <global-administrator>192.168.0.1</global-administrator>
3256 <local-administrator>12345</local-administrator>
3258 </extended-communities>
3260 * **Redirect to VRF AS 4byte format**
3263 <extended-communities>
3264 <transitive>true</transitive>
3266 <global-administrator>64495</global-administrator>
3267 <local-administrator>12345</local-administrator>
3269 </extended-communities>
3271 * **Redirect to IP**
3274 <extended-communities>
3275 <transitive>true</transitive>
3276 <redirect-ip-nh-extended-community>
3278 </redirect-ip-nh-extended-community>
3279 </extended-communities>
3281 * **Traffic Marking**
3284 <extended-communities>
3285 <transitive>true</transitive>
3286 <traffic-marking-extended-community>
3287 <global-administrator>20</global-administrator>
3288 </traffic-marking-extended-community>
3289 </extended-communities>
3293 To remove the route added above, following request can be used:
3295 **URL:** ``/restconf/config/bgp-rib:application-rib/10.25.1.9/tables/bgp-types:ipv4-address-family/bgp-flowspec:flowspec-subsequent-address-family/bgp-flowspec:flowspec-routes/bgp-flowspec:flowspec-route/flow1/0``
3297 **Method:** ``DELETE``
3299 IPv4 L3VPN Flow Specification
3300 '''''''''''''''''''''''''''''
3301 This examples show how to originate and remove IPv4 L3VPN fowspec route via programmable RIB.
3303 **URL:** ``/restconf/config/bgp-rib:application-rib/10.25.1.9/tables/bgp-types:ipv4-address-family/bgp-flowspec:flowspec-l3vpn-subsequent-address-family/bgp-flowspec:flowspec-l3vpn-ipv4-routes``
3305 **Method:** ``POST``
3307 **Content-Type:** ``application/xml``
3313 <flowspec-l3vpn-route xmlns="urn:opendaylight:params:xml:ns:yang:bgp-flowspec">
3314 <path-id>0</path-id>
3315 <route-key>flow-l3vpn</route-key>
3316 <route-distinguisher>172.16.0.44:101</route-distinguisher>
3318 <source-prefix>10.0.0.3/32</source-prefix>
3328 <extended-communities>
3329 <transitive>true</transitive>
3331 <global-administrator>172.16.0.44</global-administrator>
3332 <local-administrator>102</local-administrator>
3334 </extended-communities>
3336 </flowspec-l3vpn-route>
3340 To remove the route added above, following request can be used:
3342 **URL:** ``/restconf/config/bgp-rib:application-rib/10.25.1.9/tables/bgp-types:ipv4-address-family/bgp-flowspec:flowspec-l3vpn-subsequent-address-family/bgp-flowspec:flowspec-l3vpn-ipv4-routes/flowspec-l3vpn-route/flow-l3vpn/0``
3344 **Method:** ``DELETE``
3346 IPv6 Flow Specification
3347 '''''''''''''''''''''''
3348 This examples show how to originate and remove IPv6 fowspec route via programmable RIB.
3350 **URL:** ``/restconf/config/bgp-rib:application-rib/10.25.1.9/tables/bgp-types:ipv6-address-family/bgp-flowspec:flowspec-subsequent-address-family/bgp-flowspec:flowspec-ipv6-routes``
3352 **Method:** ``POST``
3354 **Content-Type:** ``application/xml``
3360 <flowspec-route xmlns="urn:opendaylight:params:xml:ns:yang:bgp-flowspec">
3361 <route-key>flow-v6</route-key>
3362 <path-id>0</path-id>
3364 <destination-prefix>2001:db8:30::3/128</destination-prefix>
3367 <source-prefix>2001:db8:31::3/128</source-prefix>
3371 <op>equals end-of-list</op>
3376 <extended-communities>
3377 <transitive>true</transitive>
3379 <global-administrator>2001:db8:1::6</global-administrator>
3380 <local-administrator>12345</local-administrator>
3382 </extended-communities>
3395 To remove the route added above, following request can be used:
3397 **URL:** ``/restconf/config/bgp-rib:application-rib/10.25.1.9/tables/bgp-types:ipv6-address-family/bgp-flowspec:flowspec-subsequent-address-family/bgp-flowspec:flowspec-ipv6-routes/bgp-flowspec:flowspec-route/flow-v6/0``
3399 **Method:** ``DELETE``
3403 * `Dissemination of Flow Specification Rules <https://tools.ietf.org/html/rfc5575>`_
3404 * `Dissemination of Flow Specification Rules for IPv6 <https://tools.ietf.org/html/draft-ietf-idr-flow-spec-v6-07>`_
3405 * `BGP Flow-Spec Extended Community for Traffic Redirect to IP Next Hop <https://tools.ietf.org/html/draft-ietf-idr-flowspec-redirect-ip-00>`_
3406 * `Clarification of the Flowspec Redirect Extended Community <https://tools.ietf.org/html/rfc7674>`_
3407 * `Revised Validation Procedure for BGP Flow Specifications <https://tools.ietf.org/html/draft-ietf-idr-bgp-flowspec-oid-03>`_
3411 The BGP MPLS-Based Ethernet VPN (BGP EVPN) Multiprotocol extension can be used to distribute Ethernet L2VPN service related routes in order to support a concept of MAC routing.
3412 A major use-case for BGP EVPN is data-center interconnection (DCI), where advantage of BGP EVPN are MAC/IP address advertising across MPLS network, Multihoming functionality including Fast Convergence, Split Horizon and Aliasing support, VM (MAC) Mobility, support Multicast and Broadcast traffic.
3413 In addition to MPLS, IP tunnelling encapsulation techniques like VXLAN, NVGRE, MPLSoGRE and others can be used for packet transportation.
3414 Also, Provider Backbone Bridging (PBB) can be combined with EVPN in order to reduce a number of MAC Advertisement routes.
3416 .. contents:: Contents
3422 This section shows a way to enable EVPN family in BGP speaker and peer configuration.
3426 To enable EVPN support in BGP plugin, first configure BGP speaker instance:
3428 **URL:** ``/restconf/config/openconfig-network-instance:network-instances/network-instance/global-bgp/openconfig-network-instance:protocols``
3430 **Method:** ``POST``
3432 **Content-Type:** ``application/xml``
3438 <protocol xmlns="http://openconfig.net/yang/network-instance">
3439 <name>bgp-example</name>
3440 <identifier xmlns:x="http://openconfig.net/yang/policy-types">x:BGP</identifier>
3441 <bgp xmlns="urn:opendaylight:params:xml:ns:yang:bgp:openconfig-extensions">
3444 <router-id>192.0.2.2</router-id>
3449 <afi-safi-name xmlns:x="http://openconfig.net/yang/bgp-types">x:L2VPN-EVPN</afi-safi-name>
3458 Here is an example for BGP peer configuration with enabled EVPN family.
3460 **URL:** ``/restconf/config/openconfig-network-instance:network-instances/network-instance/global-bgp/openconfig-network-instance:protocols/protocol/openconfig-policy-types:BGP/bgp-example/bgp/neighbors``
3462 **Method:** ``POST``
3464 **Content-Type:** ``application/xml``
3470 <neighbor xmlns="urn:opendaylight:params:xml:ns:yang:bgp:openconfig-extensions">
3471 <neighbor-address>192.0.2.1</neighbor-address>
3474 <afi-safi-name xmlns:x="http://openconfig.net/yang/bgp-types">x:L2VPN-EVPN</afi-safi-name>
3481 Following tree illustrate the BGP EVPN route structure.
3483 .. code-block:: console
3487 +--ro evpn-route* [route-key]
3488 +--ro route-key string
3490 | +--:(ethernet-a-d-route-case)
3491 | | +--ro ethernet-a-d-route
3493 | | | +--:(arbitrary-case)
3494 | | | | +--ro arbitrary
3495 | | | | +--ro arbitrary binary
3496 | | | +--:(lacp-auto-generated-case)
3497 | | | | +--ro lacp-auto-generated
3498 | | | | +--ro ce-lacp-mac-address yang:mac-address
3499 | | | | +--ro ce-lacp-port-key uint16
3500 | | | +--:(lan-auto-generated-case)
3501 | | | | +--ro lan-auto-generated
3502 | | | | +--ro root-bridge-mac-address yang:mac-address
3503 | | | | +--ro root-bridge-priority uint16
3504 | | | +--:(mac-auto-generated-case)
3505 | | | | +--ro mac-auto-generated
3506 | | | | +--ro system-mac-address yang:mac-address
3507 | | | | +--ro local-discriminator uint24
3508 | | | +--:(router-id-generated-case)
3509 | | | | +--ro router-id-generated
3510 | | | | +--ro router-id inet:ipv4-address
3511 | | | | +--ro local-discriminator uint32
3512 | | | +--:(as-generated-case)
3513 | | | +--ro as-generated
3514 | | | +--ro as inet:as-number
3515 | | | +--ro local-discriminator uint32
3516 | | +--ro ethernet-tag-id
3517 | | | +--ro vlan-id uint32
3518 | | +--ro mpls-label netc:mpls-label
3519 | +--:(mac-ip-adv-route-case)
3520 | | +--ro mac-ip-adv-route
3522 | | | +--:(arbitrary-case)
3523 | | | | +--ro arbitrary
3524 | | | | +--ro arbitrary binary
3525 | | | +--:(lacp-auto-generated-case)
3526 | | | | +--ro lacp-auto-generated
3527 | | | | +--ro ce-lacp-mac-address yang:mac-address
3528 | | | | +--ro ce-lacp-port-key uint16
3529 | | | +--:(lan-auto-generated-case)
3530 | | | | +--ro lan-auto-generated
3531 | | | | +--ro root-bridge-mac-address yang:mac-address
3532 | | | | +--ro root-bridge-priority uint16
3533 | | | +--:(mac-auto-generated-case)
3534 | | | | +--ro mac-auto-generated
3535 | | | | +--ro system-mac-address yang:mac-address
3536 | | | | +--ro local-discriminator uint24
3537 | | | +--:(router-id-generated-case)
3538 | | | | +--ro router-id-generated
3539 | | | | +--ro router-id inet:ipv4-address
3540 | | | | +--ro local-discriminator uint32
3541 | | | +--:(as-generated-case)
3542 | | | +--ro as-generated
3543 | | | +--ro as inet:as-number
3544 | | | +--ro local-discriminator uint32
3545 | | +--ro ethernet-tag-id
3546 | | | +--ro vlan-id uint32
3547 | | +--ro mac-address yang:mac-address
3548 | | +--ro ip-address? inet:ip-address
3549 | | +--ro mpls-label1 netc:mpls-label
3550 | | +--ro mpls-label2? netc:mpls-label
3551 | +--:(inc-multi-ethernet-tag-res-case)
3552 | | +--ro inc-multi-ethernet-tag-res
3553 | | +--ro ethernet-tag-id
3554 | | | +--ro vlan-id uint32
3555 | | +--ro orig-route-ip? inet:ip-address
3556 | +--:(es-route-case)
3559 | | +--:(arbitrary-case)
3560 | | | +--ro arbitrary
3561 | | | +--ro arbitrary binary
3562 | | +--:(lacp-auto-generated-case)
3563 | | | +--ro lacp-auto-generated
3564 | | | +--ro ce-lacp-mac-address yang:mac-address
3565 | | | +--ro ce-lacp-port-key uint16
3566 | | +--:(lan-auto-generated-case)
3567 | | | +--ro lan-auto-generated
3568 | | | +--ro root-bridge-mac-address yang:mac-address
3569 | | | +--ro root-bridge-priority uint16
3570 | | +--:(mac-auto-generated-case)
3571 | | | +--ro mac-auto-generated
3572 | | | +--ro system-mac-address yang:mac-address
3573 | | | +--ro local-discriminator uint24
3574 | | +--:(router-id-generated-case)
3575 | | | +--ro router-id-generated
3576 | | | +--ro router-id inet:ipv4-address
3577 | | | +--ro local-discriminator uint32
3578 | | +--:(as-generated-case)
3579 | | +--ro as-generated
3580 | | +--ro as inet:as-number
3581 | | +--ro local-discriminator uint32
3582 | +--ro orig-route-ip inet:ip-address
3583 +--ro route-distinguisher bgp-t:route-distinguisher
3585 +--ro extended-communities*
3586 | +--ro transitive? boolean
3587 | +--ro (extended-community)?
3588 | +--:(encapsulation-case)
3589 | | +--ro encapsulation-extended-community
3590 | | +--ro tunnel-type encapsulation-tunnel-type
3591 | +--:(esi-label-extended-community-case)
3592 | | +--ro esi-label-extended-community
3593 | | +--ro single-active-mode? boolean
3594 | | +--ro esi-label netc:mpls-label
3595 | +--:(es-import-route-extended-community-case)
3596 | | +--ro es-import-route-extended-community
3597 | | +--ro es-import yang:mac-address
3598 | +--:(mac-mobility-extended-community-case)
3599 | | +--ro mac-mobility-extended-community
3600 | | +--ro static? boolean
3601 | | +--ro seq-number uint32
3602 | +--:(default-gateway-extended-community-case)
3603 | | +--ro default-gateway-extended-community!
3604 | +--:(layer-2-attributes-extended-community-case)
3605 | +--ro layer-2-attributes-extended-community
3606 | +--ro primary-pe? boolean
3607 | +--ro backup-pe? boolean
3608 | +--ro control-word? boolean
3609 | +--ro l2-mtu uint16
3611 +--ro leaf-information-required boolean
3612 +--ro mpls-label? netc:mpls-label
3613 +--ro (tunnel-identifier)?
3614 +--:(rsvp-te-p2mp-lsp)
3615 | +--ro rsvp-te-p2mp-lps
3616 | +--ro p2mp-id uint32
3617 | +--ro tunnel-id uint16
3618 | +--ro extended-tunnel-id inet:ip-address
3620 | +--ro mldp-p2mp-lsp
3621 | +--ro address-family identityref
3622 | +--ro root-node-address inet:ip-address
3623 | +--ro opaque-value*
3624 | +--ro opaque-type uint8
3625 | +--ro opaque-extended-type? uint16
3626 | +--ro opaque yang:hex-string
3628 | +--ro pim-ssm-tree
3629 | +--ro p-address inet:ip-address
3630 | +--ro p-multicast-group inet:ip-address
3633 | +--ro p-address inet:ip-address
3634 | +--ro p-multicast-group inet:ip-address
3635 +--:(bidir-pim-tree)
3636 | +--ro bidir-pim-tree
3637 | +--ro p-address inet:ip-address
3638 | +--ro p-multicast-group inet:ip-address
3639 +--:(ingress-replication)
3640 | +--ro ingress-replication
3641 | +--ro receiving-endpoint-address? inet:ip-address
3642 +--:(mldp-mp2mp-lsp)
3643 +--ro mldp-mp2mp-lsp
3644 +--ro opaque-type uint8
3645 +--ro opaque-extended-type? uint16
3651 The L2VPN EVPN table in an instance of the speaker's Loc-RIB can be verified via REST:
3653 **URL:** ``/restconf/operational/bgp-rib:bgp-rib/rib/bgp-example/loc-rib/tables/odl-bgp-evpn:l2vpn-address-family/odl-bgp-evpn:evpn-subsequent-address-family/evpn-routes``
3661 <evpn-routes xmlns="urn:opendaylight:params:xml:ns:yang:bgp-evpn">
3663 <route-key>AxEAAcCoZAED6AAAAQAgwKhkAQ==</route-key>
3664 <route-distinguisher>192.168.100.1:1000</route-distinguisher>
3665 <inc-multi-ethernet-tag-res>
3667 <vlan-id>256</vlan-id>
3669 <orig-route-ip>192.168.100.1</orig-route-ip>
3670 </inc-multi-ethernet-tag-res>
3673 <global>172.23.29.104</global>
3679 <extended-communities>
3680 <extended-communities>
3681 <transitive>true</transitive>
3682 <route-target-extended-community>
3683 <global-administrator>65504</global-administrator>
3684 <local-administrator>AAAD6A==</local-administrator>
3685 </route-target-extended-community>
3686 </extended-communities>
3687 </extended-communities>
3689 <leaf-information-required>true</leaf-information-required>
3690 <mpls-label>20024</mpls-label>
3691 <ingress-replication>
3692 <receiving-endpoint-address>192.168.100.1</receiving-endpoint-address>
3693 </ingress-replication>
3701 This examples show how to originate and remove EVPN routes via programmable RIB.
3702 There are four different types of EVPN routes, and several extended communities.
3703 Routes can be used for variety of use-cases supported by BGP/MPLS EVPN, PBB EVPN and NVO EVPN.
3704 Make sure the *Application Peer* is configured first.
3706 **URL:** ``/restconf/config/bgp-rib:application-rib/10.25.1.9/tables/odl-bgp-evpn:l2vpn-address-family/odl-bgp-evpn:evpn-subsequent-address-family/odl-bgp-evpn:evpn-routes``
3708 **Method:** ``POST``
3710 **Content-Type:** ``application/xml``
3716 :emphasize-lines: 3,4,14
3718 <evpn-route xmlns="urn:opendaylight:params:xml:ns:yang:bgp-evpn">
3719 <route-key>evpn</route-key>
3720 <route-distinguisher>172.12.123.3:200</route-distinguisher>
3724 <global>199.20.166.41</global>
3730 <extended-communities>
3732 </extended-communities>
3736 @line 3: Route Distinguisher (RD) - set to RD of the MAC-VRF advertising the NLRI, recommended format *<IP>:<VLAN_ID>*
3738 @line 4: One of the EVPN route must be set here.
3740 @line 14: In some cases, specific extended community presence is required. The route may carry one or more Route Target attributes.
3746 * **Ethernet AD per ESI**
3749 <ethernet-a-d-route>
3750 <mpls-label>0</mpls-label>
3752 <vlan-id>4294967295</vlan-id>
3755 <arbitrary>AAAAAAAAAAAA</arbitrary>
3757 </ethernet-a-d-route>
3759 * **Ethernet AD per EVI**
3762 <ethernet-a-d-route>
3763 <mpls-label>24001</mpls-label>
3765 <vlan-id>2200</vlan-id>
3768 <arbitrary>AAAAAAAAAAAA</arbitrary>
3770 </ethernet-a-d-route>
3772 * **MAC/IP Advertisement**
3777 <arbitrary>AAAAAAAAAAAA</arbitrary>
3780 <vlan-id>2100</vlan-id>
3782 <mac-address>f2:0c:dd:80:9f:f7</mac-address>
3783 <ip-address>10.0.1.12</ip-address>
3784 <mpls-label1>299776</mpls-label1>
3788 * **Inclusive Multicast Ethernet Tag**
3791 <inc-multi-ethernet-tag-res>
3793 <vlan-id>2100</vlan-id>
3795 <orig-route-ip>43.43.43.43</orig-route-ip>
3796 </inc-multi-ethernet-tag-res>
3798 * **Ethernet Segment**
3802 <orig-route-ip>43.43.43.43</orig-route-ip>
3804 <arbitrary>AAAAAAAAAAAA</arbitrary>
3808 **EVPN Ethernet Segment Identifier (ESI):**
3811 Indicates an arbitrary 9-octet ESI.
3816 <arbitrary>AAAAAAAAAAAA</arbitrary>
3820 IEEE 802.1AX LACP is used.
3824 <lacp-auto-generated>
3825 <ce-lacp-mac-address>f2:0c:dd:80:9f:f7</ce-lacp-mac-address>
3826 <ce-lacp-port-key>22</ce-lacp-port-key>
3827 </lacp-auto-generated>
3830 Indirectly connected hosts via a bridged LAN.
3834 <lan-auto-generated>
3835 <root-bridge-mac-address>f2:0c:dd:80:9f:f7</root-bridge-mac-address>
3836 <root-bridge-priority>20</root-bridge-priority>
3837 </lan-auto-generated>
3844 <mac-auto-generated>
3845 <system-mac-address>f2:0c:dd:80:9f:f7</system-mac-address>
3846 <local-discriminator>2000</local-discriminator>
3847 </mac-auto-generated>
3854 <router-id-generated>
3855 <router-id>43.43.43.43</router-id>
3856 <local-discriminator>2000</local-discriminator>
3857 </router-id-generated>
3866 <local-discriminator>2000</local-discriminator>
3869 **Extended Communities:**
3871 * **ESI Label Extended Community**
3874 <extended-communities>
3875 <transitive>true</transitive>
3876 <esi-label-extended-community>
3877 <single-active-mode>false</single-active-mode>
3878 <esi-label>24001</esi-label>
3879 </esi-label-extended-community >
3880 </extended-communities>
3882 * **ES-Import Route Target**
3885 <extended-communities>
3886 <transitive>true</transitive>
3887 <es-import-route-extended-community>
3888 <es-import>f2:0c:dd:80:9f:f7</es-import>
3889 </es-import-route-extended-community>
3890 </extended-communities>
3892 * **MAC Mobility Extended Community**
3895 <extended-communities>
3896 <transitive>true</transitive>
3897 <mac-mobility-extended-community>
3898 <static>true</static>
3899 <seq-number>200</seq-number>
3900 </mac-mobility-extended-community>
3901 </extended-communities>
3903 * **Default Gateway Extended Community**
3906 <extended-communities>
3907 <transitive>true</transitive>
3908 <default-gateway-extended-community>
3909 </default-gateway-extended-community>
3910 </extended-communities>
3912 * **EVPN Layer 2 attributes extended community**
3915 <extended-communities>
3916 <transitive>false</transitive>
3917 <layer-2-attributes-extended-community>
3918 <primary-pe>true</primary-pe>
3919 <backup-pe>true</backup-pe>
3920 <control-word >true</control-word>
3921 <l2-mtu>200</l2-mtu>
3922 </layer-2-attributes-extended-community>
3923 </extended-communities>
3925 * **BGP Encapsulation extended community**
3930 <extended-communities>
3931 <transitive>false</transitive>
3932 <encapsulation-extended-community>
3933 <tunnel-type>vxlan</tunnel-type>
3934 </encapsulation-extended-community>
3935 </extended-communities>
3937 @line 4: `full list of tunnel types <http://www.iana.org/assignments/bgp-parameters/bgp-parameters.xhtml#tunnel-types>`_
3939 * **P-Multicast Service Interface Tunnel (PMSI) attribute**
3943 <leaf-information-required>true</leaf-information-required>
3944 <mpls-label>20024</mpls-label>
3945 <ingress-replication>
3946 <receiving-endpoint-address>172.12.123.3</receiving-endpoint-address>
3947 </ingress-replication>
3952 To remove the route added above, following request can be used:
3954 **URL:** ``/restconf/config/bgp-rib:application-rib/10.25.1.9/tables/bgp-types:ipv4-address-family/odl-bgp-evpn:l2vpn-address-family/odl-bgp-evpn:evpn-subsequent-address-family/odl-bgp-evpn:evpn-routes/evpn-route/evpn``
3956 **Method:** ``DELETE``
3960 .. table:: EVPN Routes Usage.
3962 +--------------------------------------+-----------------------------------------------------+-------------------------------------------+
3963 | EVN Route Type | Extended Communities | Usage |
3964 +======================================+=====================================================+===========================================+
3965 | **Ethernet Auto-discovery** | ESI Label, BGP EncapsulationEVPN Layer 2 attributes | Fast Convergence, Split Horizon, Aliasing |
3966 +--------------------------------------+-----------------------------------------------------+-------------------------------------------+
3967 | **MAC/IP Advertisement** | BGP Encapsulation, MAC Mobility, Default Gateway | MAC address reachability |
3968 +--------------------------------------+-----------------------------------------------------+-------------------------------------------+
3969 | **Inclusive Multicast Ethernet Tag** | PMSI Tunnel, BGP Encapsulation | Handling of Multi-destination traffic |
3970 +--------------------------------------+-----------------------------------------------------+-------------------------------------------+
3971 | **Ethernet Segment** | BGP Encapsulation, ES-Import Route Target | Designated Forwarder Election |
3972 +--------------------------------------+-----------------------------------------------------+-------------------------------------------+
3976 * `BGP MPLS-Based Ethernet VPN <https://tools.ietf.org/html/rfc7432>`_
3977 * `Provider Backbone Bridging Combined with Ethernet VPN <https://tools.ietf.org/html/rfc7623>`_
3978 * `VPWS support in EVPN <https://tools.ietf.org/html/draft-ietf-bess-evpn-vpws-07>`_
3979 * `A Network Virtualization Overlay Solution using EVPN <https://tools.ietf.org/html/draft-ietf-bess-evpn-overlay-04>`_
3980 * `Interconnect Solution for EVPN Overlay networks <https://tools.ietf.org/html/draft-ietf-bess-dci-evpn-overlay-04>`_
3981 * `Usage and applicability of BGP MPLS based Ethernet VPN <https://tools.ietf.org/html/draft-ietf-bess-evpn-usage-03>`_
3985 The ADD-PATH capability allows to advertise multiple paths for the same address prefix.
3986 It can help with optimal routing and routing convergence in a network by providing potential alternate or backup paths.
3988 .. contents:: Contents
3994 This section shows a way to enable ADD-PATH capability in BGP speaker and peer configuration.
3996 .. note:: The capability is applicable for IP Unicast, IP Labeled Unicast and Flow Specification address families.
4000 To enable ADD-PATH capability in BGP plugin, first configure BGP speaker instance:
4002 **URL:** ``/restconf/config/openconfig-network-instance:network-instances/network-instance/global-bgp/openconfig-network-instance:protocols``
4004 **Method:** ``POST``
4006 **Content-Type:** ``application/xml``
4012 :emphasize-lines: 14
4014 <protocol xmlns="http://openconfig.net/yang/network-instance">
4015 <name>bgp-example</name>
4016 <identifier xmlns:x="http://openconfig.net/yang/policy-types">x:BGP</identifier>
4017 <bgp xmlns="urn:opendaylight:params:xml:ns:yang:bgp:openconfig-extensions">
4020 <router-id>192.0.2.2</router-id>
4025 <afi-safi-name xmlns:x="http://openconfig.net/yang/bgp-types">x:IPV4-UNICAST</afi-safi-name>
4026 <receive>true</receive>
4027 <send-max>2</send-max>
4034 @line 14: Defines path selection strategy: *send-max* > 1 -> Advertise N Paths or *send-max* = 0 -> Advertise All Paths
4036 Here is an example for update a specific family with enable ADD-PATH capability
4038 **URL:** ``/restconf/config/openconfig-network-instance:network-instances/network-instance/global-bgp/openconfig-network-instance:protocols/protocol/openconfig-policy-types:BGP/bgp-example/bgp/global/afi-safis/afi-safi/openconfig-bgp-types:IPV4%2DUNICAST``
4042 **Content-Type:** ``application/xml``
4048 <afi-safi xmlns="urn:opendaylight:params:xml:ns:yang:bgp:openconfig-extensions">
4049 <afi-safi-name xmlns:x="http://openconfig.net/yang/bgp-types">x:IPV4-UNICAST</afi-safi-name>
4050 <receive>true</receive>
4051 <send-max>0</send-max>
4056 Here is an example for BGP peer configuration with enabled ADD-PATH capability.
4058 **URL:** ``/restconf/config/openconfig-network-instance:network-instances/network-instance/global-bgp/openconfig-network-instance:protocols/protocol/openconfig-policy-types:BGP/bgp-example/bgp/neighbors``
4060 **Method:** ``POST``
4062 **Content-Type:** ``application/xml``
4068 <neighbor xmlns="urn:opendaylight:params:xml:ns:yang:bgp:openconfig-extensions">
4069 <neighbor-address>192.0.2.1</neighbor-address>
4072 <afi-safi-name xmlns:x="http://openconfig.net/yang/bgp-types">x:IPV4-LABELLED-UNICAST</afi-safi-name>
4075 <afi-safi-name xmlns:x="http://openconfig.net/yang/bgp-types">x:IPV4-UNICAST</afi-safi-name>
4076 <receive>true</receive>
4077 <send-max>0</send-max>
4082 .. note:: The path selection strategy is not configurable on per peer basis. The send-max presence indicates a willingness to send ADD-PATH NLRIs to the neighbor.
4084 Here is an example for update specific family BGP peer configuration with enabled ADD-PATH capability.
4086 **URL:** ``/restconf/config/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``
4090 **Content-Type:** ``application/xml``
4096 <afi-safi xmlns="urn:opendaylight:params:xml:ns:yang:bgp:openconfig-extensions">
4097 <afi-safi-name xmlns:x="http://openconfig.net/yang/bgp-types">x:IPV4-UNICAST</afi-safi-name>
4098 <receive>true</receive>
4099 <send-max>0</send-max>
4104 The IPv4 Unicast table with enabled ADD-PATH capability in an instance of the speaker's Loc-RIB can be verified via REST:
4106 **URL:** ``/restconf/operational/bgp-rib:bgp-rib/rib/bgp-example/loc-rib/tables/bgp-types:ipv4-address-family/bgp-types:unicast-subsequent-address-family/ipv4-routes``
4116 <ipv4-routes xmlns="urn:opendaylight:params:xml:ns:yang:bgp-inet">
4118 <path-id>1</path-id>
4119 <prefix>193.0.2.1/32</prefix>
4129 <global>10.0.0.1</global>
4134 <path-id>2</path-id>
4135 <prefix>193.0.2.1/32</prefix>
4145 <global>10.0.0.2</global>
4151 @line 3: The routes with the same destination are distinguished by *path-id* attribute.
4155 * `Advertisement of Multiple Paths in BGP <https://tools.ietf.org/html/rfc7911>`_
4156 * `Best Practices for Advertisement of Multiple Paths in IBGP <https://tools.ietf.org/html/draft-ietf-idr-add-paths-guidelines-08>`_
4160 The Route Refresh Capability allows to dynamically request a re-advertisement of the Adj-RIB-Out from a BGP peer.
4161 This is useful when the inbound routing policy for a peer changes and all prefixes from a peer must be reexamined against a new policy.
4163 .. contents:: Contents
4169 The capability is enabled by default, no additional configuration is required.
4173 To send a Route Refresh request from OpenDaylight BGP speaker instance to its neighbor, invoke RPC:
4175 **URL:** ``/restconf/operations/bgp-peer-rpc:route-refresh-request``
4177 **Method:** ``POST``
4179 **Content-Type:** ``application/xml``
4185 <input xmlns="urn:opendaylight:params:xml:ns:yang:bgp-peer-rpc">
4186 <afi xmlns:types="urn:opendaylight:params:xml:ns:yang:bgp-types">types:ipv4-address-family</afi>
4187 <safi xmlns:types="urn:opendaylight:params:xml:ns:yang:bgp-types">types:unicast-subsequent-address-family</safi>
4188 <peer-ref xmlns:rib="urn:opendaylight:params:xml:ns:yang:bgp-rib">/rib:bgp-rib/rib:rib[rib:id="bgp-example"]/rib:peer[rib:peer-id="bgp://10.25.1.9"]</peer-ref>
4193 * `Route Refresh Capability for BGP-4 <https://tools.ietf.org/html/rfc2918>`_
4195 Peer Session Release
4198 BGP provides a RPC feature to release a Neighbor session.
4200 .. contents:: Contents
4206 The capability is enabled by default, no additional configuration is required.
4210 To release neighbor session, invoke RPC:
4212 **URL:** ``/restconf/operations/bgp-peer-rpc:release-session``
4214 **Method:** ``POST``
4216 **Content-Type:** ``application/xml``
4222 <input xmlns="urn:opendaylight:params:xml:ns:yang:bgp-peer-rpc">
4223 <peer-ref xmlns:rib="urn:opendaylight:params:xml:ns:yang:bgp-rib">/rib:bgp-rib/rib:rib[rib:id="bgp-example"]/rib:peer[rib:peer-id="bgp://10.25.1.9"]</peer-ref>
4229 The OpenDaylight BGP implementation provides a set of APIs (described below), that give its operational state refreshed periodically, by default every 5 seconds.
4230 The following APIs describe what is available starting with how to change the default refresh rate.
4232 .. contents:: Contents
4236 Operational State Configuration
4237 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
4239 **URL:** ``/restconf/config/bgp-state-config:bgp-state-config``
4243 **Content-Type:** ``application/xml``
4251 <bgp-state-config xmlns="urn:opendaylight:params:xml:ns:yang:controller:config">
4252 <config-name xmlns="urn:opendaylight:params:xml:ns:yang:bgp-state-config">operationalState</config-name>
4253 <timer xmlns="urn:opendaylight:params:xml:ns:yang:bgp-state-config">1</timer>
4256 @line 3: Time in seconds between operational state update.
4258 BGP RIB Operational State
4259 ^^^^^^^^^^^^^^^^^^^^^^^^^
4261 **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``
4265 **Content-Type:** ``application/xml``
4272 <state xmlns="urn:opendaylight:params:xml:ns:yang:bgp:openconfig-extensions">
4274 <router-id>192.0.2.2</router-id>
4275 <total-paths>0</total-paths>
4276 <total-prefixes>0</total-prefixes>
4279 @line 2: AS number of the remote peer.
4281 @line 3: The unique protocol instance identifier.
4283 @line 4: Total number of Paths installed on RIB (Loc-RIB)
4285 @line 5: Total number of Prefixes installed on RIB (Loc-RIB)
4287 BGP RIB Families Operational State
4288 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
4290 **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``
4294 **Content-Type:** ``application/xml``
4300 :emphasize-lines: 3,5,6
4302 <afi-safis xmlns="urn:opendaylight:params:xml:ns:yang:bgp:openconfig-extensions">
4304 <afi-safi-name xmlns:x="http://openconfig.net/yang/bgp-types">x:IPV4-UNICAST</afi-safi-name>
4306 <total-paths>0</total-paths>
4307 <total-prefixes>0</total-prefixes>
4311 <afi-safi-name xmlns:x="http://openconfig.net/yang/bgp-types">x:IPV6-UNICAST</afi-safi-name>
4313 <total-paths>0</total-paths>
4314 <total-prefixes>0</total-prefixes>
4320 @line 3: Family Identifier.
4322 @line 5: Total number of Paths installed on RIB (Loc-RIB) per specific family.
4324 @line 6: Total number of Prefixes installed on RIB (Loc-RIB) per specific family.
4326 BGP Neighbors Operational State
4327 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
4329 **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``
4333 **Content-Type:** ``application/xml``
4341 <neighbors xmlns="urn:opendaylight:params:xml:ns:yang:bgp:openconfig-extensions">
4343 <neighbor-address>192.0.2.1</neighbor-address>
4347 <neighbor-address>192.0.2.2</neighbor-address>
4352 @line 3: IP address of the remote BGP peer. Also serves as an unique identifier of a neighbor in a list of neighbors.
4354 BGP Neighbor Operational State
4355 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
4357 .. note:: Supported Capabilities only provided when session has been established.
4359 **URL:** ``/restconf/operational/openconfig-network-instance:network-instances/network-instance/global-bgp/openconfig-network-instance:protocols/protocol/openconfig-policy-types:BGP/bgp-example/bgp/neighbor/127.0.0.2/state``
4363 **Content-Type:** ``application/xml``
4369 :emphasize-lines: 2,3,4,7,8,11,12
4371 <state xmlns="urn:opendaylight:params:xml:ns:yang:bgp:openconfig-extensions">
4372 <session-state>ESTABLISHED</session-state>
4373 <supported-capabilities xmlns:x="http://openconfig.net/yang/bgp-types">x:ASN32</supported-capabilities>
4374 <supported-capabilities xmlns:x="http://openconfig.net/yang/bgp-types">x:MPBGP</supported-capabilities>
4378 <NOTIFICATION>0</NOTIFICATION>
4382 <NOTIFICATION>0</NOTIFICATION>
4387 @line 2: Session status
4389 @line 3-4: BGP capabilities supported ( ASN32 / MPBGP / ROUTE_REFRESH / GRACEFUL_RESTART / ADD_PATHS)
4391 @line 7: Total count of Update Messages sent
4393 @line 8: Total count of Notification Messages sent
4395 @line 11: Total count of Update Messages received
4397 @line 12: Total count of Notification Messages received
4399 BGP Neighbor Families Operational State
4400 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
4402 .. note:: Graceful Restart not supported yet. Planned for Carbon.
4405 **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``
4409 **Content-Type:** ``application/xml``
4415 :emphasize-lines: 3,5,7,9,10
4417 <afi-safis xmlns="urn:opendaylight:params:xml:ns:yang:bgp:openconfig-extensions">
4419 <afi-safi-name xmlns:x="http://openconfig.net/yang/bgp-types">x:IPV4-UNICAST</afi-safi-name>
4421 <active>false</active>
4425 <received>false</received>
4426 <advertised>false</advertised>
4431 <afi-safi-name xmlns:x="http://openconfig.net/yang/bgp-types">x:IPV6-UNICAST</afi-safi-name>
4433 <active>false</active>
4437 <received>false</received>
4438 <advertised>false</advertised>
4444 @line 3: Family Identifier.
4446 @line 5: True if family is advertized by peer.
4448 @line 7: Graceful Restart Operational State per specific family.
4450 @line 9: True if the peer supports graceful restart.
4452 @line 10: True if we support graceful restart.
4454 BGP Neighbor Family Operational State
4455 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
4457 .. note:: Prefixes state is only provided once session is established.
4458 .. note:: Graceful Restart not supported yet. Planned to be implemented in Carbon.
4460 **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``
4464 **Content-Type:** ``application/xml``
4470 :emphasize-lines: 2,4,6,7,8
4472 <afi-safi xmlns="urn:opendaylight:params:xml:ns:yang:bgp:openconfig-extensions">
4473 <afi-safi-name xmlns:x="http://openconfig.net/yang/bgp-types">x:IPV4-UNICAST</afi-safi-name>
4475 <active>true</active>
4477 <installed>3</installed>
4479 <received>3</received>
4484 <received>false</received>
4485 <advertised>false</advertised>
4490 @line 2: Family Identifier.
4492 @line 4: True if family is advertized to and by peer.
4494 @line 6: Total count of prefixes advertized by peer and installed (effective-rib-in).
4496 @line 7: Total count of prefixes advertized to peer (adj-rib-out).
4498 @line 8: Total count of prefixes advertized by peer (adj-rib-in).
4500 BGP Neighbor Timers Operational State
4501 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
4503 .. note:: State is only provided once session is established.
4505 **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``
4509 **Content-Type:** ``application/xml``
4515 :emphasize-lines: 3,4
4517 <timers xmlns="urn:opendaylight:params:xml:ns:yang:bgp:openconfig-extensions">
4519 <negotiated-hold-time>180</negotiated-hold-time>
4520 <uptime>1580676</uptime>
4524 @line 3: The negotiated hold-time for the BGP session in seconds.
4526 @line 4: Session duration since establishment in milliseconds.
4528 BGP Neighbor Transport Operational State
4529 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
4531 .. note:: State is only provided once session is established.
4533 **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``
4537 **Content-Type:** ``application/xml``
4543 :emphasize-lines: 3,4,5
4545 <transport xmlns="urn:opendaylight:params:xml:ns:yang:bgp:openconfig-extensions">
4547 <remote-address>127.0.0.2</remote-address>
4548 <remote-port>44718</remote-port>
4549 <local-port>1790</local-port>
4553 @line 3: IP address of the remote BGP peer.
4555 @line 4: Port of the remote BGP peer.
4557 @line 5: Local port.
4559 BGP Neighbor Error Handling Operational State
4560 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
4562 .. note:: State is only provided once session is established.
4563 .. note:: Error handling not supported yet. Planned for Carbon.
4565 **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``
4569 **Content-Type:** ``application/xml``
4577 <error-handling xmlns="urn:opendaylight:params:xml:ns:yang:bgp:openconfig-extensions">
4579 <erroneous-update-messages>0</erroneous-update-messages>
4583 @line 3: The number of BGP UPDATE messages for which the treat-as-withdraw mechanism has been applied based on
4584 erroneous message contents
4586 BGP Neighbor Graceful Restart Operational State
4587 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
4589 .. note:: Graceful Restart not supported yet. Planned for Carbon.
4591 **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``
4595 **Content-Type:** ``application/xml``
4601 :emphasize-lines: 3,4,5
4603 <graceful-restart xmlns="urn:opendaylight:params:xml:ns:yang:bgp:openconfig-extensions">
4605 <peer-restart-time>0</peer-restart-time>
4606 <peer-restarting>false</peer-restarting>
4607 <local-restarting>false</local-restarting>
4611 @line 3: The period of time (advertised by the peer) that the peer expects a restart of a BGP session to take.
4613 @line 4: This flag indicates whether the remote neighbor is currently in the process of restarting, and hence
4614 received routes are currently stale.
4616 @line 5: This flag indicates whether the local neighbor is currently restarting. The flag is unset after all NLRI
4617 have been advertised to the peer, and the End-of-RIB (EOR) marker has been unset.
4619 BGP Peer Groups Operational State
4620 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
4622 **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``
4626 **Content-Type:** ``application/xml``
4632 :emphasize-lines: 3,5,6
4636 <peer-group-name>application-peers</peer-group-name>
4638 <total-paths>0</total-paths>
4639 <total-prefixes>0</total-prefixes>
4643 @line 3: Peer Group Identifier.
4645 @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.
4647 @line 6: Total Prefixes installed under by peers pertaining to this peer group (effective-rib-in).
4648 This count doesn't differentiate repeated prefixes.
4653 BGP Karaf Console (odl-bgpcep-bgp-cli) provides a CLI feature to read operational state per RIB, Neighbor and Peer Group.
4655 .. code-block:: bash
4658 opendaylight-user@root> bgp:operational-state -rib example-bgp-rib
4660 .. code-block:: bash
4663 opendaylight-user@root> bgp:operational-state -rib example-bgp-rib -neighbor 192.0.2.1
4665 .. code-block:: bash
4668 opendaylight-user@root> bgp:operational-state -rib -peer-group application-peers
4672 Running OpenDaylight BGP in clustered environment brings an advantage of the plugin's high availability (HA).
4673 This section illustrates a basic scenario for HA, also presents a configuration for clustered OpenDaylight BGP.
4675 .. contents:: Contents
4681 Following example shows a configuration for running BGP in clustered environment.
4683 #. As the first step, configure (replicated *deafult* shard and *topology* shard if needed) and run OpenDaylight in clustered environment, install BGP and RESTCONF.
4685 #. On one node (OpenDaylight instance), configure BGP speaker instance and neighbor. In addition, configure BGP topology exporter if required. The configuration is shared across all interconnected cluster nodes, however BGP become active only on one node. Other nodes with configured BGP serves as stand-by backups.
4687 #. Remote peer should be configured to accept/initiate connection from/to all OpenDaylight cluster nodes with configured BGP plugin.
4689 #. Connect remote peer, let it advertise some routes. Verify routes presence in Loc-RIB and/or BGP topology exporter instance on all nodes of the OpenDaylight cluster.
4693 Replicating RIBs across the cluster nodes is causing severe scalability issue and overall performance degradation. To avoid this problems, configure BGP RIB module as a separate shard without enabled replication. Change configuration on all nodes as following (`configuration/initial`):
4695 * In ``modules.conf`` add a new module:
4696 .. code-block:: console
4700 namespace = "urn:opendaylight:params:xml:ns:yang:bgp-rib"
4701 shard-strategy = "module"
4704 * In ``module-shards.conf`` define a new module shard:
4705 .. code-block:: console
4719 **Note:** Use correct member name in module shard configuration.
4723 Following section presents a basic BGP speaker failover scenario on 3-node OpenDaylight cluster setup.
4725 .. figure:: ./images/bgpcep/BGP_HA.png
4728 Once the OpenDaylight BGP is configured, the speaker become active on one of the cluster nodes. Remote peer can establish connection with this BGP instance.
4729 Routes advertised by remote peer are replicated, hence RIBs state on all nodes is the same.
4733 .. figure:: ./images/bgpcep/BGP_HA_failure.png
4734 :alt: Node went down.
4736 In a case a cluster node, where BGP instance is running, goes down (unexpected failure, restart), active BGP session is dropped.
4740 .. figure:: ./images/bgpcep/BGP_HA_recovery.png
4743 Now, one of the stand-by BGP speaker instances become active. Remote peer establishes new connection and advertises routes again.
4747 This section provides an overview of the BGP topology provider service.
4748 It shows how to configure and use all available BGP topology providers.
4749 Providers are building topology view of BGP routes stored in local BGP speaker's Loc-RIB.
4750 Output topologies are rendered in a form of standardised IETF network topology model.
4752 .. contents:: Contents
4756 Inet Reachability Topology
4757 ^^^^^^^^^^^^^^^^^^^^^^^^^^
4758 Inet reachability topology exporter offers a mapping service from IPv4/6 routes to network topology nodes.
4762 Following example shows how to create a new instance of IPv4 BGP topology exporter:
4764 **URL:** ``/restconf/config/network-topology:network-topology``
4766 **Method:** ``POST``
4768 **Content-Type:** ``application/xml``
4774 :emphasize-lines: 2,4,6
4776 <topology xmlns="urn:TBD:params:xml:ns:yang:network-topology">
4777 <topology-id>bgp-example-ipv4-topology</topology-id>
4779 <bgp-ipv4-reachability-topology xmlns="urn:opendaylight:params:xml:ns:yang:odl-bgp-topology-types"></bgp-ipv4-reachability-topology>
4781 <rib-id xmlns="urn:opendaylight:params:xml:ns:yang:odl-bgp-topology-config">bgp-example</rib-id>
4784 @line 2: An identifier for a topology.
4786 @line 4: Used to identify type of the topology. In this case BGP IPv4 reachability topology.
4788 @line 6: A name of the local BGP speaker instance.
4792 The topology exporter instance can be removed in a following way:
4794 **URL:** ``/restconf/config/network-topology:network-topology/topology/bgp-example-ipv4-topology``
4796 **Method:** ``DELETE``
4800 Following example shows how to create a new instance of IPv6 BGP topology exporter:
4802 **URL:** ``/restconf/config/network-topology:network-topology``
4804 **Method:** ``POST``
4806 **Content-Type:** ``application/xml``
4812 <topology xmlns="urn:TBD:params:xml:ns:yang:network-topology">
4813 <topology-id>bgp-example-ipv6-topology</topology-id>
4815 <bgp-ipv6-reachability-topology xmlns="urn:opendaylight:params:xml:ns:yang:odl-bgp-topology-types"></bgp-ipv6-reachability-topology>
4817 <rib-id xmlns="urn:opendaylight:params:xml:ns:yang:odl-bgp-topology-config">bgp-example</rib-id>
4822 Operational state of the topology can be verified via REST:
4824 **URL:** ``/restconf/operational/network-topology:network-topology/topology/bgp-example-ipv4-topology``
4832 :emphasize-lines: 8,11
4834 <topology xmlns="urn:TBD:params:xml:ns:yang:network-topology">
4835 <topology-id>bgp-example-ipv4-topology</topology-id>
4836 <server-provided>true</server-provided>
4838 <bgp-ipv4-reachability-topology xmlns="urn:opendaylight:params:xml:ns:yang:odl-bgp-topology-types"></bgp-ipv4-reachability-topology>
4841 <node-id>10.10.1.1</node-id>
4842 <igp-node-attributes xmlns="urn:TBD:params:xml:ns:yang:nt:l3-unicast-igp-topology">
4844 <prefix>10.0.0.10/32</prefix>
4846 </igp-node-attributes>
4850 @line 8: The identifier of a node in a topology. Its value is mapped from route's NEXT_HOP attribute.
4852 @line 11: The IP prefix attribute of the node. Its value is mapped from routes's destination IP prefix.
4854 BGP Linkstate Topology
4855 ^^^^^^^^^^^^^^^^^^^^^^
4856 BGP linkstate topology exporter offers a mapping service from BGP-LS routes to network topology nodes and links.
4860 Following example shows how to create a new instance of linkstate BGP topology exporter:
4862 **URL:** ``/restconf/config/network-topology:network-topology``
4864 **Method:** ``POST``
4866 **Content-Type:** ``application/xml``
4872 <topology xmlns="urn:TBD:params:xml:ns:yang:network-topology">
4873 <topology-id>bgp-example-linkstate-topology</topology-id>
4875 <bgp-linkstate-topology xmlns="urn:opendaylight:params:xml:ns:yang:odl-bgp-topology-types"></bgp-linkstate-topology>
4877 <rib-id xmlns="urn:opendaylight:params:xml:ns:yang:odl-bgp-topology-config">bgp-example</rib-id>
4882 Operational state of the topology can be verified via REST.
4883 A sample output below represents a two node topology with two unidirectional links interconnecting those nodes.
4885 **URL:** ``/restconf/operational/network-topology:network-topology/topology/bgp-example-linkstate-topology``
4893 <topology xmlns="urn:TBD:params:xml:ns:yang:network-topology">
4894 <topology-id>bgp-example-linkstate-topology</topology-id>
4895 <server-provided>true</server-provided>
4897 <bgp-linkstate-topology xmlns="urn:opendaylight:params:xml:ns:yang:odl-bgp-topology-types"></bgp-linkstate-topology>
4900 <node-id>bgpls://IsisLevel2:1/type=node&as=65000&domain=673720360&router=0000.0000.0040</node-id>
4902 <tp-id>bgpls://IsisLevel2:1/type=tp&ipv4=203.20.160.40</tp-id>
4903 <igp-termination-point-attributes xmlns="urn:TBD:params:xml:ns:yang:nt:l3-unicast-igp-topology"/>
4904 </termination-point>
4905 <igp-node-attributes xmlns="urn:TBD:params:xml:ns:yang:nt:l3-unicast-igp-topology">
4907 <prefix>40.40.40.40/32</prefix>
4911 <prefix>203.20.160.0/24</prefix>
4915 <router-id>40.40.40.40</router-id>
4916 <isis-node-attributes xmlns="urn:TBD:params:xml:ns:yang:network:isis-topology">
4918 <te-router-id-ipv4>40.40.40.40</te-router-id-ipv4>
4921 <iso-system-id>MDAwMDAwMDAwMDY0</iso-system-id>
4923 </isis-node-attributes>
4924 </igp-node-attributes>
4927 <node-id>bgpls://IsisLevel2:1/type=node&as=65000&domain=673720360&router=0000.0000.0039</node-id>
4929 <tp-id>bgpls://IsisLevel2:1/type=tp&ipv4=203.20.160.39</tp-id>
4930 <igp-termination-point-attributes xmlns="urn:TBD:params:xml:ns:yang:nt:l3-unicast-igp-topology"/>
4931 </termination-point>
4932 <igp-node-attributes xmlns="urn:TBD:params:xml:ns:yang:nt:l3-unicast-igp-topology">
4934 <prefix>39.39.39.39/32</prefix>
4938 <prefix>203.20.160.0/24</prefix>
4942 <router-id>39.39.39.39</router-id>
4943 <isis-node-attributes xmlns="urn:TBD:params:xml:ns:yang:network:isis-topology">
4945 <te-router-id-ipv4>39.39.39.39</te-router-id-ipv4>
4948 <iso-system-id>MDAwMDAwMDAwMDg3</iso-system-id>
4950 </isis-node-attributes>
4951 </igp-node-attributes>
4955 <dest-node>bgpls://IsisLevel2:1/type=node&as=65000&domain=673720360&router=0000.0000.0039</dest-node>
4956 <dest-tp>bgpls://IsisLevel2:1/type=tp&ipv4=203.20.160.39</dest-tp>
4958 <link-id>bgpls://IsisLevel2:1/type=link&local-as=65000&local-domain=673720360&local-router=0000.0000.0040&remote-as=65000&remote-domain=673720360&remote-router=0000.0000.0039&ipv4-iface=203.20.160.40&ipv4-neigh=203.20.160.39</link-id>
4960 <source-node>bgpls://IsisLevel2:1/type=node&as=65000&domain=673720360&router=0000.0000.0040</source-node>
4961 <source-tp>bgpls://IsisLevel2:1/type=tp&ipv4=203.20.160.40</source-tp>
4963 <igp-link-attributes xmlns="urn:TBD:params:xml:ns:yang:nt:l3-unicast-igp-topology">
4965 <isis-link-attributes xmlns="urn:TBD:params:xml:ns:yang:network:isis-topology">
4968 <max-link-bandwidth>1250000.0</max-link-bandwidth>
4969 <max-resv-link-bandwidth>12500.0</max-resv-link-bandwidth>
4970 <te-default-metric>0</te-default-metric>
4971 <unreserved-bandwidth>
4972 <bandwidth>12500.0</bandwidth>
4973 <priority>0</priority>
4974 </unreserved-bandwidth>
4975 <unreserved-bandwidth>
4976 <bandwidth>12500.0</bandwidth>
4977 <priority>1</priority>
4978 </unreserved-bandwidth>
4979 <unreserved-bandwidth>
4980 <bandwidth>12500.0</bandwidth>
4981 <priority>2</priority>
4982 </unreserved-bandwidth>
4983 <unreserved-bandwidth>
4984 <bandwidth>12500.0</bandwidth>
4985 <priority>3</priority>
4986 </unreserved-bandwidth>
4987 <unreserved-bandwidth>
4988 <bandwidth>12500.0</bandwidth>
4989 <priority>4</priority>
4990 </unreserved-bandwidth>
4991 <unreserved-bandwidth>
4992 <bandwidth>12500.0</bandwidth>
4993 <priority>5</priority>
4994 </unreserved-bandwidth>
4995 <unreserved-bandwidth>
4996 <bandwidth>12500.0</bandwidth>
4997 <priority>6</priority>
4998 </unreserved-bandwidth>
4999 <unreserved-bandwidth>
5000 <bandwidth>12500.0</bandwidth>
5001 <priority>7</priority>
5002 </unreserved-bandwidth>
5004 </isis-link-attributes>
5005 </igp-link-attributes>
5009 <dest-node>bgpls://IsisLevel2:1/type=node&as=65000&domain=673720360&router=0000.0000.0040</dest-node>
5010 <dest-tp>bgpls://IsisLevel2:1/type=tp&ipv4=203.20.160.40</dest-tp>
5012 <link-id>bgpls://IsisLevel2:1/type=link&local-as=65000&local-domain=673720360&local-router=0000.0000.0039&remote-as=65000&remote-domain=673720360&remote-router=0000.0000.0040&ipv4-iface=203.20.160.39&ipv4-neigh=203.20.160.40</link-id>
5014 <source-node>bgpls://IsisLevel2:1/type=node&as=65000&domain=673720360&router=0000.0000.0039</source-node>
5015 <source-tp>bgpls://IsisLevel2:1/type=tp&ipv4=203.20.160.39</source-tp>
5017 <igp-link-attributes xmlns="urn:TBD:params:xml:ns:yang:nt:l3-unicast-igp-topology">
5019 <isis-link-attributes xmlns="urn:TBD:params:xml:ns:yang:network:isis-topology">
5022 <max-link-bandwidth>1250000.0</max-link-bandwidth>
5023 <max-resv-link-bandwidth>12500.0</max-resv-link-bandwidth>
5024 <te-default-metric>0</te-default-metric>
5025 <unreserved-bandwidth>
5026 <bandwidth>12500.0</bandwidth>
5027 <priority>0</priority>
5028 </unreserved-bandwidth>
5029 <unreserved-bandwidth>
5030 <bandwidth>12500.0</bandwidth>
5031 <priority>1</priority>
5032 </unreserved-bandwidth>
5033 <unreserved-bandwidth>
5034 <bandwidth>12500.0</bandwidth>
5035 <priority>2</priority>
5036 </unreserved-bandwidth>
5037 <unreserved-bandwidth>
5038 <bandwidth>12500.0</bandwidth>
5039 <priority>3</priority>
5040 </unreserved-bandwidth>
5041 <unreserved-bandwidth>
5042 <bandwidth>12500.0</bandwidth>
5043 <priority>4</priority>
5044 </unreserved-bandwidth>
5045 <unreserved-bandwidth>
5046 <bandwidth>12500.0</bandwidth>
5047 <priority>5</priority>
5048 </unreserved-bandwidth>
5049 <unreserved-bandwidth>
5050 <bandwidth>12500.0</bandwidth>
5051 <priority>6</priority>
5052 </unreserved-bandwidth>
5053 <unreserved-bandwidth>
5054 <bandwidth>12500.0</bandwidth>
5055 <priority>7</priority>
5056 </unreserved-bandwidth>
5058 </isis-link-attributes>
5059 </igp-link-attributes>
5063 BGP Network Topology Configuration Loader
5064 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
5066 BGP Network Topology Configuration Loader allows user to define static initial configuration for a BGP protocol instance.
5067 This service will detect the creation of new configuration files following the pattern "network-topology-*.xml" under the path "etc/opendaylight/bgp".
5068 Once the file is processed, the defined configuration will be available from the configuration Data Store.
5070 .. note:: If the BGP topology instance is already present, no update or configuration will be applied.
5072 When installing BGP an example will be provided and a default configuration loaded.
5074 **PATH:** ``etc/opendaylight/bgp/network-topology-config.xml``
5078 <network-topology xmlns="urn:TBD:params:xml:ns:yang:network-topology">
5080 <topology-id>example-ipv4-topology</topology-id>
5082 <bgp-ipv4-reachability-topology xmlns="urn:opendaylight:params:xml:ns:yang:odl-bgp-topology-types"/>
5084 <rib-id xmlns="urn:opendaylight:params:xml:ns:yang:odl-bgp-topology-config">example-bgp-rib</rib-id>
5087 <topology-id>example-ipv6-topology</topology-id>
5089 <bgp-ipv6-reachability-topology xmlns="urn:opendaylight:params:xml:ns:yang:odl-bgp-topology-types"/>
5091 <rib-id xmlns="urn:opendaylight:params:xml:ns:yang:odl-bgp-topology-config">example-bgp-rib</rib-id>
5094 <topology-id>example-linkstate-topology</topology-id>
5096 <bgp-linkstate-topology xmlns="urn:opendaylight:params:xml:ns:yang:odl-bgp-topology-types"/>
5098 <rib-id xmlns="urn:opendaylight:params:xml:ns:yang:odl-bgp-topology-config">example-bgp-rib</rib-id>
5104 BGP test tools serves to test basic BGP functionality, scalability and performance.
5106 .. contents:: Contents
5112 The BGP Test Tool is a stand-alone Java application purposed to simulate remote BGP peers, that are capable to advertise sample routes.
5113 This application is not part of the OpenDaylight Karaf distribution, however it can be downloaded from OpenDaylight's Nexus (use latest release version):
5115 ``https://nexus.opendaylight.org/content/repositories/opendaylight.release/org/opendaylight/bgpcep/bgp-testtool``
5119 The application can be run from command line:
5121 .. code-block:: console
5123 java -jar bgp-testtool-*-executable.jar
5126 with optional input parameters:
5128 .. code-block:: console
5130 -i <BOOLEAN>, --active <BOOLEAN>
5131 Active initialisation of the connection, by default false.
5133 -ho <N>, --holdtimer <N>
5134 In seconds, value of the desired holdtimer, by default 90.
5136 -sc <N>, --speakersCount <N>
5137 Number of simulated BGP speakers, when creating each speaker, uses incremented local-address for binding, by default 0.
5139 -ra <IP_ADDRESS:PORT,...>, --remoteAddress <IP_ADDRESS:PORT,...>
5140 A list of IP addresses of remote BGP peers, that the tool can accept or initiate connect to that address (based on the mode), by default 192.0.2.2:1790.
5142 -la <IP_ADDRESS:PORT>, --localAddress <IP_ADDRESS:PORT>
5143 IP address of BGP speakers which the tools simulates, by default 192.0.2.2:0.
5145 -pr <N>, --prefixes <N>
5146 Number of prefixes to be advertised by each simulated speaker
5148 -mp <BOOLEAN>, --multiPathSupport <BOOLEAN>
5149 Active ADD-PATH support, by default false.
5152 Local AS Number, by default 64496.
5154 -ec <EXTENDED_COMMUNITIES>, --extended_communities <EXTENDED_COMMUNITIES>
5155 Extended communities to be send. Format: x,x,x where x is each extended community from bgp-types.yang, by default empty.
5157 -ll <LOG_LEVEL>, --log_level <LOG_LEVEL>
5158 Log level for console output, by default INFO.
5160 BGP Application Peer Benchmark
5161 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
5162 It is a simple OpenDaylight application which is capable to inject and remove specific amount of IPv4 routes.
5163 This application is part of the OpenDaylight Karaf distribution.
5167 As a first step install BGP and RESTCONF, then configure *Application Peer*.
5168 Install ``odl-bgpcep-bgp-benchmark`` feature and reconfigure BGP Application Peer Benchmark application as per following:
5170 **URL:** ``/restconf/config/odl-bgp-app-peer-benchmark-config:config``
5174 **Content-Type:** ``application/xml``
5182 <odl-bgp-app-peer-benchmark-config xmlns="urn:opendaylight:params:xml:ns:yang:odl-bgp-app-peer-benchmark-config">
5183 <app-peer-id xmlns="urn:opendaylight:params:xml:ns:yang:odl-bgp-app-peer-benchmark-config">10.25.1.9</app-peer-id>
5184 </odl-bgp-app-peer-benchmark-config>
5186 @line 2: The *Application Peer* identifier.
5190 Routes injection can be invoked via RPC:
5192 **URL:** ``/restconf/operations/odl-bgp-app-peer-benchmark:add-prefix``
5194 **Method:** ``POST``
5196 **Content-Type:** ``application/xml``
5202 :emphasize-lines: 2,3,4,5
5204 <input xmlns="urn:opendaylight:params:xml:ns:yang:odl-bgp-app-peer-benchmark">
5205 <prefix>1.1.1.1/32</prefix>
5206 <count>100000</count>
5207 <batchsize>2000</batchsize>
5208 <nexthop>192.0.2.2</nexthop>
5211 @line 2: A initial IPv4 prefix carried in route. Value is incremented for following routes.
5213 @line 3: An amount of routes to be added to *Application Peer's* programmable RIB.
5215 @line 4: A size of the transaction batch.
5217 @line 5: A NEXT_HOP attribute value used in all injected routes.
5223 :emphasize-lines: 3,4,5
5225 <output xmlns="urn:opendaylight:params:xml:ns:yang:odl-bgp-app-peer-benchmark">
5227 <duration>4301</duration>
5229 <count>100000</count>
5233 @line 3: Request duration in milliseconds.
5235 @line 4: Writes per second rate.
5237 @line 5: An amount of routes added to *Application Peer's* programmable RIB.
5241 Routes deletion can be invoked via RPC:
5243 **URL:** ``/restconf/operations/odl-bgp-app-peer-benchmark:delete-prefix``
5245 **Method:** ``POST``
5247 **Content-Type:** ``application/xml``
5253 :emphasize-lines: 2,3,4
5255 <input xmlns="urn:opendaylight:params:xml:ns:yang:odl-bgp-app-peer-benchmark">
5256 <prefix>1.1.1.1/32</prefix>
5257 <count>100000</count>
5258 <batchsize>2000</batchsize>
5261 @line 2: A initial IPv4 prefix carried in route to be removed. Value is incremented for following routes.
5263 @line 3: An amount of routes to be removed from *Application Peer's* programmable RIB.
5265 @line 4: A size of the transaction batch.
5271 <output xmlns="urn:opendaylight:params:xml:ns:yang:odl-bgp-app-peer-benchmark">
5273 <duration>1837</duration>
5275 <count>100000</count>
5281 This section offers advices in a case OpenDaylight BGP plugin is not working as expected.
5283 .. contents:: Contents
5287 BGP is not working...
5288 ^^^^^^^^^^^^^^^^^^^^^
5289 * First of all, ensure that all required features are installed, local and remote BGP configuration is correct.
5291 * Check OpenDaylight Karaf logs:
5295 .. code-block:: console
5299 or open log file: ``data/log/karaf.log``
5301 Possibly, a reason/hint for a cause of the problem can be found there.
5303 * Try to minimise effect of other OpenDaylight features, when searching for a reason of the problem.
5305 * Try to set DEBUG severity level for BGP logger via Karaf console commands, in order to collect more information:
5307 .. code-block:: console
5309 log:set DEBUG org.opendaylight.protocol.bgp
5311 .. code-block:: console
5313 log:set DEBUG org.opendaylight.bgpcep.bgp
5317 Before you report a bug, check `BGPCEP Bugzilla <https://bugs.opendaylight.org/buglist.cgi?list_id=65849&product=bgpcep&resolution=--->`_ to ensure same/similar bug is not already filed there.
5319 Write an e-mail to bgpcep-users@lists.opendaylight.org and provide following information:
5321 #. State OpenDaylight version
5323 #. Describe your use-case and provide as much details related to BGP as possible
5325 #. Steps to reproduce
5327 #. Attach Karaf log files, optionally packet captures, REST input/output