3 This guide contains information on how to use OpenDaylight Border Gateway Protocol (BGP) plugin.
4 The user should learn about BGP basic concepts, supported capabilities, configuration and usage.
12 This section provides high-level overview of the Border Gateway Protocol, OpenDaylight implementation and BGP usage in SDN era.
14 .. contents:: Contents
18 Border Gateway Protocol
19 ^^^^^^^^^^^^^^^^^^^^^^^
20 The Border Gateway Protocol (BGP) is an inter-Autonomous System (AS) routing protocol.
21 The primary role of the BGP is an exchange of routes among other BGP systems.
22 The route is an unit of information which pairs destination (IP address prefix) with attributes to the path with the destination.
23 One of the most interesting attributes is a list of ASes that the route traversed - essential when avoiding loop routing.
24 Advertised routes are stored in the Routing Information Bases (RIBs). Routes are later used to forward packets, stored in Routing Table for this purpose.
25 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).
29 However BGP evolved long time before SDN was born, it plays a significant role in many SDN use-cases.
30 Also, continuous evolution of the protocol brings extensions that are very well suited for SDN.
31 Nowadays, BGP can carry various types of routing information - L3VPN, L2VPN, IP multicast, linkstate, etc.
32 Here is a brief list of software-based/legacy-network technologies where BGP-based SDN solution get into an action:
34 * SDN WAN - WAN orchestration and optimization
35 * SDN router - Turns switch into an Internet router
36 * Virtual Route Reflector - High-performance server-based BGP Route Reflector
37 * SDX - A Software Defined Internet Exchange controller
38 * Large-Scale Data Centers - BGP Data Center Routing, MPLS/SR in DCs, DC interconnection
39 * DDoS mitigation - Traffic Filtering distribution with BGP
41 OpenDaylight BGP plugin
42 ^^^^^^^^^^^^^^^^^^^^^^^
43 The OpenDaylight controller provides an implementation of BGP (RFC 4271) as a south-bound protocol plugin.
44 The implementation renders all basic *BGP speaker capabilities*:
46 * inter/intra-AS peering
51 The plugin's **north-bound API** (``REST``/``Java``) provides to user:
53 * fully dynamic runtime standardized BGP configuration
54 * read-only access to all RIBs
55 * read-write programmable RIBs
56 * read-only reachability/linkstate topology view
58 .. note:: The BGP plugin is NOT a virtual router - does not construct Routing Tables, nor forward traffic.
60 List of supported capabilities
61 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
62 In addition to the base protocol implementation, the plugin provides many extensions to BGP, all based on IETF standards.
64 * `RFC4271 <https://tools.ietf.org/html/rfc4271>`_ - A Border Gateway Protocol 4 (BGP-4)
65 * `RFC4456 <https://tools.ietf.org/html/rfc4456>`_ - BGP Route Reflection: An Alternative to Full Mesh Internal BGP (IBGP)
66 * `RFC1997 <https://tools.ietf.org/html/rfc1997>`_ - BGP Communities Attribute
67 * `RFC4360 <https://tools.ietf.org/html/rfc4360>`_ - BGP Extended Communities Attribute
68 * `RFC4486 <https://tools.ietf.org/html/rfc4486>`_ - Subcodes for BGP Cease Notification Message
69 * `RFC5492 <https://tools.ietf.org/html/rfc5492>`_ - Capabilities Advertisement with BGP-4
70 * `RFC5004 <https://tools.ietf.org/html/rfc5004>`_ - Avoid BGP Best Path Transitions from One External to Another
71 * `RFC6286 <https://tools.ietf.org/html/rfc6286>`_ - Autonomous-System-Wide Unique BGP Identifier for BGP-4
72 * `RFC6793 <https://tools.ietf.org/html/rfc6793>`_ - BGP Support for Four-Octet Autonomous System (AS) Number Space
73 * `RFC7311 <https://tools.ietf.org/html/rfc7311>`_ - The Accumulated IGP Metric Attribute for BGP
74 * `RFC5668 <https://tools.ietf.org/html/rfc5668>`_ - 4-Octet AS Specific BGP Extended Community
75 * `draft-ietf-idr-link-bandwidth <https://tools.ietf.org/html/draft-ietf-idr-link-bandwidth-06>`_ - BGP Link Bandwidth Extended Community
76 * `draft-ietf-idr-bgp-extended-messages <https://tools.ietf.org/html/draft-ietf-idr-bgp-extended-messages-13>`_ - Extended Message support for BGP
77 * `RFC4760 <https://tools.ietf.org/html/rfc4760>`_ - Multiprotocol Extensions for BGP-4
78 * `RFC7752 <https://tools.ietf.org/html/rfc7752>`_ - North-Bound Distribution of Link-State and TE Information using BGP
79 * `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
80 * `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
81 * `RFC5575 <https://tools.ietf.org/html/rfc5575>`_ - Dissemination of Flow Specification Rules
82 * `RFC7674 <http://tools.ietf.org/html/rfc7674>`_ - Clarification of the Flowspec Redirect Extended Community
83 * `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
84 * `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
85 * `RFC3107 <https://tools.ietf.org/html/rfc3107>`_ - Carrying Label Information in BGP-4
86 * `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
87 * `RFC4364 <https://tools.ietf.org/html/rfc4364>`_ - BGP/MPLS IP Virtual Private Networks (VPNs)
88 * `RFC4659 <https://tools.ietf.org/html/rfc4659>`_ - BGP-MPLS IP Virtual Private Network (VPN) Extension for IPv6 VPN
89 * `RFC7432 <https://tools.ietf.org/html/rfc7432>`_ - BGP MPLS-Based Ethernet VPN
90 * `draft-ietf-bess-evpn-overlay <https://tools.ietf.org/html/draft-ietf-bess-evpn-overlay-04>`_ - A Network Virtualization Overlay Solution using EVPN
91 * `draft-ietf-bess-evpn-vpws <https://tools.ietf.org/html/draft-ietf-bess-evpn-vpws-07>`_ - VPWS support in EVPN
92 * `RFC7911 <https://tools.ietf.org/html/rfc7911>`_ - Advertisement of Multiple Paths in BGP
93 * `RFC2918 <https://tools.ietf.org/html/rfc2918>`_ - Route Refresh Capability for BGP-4
97 This section explains how to install BGP plugin.
99 1. Install BGP feature - ``odl-bgpcep-bgp``.
100 Also, for sake of this sample, it is required to install RESTCONF.
101 In the Karaf console, type command:
103 .. code-block:: console
105 feature:install odl-restconf odl-bgpcep-bgp
107 2. The BGP plugin contains a default configuration, which is applied after the feature starts up.
108 One instance of BGP plugin is created (named *example-bgp-rib*), and its presence can be verified via REST:
110 **URL:** ``/restconf/operational/bgp-rib:bgp-rib``
118 <bgp-rib xmlns="urn:opendaylight:params:xml:ns:yang:bgp-rib">
120 <id>example-bgp-rib</id>
127 Basic Configuration & Concepts
128 ------------------------------
129 The following section shows how to configure BGP basics, how to verify functionality and presents essential components of the plugin.
130 Next samples demonstrate the plugin's runtime configuration capability.
131 It shows the way to configure the plugin via REST, using standardized OpenConfig BGP APIs.
133 .. contents:: Contents
139 This tree illustrates the BGP RIBs organization in datastore.
141 .. code-block:: console
146 +--ro peer* [peer-id]
147 | +--ro peer-id peer-id
148 | +--ro peer-role peer-role
149 | +--ro simple-routing-policy? simple-routing-policy
150 | +--ro supported-tables* [afi safi]
151 | | +--ro afi identityref
152 | | +--ro safi identityref
153 | | +--ro send-receive? send-receive
155 | | +--ro tables* [afi safi]
156 | | +--ro afi identityref
157 | | +--ro safi identityref
159 | | | +--ro uptodate? boolean
161 | +--ro effective-rib-in
162 | | +--ro tables* [afi safi]
163 | | +--ro afi identityref
164 | | +--ro safi identityref
166 | | | +--ro uptodate? boolean
169 | +--ro tables* [afi safi]
170 | +--ro afi identityref
171 | +--ro safi identityref
173 | | +--ro uptodate? boolean
176 +--ro tables* [afi safi]
177 +--ro afi identityref
178 +--ro safi identityref
180 | +--ro uptodate? boolean
183 Protocol Configuration
184 ^^^^^^^^^^^^^^^^^^^^^^
185 As a first step, a new protocol instance needs to be configured.
186 It is a very basic configuration conforming with RFC4271.
188 **URL:** ``/restconf/config/openconfig-network-instance:network-instances/network-instance/global-bgp/openconfig-network-instance:protocols``
192 **Content-Type:** ``application/xml``
198 :emphasize-lines: 2,7,8
200 <protocol xmlns="http://openconfig.net/yang/network-instance">
201 <name>bgp-example</name>
202 <identifier xmlns:x="http://openconfig.net/yang/policy-types">x:BGP</identifier>
203 <bgp xmlns="urn:opendaylight:params:xml:ns:yang:bgp:openconfig-extensions">
206 <router-id>192.0.2.2</router-id>
213 @line 2: The unique protocol instance identifier.
215 @line 7: BGP Identifier of the speaker.
217 @line 8: Local autonomous system number of the speaker. Note that, OpenDaylight BGP implementation supports four-octet AS numbers only.
221 The new instance presence can be verified via REST:
223 **URL:** ``/restconf/operational/bgp-rib:bgp-rib/rib/bgp-example``
231 :emphasize-lines: 3,4
233 <rib xmlns="urn:opendaylight:params:xml:ns:yang:bgp-rib">
237 <afi xmlns:x="urn:opendaylight:params:xml:ns:yang:bgp-types">x:ipv4-address-family</afi>
238 <safi xmlns:x="urn:opendaylight:params:xml:ns:yang:bgp-types">x:unicast-subsequent-address-family</safi>
239 <ipv4-routes xmlns="urn:opendaylight:params:xml:ns:yang:bgp-inet"></ipv4-routes>
241 <uptodate>true</uptodate>
247 @line 3: Loc-RIB - Per-protocol instance RIB, which contains the routes that have been selected by local BGP speaker's decision process.
249 @line 4: The BGP-4 supports carrying IPv4 prefixes, such routes are stored in *ipv4-address-family*/*unicast-subsequent-address-family* table.
254 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
255 privileged ports restriction for non-root users.
256 One of the workarounds is to use port redirection. In case other port is desired to be used instead, we can reconfigure it.
258 Here is a sample of bgp port listening re-configuration:
260 **URL:** ``/restconf/config/odl-bgp-peer-acceptor-config:bgp-peer-acceptor-config/default``
264 **Content-Type:** ``application/xml``
270 :emphasize-lines: 3,4
272 <bgp-peer-acceptor-config xmlns="urn:opendaylight:params:xml:ns:yang:odl-bgp-peer-acceptor-config">
273 <config-name>default</config-name>
274 <binding-address>0.0.0.0</binding-address>
275 <binding-port>1791</binding-port>
276 </bgp-peer-acceptor-config>
278 @line 3: Binding address: By default is 0.0.0.0, so it is not a mandatory field.
280 @line 4: Binding Port: Port were BGP Server will listen.
284 To exchange routing information between two BGP systems (peers), it is required to configure a peering on both BGP speakers first.
285 This mean that each BGP speaker has a white list of neighbors, representing remote peers, with which the peering is allowed.
286 The TCP connection is established between two peers and they exchange messages to open and confirm the connection parameters followed by routes exchange.
288 Here is a sample basic neighbor configuration:
290 **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``
294 **Content-Type:** ``application/xml``
300 :emphasize-lines: 3,4
302 <neighbor xmlns="urn:opendaylight:params:xml:ns:yang:bgp:openconfig-extensions">
303 <neighbor-address>192.0.2.1</neighbor-address>
306 <hold-time>90</hold-time>
307 <connect-retry>10</connect-retry>
312 <remote-port>179</remote-port>
313 <passive-mode>false</passive-mode>
317 <peer-type>INTERNAL</peer-type>
321 @line 2: IP address of the remote BGP peer. Also serves as an unique identifier of a neighbor in a list of neighbors.
323 @line 5: Proposed number of seconds for value of the Hold Timer. Default value is **90**.
325 @line 6: Time interval in seconds between attempts to establish session with the peer. Effective in active mode only. Default value is **30**.
327 @line 11: Remote port number to which the local BGP is connecting. Effective in active mode only. Default value **179**.
329 @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**.
331 @line 16: Explicitly designate the peer as internal or external. Default value is **INTERNAL**.
335 Once the remote peer is connected and it advertised routes to local BGP system, routes are stored in peer's RIBs.
336 The RIBs can be checked via REST:
338 **URL:** ``/restconf/operational/bgp-rib:bgp-rib/rib/bgp-example/peer/bgp:%2F%2F192.0.2.1``
346 :emphasize-lines: 8,13,35,40,62,66
348 <peer xmlns="urn:opendaylight:params:xml:ns:yang:bgp-rib">
349 <peer-id>bgp://192.0.2.1</peer-id>
351 <afi xmlns:x="urn:opendaylight:params:xml:ns:yang:bgp-types">x:ipv4-address-family</afi>
352 <safi xmlns:x="urn:opendaylight:params:xml:ns:yang:bgp-types">x:unicast-subsequent-address-family</safi>
354 <peer-role>ibgp</peer-role>
357 <afi xmlns:x="urn:opendaylight:params:xml:ns:yang:bgp-types">x:ipv4-address-family</afi>
358 <safi xmlns:x="urn:opendaylight:params:xml:ns:yang:bgp-types">x:unicast-subsequent-address-family</safi>
359 <ipv4-routes xmlns="urn:opendaylight:params:xml:ns:yang:bgp-inet">
362 <prefix>10.0.0.10/32</prefix>
372 <global>10.10.1.1</global>
378 <uptodate>true</uptodate>
384 <afi xmlns:x="urn:opendaylight:params:xml:ns:yang:bgp-types">x:ipv4-address-family</afi>
385 <safi xmlns:x="urn:opendaylight:params:xml:ns:yang:bgp-types">x:unicast-subsequent-address-family</safi>
386 <ipv4-routes xmlns="urn:opendaylight:params:xml:ns:yang:bgp-inet">
389 <prefix>10.0.0.10/32</prefix>
399 <global>10.10.1.1</global>
405 <uptodate>true</uptodate>
411 <afi xmlns:x="urn:opendaylight:params:xml:ns:yang:bgp-types">x:ipv4-address-family</afi>
412 <safi xmlns:x="urn:opendaylight:params:xml:ns:yang:bgp-types">x:unicast-subsequent-address-family</safi>
413 <ipv4-routes xmlns="urn:opendaylight:params:xml:ns:yang:bgp-inet"></ipv4-routes>
414 <attributes></attributes>
419 @line 8: **Adj-RIB-In** - Per-peer RIB, which contains unprocessed routes that has been advertised to local BGP speaker by the remote peer.
421 @line 13: Here is the reported route with destination *10.0.0.10/32* in Adj-RIB-In.
423 @line 35: **Effective-RIB-In** - Per-peer RIB, which contains processed routes as a result of applying inbound policy to Adj-RIB-In routes.
425 @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.
427 @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.
429 @line 66: The peer's Adj-RIB-Out is empty as there are no routes to be advertise from local BGP speaker.
433 Also the same route should appeared in Loc-RIB now:
435 **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``
443 :emphasize-lines: 4,6,8,11,14
445 <ipv4-routes xmlns="urn:opendaylight:params:xml:ns:yang:bgp-inet">
448 <prefix>10.0.0.10/32</prefix>
458 <global>10.10.1.1</global>
464 @line 4: **Destination** - IPv4 Prefix Address.
466 @line 6: **AS_PATH** - mandatory attribute, contains a list of the autonomous system numbers through that routing information has traversed.
468 @line 8: **ORIGIN** - mandatory attribute, indicates an origin of the route - **ibgp**, **egp**, **incomplete**.
470 @line 11: **LOCAL_PREF** - indicates a degree of preference for external routes, higher value is preferred.
472 @line 14: **NEXT_HOP** - mandatory attribute, defines IP address of the router that should be used as the next hop to the destination.
476 There are much more attributes that may be carried along with the destination:
478 **BGP-4 Path Attributes**
480 * **MULTI_EXIT_DISC** (MED)
481 Optional attribute, to be used to discriminate among multiple exit/entry points on external links, lower number is preferred.
490 * **ATOMIC_AGGREGATE**
491 Indicates whether AS_SET was excluded from AS_PATH due to routes aggregation.
498 Optional attribute, contains AS number and IP address of a BGP speaker which performed routes aggregation.
503 <as-number>65000</as-number>
504 <network-address>192.0.2.2</network-address>
508 Optional attribute, used to store optional attributes, unrecognized by a local BGP speaker.
512 <unrecognized-attributes>
513 <partial>true</partial>
514 <transitive>true</transitive>
516 <value>0101010101010101</value>
517 </unrecognized-attributes>
519 **Route Reflector Attributes**
522 Optional attribute, carries BGP Identifier of the originator of the route.
527 <originator>41.41.41.41</originator>
531 Optional attribute, contains a list of CLUSTER_ID values representing the path that the route has traversed.
536 <cluster>40.40.40.40</cluster>
540 Optional attribute, may be used for policy routing.
545 <as-number>65000</as-number>
546 <semantics>30740</semantics>
549 **Extended Communities**
552 Identifies one or more routers that may receive a route.
556 <extended-communities>
557 <transitive>true</transitive>
559 <global-administrator>192.0.2.2</global-administrator>
560 <local-administrator>123</local-administrator>
562 </extended-communities>
563 <extended-communities>
564 <transitive>true</transitive>
565 <as-4-route-target-extended-community>
566 <as-4-specific-common>
567 <as-number>65000</as-number>
568 <local-administrator>123</local-administrator>
569 </as-4-specific-common>
570 </as-4-route-target-extended-community>
571 </extended-communities>
575 Identifies one or more routers that injected a route.
579 <extended-communities>
580 <transitive>true</transitive>
582 <global-administrator>192.0.2.2</global-administrator>
583 <local-administrator>123</local-administrator>
585 </extended-communities>
586 <extended-communities>
587 <transitive>true</transitive>
588 <as-4-route-origin-extended-community>
589 <as-4-specific-common>
590 <as-number>65000</as-number>
591 <local-administrator>123</local-administrator>
592 </as-4-origin-common>
593 </as-4-route-target-extended-community>
594 </extended-communities>
598 Carries the cost to reach external neighbor.
602 <extended-communities>
603 <transitive>true</transitive>
604 <link-bandwidth-extended-community>
605 <bandwidth>BH9CQAA=</bandwidth>
606 </link-bandwidth-extended-community>
607 </extended-communities>
610 Optional attribute, carries accumulated IGP metric.
621 .. note:: When the remote peer disconnects, it disappear from operational state of local speaker instance and advertised routes are removed too.
623 External peering configuration
624 ''''''''''''''''''''''''''''''
625 An example above provided configuration for internal peering only.
626 Following configuration sample is intended for external peering:
628 **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``
632 **Content-Type:** ``application/xml``
640 <neighbor xmlns="urn:opendaylight:params:xml:ns:yang:bgp:openconfig-extensions">
641 <neighbor-address>192.0.2.3</neighbor-address>
643 <peer-type>EXTERNAL</peer-type>
644 <peer-as>64999</peer-as>
648 @line 5: AS number of the remote peer.
650 Route reflector configuration
651 '''''''''''''''''''''''''''''
652 The local BGP speaker can be configured with a specific *cluster ID*.
653 Following example adds the cluster ID to the existing speaker instance:
655 **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``
659 **Content-Type:** ``application/xml``
668 <router-id>192.0.2.2</router-id>
670 <route-reflector-cluster-id>192.0.2.1</route-reflector-cluster-id>
673 @line 4: Route-reflector cluster id to use when local router is configured as a route reflector.
674 The *router-id* is used as a default value.
678 Following configuration sample is intended for route reflector client peering:
680 **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``
684 **Content-Type:** ``application/xml``
692 <neighbor xmlns="urn:opendaylight:params:xml:ns:yang:bgp:openconfig-extensions">
693 <neighbor-address>192.0.2.4</neighbor-address>
695 <peer-type>INTERNAL</peer-type>
699 <route-reflector-client>true</route-reflector-client>
704 @line 8: Configure the neighbor as a route reflector client. Default value is *false*.
706 MD5 authentication configuration
707 ''''''''''''''''''''''''''''''''
708 The OpenDaylight BGP implementation is supporting TCP MD5 for authentication.
709 Sample configuration below shows how to set authentication password for a peer:
711 **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``
715 **Content-Type:** ``application/xml``
723 <neighbor xmlns="urn:opendaylight:params:xml:ns:yang:bgp:openconfig-extensions">
724 <neighbor-address>192.0.2.5</neighbor-address>
726 <auth-password>topsecret</auth-password>
730 @line 4: Configures an MD5 authentication password for use with neighboring devices.
732 Simple Routing Policy configuration
733 '''''''''''''''''''''''''''''''''''
734 The OpenDaylight BGP implementation is supporting *Simple Routing Policy*.
735 Sample configuration below shows how to set *Simple Routing Policy* for a peer:
737 **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``
741 **Content-Type:** ``application/xml``
749 <neighbor xmlns="urn:opendaylight:params:xml:ns:yang:bgp:openconfig-extensions">
750 <neighbor-address>192.0.2.7</neighbor-address>
752 <simple-routing-policy>learn-none</simple-routing-policy>
756 @line 4: *Simple Routing Policy*:
758 * ``learn-none`` - routes advertised by the peer are not propagated to Effective-RIB-In and Loc-RIB
759 * ``announce-none`` - routes from local Loc-RIB are not advertised to the peer
761 .. note:: Existing neighbor configuration can be reconfigured (change configuration parameters) anytime.
762 As a result, established connection is dropped, peer instance is recreated with a new configuration settings and connection re-established.
764 .. note:: The BGP configuration is persisted on OpendDaylight shutdown and restored after the re-start.
766 BGP Application Peer and programmable RIB
767 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
768 The OpenDaylight BGP implementation also supports routes injection via *Application Peer*.
769 Such peer has its own programmable RIB, which can be modified by user.
770 This concept allows user to originate new routes and advertise them to all connected peers.
772 Application Peer configuration
773 ''''''''''''''''''''''''''''''
774 Following configuration sample show a way to configure the *Application Peer*:
776 **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``
780 **Content-Type:** ``application/xml``
786 :emphasize-lines: 2,4
788 <neighbor xmlns="urn:opendaylight:params:xml:ns:yang:bgp:openconfig-extensions">
789 <neighbor-address>10.25.1.9</neighbor-address>
791 <peer-group>application-peers</peer-group>
795 @line 2: IP address is uniquely identifying *Application Peer* and its programmable RIB. Address is also used in local BGP speaker decision process.
797 @line 4: Indicates that peer is associated with *application-peers* group. It serves to distinguish *Application Peer's* from regular neighbors.
801 The *Application Peer* presence can be verified via REST:
803 **URL:** ``/restconf/operational/bgp-rib:bgp-rib/rib/bgp-example/peer/bgp:%2F%2F10.25.1.9``
811 :emphasize-lines: 3,8
813 <peer xmlns="urn:opendaylight:params:xml:ns:yang:bgp-rib">
814 <peer-id>bgp://10.25.1.9</peer-id>
815 <peer-role>internal</peer-role>
818 <afi xmlns:x="urn:opendaylight:params:xml:ns:yang:bgp-types">x:ipv4-address-family</afi>
819 <safi xmlns:x="urn:opendaylight:params:xml:ns:yang:bgp-types">x:unicast-subsequent-address-family</safi>
820 <ipv4-routes xmlns="urn:opendaylight:params:xml:ns:yang:bgp-inet"></ipv4-routes>
822 <uptodate>false</uptodate>
828 <afi xmlns:x="urn:opendaylight:params:xml:ns:yang:bgp-types">x:ipv4-address-family</afi>
829 <safi xmlns:x="urn:opendaylight:params:xml:ns:yang:bgp-types">x:unicast-subsequent-address-family</safi>
830 <ipv4-routes xmlns="urn:opendaylight:params:xml:ns:yang:bgp-inet"></ipv4-routes>
831 <attributes></attributes>
836 @line 3: Peer role for *Application Peer* is *internal*.
838 @line 8: Adj-RIB-In is empty, as no routes were originated yet.
840 .. note:: There is no Adj-RIB-Out for *Application Peer*.
844 Next example shows how to inject a route into the programmable RIB.
846 **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``
850 **Content-Type:** ``application/xml``
856 <ipv4-route xmlns="urn:opendaylight:params:xml:ns:yang:bgp-inet">
858 <prefix>10.0.0.11/32</prefix>
868 <global>10.11.1.1</global>
875 Now the injected route appears in *Application Peer's* RIBs and in local speaker's Loc-RIB:
877 **URL:** ``/restconf/operational/bgp-rib:bgp-rib/rib/bgp-example/peer/bgp:%2F%2F10.25.1.9``
887 <peer xmlns="urn:opendaylight:params:xml:ns:yang:bgp-rib">
888 <peer-id>bgp://10.25.1.9</peer-id>
889 <peer-role>internal</peer-role>
892 <afi xmlns:x="urn:opendaylight:params:xml:ns:yang:bgp-types">x:ipv4-address-family</afi>
893 <safi xmlns:x="urn:opendaylight:params:xml:ns:yang:bgp-types">x:unicast-subsequent-address-family</safi>
894 <ipv4-routes xmlns="urn:opendaylight:params:xml:ns:yang:bgp-inet">
897 <prefix>10.0.0.11/32</prefix>
907 <global>10.11.1.1</global>
913 <uptodate>false</uptodate>
919 <afi xmlns:x="urn:opendaylight:params:xml:ns:yang:bgp-types">x:ipv4-address-family</afi>
920 <safi xmlns:x="urn:opendaylight:params:xml:ns:yang:bgp-types">x:unicast-subsequent-address-family</safi>
921 <ipv4-routes xmlns="urn:opendaylight:params:xml:ns:yang:bgp-inet">
924 <prefix>10.0.0.11/32</prefix>
934 <global>10.11.1.1</global>
939 <attributes></attributes>
944 @line 9: Injected route is present in *Application Peer's* Adj-RIB-In and Effective-RIB-In.
948 **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``
958 <ipv4-routes xmlns="urn:opendaylight:params:xml:ns:yang:bgp-inet">
961 <prefix>10.0.0.10/32</prefix>
971 <global>10.11.1.1</global>
977 <prefix>10.0.0.10/32</prefix>
987 <global>10.10.1.1</global>
993 @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.
997 This route is also advertised to the remote peer (*192.0.2.1*), hence route appears in its Adj-RIB-Out:
999 **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``
1007 <ipv4-route xmlns="urn:opendaylight:params:xml:ns:yang:bgp-inet">
1008 <path-id>0</path-id>
1009 <prefix>10.0.0.11/32</prefix>
1019 <global>10.11.1.1</global>
1026 The injected route can be modified (i.e. different path attribute):
1028 **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``
1032 **Content-Type:** ``application/xml``
1038 <ipv4-route xmlns="urn:opendaylight:params:xml:ns:yang:bgp-inet">
1039 <path-id>0</path-id>
1040 <prefix>10.0.0.11/32</prefix>
1050 <global>10.11.1.2</global>
1057 The route can be removed from programmable RIB in a following way:
1059 **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``
1061 **Method:** ``DELETE``
1065 Also it is possible to remove all routes from a particular table at once:
1067 **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/``
1069 **Method:** ``DELETE``
1073 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).
1075 .. note:: Routes stored in programmable RIB are persisted on OpendDaylight shutdown and restored after the re-start.
1077 BGP Protocol Configuration Loader
1078 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1080 BGP Protocol Configuration Loader allows user to define static initial configuration for a BGP protocol instance.
1081 This service will detect the creation of new configuration files following the pattern "protocols-*.xml" under the path "etc/opendaylight/bgp".
1082 Once the file is processed, the defined configuration will be available from the configuration Data Store.
1084 .. note:: If the BGP instance is already present, no update or configuration will be applied.
1086 When installing BGP an example will be provided and a default configuration loaded.
1088 **PATH:** ``etc/opendaylight/bgp/protocols-config.xml``
1092 <protocols xmlns="http://openconfig.net/yang/network-instance">
1094 <name>example-bgp-rib</name>
1095 <identifier xmlns:x="http://openconfig.net/yang/policy-types">x:BGP</identifier>
1096 <bgp xmlns="urn:opendaylight:params:xml:ns:yang:bgp:openconfig-extensions">
1099 <router-id>192.0.2.2</router-id>
1101 <!-- if cluster-id is not present, it's value is the same as bgp-id -->
1102 <!-- <route-reflector-cluster-id>192.0.2.3</route-reflector-cluster-id> -->
1103 <!-- <read-only-limit>120</read-only-limit>-->
1107 <afi-safi-name xmlns:x="http://openconfig.net/yang/bgp-types">x:IPV4-UNICAST</afi-safi-name>
1108 <!--Advertise N Paths
1109 <receive>true</receive>
1110 <send-max>2</send-max>-->
1113 <afi-safi-name xmlns:x="http://openconfig.net/yang/bgp-types">x:IPV6-UNICAST</afi-safi-name>
1116 <afi-safi-name xmlns:x="http://openconfig.net/yang/bgp-types">x:IPV4-LABELLED-UNICAST</afi-safi-name>
1119 <afi-safi-name xmlns:x="http://openconfig.net/yang/bgp-types">x:IPV6-LABELLED-UNICAST</afi-safi-name>
1122 <afi-safi-name xmlns:x="http://openconfig.net/yang/bgp-types">x:L3VPN-IPV4-UNICAST</afi-safi-name>
1125 <afi-safi-name xmlns:x="http://openconfig.net/yang/bgp-types">x:L3VPN-IPV6-UNICAST</afi-safi-name>
1128 <afi-safi-name xmlns:x="http://openconfig.net/yang/bgp-types">x:L2VPN-EVPN</afi-safi-name>
1131 <afi-safi-name>LINKSTATE</afi-safi-name>
1134 <afi-safi-name>IPV4-FLOW</afi-safi-name>
1137 <afi-safi-name>IPV6-FLOW</afi-safi-name>
1140 <afi-safi-name>IPV4-L3VPN-FLOW</afi-safi-name>
1143 <afi-safi-name>IPV6-L3VPN-FLOW</afi-safi-name>
1147 <neighbors xmlns="urn:opendaylight:params:xml:ns:yang:bgp:openconfig-extensions">
1148 <neighbor xmlns="urn:opendaylight:params:xml:ns:yang:bgp:openconfig-extensions">
1149 <neighbor-address>192.0.2.1</neighbor-address>
1151 <peer-type>INTERNAL</peer-type>
1152 <peer-as>64496</peer-as>
1156 <remote-port>179</remote-port>
1157 <passive-mode>true</passive-mode>
1162 <hold-time>180</hold-time>
1163 <connect-retry>10</connect-retry>
1168 <route-reflector-client>false</route-reflector-client>
1173 <afi-safi-name xmlns:x="http://openconfig.net/yang/bgp-types">x:IPV4-UNICAST</afi-safi-name>
1174 <!--Advertise N Paths
1175 <receive>true</receive>
1176 <send-max>0</send-max>-->
1179 <afi-safi-name xmlns:x="http://openconfig.net/yang/bgp-types">x:IPV6-UNICAST</afi-safi-name>
1182 <afi-safi-name xmlns:x="http://openconfig.net/yang/bgp-types">x:IPV4-LABELLED-UNICAST</afi-safi-name>
1185 <afi-safi-name xmlns:x="http://openconfig.net/yang/bgp-types">x:IPV6-LABELLED-UNICAST</afi-safi-name>
1188 <afi-safi-name xmlns:x="http://openconfig.net/yang/bgp-types">x:L3VPN-IPV4-UNICAST</afi-safi-name>
1191 <afi-safi-name xmlns:x="http://openconfig.net/yang/bgp-types">x:L3VPN-IPV6-UNICAST</afi-safi-name>
1194 <afi-safi-name xmlns:x="http://openconfig.net/yang/bgp-types">x:L2VPN-EVPN</afi-safi-name>
1197 <afi-safi-name>LINKSTATE</afi-safi-name>
1200 <afi-safi-name>IPV4-FLOW</afi-safi-name>
1203 <afi-safi-name>IPV6-FLOW</afi-safi-name>
1206 <afi-safi-name>IPV4-L3VPN-FLOW</afi-safi-name>
1209 <afi-safi-name>IPV6-L3VPN-FLOW</afi-safi-name>
1213 <neighbor xmlns="urn:opendaylight:params:xml:ns:yang:bgp:openconfig-extensions">
1214 <neighbor-address>192.0.2.6</neighbor-address>
1216 <peer-group>application-peers</peer-group>
1226 .. figure:: ./images/bgpcep/bgp-pipeline.png
1229 BGP pipeline - routes re-advertisement.
1231 .. figure:: ./images/bgpcep/bgp-app-pipeline.png
1232 :alt: BGP Application Peer pipeline.
1234 BGP applcaition peer pipeline - routes injection.
1238 * `A Border Gateway Protocol 4 (BGP-4) <https://tools.ietf.org/html/rfc4271>`_
1239 * `BGP Route Reflection <https://tools.ietf.org/html/rfc4456>`_
1240 * `BGP Communities Attribute <https://tools.ietf.org/html/rfc1997>`_
1241 * `BGP Support for Four-Octet Autonomous System (AS) Number Space <https://tools.ietf.org/html/rfc6793>`_
1242 * `The Accumulated IGP Metric Attribute for BGP <https://tools.ietf.org/html/rfc7311>`_
1243 * `4-Octet AS Specific BGP Extended Community <https://tools.ietf.org/html/rfc5668>`_
1244 * `BGP Link Bandwidth Extended Community <https://tools.ietf.org/html/draft-ietf-idr-link-bandwidth-06>`_
1245 * `Use of BGP for Routing in Large-Scale Data Centers <https://tools.ietf.org/html/rfc7938>`_
1249 The BGP-4 allows to carry IPv4 specific information only.
1250 The basic BGP Multiprotocol extension brings *Unicast* Subsequent Address Family (SAFI) - intended to be used for IP unicast forwarding.
1251 The combination of IPv4 and IPv6 Address Family (AF) and Unicast SAFI is essential for Internet routing.
1252 The IPv4 Unicast routes are interchangeable with BGP-4 routes, as they can carry the same type of routing information.
1254 .. contents:: Contents
1260 This section shows a way to enable IPv4 and IPv6 Unicast family in BGP speaker and peer configuration.
1264 To enable IPv4 and IPv6 Unicast support in BGP plugin, first configure BGP speaker instance:
1266 **URL:** ``/restconf/config/openconfig-network-instance:network-instances/network-instance/global-bgp/openconfig-network-instance:protocols``
1268 **Method:** ``POST``
1270 **Content-Type:** ``application/xml``
1276 <protocol xmlns="http://openconfig.net/yang/network-instance">
1277 <name>bgp-example</name>
1278 <identifier xmlns:x="http://openconfig.net/yang/policy-types">x:BGP</identifier>
1279 <bgp xmlns="urn:opendaylight:params:xml:ns:yang:bgp:openconfig-extensions">
1282 <router-id>192.0.2.2</router-id>
1287 <afi-safi-name xmlns:x="http://openconfig.net/yang/bgp-types">x:IPV4-UNICAST</afi-safi-name>
1290 <afi-safi-name xmlns:x="http://openconfig.net/yang/bgp-types">x:IPV6-UNICAST</afi-safi-name>
1299 Here is an example for BGP peer configuration with enabled IPv4 and IPv6 Unicast family.
1301 **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``
1303 **Method:** ``POST``
1305 **Content-Type:** ``application/xml``
1311 <neighbor xmlns="urn:opendaylight:params:xml:ns:yang:bgp:openconfig-extensions">
1312 <neighbor-address>192.0.2.1</neighbor-address>
1315 <afi-safi-name xmlns:x="http://openconfig.net/yang/bgp-types">x:IPV4-UNICAST</afi-safi-name>
1318 <afi-safi-name xmlns:x="http://openconfig.net/yang/bgp-types">x:IPV6-UNICAST</afi-safi-name>
1325 Following trees illustrate the BGP IP Unicast routes structures.
1329 .. code-block:: console
1333 +--ro ipv4-route* [prefix path-id]
1334 +--ro prefix inet:ipv4-prefix
1335 +--ro path-id path-id
1338 | +--ro value bgp-t:bgp-origin
1341 | +--ro as-sequence* inet:as-number
1342 | +--ro as-set* inet:as-number
1344 | +--:(ipv4-next-hop-case)
1345 | | +--ro ipv4-next-hop
1346 | | +--ro global? inet:ipv4-address
1347 | +--:(ipv6-next-hop-case)
1348 | | +--ro ipv6-next-hop
1349 | | +--ro global? inet:ipv6-address
1350 | | +--ro link-local? inet:ipv6-address
1351 | +--:(empty-next-hop-case)
1352 | +--ro empty-next-hop? empty
1353 +--ro multi-exit-disc
1356 | +--ro pref? uint32
1357 +--ro atomic-aggregate!
1359 | +--ro as-number? inet:as-number
1360 | +--ro network-address? inet:ipv4-address
1362 | +--ro as-number? inet:as-number
1363 | +--ro semantics? uint16
1364 +--ro extended-communities*
1365 | +--ro transitive? boolean
1366 | +--ro (extended-community)?
1367 | +--:(as-specific-extended-community-case)
1368 | | +--ro as-specific-extended-community
1369 | | +--ro global-administrator? short-as-number
1370 | | +--ro local-administrator? binary
1371 | +--:(inet4-specific-extended-community-case)
1372 | | +--ro inet4-specific-extended-community
1373 | | +--ro global-administrator? inet:ipv4-address
1374 | | +--ro local-administrator? binary
1375 | +--:(opaque-extended-community-case)
1376 | | +--ro opaque-extended-community
1377 | | +--ro value? binary
1378 | +--:(route-target-extended-community-case)
1379 | | +--ro route-target-extended-community
1380 | | +--ro global-administrator? short-as-number
1381 | | +--ro local-administrator? binary
1382 | +--:(route-origin-extended-community-case)
1383 | | +--ro route-origin-extended-community
1384 | | +--ro global-administrator? short-as-number
1385 | | +--ro local-administrator? binary
1386 | +--:(route-target-ipv4-case)
1387 | | +--ro route-target-ipv4
1388 | | +--ro global-administrator? inet:ipv4-address
1389 | | +--ro local-administrator? uint16
1390 | +--:(route-origin-ipv4-case)
1391 | | +--ro route-origin-ipv4
1392 | | +--ro global-administrator? inet:ipv4-address
1393 | | +--ro local-administrator? uint16
1394 | +--:(link-bandwidth-case)
1395 | | +--ro link-bandwidth-extended-community
1396 | | +--ro bandwidth netc:bandwidth
1397 | +--:(as-4-generic-spec-extended-community-case)
1398 | | +--ro as-4-generic-spec-extended-community
1399 | | +--ro as-4-specific-common
1400 | | +--ro as-number inet:as-number
1401 | | +--ro local-administrator uint16
1402 | +--:(as-4-route-target-extended-community-case)
1403 | | +--ro as-4-route-target-extended-community
1404 | | +--ro as-4-specific-common
1405 | | +--ro as-number inet:as-number
1406 | | +--ro local-administrator uint16
1407 | +--:(as-4-route-origin-extended-community-case)
1408 | | +--ro as-4-route-origin-extended-community
1409 | | +--ro as-4-specific-common
1410 | | +--ro as-number inet:as-number
1411 | | +--ro local-administrator uint16
1412 | +--:(encapsulation-case)
1413 | +--ro encapsulation-extended-community
1414 | +--ro tunnel-type encapsulation-tunnel-type
1416 | +--ro originator? inet:ipv4-address
1418 | +--ro cluster* bgp-t:cluster-identifier
1421 | +--ro metric? netc:accumulated-igp-metric
1422 +--ro unrecognized-attributes* [type]
1423 +--ro partial boolean
1424 +--ro transitive boolean
1430 .. code-block:: console
1434 +--ro ipv6-route* [prefix path-id]
1435 +--ro prefix inet:ipv6-prefix
1436 +--ro path-id path-id
1444 The IPv4 Unicast table in an instance of the speaker's Loc-RIB can be verified via REST:
1446 **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``
1454 <ipv4-routes xmlns="urn:opendaylight:params:xml:ns:yang:bgp-inet">
1456 <path-id>0</path-id>
1457 <prefix>193.0.2.1/32</prefix>
1467 <global>10.0.0.1</global>
1475 The IPv6 Unicast table in an instance of the speaker's Loc-RIB can be verified via REST:
1477 **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``
1485 <ipv6-routes xmlns="urn:opendaylight:params:xml:ns:yang:bgp-inet">
1487 <path-id>0</path-id>
1488 <prefix>2a02:b80:0:1::/64</prefix>
1498 <global>2a02:b80:0:2::1</global>
1504 .. note:: IPv4/6 routes mapping to topology nodes is supported by BGP Topology Provider.
1510 This examples show how to originate and remove IPv4 route via programmable RIB.
1511 Make sure the *Application Peer* is configured first.
1513 **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``
1515 **Method:** ``POST``
1517 **Content-Type:** ``application/xml``
1523 <ipv4-route xmlns="urn:opendaylight:params:xml:ns:yang:bgp-inet">
1524 <path-id>0</path-id>
1525 <prefix>10.0.0.11/32</prefix>
1535 <global>10.11.1.1</global>
1542 To remove the route added above, following request can be used:
1544 **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``
1546 **Method:** ``DELETE``
1550 This examples show how to originate and remove IPv6 route via programmable RIB:
1552 **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``
1554 **Method:** ``POST``
1556 **Content-Type:** ``application/xml``
1562 <ipv6-route xmlns="urn:opendaylight:params:xml:ns:yang:bgp-inet">
1563 <prefix>2001:db8:30::3/128</prefix>
1564 <path-id>0</path-id>
1567 <global>2001:db8:1::6</global>
1581 To remove the route added above, following request can be used:
1583 **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``
1585 **Method:** ``DELETE``
1589 * `Multiprotocol Extensions for BGP-4 <https://tools.ietf.org/html/rfc4760>`_
1591 IP Labeled Unicast Family
1592 -------------------------
1593 The BGP Labeled Unicast (BGP-LU) Multiprotocol extension is used to distribute a MPLS label that is mapped to a particular route.
1594 It can be used to advertise a MPLS transport path between IGP regions and Autonomous Systems.
1595 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.
1596 In addition, IPv6 Labeled Unicast can be used to interconnect IPv6 islands over IPv4/MPLS networks using 6PE.
1598 .. contents:: Contents
1604 This section shows a way to enable IPv4 and IPv6 Labeled Unicast family in BGP speaker and peer configuration.
1608 To enable IPv4 and IPv6 Labeled Unicast support in BGP plugin, first configure BGP speaker instance:
1610 **URL:** ``/restconf/config/openconfig-network-instance:network-instances/network-instance/global-bgp/openconfig-network-instance:protocols``
1612 **Method:** ``POST``
1614 **Content-Type:** ``application/xml``
1620 <protocol xmlns="http://openconfig.net/yang/network-instance">
1621 <name>bgp-example</name>
1622 <identifier xmlns:x="http://openconfig.net/yang/policy-types">x:BGP</identifier>
1623 <bgp xmlns="urn:opendaylight:params:xml:ns:yang:bgp:openconfig-extensions">
1626 <router-id>192.0.2.2</router-id>
1631 <afi-safi-name xmlns:x="http://openconfig.net/yang/bgp-types">x:IPV4-LABELLED-UNICAST</afi-safi-name>
1634 <afi-safi-name xmlns:x="http://openconfig.net/yang/bgp-types">x:IPV6-LABELLED-UNICAST</afi-safi-name>
1643 Here is an example for BGP peer configuration with enabled IPv4 and IPv6 Labeled Unicast family.
1645 **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``
1647 **Method:** ``POST``
1649 **Content-Type:** ``application/xml``
1655 <neighbor xmlns="urn:opendaylight:params:xml:ns:yang:bgp:openconfig-extensions">
1656 <neighbor-address>192.0.2.1</neighbor-address>
1659 <afi-safi-name xmlns:x="http://openconfig.net/yang/bgp-types">x:IPV4-LABELLED-UNICAST</afi-safi-name>
1662 <afi-safi-name xmlns:x="http://openconfig.net/yang/bgp-types">x:IPV6-LABELLED-UNICAST</afi-safi-name>
1667 IP Labeled Unicast API
1668 ^^^^^^^^^^^^^^^^^^^^^^
1669 Following trees illustrate the BGP IP Labeled Unicast routes structures.
1671 IPv4 Labeled Unicast Route
1672 ''''''''''''''''''''''''''
1673 .. code-block:: console
1675 :(labeled-unicast-routes-case)
1676 +--ro labeled-unicast-routes
1677 +--ro labeled-unicast-route* [route-key path-id]
1678 +--ro route-key string
1680 | +--ro label-value? netc:mpls-label
1681 +--ro prefix? inet:ip-prefix
1682 +--ro path-id path-id
1687 IPv6 Labeled Unicast Route
1688 ''''''''''''''''''''''''''
1689 .. code-block:: console
1691 :(labeled-unicast-ipv6-routes-case)
1692 +--ro labeled-unicast-ipv6-routes
1693 +--ro labeled-unicast-route* [route-key path-id]
1694 +--ro route-key string
1696 | +--ro label-value? netc:mpls-label
1697 +--ro prefix? inet:ip-prefix
1698 +--ro path-id path-id
1704 The IPv4 Labeled Unicast table in an instance of the speaker's Loc-RIB can be verified via REST:
1706 **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``
1714 <labeled-unicast-routes xmlns="urn:opendaylight:params:xml:ns:yang:bgp-labeled-unicast">
1715 <labeled-unicast-route>
1716 <path-id>0</path-id>
1717 <route-key>MAA+gRQAAA==</route-key>
1723 <global>200.10.0.101</global>
1731 <label-value>1000</label-value>
1733 <prefix>20.0.0.0/24</prefix>
1734 </labeled-unicast-route>
1735 </labeled-unicast-routes>
1741 This examples show how to originate and remove IPv4 labeled route via programmable RIB.
1742 Make sure the *Application Peer* is configured first.
1744 **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``
1746 **Method:** ``POST``
1748 **Content-Type:** ``application/xml``
1754 <labeled-unicast-route xmlns="urn:opendaylight:params:xml:ns:yang:bgp-labeled-unicast">
1755 <route-key>label1</route-key>
1756 <prefix>1.1.1.1/32</prefix>
1757 <path-id>0</path-id>
1759 <label-value>800322</label-value>
1763 <global>199.20.160.41</global>
1773 </labeled-unicast-route>
1777 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.
1782 <bgp-prefix-sid-tlvs>
1783 <label-index-tlv xmlns="urn:opendaylight:params:xml:ns:yang:bgp-labeled-unicast">322</label-index-tlv>
1784 </bgp-prefix-sid-tlvs>
1785 <bgp-prefix-sid-tlvs>
1786 <srgb-value xmlns="urn:opendaylight:params:xml:ns:yang:bgp-labeled-unicast">
1790 </bgp-prefix-sid-tlvs>
1795 To remove the route added above, following request can be used:
1797 **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``
1799 **Method:** ``DELETE``
1803 This examples show how to originate and remove IPv6 labeled route via programmable RIB.
1805 **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``
1807 **Method:** ``POST``
1809 **Content-Type:** ``application/xml``
1815 <labeled-unicast-route xmlns="urn:opendaylight:params:xml:ns:yang:bgp-labeled-unicast">
1816 <route-key>label1</route-key>
1817 <prefix>2001:db8:30::3/128</prefix>
1818 <path-id>0</path-id>
1820 <label-value>123</label-value>
1824 <global>2003:4:5:6::7</global>
1834 </labeled-unicast-route>
1838 To remove the route added above, following request can be used:
1840 **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``
1842 **Method:** ``DELETE``
1846 * `Carrying Label Information in BGP-4 <https://tools.ietf.org/html/rfc3107>`_
1847 * `Segment Routing Prefix SID extensions for BGP <https://tools.ietf.org/html/draft-ietf-idr-bgp-prefix-sid-03>`_
1848 * `Connecting IPv6 Islands over IPv4 MPLS Using IPv6 Provider Edge Routers (6PE) <https://tools.ietf.org/html/rfc4798>`_
1849 * `BGP-Prefix Segment in large-scale data centers <https://tools.ietf.org/html/draft-ietf-spring-segment-routing-msdc-01>`_
1850 * `Egress Peer Engineering using BGP-LU <https://tools.ietf.org/html/draft-gredler-idr-bgplu-epe-06>`_
1854 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.
1855 Also, routes are distributed to specific VPN remote sites.
1857 .. contents:: Contents
1863 This section shows a way to enable IPv4 and IPv6 L3VPN family in BGP speaker and peer configuration.
1867 To enable IPv4 and IPv6 L3VPN support in BGP plugin, first configure BGP speaker instance:
1869 **URL:** ``/restconf/config/openconfig-network-instance:network-instances/network-instance/global-bgp/openconfig-network-instance:protocols``
1871 **Method:** ``POST``
1873 **Content-Type:** ``application/xml``
1879 <protocol xmlns="http://openconfig.net/yang/network-instance">
1880 <name>bgp-example</name>
1881 <identifier xmlns:x="http://openconfig.net/yang/policy-types">x:BGP</identifier>
1882 <bgp xmlns="urn:opendaylight:params:xml:ns:yang:bgp:openconfig-extensions">
1885 <router-id>192.0.2.2</router-id>
1890 <afi-safi-name xmlns:x="http://openconfig.net/yang/bgp-types">x:L3VPN-IPV4-UNICAST</afi-safi-name>
1893 <afi-safi-name xmlns:x="http://openconfig.net/yang/bgp-types">x:L3VPN-IPV6-UNICAST</afi-safi-name>
1902 Here is an example for BGP peer configuration with enabled IPv4 and IPv6 L3VPN family.
1904 **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``
1906 **Method:** ``POST``
1908 **Content-Type:** ``application/xml``
1914 <neighbor xmlns="urn:opendaylight:params:xml:ns:yang:bgp:openconfig-extensions">
1915 <neighbor-address>192.0.2.1</neighbor-address>
1918 <afi-safi-name xmlns:x="http://openconfig.net/yang/bgp-types">x:L3VPN-IPV4-UNICAST</afi-safi-name>
1921 <afi-safi-name xmlns:x="http://openconfig.net/yang/bgp-types">x:L3VPN-IPV6-UNICAST</afi-safi-name>
1928 Following trees illustrate the BGP IP L3VPN routes structures.
1932 .. code-block:: console
1934 :(vpn-ipv4-routes-case)
1935 +--ro vpn-ipv4-routes
1936 +--ro vpn-route* [route-key]
1937 +--ro route-key string
1939 | +--ro label-value? netc:mpls-label
1940 +--ro prefix? inet:ip-prefix
1941 +--ro path-id? path-id
1942 +--ro route-distinguisher? bgp-t:route-distinguisher
1948 .. code-block:: console
1950 :(vpn-ipv6-routes-case)
1951 +--ro vpn-ipv6-routes
1952 +--ro vpn-route* [route-key]
1953 +--ro route-key string
1955 | +--ro label-value? netc:mpls-label
1956 +--ro prefix? inet:ip-prefix
1957 +--ro path-id? path-id
1958 +--ro route-distinguisher? bgp-t:route-distinguisher
1966 The IPv4 L3VPN table in an instance of the speaker's Loc-RIB can be verified via REST:
1968 **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``
1976 <vpn-ipv4-routes xmlns="urn:opendaylight:params:xml:ns:yang:bgp-vpn-ipv4">
1978 <route-key>cAXdYQABrBAALABlCgIi</route-key>
1980 <label-value>24022</label-value>
1983 <extended-communities>
1984 <transitive>true</transitive>
1985 <route-target-extended-community>
1986 <global-administrator>65000</global-administrator>
1987 <local-administrator>AAAAZQ==</local-administrator>
1988 </route-target-extended-community>
1989 </extended-communities>
1998 <global>127.16.0.44</global>
2001 <route-distinguisher>172.16.0.44:101</route-distinguisher>
2002 <prefix>10.2.34.0/24</prefix>
2008 The IPv6 L3VPN table in an instance of the speaker's Loc-RIB can be verified via REST:
2010 **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``
2018 <vpn-ipv6-routes xmlns="urn:opendaylight:params:xml:ns:yang:bgp-vpn-ipv6">
2020 <route-key>mAXdcQABrBAALABlKgILgAAAAAE=</route-key>
2022 <label-value>24023</label-value>
2028 <extended-communities>
2029 <route-target-extended-community>
2030 <global-administrator>65000</global-administrator>
2031 <local-administrator>AAAAZQ==</local-administrator>
2032 </route-target-extended-community>
2033 <transitive>true</transitive>
2034 </extended-communities>
2036 <global>2a02:b80:0:2::1</global>
2043 <route-distinguisher>172.16.0.44:101</route-distinguisher>
2044 <prefix>2a02:b80:0:1::/64</prefix>
2050 This examples show how to originate and remove IPv4 L3VPN route via programmable RIB.
2051 Make sure the *Application Peer* is configured first.
2053 **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``
2055 **Method:** ``POST``
2057 **Content-Type:** ``application/xml``
2063 <vpn-route xmlns="urn:opendaylight:params:xml:ns:yang:bgp-vpn-ipv4">
2064 <route-key>vpn1</route-key>
2066 <label-value>123</label-value>
2068 <route-distinguisher>429496729:1</route-distinguisher>
2069 <prefix>2.2.2.2/32</prefix>
2072 <global>199.20.166.41</global>
2078 <extended-communities>
2079 <route-target-extended-community>
2080 <global-administrator>65000</global-administrator>
2081 <local-administrator>AAAAZQ==</local-administrator>
2082 </route-target-extended-community>
2083 <transitive>true</transitive>
2084 </extended-communities>
2090 To remove the route added above, following request can be used:
2092 **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``
2094 **Method:** ``DELETE``
2098 * `BGP/MPLS IP Virtual Private Networks (VPNs) <https://tools.ietf.org/html/rfc4364>`_
2099 * `BGP-MPLS IP Virtual Private Network (VPN) Extension for IPv6 VPN <https://tools.ietf.org/html/rfc4659>`_
2100 * `BGP/MPLS VPN Virtual PE <https://tools.ietf.org/html/draft-ietf-bess-virtual-pe-00>`_
2104 The BGP Link-State (BGP-LS) Multiprotocol extension allows to distribute Link-State and Traffic Engineering (TE) information.
2105 This information is typically distributed by IGP routing protocols with in the network, limiting LSDB or TED visibility to the IGP area.
2106 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).
2107 The information is applicable in ALTO servers and PCEs, as both need to gather information about topologies.
2108 In addition, link-state information is extended to carry segment information (Spring).
2110 .. contents:: Contents
2116 This section shows a way to enable IPv4 and IPv6 Labeled Unicast family in BGP speaker and peer configuration.
2120 To enable BGP-LS support in BGP plugin, first configure BGP speaker instance:
2122 **URL:** ``/restconf/config/openconfig-network-instance:network-instances/network-instance/global-bgp/openconfig-network-instance:protocols``
2124 **Method:** ``POST``
2126 **Content-Type:** ``application/xml``
2132 <protocol xmlns="http://openconfig.net/yang/network-instance">
2133 <name>bgp-example</name>
2134 <identifier xmlns:x="http://openconfig.net/yang/policy-types">x:BGP</identifier>
2135 <bgp xmlns="urn:opendaylight:params:xml:ns:yang:bgp:openconfig-extensions">
2138 <router-id>192.0.2.2</router-id>
2143 <afi-safi-name>LINKSTATE</afi-safi-name>
2152 Here is an example for BGP peer configuration with enabled BGP-LS family.
2154 **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``
2156 **Method:** ``POST``
2158 **Content-Type:** ``application/xml``
2164 <neighbor xmlns="urn:opendaylight:params:xml:ns:yang:bgp:openconfig-extensions">
2165 <neighbor-address>192.0.2.1</neighbor-address>
2168 <afi-safi-name>LINKSTATE</afi-safi-name>
2173 Link-State Route API
2174 ^^^^^^^^^^^^^^^^^^^^
2175 Following tree illustrate the BGP Link-State route structure.
2177 .. code-block:: console
2179 :(linkstate-routes-case)
2180 +--ro linkstate-routes
2181 +--ro linkstate-route* [route-key]
2182 +--ro route-key binary
2183 +--ro protocol-id protocol-id
2184 +--ro identifier identifier
2185 +--ro (object-type)?
2187 | | +--ro node-descriptors
2188 | | +--ro as-number? inet:as-number
2189 | | +--ro area-id? area-identifier
2190 | | +--ro domain-id? domain-identifier
2191 | | +--ro (c-router-identifier)?
2192 | | +--:(isis-node-case)
2193 | | | +--ro isis-node
2194 | | | +--ro iso-system-id netc:iso-system-identifier
2195 | | +--:(isis-pseudonode-case)
2196 | | | +--ro isis-pseudonode
2197 | | | +--ro is-is-router-identifier
2198 | | | | +--ro iso-system-id netc:iso-system-identifier
2199 | | | +--ro psn uint8
2200 | | +--:(ospf-node-case)
2201 | | | +--ro ospf-node
2202 | | | +--ro ospf-router-id uint32
2203 | | +--:(ospf-pseudonode-case)
2204 | | +--ro ospf-pseudonode
2205 | | +--ro ospf-router-id uint32
2206 | | +--ro lan-interface ospf-interface-identifier
2208 | | +--ro local-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
2228 | | | +--ro bgp-router-id? inet:ipv4-address
2229 | | | +--ro member-asn? inet:as-number
2230 | | +--ro remote-node-descriptors
2231 | | | +--ro as-number? inet:as-number
2232 | | | +--ro area-id? area-identifier
2233 | | | +--ro domain-id? domain-identifier
2234 | | | +--ro (c-router-identifier)?
2235 | | | | +--:(isis-node-case)
2236 | | | | | +--ro isis-node
2237 | | | | | +--ro iso-system-id netc:iso-system-identifier
2238 | | | | +--:(isis-pseudonode-case)
2239 | | | | | +--ro isis-pseudonode
2240 | | | | | +--ro is-is-router-identifier
2241 | | | | | | +--ro iso-system-id netc:iso-system-identifier
2242 | | | | | +--ro psn uint8
2243 | | | | +--:(ospf-node-case)
2244 | | | | | +--ro ospf-node
2245 | | | | | +--ro ospf-router-id uint32
2246 | | | | +--:(ospf-pseudonode-case)
2247 | | | | +--ro ospf-pseudonode
2248 | | | | +--ro ospf-router-id uint32
2249 | | | | +--ro lan-interface ospf-interface-identifier
2250 | | | +--ro bgp-router-id? inet:ipv4-address
2251 | | | +--ro member-asn? inet:as-number
2252 | | +--ro link-descriptors
2253 | | +--ro link-local-identifier? uint32
2254 | | +--ro link-remote-identifier? uint32
2255 | | +--ro ipv4-interface-address? ipv4-interface-identifier
2256 | | +--ro ipv6-interface-address? ipv6-interface-identifier
2257 | | +--ro ipv4-neighbor-address? ipv4-interface-identifier
2258 | | +--ro ipv6-neighbor-address? ipv6-interface-identifier
2259 | | +--ro multi-topology-id? topology-identifier
2261 | | +--ro advertising-node-descriptors
2262 | | | +--ro as-number? inet:as-number
2263 | | | +--ro area-id? area-identifier
2264 | | | +--ro domain-id? domain-identifier
2265 | | | +--ro (c-router-identifier)?
2266 | | | +--:(isis-node-case)
2267 | | | | +--ro isis-node
2268 | | | | +--ro iso-system-id netc:iso-system-identifier
2269 | | | +--:(isis-pseudonode-case)
2270 | | | | +--ro isis-pseudonode
2271 | | | | +--ro is-is-router-identifier
2272 | | | | | +--ro iso-system-id netc:iso-system-identifier
2273 | | | | +--ro psn uint8
2274 | | | +--:(ospf-node-case)
2275 | | | | +--ro ospf-node
2276 | | | | +--ro ospf-router-id uint32
2277 | | | +--:(ospf-pseudonode-case)
2278 | | | +--ro ospf-pseudonode
2279 | | | +--ro ospf-router-id uint32
2280 | | | +--ro lan-interface ospf-interface-identifier
2281 | | +--ro prefix-descriptors
2282 | | +--ro multi-topology-id? topology-identifier
2283 | | +--ro ospf-route-type? ospf-route-type
2284 | | +--ro ip-reachability-information? inet:ip-prefix
2286 | +--ro (address-family)?
2288 | | | +--ro ipv4-tunnel-sender-address inet:ipv4-address
2289 | | | +--ro ipv4-tunnel-endpoint-address inet:ipv4-address
2291 | | +--ro ipv6-tunnel-sender-address inet:ipv6-address
2292 | | +--ro ipv6-tunnel-endpoint-address inet:ipv6-address
2293 | +--ro tunnel-id? rsvp:tunnel-id
2294 | +--ro lsp-id? rsvp:lsp-id
2296 +--ro (link-state-attribute)?
2297 +--:(node-attributes-case)
2298 | +--ro node-attributes
2299 | +--ro topology-identifier* topology-identifier
2300 | +--ro node-flags? node-flag-bits
2301 | +--ro isis-area-id* isis-area-identifier
2302 | +--ro dynamic-hostname? string
2303 | +--ro ipv4-router-id? ipv4-router-identifier
2304 | +--ro ipv6-router-id? ipv6-router-identifier
2305 | +--ro sr-capabilities
2306 | | +--ro mpls-ipv4? boolean
2307 | | +--ro mpls-ipv6? boolean
2308 | | +--ro sr-ipv6? boolean
2309 | | +--ro range-size? uint32
2310 | | +--ro (sid-label-index)?
2311 | | +--:(local-label-case)
2312 | | | +--ro local-label? netc:mpls-label
2313 | | +--:(ipv6-address-case)
2314 | | | +--ro ipv6-address? inet:ipv6-address
2316 | | +--ro sid? uint32
2317 | +--ro sr-algorithm
2318 | +--ro algorithms* algorithm
2319 +--:(link-attributes-case)
2320 | +--ro link-attributes
2321 | +--ro local-ipv4-router-id? ipv4-router-identifier
2322 | +--ro local-ipv6-router-id? ipv6-router-identifier
2323 | +--ro remote-ipv4-router-id? ipv4-router-identifier
2324 | +--ro remote-ipv6-router-id? ipv6-router-identifier
2325 | +--ro mpls-protocol? mpls-protocol-mask
2326 | +--ro te-metric? netc:te-metric
2327 | +--ro metric? netc:metric
2328 | +--ro shared-risk-link-groups* rsvp:srlg-id
2329 | +--ro link-name? string
2330 | +--ro max-link-bandwidth? netc:bandwidth
2331 | +--ro max-reservable-bandwidth? netc:bandwidth
2332 | +--ro unreserved-bandwidth* [priority]
2333 | | +--ro priority uint8
2334 | | +--ro bandwidth? netc:bandwidth
2335 | +--ro link-protection? link-protection-type
2336 | +--ro admin-group? administrative-group
2339 | | | +--:(ospf-adj-flags-case)
2340 | | | | +--ro backup? boolean
2341 | | | | +--ro set? boolean
2342 | | | +--:(isis-adj-flags-case)
2343 | | | +--ro backup? boolean
2344 | | | +--ro set? boolean
2345 | | | +--ro address-family? boolean
2346 | | +--ro weight? weight
2347 | | +--ro (sid-label-index)?
2348 | | +--:(local-label-case)
2349 | | | +--ro local-label? netc:mpls-label
2350 | | +--:(ipv6-address-case)
2351 | | | +--ro ipv6-address? inet:ipv6-address
2353 | | +--ro sid? uint32
2354 | +--ro sr-lan-adj-ids*
2356 | | | +--:(ospf-adj-flags-case)
2357 | | | | +--ro backup? boolean
2358 | | | | +--ro set? boolean
2359 | | | +--:(isis-adj-flags-case)
2360 | | | +--ro backup? boolean
2361 | | | +--ro set? boolean
2362 | | | +--ro address-family? boolean
2363 | | +--ro weight? weight
2364 | | +--ro iso-system-id? netc:iso-system-identifier
2365 | | +--ro neighbor-id? inet:ipv4-address
2366 | | +--ro (sid-label-index)?
2367 | | +--:(local-label-case)
2368 | | | +--ro local-label? netc:mpls-label
2369 | | +--:(ipv6-address-case)
2370 | | | +--ro ipv6-address? inet:ipv6-address
2372 | | +--ro sid? uint32
2373 | +--ro peer-node-sid
2374 | | +--ro weight? weight
2375 | | +--ro (sid-label-index)?
2376 | | +--:(local-label-case)
2377 | | | +--ro local-label? netc:mpls-label
2378 | | +--:(ipv6-address-case)
2379 | | | +--ro ipv6-address? inet:ipv6-address
2381 | | +--ro sid? uint32
2382 | +--ro peer-adj-sid
2383 | | +--ro weight? weight
2384 | | +--ro (sid-label-index)?
2385 | | +--:(local-label-case)
2386 | | | +--ro local-label? netc:mpls-label
2387 | | +--:(ipv6-address-case)
2388 | | | +--ro ipv6-address? inet:ipv6-address
2390 | | +--ro sid? uint32
2391 | +--ro peer-set-sids*
2392 | +--ro weight? weight
2393 | +--ro (sid-label-index)?
2394 | +--:(local-label-case)
2395 | | +--ro local-label? netc:mpls-label
2396 | +--:(ipv6-address-case)
2397 | | +--ro ipv6-address? inet:ipv6-address
2400 +--:(prefix-attributes-case)
2401 | +--ro prefix-attributes
2403 | | x--ro up-down? bits
2404 | | +--ro is-is-up-down? boolean
2405 | | +--ro ospf-no-unicast? boolean
2406 | | +--ro ospf-local-address? boolean
2407 | | +--ro ospf-propagate-nssa? boolean
2408 | +--ro route-tags* route-tag
2409 | +--ro extended-tags* extended-route-tag
2410 | +--ro prefix-metric? netc:igp-metric
2411 | +--ro ospf-forwarding-address? inet:ip-address
2414 | | | +--:(isis-prefix-flags-case)
2415 | | | | +--ro no-php? boolean
2416 | | | | +--ro explicit-null? boolean
2417 | | | | +--ro readvertisement? boolean
2418 | | | | +--ro node-sid? boolean
2419 | | | +--:(ospf-prefix-flags-case)
2420 | | | +--ro no-php? boolean
2421 | | | +--ro explicit-null? boolean
2422 | | | +--ro mapping-server? boolean
2423 | | +--ro algorithm? algorithm
2424 | | +--ro (sid-label-index)?
2425 | | +--:(local-label-case)
2426 | | | +--ro local-label? netc:mpls-label
2427 | | +--:(ipv6-address-case)
2428 | | | +--ro ipv6-address? inet:ipv6-address
2430 | | +--ro sid? uint32
2431 | +--ro ipv6-sr-prefix
2432 | | +--ro algorithm? algorithm
2434 | | +--ro inter-area? boolean
2435 | | +--ro range-size? uint16
2437 | | +--ro (range-sub-tlv)?
2438 | | +--:(binding-sid-tlv-case)
2439 | | | +--ro weight? weight
2440 | | | +--ro (flags)?
2441 | | | | +--:(isis-binding-flags-case)
2442 | | | | | +--ro address-family? boolean
2443 | | | | | +--ro mirror-context? boolean
2444 | | | | | +--ro spread-tlv? boolean
2445 | | | | | +--ro leaked-from-level-2? boolean
2446 | | | | | +--ro attached-flag? boolean
2447 | | | | +--:(ospf-binding-flags-case)
2448 | | | | +--ro mirroring? boolean
2449 | | | +--ro binding-sub-tlvs*
2450 | | | +--ro (binding-sub-tlv)?
2451 | | | +--:(prefix-sid-case)
2452 | | | | +--ro (flags)?
2453 | | | | | +--:(isis-prefix-flags-case)
2454 | | | | | | +--ro no-php? boolean
2455 | | | | | | +--ro explicit-null? boolean
2456 | | | | | | +--ro readvertisement? boolean
2457 | | | | | | +--ro node-sid? boolean
2458 | | | | | +--:(ospf-prefix-flags-case)
2459 | | | | | +--ro no-php? boolean
2460 | | | | | +--ro explicit-null? boolean
2461 | | | | | +--ro mapping-server? boolean
2462 | | | | +--ro algorithm? algorithm
2463 | | | | +--ro (sid-label-index)?
2464 | | | | +--:(local-label-case)
2465 | | | | | +--ro local-label? netc:mpls-label
2466 | | | | +--:(ipv6-address-case)
2467 | | | | | +--ro ipv6-address? inet:ipv6-address
2468 | | | | +--:(sid-case)
2469 | | | | +--ro sid? uint32
2470 | | | +--:(ipv6-prefix-sid-case)
2471 | | | | +--ro algorithm? algorithm
2472 | | | +--:(sid-label-case)
2473 | | | | +--ro (sid-label-index)?
2474 | | | | +--:(local-label-case)
2475 | | | | | +--ro local-label? netc:mpls-label
2476 | | | | +--:(ipv6-address-case)
2477 | | | | | +--ro ipv6-address? inet:ipv6-address
2478 | | | | +--:(sid-case)
2479 | | | | +--ro sid? uint32
2480 | | | +--:(ero-metric-case)
2481 | | | | +--ro ero-metric? netc:te-metric
2482 | | | +--:(ipv4-ero-case)
2483 | | | | +--ro loose? boolean
2484 | | | | +--ro address inet:ipv4-address
2485 | | | +--:(ipv6-ero-case)
2486 | | | | +--ro loose? boolean
2487 | | | | +--ro address inet:ipv6-address
2488 | | | +--:(unnumbered-interface-id-ero-case)
2489 | | | | +--ro loose? boolean
2490 | | | | +--ro router-id? uint32
2491 | | | | +--ro interface-id? uint32
2492 | | | +--:(ipv4-ero-backup-case)
2493 | | | | +--ro loose? boolean
2494 | | | | +--ro address inet:ipv4-address
2495 | | | +--:(ipv6-ero-backup-case)
2496 | | | | +--ro loose? boolean
2497 | | | | +--ro address inet:ipv6-address
2498 | | | +--:(unnumbered-interface-id-backup-ero-case)
2499 | | | +--ro loose? boolean
2500 | | | +--ro router-id? uint32
2501 | | | +--ro interface-id? uint32
2502 | | +--:(prefix-sid-tlv-case)
2503 | | | +--ro (flags)?
2504 | | | | +--:(isis-prefix-flags-case)
2505 | | | | | +--ro no-php? boolean
2506 | | | | | +--ro explicit-null? boolean
2507 | | | | | +--ro readvertisement? boolean
2508 | | | | | +--ro node-sid? boolean
2509 | | | | +--:(ospf-prefix-flags-case)
2510 | | | | +--ro no-php? boolean
2511 | | | | +--ro explicit-null? boolean
2512 | | | | +--ro mapping-server? boolean
2513 | | | +--ro algorithm? algorithm
2514 | | | +--ro (sid-label-index)?
2515 | | | +--:(local-label-case)
2516 | | | | +--ro local-label? netc:mpls-label
2517 | | | +--:(ipv6-address-case)
2518 | | | | +--ro ipv6-address? inet:ipv6-address
2519 | | | +--:(sid-case)
2520 | | | +--ro sid? uint32
2521 | | +--:(ipv6-prefix-sid-tlv-case)
2522 | | | +--ro algorithm? algorithm
2523 | | +--:(sid-label-tlv-case)
2524 | | +--ro (sid-label-index)?
2525 | | +--:(local-label-case)
2526 | | | +--ro local-label? netc:mpls-label
2527 | | +--:(ipv6-address-case)
2528 | | | +--ro ipv6-address? inet:ipv6-address
2530 | | +--ro sid? uint32
2531 | +--ro sr-binding-sid-labels*
2532 | +--ro weight? weight
2534 | | +--:(isis-binding-flags-case)
2535 | | | +--ro address-family? boolean
2536 | | | +--ro mirror-context? boolean
2537 | | | +--ro spread-tlv? boolean
2538 | | | +--ro leaked-from-level-2? boolean
2539 | | | +--ro attached-flag? boolean
2540 | | +--:(ospf-binding-flags-case)
2541 | | +--ro mirroring? boolean
2542 | +--ro binding-sub-tlvs*
2543 | +--ro (binding-sub-tlv)?
2544 | +--:(prefix-sid-case)
2546 | | | +--:(isis-prefix-flags-case)
2547 | | | | +--ro no-php? boolean
2548 | | | | +--ro explicit-null? boolean
2549 | | | | +--ro readvertisement? boolean
2550 | | | | +--ro node-sid? boolean
2551 | | | +--:(ospf-prefix-flags-case)
2552 | | | +--ro no-php? boolean
2553 | | | +--ro explicit-null? boolean
2554 | | | +--ro mapping-server? boolean
2555 | | +--ro algorithm? algorithm
2556 | | +--ro (sid-label-index)?
2557 | | +--:(local-label-case)
2558 | | | +--ro local-label? netc:mpls-label
2559 | | +--:(ipv6-address-case)
2560 | | | +--ro ipv6-address? inet:ipv6-address
2562 | | +--ro sid? uint32
2563 | +--:(ipv6-prefix-sid-case)
2564 | | +--ro algorithm? algorithm
2565 | +--:(sid-label-case)
2566 | | +--ro (sid-label-index)?
2567 | | +--:(local-label-case)
2568 | | | +--ro local-label? netc:mpls-label
2569 | | +--:(ipv6-address-case)
2570 | | | +--ro ipv6-address? inet:ipv6-address
2572 | | +--ro sid? uint32
2573 | +--:(ero-metric-case)
2574 | | +--ro ero-metric? netc:te-metric
2575 | +--:(ipv4-ero-case)
2576 | | +--ro loose? boolean
2577 | | +--ro address inet:ipv4-address
2578 | +--:(ipv6-ero-case)
2579 | | +--ro loose? boolean
2580 | | +--ro address inet:ipv6-address
2581 | +--:(unnumbered-interface-id-ero-case)
2582 | | +--ro loose? boolean
2583 | | +--ro router-id? uint32
2584 | | +--ro interface-id? uint32
2585 | +--:(ipv4-ero-backup-case)
2586 | | +--ro loose? boolean
2587 | | +--ro address inet:ipv4-address
2588 | +--:(ipv6-ero-backup-case)
2589 | | +--ro loose? boolean
2590 | | +--ro address inet:ipv6-address
2591 | +--:(unnumbered-interface-id-backup-ero-case)
2592 | +--ro loose? boolean
2593 | +--ro router-id? uint32
2594 | +--ro interface-id? uint32
2595 x--:(te-lsp-attributes-case)
2596 +--ro te-lsp-attributes
2601 The Link-State table in a instance of the speaker's Loc-RIB can be verified via REST:
2603 **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``
2611 <linkstate-routes xmlns="urn:opendaylight:params:xml:ns:yang:bgp-linkstate">
2615 .. note:: Link-State routes mapping to topology links/nodes/prefixes is supported by BGP Topology Provider.
2619 * `North-Bound Distribution of Link-State and Traffic Engineering (TE) Information Using BGP <https://tools.ietf.org/html/rfc7752>`_
2620 * `BGP Link-State extensions for Segment Routing <https://tools.ietf.org/html/draft-gredler-idr-bgp-ls-segment-routing-ext-03>`_
2621 * `Segment Routing BGP Egress Peer Engineering BGP-LS Extensions <https://tools.ietf.org/html/draft-ietf-idr-bgpls-segment-routing-epe-05>`_
2622 * `BGP Link-State Information Distribution Implementation Report <https://tools.ietf.org/html/draft-ietf-idr-ls-distribution-impl-04>`_
2624 Flow Specification Family
2625 -------------------------
2626 The BGP Flow Specification (BGP-FS) Multiprotocol extension can be used to distribute traffic flow specifications.
2627 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).
2629 .. contents:: Contents
2635 This section shows a way to enable BGP-FS family in BGP speaker and peer configuration.
2639 To enable BGP-FS support in BGP plugin, first configure BGP speaker instance:
2641 **URL:** ``/restconf/config/openconfig-network-instance:network-instances/network-instance/global-bgp/openconfig-network-instance:protocols``
2643 **Method:** ``POST``
2645 **Content-Type:** ``application/xml``
2651 <protocol xmlns="http://openconfig.net/yang/network-instance">
2652 <name>bgp-example</name>
2653 <identifier xmlns:x="http://openconfig.net/yang/policy-types">x:BGP</identifier>
2654 <bgp xmlns="urn:opendaylight:params:xml:ns:yang:bgp:openconfig-extensions">
2657 <router-id>192.0.2.2</router-id>
2662 <afi-safi-name>IPV4-FLOW</afi-safi-name>
2665 <afi-safi-name>IPV6-FLOW</afi-safi-name>
2668 <afi-safi-name>IPV4-L3VPN-FLOW</afi-safi-name>
2671 <afi-safi-name>IPV6-L3VPN-FLOW</afi-safi-name>
2680 Here is an example for BGP peer configuration with enabled BGP-FS family.
2682 **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``
2684 **Method:** ``POST``
2686 **Content-Type:** ``application/xml``
2692 <neighbor xmlns="urn:opendaylight:params:xml:ns:yang:bgp:openconfig-extensions">
2693 <neighbor-address>192.0.2.1</neighbor-address>
2696 <afi-safi-name>IPV4-FLOW</afi-safi-name>
2699 <afi-safi-name>IPV6-FLOW</afi-safi-name>
2702 <afi-safi-name>IPV4-L3VPN-FLOW</afi-safi-name>
2705 <afi-safi-name>IPV6-L3VPN-FLOW</afi-safi-name>
2710 Flow Specification API
2711 ^^^^^^^^^^^^^^^^^^^^^^
2712 Following trees illustrate the BGP Flow Specification routes structure.
2714 IPv4 Flow Specification Route
2715 '''''''''''''''''''''''''''''
2716 .. code-block:: console
2718 :(flowspec-routes-case)
2719 +--ro flowspec-routes
2720 +--ro flowspec-route* [route-key path-id]
2721 +--ro route-key string
2723 | +--ro (flowspec-type)?
2726 | | +--ro op? numeric-operand
2727 | | +--ro value? uint16
2728 | +--:(destination-port-case)
2729 | | +--ro destination-ports*
2730 | | +--ro op? numeric-operand
2731 | | +--ro value? uint16
2732 | +--:(source-port-case)
2733 | | +--ro source-ports*
2734 | | +--ro op? numeric-operand
2735 | | +--ro value? uint16
2736 | +--:(icmp-type-case)
2738 | | +--ro op? numeric-operand
2739 | | +--ro value? uint8
2740 | +--:(icmp-code-case)
2742 | | +--ro op? numeric-operand
2743 | | +--ro value? uint8
2744 | +--:(tcp-flags-case)
2745 | | +--ro tcp-flags*
2746 | | +--ro op? bitmask-operand
2747 | | +--ro value? uint16
2748 | +--:(packet-length-case)
2749 | | +--ro packet-lengths*
2750 | | +--ro op? numeric-operand
2751 | | +--ro value? uint16
2754 | | +--ro op? numeric-operand
2755 | | +--ro value? dscp
2756 | +--:(fragment-case)
2757 | | +--ro fragments*
2758 | | +--ro op? bitmask-operand
2759 | | +--ro value? fragment
2760 | +--:(destination-prefix-case)
2761 | | +--ro destination-prefix? inet:ipv4-prefix
2762 | +--:(source-prefix-case)
2763 | | +--ro source-prefix? inet:ipv4-prefix
2764 | +--:(protocol-ip-case)
2765 | +--ro protocol-ips*
2766 | +--ro op? numeric-operand
2767 | +--ro value? uint8
2768 +--ro path-id path-id
2770 +--ro extended-communities*
2771 +--ro transitive? boolean
2772 +--ro (extended-community)?
2773 +--:(traffic-rate-extended-community-case)
2774 | +--ro traffic-rate-extended-community
2775 | +--ro informative-as? bgp-t:short-as-number
2776 | +--ro local-administrator? netc:bandwidth
2777 +--:(traffic-action-extended-community-case)
2778 | +--ro traffic-action-extended-community
2779 | +--ro sample? boolean
2780 | +--ro terminal-action? boolean
2781 +--:(redirect-extended-community-case)
2782 | +--ro redirect-extended-community
2783 | +--ro global-administrator? bgp-t:short-as-number
2784 | +--ro local-administrator? binary
2785 +--:(traffic-marking-extended-community-case)
2786 | +--ro traffic-marking-extended-community
2787 | +--ro global-administrator? dscp
2788 +--:(redirect-ipv4-extended-community-case)
2789 | +--ro redirect-ipv4
2790 | +--ro global-administrator? inet:ipv4-address
2791 | +--ro local-administrator? uint16
2792 +--:(redirect-as4-extended-community-case)
2793 | +--ro redirect-as4
2794 | +--ro global-administrator? inet:as-number
2795 | +--ro local-administrator? uint16
2796 +--:(redirect-ip-nh-extended-community-case)
2797 +--ro redirect-ip-nh-extended-community
2798 +--ro next-hop-address? inet:ip-address
2802 IPv6 Flow Specification Route
2803 '''''''''''''''''''''''''''''
2804 .. code-block:: console
2806 :(flowspec-ipv6-routes-case)
2807 +--ro flowspec-ipv6-routes
2808 +--ro flowspec-route* [route-key path-id]
2810 | +--ro (flowspec-type)?
2813 | | +--ro op? numeric-operand
2814 | | +--ro value? uint16
2815 | +--:(destination-port-case)
2816 | | +--ro destination-ports*
2817 | | +--ro op? numeric-operand
2818 | | +--ro value? uint16
2819 | +--:(source-port-case)
2820 | | +--ro source-ports*
2821 | | +--ro op? numeric-operand
2822 | | +--ro value? uint16
2823 | +--:(icmp-type-case)
2825 | | +--ro op? numeric-operand
2826 | | +--ro value? uint8
2827 | +--:(icmp-code-case)
2829 | | +--ro op? numeric-operand
2830 | | +--ro value? uint8
2831 | +--:(tcp-flags-case)
2832 | | +--ro tcp-flags*
2833 | | +--ro op? bitmask-operand
2834 | | +--ro value? uint16
2835 | +--:(packet-length-case)
2836 | | +--ro packet-lengths*
2837 | | +--ro op? numeric-operand
2838 | | +--ro value? uint16
2841 | | +--ro op? numeric-operand
2842 | | +--ro value? dscp
2843 | +--:(fragment-case)
2844 | | +--ro fragments*
2845 | | +--ro op? bitmask-operand
2846 | | +--ro value? fragment
2847 | +--:(destination-ipv6-prefix-case)
2848 | | +--ro destination-prefix? inet:ipv6-prefix
2849 | +--:(source-ipv6-prefix-case)
2850 | | +--ro source-prefix? inet:ipv6-prefix
2851 | +--:(next-header-case)
2852 | | +--ro next-headers*
2853 | | +--ro op? numeric-operand
2854 | | +--ro value? uint8
2855 | +--:(flow-label-case)
2857 | +--ro op? numeric-operand
2858 | +--ro value? uint32
2859 +--ro path-id path-id
2861 +--ro extended-communities*
2862 +--ro transitive? boolean
2863 +--ro (extended-community)?
2864 +--:(traffic-rate-extended-community-case)
2865 | +--ro traffic-rate-extended-community
2866 | +--ro informative-as? bgp-t:short-as-number
2867 | +--ro local-administrator? netc:bandwidth
2868 +--:(traffic-action-extended-community-case)
2869 | +--ro traffic-action-extended-community
2870 | +--ro sample? boolean
2871 | +--ro terminal-action? boolean
2872 +--:(redirect-extended-community-case)
2873 | +--ro redirect-extended-community
2874 | +--ro global-administrator? bgp-t:short-as-number
2875 | +--ro local-administrator? binary
2876 +--:(traffic-marking-extended-community-case)
2877 | +--ro traffic-marking-extended-community
2878 | +--ro global-administrator? dscp
2879 +--:(redirect-ipv6-extended-community-case)
2880 | +--ro redirect-ipv6
2881 | +--ro global-administrator? inet:ipv6-address
2882 | +--ro local-administrator? uint16
2883 +--:(redirect-as4-extended-community-case)
2884 | +--ro redirect-as4
2885 | +--ro global-administrator? inet:as-number
2886 | +--ro local-administrator? uint16
2887 +--:(redirect-ip-nh-extended-community-case)
2888 +--ro redirect-ip-nh-extended-community
2889 +--ro next-hop-address? inet:ip-address
2894 The flowspec route represents rules and an action, defined as an extended community.
2896 IPv4 Flow Specification
2897 '''''''''''''''''''''''
2898 The IPv4 Flowspec table in an instance of the speaker's Loc-RIB can be verified via REST:
2900 **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``
2908 <flowspec-routes xmlns="urn:opendaylight:params:xml:ns:yang:bgp-flowspec">
2910 <path-id>0</path-id>
2911 <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>
2920 <extended-communities>
2921 <transitive>true</transitive>
2922 <redirect-extended-community>
2923 <local-administrator>AgMWLg==</local-administrator>
2924 <global-administrator>258</global-administrator>
2925 </redirect-extended-community>
2926 </extended-communities>
2929 <destination-prefix>192.168.0.1/32</destination-prefix>
2932 <source-prefix>10.0.0.2/32</source-prefix>
2940 <op>equals end-of-list</op>
2950 <op>equals end-of-list</op>
2956 <op>greater-than</op>
2958 </destination-ports>
2960 <op>less-than and-bit</op>
2962 </destination-ports>
2964 <op>equals end-of-list</op>
2966 </destination-ports>
2970 <op>end-of-list greater-than</op>
2977 IPv6 Flows Specification
2978 ''''''''''''''''''''''''
2979 The IPv6 Flowspec table in an instance of the speaker's Loc-RIB can be verified via REST:
2981 **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``
2989 <flowspec-ipv6-routes xmlns="urn:opendaylight:params:xml:ns:yang:bgp-flowspec">
2991 <path-id>0</path-id>
2992 <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>
3001 <extended-communities>
3002 <transitive>true</transitive>
3003 <traffic-rate-extended-community>
3004 <informative-as>0</informative-as>
3005 <local-administrator>AAAAAA==</local-administrator>
3006 </traffic-rate-extended-community>
3007 </extended-communities>
3010 <destination-prefix>2001:db8:31::/64</destination-prefix>
3013 <source-prefix>2001:db8:30::/64</source-prefix>
3017 <op>equals end-of-list</op>
3023 <op>equals end-of-list</op>
3029 <op>equals end-of-list</op>
3034 </flowspec-ipv6-routes>
3036 IPv4 L3VPN Flows Specification
3037 ''''''''''''''''''''''''''''''
3038 The IPv4 L3VPN Flowspec table in an instance of the speaker's Loc-RIB can be verified via REST:
3040 **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``
3048 <flowspec-l3vpn-ipv4-routes xmlns="urn:opendaylight:params:xml:ns:yang:bgp-flowspec">
3049 <flowspec-l3vpn-route>
3050 <path-id>0</path-id>
3051 <route-key>[l3vpn with route-distinguisher 172.16.0.44:101] all packets from 10.0.0.3/32</route-key>
3057 <global>5.6.7.8</global>
3063 <extended-communities>
3064 <transitive>true</transitive>
3065 <redirect-ip-nh-extended-community>
3067 <next-hop-address>0.0.0.0</next-hop-address>
3068 </redirect-ip-nh-extended-community>
3069 </extended-communities>
3071 <route-distinguisher>172.16.0.44:101</route-distinguisher>
3073 <source-prefix>10.0.0.3/32</source-prefix>
3075 </flowspec-l3vpn-route>
3076 </flowspec-l3vpn-ipv4-routes>
3080 IPv4 Flow Specification
3081 '''''''''''''''''''''''
3082 This examples show how to originate and remove IPv4 fowspec route via programmable RIB.
3083 Make sure the *Application Peer* is configured first.
3085 **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``
3087 **Method:** ``POST``
3089 **Content-Type:** ``application/xml``
3095 <flowspec-route xmlns="urn:opendaylight:params:xml:ns:yang:bgp-flowspec">
3096 <route-key>flow1</route-key>
3097 <path-id>0</path-id>
3099 <destination-prefix>192.168.0.1/32</destination-prefix>
3102 <source-prefix>10.0.0.1/32</source-prefix>
3106 <op>equals end-of-list</op>
3112 <op>equals end-of-list</op>
3118 <op>greater-than</op>
3120 </destination-ports>
3122 <op>and-bit less-than end-of-list</op>
3124 </destination-ports>
3128 <op>greater-than end-of-list</op>
3134 <op>equals end-of-list</op>
3140 <op>equals end-of-list</op>
3146 <op>match end-of-list</op>
3152 <op>greater-than</op>
3156 <op>and-bit less-than end-of-list</op>
3162 <op>equals end-of-list</op>
3168 <op>match end-of-list</op>
3169 <value>first</value>
3180 <extended-communities>
3182 </extended-communities>
3188 **Extended Communities**
3195 <extended-communities>
3196 <transitive>true</transitive>
3197 <traffic-rate-extended-community>
3198 <informative-as>123</informative-as>
3199 <local-administrator>AAAAAA==</local-administrator>
3200 </traffic-rate-extended-community>
3201 </extended-communities>
3203 @line 5: A rate in bytes per second, *AAAAAA==* (0) means traffic discard.
3205 * **Traffic Action**
3208 <extended-communities>
3209 <transitive>true</transitive>
3210 <traffic-action-extended-community>
3211 <sample>true</sample>
3212 <terminal-action>false</terminal-action>
3213 </traffic-action-extended-community>
3214 </extended-communities>
3217 * **Redirect to VRF AS 2byte format**
3220 <extended-communities>
3221 <transitive>true</transitive>
3222 <redirect-extended-community>
3223 <global-administrator>123</global-administrator>
3224 <local-administrator>AAAAew==</local-administrator>
3225 </redirect-extended-community>
3226 </extended-communities>
3228 * **Redirect to VRF IPv4 format**
3231 <extended-communities>
3232 <transitive>true</transitive>
3234 <global-administrator>192.168.0.1</global-administrator>
3235 <local-administrator>12345</local-administrator>
3237 </extended-communities>
3239 * **Redirect to VRF AS 4byte format**
3242 <extended-communities>
3243 <transitive>true</transitive>
3245 <global-administrator>64495</global-administrator>
3246 <local-administrator>12345</local-administrator>
3248 </extended-communities>
3250 * **Redirect to IP**
3253 <extended-communities>
3254 <transitive>true</transitive>
3255 <redirect-ip-nh-extended-community>
3257 </redirect-ip-nh-extended-community>
3258 </extended-communities>
3260 * **Traffic Marking**
3263 <extended-communities>
3264 <transitive>true</transitive>
3265 <traffic-marking-extended-community>
3266 <global-administrator>20</global-administrator>
3267 </traffic-marking-extended-community>
3268 </extended-communities>
3272 To remove the route added above, following request can be used:
3274 **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``
3276 **Method:** ``DELETE``
3278 IPv4 L3VPN Flow Specification
3279 '''''''''''''''''''''''''''''
3280 This examples show how to originate and remove IPv4 L3VPN fowspec route via programmable RIB.
3282 **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``
3284 **Method:** ``POST``
3286 **Content-Type:** ``application/xml``
3292 <flowspec-l3vpn-route xmlns="urn:opendaylight:params:xml:ns:yang:bgp-flowspec">
3293 <path-id>0</path-id>
3294 <route-key>flow-l3vpn</route-key>
3295 <route-distinguisher>172.16.0.44:101</route-distinguisher>
3297 <source-prefix>10.0.0.3/32</source-prefix>
3307 <extended-communities>
3308 <transitive>true</transitive>
3310 <global-administrator>172.16.0.44</global-administrator>
3311 <local-administrator>102</local-administrator>
3313 </extended-communities>
3315 </flowspec-l3vpn-route>
3319 To remove the route added above, following request can be used:
3321 **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``
3323 **Method:** ``DELETE``
3325 IPv6 Flow Specification
3326 '''''''''''''''''''''''
3327 This examples show how to originate and remove IPv6 fowspec route via programmable RIB.
3329 **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``
3331 **Method:** ``POST``
3333 **Content-Type:** ``application/xml``
3339 <flowspec-route xmlns="urn:opendaylight:params:xml:ns:yang:bgp-flowspec">
3340 <route-key>flow-v6</route-key>
3341 <path-id>0</path-id>
3343 <destination-prefix>2001:db8:30::3/128</destination-prefix>
3346 <source-prefix>2001:db8:31::3/128</source-prefix>
3350 <op>equals end-of-list</op>
3355 <extended-communities>
3356 <transitive>true</transitive>
3358 <global-administrator>2001:db8:1::6</global-administrator>
3359 <local-administrator>12345</local-administrator>
3361 </extended-communities>
3374 To remove the route added above, following request can be used:
3376 **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``
3378 **Method:** ``DELETE``
3382 * `Dissemination of Flow Specification Rules <https://tools.ietf.org/html/rfc5575>`_
3383 * `Dissemination of Flow Specification Rules for IPv6 <https://tools.ietf.org/html/draft-ietf-idr-flow-spec-v6-07>`_
3384 * `BGP Flow-Spec Extended Community for Traffic Redirect to IP Next Hop <https://tools.ietf.org/html/draft-ietf-idr-flowspec-redirect-ip-00>`_
3385 * `Clarification of the Flowspec Redirect Extended Community <https://tools.ietf.org/html/rfc7674>`_
3386 * `Revised Validation Procedure for BGP Flow Specifications <https://tools.ietf.org/html/draft-ietf-idr-bgp-flowspec-oid-03>`_
3390 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.
3391 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.
3392 In addition to MPLS, IP tunnelling encapsulation techniques like VXLAN, NVGRE, MPLSoGRE and others can be used for packet transportation.
3393 Also, Provider Backbone Bridging (PBB) can be combined with EVPN in order to reduce a number of MAC Advertisement routes.
3395 .. contents:: Contents
3401 This section shows a way to enable EVPN family in BGP speaker and peer configuration.
3405 To enable EVPN support in BGP plugin, first configure BGP speaker instance:
3407 **URL:** ``/restconf/config/openconfig-network-instance:network-instances/network-instance/global-bgp/openconfig-network-instance:protocols``
3409 **Method:** ``POST``
3411 **Content-Type:** ``application/xml``
3417 <protocol xmlns="http://openconfig.net/yang/network-instance">
3418 <name>bgp-example</name>
3419 <identifier xmlns:x="http://openconfig.net/yang/policy-types">x:BGP</identifier>
3420 <bgp xmlns="urn:opendaylight:params:xml:ns:yang:bgp:openconfig-extensions">
3423 <router-id>192.0.2.2</router-id>
3428 <afi-safi-name xmlns:x="http://openconfig.net/yang/bgp-types">x:L2VPN-EVPN</afi-safi-name>
3437 Here is an example for BGP peer configuration with enabled EVPN family.
3439 **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``
3441 **Method:** ``POST``
3443 **Content-Type:** ``application/xml``
3449 <neighbor xmlns="urn:opendaylight:params:xml:ns:yang:bgp:openconfig-extensions">
3450 <neighbor-address>192.0.2.1</neighbor-address>
3453 <afi-safi-name xmlns:x="http://openconfig.net/yang/bgp-types">x:L2VPN-EVPN</afi-safi-name>
3460 Following tree illustrate the BGP EVPN route structure.
3462 .. code-block:: console
3466 +--ro evpn-route* [route-key]
3467 +--ro route-key string
3469 | +--:(ethernet-a-d-route-case)
3470 | | +--ro ethernet-a-d-route
3472 | | | +--:(arbitrary-case)
3473 | | | | +--ro arbitrary
3474 | | | | +--ro arbitrary binary
3475 | | | +--:(lacp-auto-generated-case)
3476 | | | | +--ro lacp-auto-generated
3477 | | | | +--ro ce-lacp-mac-address yang:mac-address
3478 | | | | +--ro ce-lacp-port-key uint16
3479 | | | +--:(lan-auto-generated-case)
3480 | | | | +--ro lan-auto-generated
3481 | | | | +--ro root-bridge-mac-address yang:mac-address
3482 | | | | +--ro root-bridge-priority uint16
3483 | | | +--:(mac-auto-generated-case)
3484 | | | | +--ro mac-auto-generated
3485 | | | | +--ro system-mac-address yang:mac-address
3486 | | | | +--ro local-discriminator uint24
3487 | | | +--:(router-id-generated-case)
3488 | | | | +--ro router-id-generated
3489 | | | | +--ro router-id inet:ipv4-address
3490 | | | | +--ro local-discriminator uint32
3491 | | | +--:(as-generated-case)
3492 | | | +--ro as-generated
3493 | | | +--ro as inet:as-number
3494 | | | +--ro local-discriminator uint32
3495 | | +--ro ethernet-tag-id
3496 | | | +--ro vlan-id uint32
3497 | | +--ro mpls-label netc:mpls-label
3498 | +--:(mac-ip-adv-route-case)
3499 | | +--ro mac-ip-adv-route
3501 | | | +--:(arbitrary-case)
3502 | | | | +--ro arbitrary
3503 | | | | +--ro arbitrary binary
3504 | | | +--:(lacp-auto-generated-case)
3505 | | | | +--ro lacp-auto-generated
3506 | | | | +--ro ce-lacp-mac-address yang:mac-address
3507 | | | | +--ro ce-lacp-port-key uint16
3508 | | | +--:(lan-auto-generated-case)
3509 | | | | +--ro lan-auto-generated
3510 | | | | +--ro root-bridge-mac-address yang:mac-address
3511 | | | | +--ro root-bridge-priority uint16
3512 | | | +--:(mac-auto-generated-case)
3513 | | | | +--ro mac-auto-generated
3514 | | | | +--ro system-mac-address yang:mac-address
3515 | | | | +--ro local-discriminator uint24
3516 | | | +--:(router-id-generated-case)
3517 | | | | +--ro router-id-generated
3518 | | | | +--ro router-id inet:ipv4-address
3519 | | | | +--ro local-discriminator uint32
3520 | | | +--:(as-generated-case)
3521 | | | +--ro as-generated
3522 | | | +--ro as inet:as-number
3523 | | | +--ro local-discriminator uint32
3524 | | +--ro ethernet-tag-id
3525 | | | +--ro vlan-id uint32
3526 | | +--ro mac-address yang:mac-address
3527 | | +--ro ip-address? inet:ip-address
3528 | | +--ro mpls-label1 netc:mpls-label
3529 | | +--ro mpls-label2? netc:mpls-label
3530 | +--:(inc-multi-ethernet-tag-res-case)
3531 | | +--ro inc-multi-ethernet-tag-res
3532 | | +--ro ethernet-tag-id
3533 | | | +--ro vlan-id uint32
3534 | | +--ro orig-route-ip? inet:ip-address
3535 | +--:(es-route-case)
3538 | | +--:(arbitrary-case)
3539 | | | +--ro arbitrary
3540 | | | +--ro arbitrary binary
3541 | | +--:(lacp-auto-generated-case)
3542 | | | +--ro lacp-auto-generated
3543 | | | +--ro ce-lacp-mac-address yang:mac-address
3544 | | | +--ro ce-lacp-port-key uint16
3545 | | +--:(lan-auto-generated-case)
3546 | | | +--ro lan-auto-generated
3547 | | | +--ro root-bridge-mac-address yang:mac-address
3548 | | | +--ro root-bridge-priority uint16
3549 | | +--:(mac-auto-generated-case)
3550 | | | +--ro mac-auto-generated
3551 | | | +--ro system-mac-address yang:mac-address
3552 | | | +--ro local-discriminator uint24
3553 | | +--:(router-id-generated-case)
3554 | | | +--ro router-id-generated
3555 | | | +--ro router-id inet:ipv4-address
3556 | | | +--ro local-discriminator uint32
3557 | | +--:(as-generated-case)
3558 | | +--ro as-generated
3559 | | +--ro as inet:as-number
3560 | | +--ro local-discriminator uint32
3561 | +--ro orig-route-ip inet:ip-address
3562 +--ro route-distinguisher bgp-t:route-distinguisher
3564 +--ro extended-communities*
3565 | +--ro transitive? boolean
3566 | +--ro (extended-community)?
3567 | +--:(encapsulation-case)
3568 | | +--ro encapsulation-extended-community
3569 | | +--ro tunnel-type encapsulation-tunnel-type
3570 | +--:(esi-label-extended-community-case)
3571 | | +--ro esi-label-extended-community
3572 | | +--ro single-active-mode? boolean
3573 | | +--ro esi-label netc:mpls-label
3574 | +--:(es-import-route-extended-community-case)
3575 | | +--ro es-import-route-extended-community
3576 | | +--ro es-import yang:mac-address
3577 | +--:(mac-mobility-extended-community-case)
3578 | | +--ro mac-mobility-extended-community
3579 | | +--ro static? boolean
3580 | | +--ro seq-number uint32
3581 | +--:(default-gateway-extended-community-case)
3582 | | +--ro default-gateway-extended-community!
3583 | +--:(layer-2-attributes-extended-community-case)
3584 | +--ro layer-2-attributes-extended-community
3585 | +--ro primary-pe? boolean
3586 | +--ro backup-pe? boolean
3587 | +--ro control-word? boolean
3588 | +--ro l2-mtu uint16
3590 +--ro leaf-information-required boolean
3591 +--ro mpls-label? netc:mpls-label
3592 +--ro (tunnel-identifier)?
3593 +--:(rsvp-te-p2mp-lsp)
3594 | +--ro rsvp-te-p2mp-lps
3595 | +--ro p2mp-id uint32
3596 | +--ro tunnel-id uint16
3597 | +--ro extended-tunnel-id inet:ip-address
3599 | +--ro mldp-p2mp-lsp
3600 | +--ro address-family identityref
3601 | +--ro root-node-address inet:ip-address
3602 | +--ro opaque-value*
3603 | +--ro opaque-type uint8
3604 | +--ro opaque-extended-type? uint16
3605 | +--ro opaque yang:hex-string
3607 | +--ro pim-ssm-tree
3608 | +--ro p-address inet:ip-address
3609 | +--ro p-multicast-group inet:ip-address
3612 | +--ro p-address inet:ip-address
3613 | +--ro p-multicast-group inet:ip-address
3614 +--:(bidir-pim-tree)
3615 | +--ro bidir-pim-tree
3616 | +--ro p-address inet:ip-address
3617 | +--ro p-multicast-group inet:ip-address
3618 +--:(ingress-replication)
3619 | +--ro ingress-replication
3620 | +--ro receiving-endpoint-address? inet:ip-address
3621 +--:(mldp-mp2mp-lsp)
3622 +--ro mldp-mp2mp-lsp
3623 +--ro opaque-type uint8
3624 +--ro opaque-extended-type? uint16
3630 The L2VPN EVPN table in an instance of the speaker's Loc-RIB can be verified via REST:
3632 **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``
3640 <evpn-routes xmlns="urn:opendaylight:params:xml:ns:yang:bgp-evpn">
3642 <route-key>AxEAAcCoZAED6AAAAQAgwKhkAQ==</route-key>
3643 <route-distinguisher>192.168.100.1:1000</route-distinguisher>
3644 <inc-multi-ethernet-tag-res>
3646 <vlan-id>256</vlan-id>
3648 <orig-route-ip>192.168.100.1</orig-route-ip>
3649 </inc-multi-ethernet-tag-res>
3652 <global>172.23.29.104</global>
3658 <extended-communities>
3659 <extended-communities>
3660 <transitive>true</transitive>
3661 <route-target-extended-community>
3662 <global-administrator>65504</global-administrator>
3663 <local-administrator>AAAD6A==</local-administrator>
3664 </route-target-extended-community>
3665 </extended-communities>
3666 </extended-communities>
3668 <leaf-information-required>true</leaf-information-required>
3669 <mpls-label>20024</mpls-label>
3670 <ingress-replication>
3671 <receiving-endpoint-address>192.168.100.1</receiving-endpoint-address>
3672 </ingress-replication>
3680 This examples show how to originate and remove EVPN routes via programmable RIB.
3681 There are four different types of EVPN routes, and several extended communities.
3682 Routes can be used for variety of use-cases supported by BGP/MPLS EVPN, PBB EVPN and NVO EVPN.
3683 Make sure the *Application Peer* is configured first.
3685 **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``
3687 **Method:** ``POST``
3689 **Content-Type:** ``application/xml``
3695 :emphasize-lines: 3,4,14
3697 <evpn-route xmlns="urn:opendaylight:params:xml:ns:yang:bgp-evpn">
3698 <route-key>evpn</route-key>
3699 <route-distinguisher>172.12.123.3:200</route-distinguisher>
3703 <global>199.20.166.41</global>
3709 <extended-communities>
3711 </extended-communities>
3715 @line 3: Route Distinguisher (RD) - set to RD of the MAC-VRF advertising the NLRI, recommended format *<IP>:<VLAN_ID>*
3717 @line 4: One of the EVPN route must be set here.
3719 @line 14: In some cases, specific extended community presence is required. The route may carry one or more Route Target attributes.
3725 * **Ethernet AD per ESI**
3728 <ethernet-a-d-route>
3729 <mpls-label>0</mpls-label>
3731 <vlan-id>4294967295</vlan-id>
3734 <arbitrary>AAAAAAAAAAAA</arbitrary>
3736 </ethernet-a-d-route>
3738 * **Ethernet AD per EVI**
3741 <ethernet-a-d-route>
3742 <mpls-label>24001</mpls-label>
3744 <vlan-id>2200</vlan-id>
3747 <arbitrary>AAAAAAAAAAAA</arbitrary>
3749 </ethernet-a-d-route>
3751 * **MAC/IP Advertisement**
3756 <arbitrary>AAAAAAAAAAAA</arbitrary>
3759 <vlan-id>2100</vlan-id>
3761 <mac-address>f2:0c:dd:80:9f:f7</mac-address>
3762 <ip-address>10.0.1.12</ip-address>
3763 <mpls-label1>299776</mpls-label1>
3767 * **Inclusive Multicast Ethernet Tag**
3770 <inc-multi-ethernet-tag-res>
3772 <vlan-id>2100</vlan-id>
3774 <orig-route-ip>43.43.43.43</orig-route-ip>
3775 </inc-multi-ethernet-tag-res>
3777 * **Ethernet Segment**
3781 <orig-route-ip>43.43.43.43</orig-route-ip>
3783 <arbitrary>AAAAAAAAAAAA</arbitrary>
3787 **EVPN Ethernet Segment Identifier (ESI):**
3790 Indicates an arbitrary 9-octet ESI.
3795 <arbitrary>AAAAAAAAAAAA</arbitrary>
3799 IEEE 802.1AX LACP is used.
3803 <lacp-auto-generated>
3804 <ce-lacp-mac-address>f2:0c:dd:80:9f:f7</ce-lacp-mac-address>
3805 <ce-lacp-port-key>22</ce-lacp-port-key>
3806 </lacp-auto-generated>
3809 Indirectly connected hosts via a bridged LAN.
3813 <lan-auto-generated>
3814 <root-bridge-mac-address>f2:0c:dd:80:9f:f7</root-bridge-mac-address>
3815 <root-bridge-priority>20</root-bridge-priority>
3816 </lan-auto-generated>
3823 <mac-auto-generated>
3824 <system-mac-address>f2:0c:dd:80:9f:f7</system-mac-address>
3825 <local-discriminator>2000</local-discriminator>
3826 </mac-auto-generated>
3833 <router-id-generated>
3834 <router-id>43.43.43.43</router-id>
3835 <local-discriminator>2000</local-discriminator>
3836 </router-id-generated>
3845 <local-discriminator>2000</local-discriminator>
3848 **Extended Communities:**
3850 * **ESI Label Extended Community**
3853 <extended-communities>
3854 <transitive>true</transitive>
3855 <esi-label-extended-community>
3856 <single-active-mode>false</single-active-mode>
3857 <esi-label>24001</esi-label>
3858 </esi-label-extended-community >
3859 </extended-communities>
3861 * **ES-Import Route Target**
3864 <extended-communities>
3865 <transitive>true</transitive>
3866 <es-import-route-extended-community>
3867 <es-import>f2:0c:dd:80:9f:f7</es-import>
3868 </es-import-route-extended-community>
3869 </extended-communities>
3871 * **MAC Mobility Extended Community**
3874 <extended-communities>
3875 <transitive>true</transitive>
3876 <mac-mobility-extended-community>
3877 <static>true</static>
3878 <seq-number>200</seq-number>
3879 </mac-mobility-extended-community>
3880 </extended-communities>
3882 * **Default Gateway Extended Community**
3885 <extended-communities>
3886 <transitive>true</transitive>
3887 <default-gateway-extended-community>
3888 </default-gateway-extended-community>
3889 </extended-communities>
3891 * **EVPN Layer 2 attributes extended community**
3894 <extended-communities>
3895 <transitive>false</transitive>
3896 <layer-2-attributes-extended-community>
3897 <primary-pe>true</primary-pe>
3898 <backup-pe>true</backup-pe>
3899 <control-word >true</control-word>
3900 <l2-mtu>200</l2-mtu>
3901 </layer-2-attributes-extended-community>
3902 </extended-communities>
3904 * **BGP Encapsulation extended community**
3909 <extended-communities>
3910 <transitive>false</transitive>
3911 <encapsulation-extended-community>
3912 <tunnel-type>vxlan</tunnel-type>
3913 </encapsulation-extended-community>
3914 </extended-communities>
3916 @line 4: `full list of tunnel types <http://www.iana.org/assignments/bgp-parameters/bgp-parameters.xhtml#tunnel-types>`_
3918 * **P-Multicast Service Interface Tunnel (PMSI) attribute**
3922 <leaf-information-required>true</leaf-information-required>
3923 <mpls-label>20024</mpls-label>
3924 <ingress-replication>
3925 <receiving-endpoint-address>172.12.123.3</receiving-endpoint-address>
3926 </ingress-replication>
3931 To remove the route added above, following request can be used:
3933 **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``
3935 **Method:** ``DELETE``
3939 .. table:: EVPN Routes Usage.
3941 +--------------------------------------+-----------------------------------------------------+-------------------------------------------+
3942 | EVN Route Type | Extended Communities | Usage |
3943 +======================================+=====================================================+===========================================+
3944 | **Ethernet Auto-discovery** | ESI Label, BGP EncapsulationEVPN Layer 2 attributes | Fast Convergence, Split Horizon, Aliasing |
3945 +--------------------------------------+-----------------------------------------------------+-------------------------------------------+
3946 | **MAC/IP Advertisement** | BGP Encapsulation, MAC Mobility, Default Gateway | MAC address reachability |
3947 +--------------------------------------+-----------------------------------------------------+-------------------------------------------+
3948 | **Inclusive Multicast Ethernet Tag** | PMSI Tunnel, BGP Encapsulation | Handling of Multi-destination traffic |
3949 +--------------------------------------+-----------------------------------------------------+-------------------------------------------+
3950 | **Ethernet Segment** | BGP Encapsulation, ES-Import Route Target | Designated Forwarder Election |
3951 +--------------------------------------+-----------------------------------------------------+-------------------------------------------+
3955 * `BGP MPLS-Based Ethernet VPN <https://tools.ietf.org/html/rfc7432>`_
3956 * `Provider Backbone Bridging Combined with Ethernet VPN <https://tools.ietf.org/html/rfc7623>`_
3957 * `VPWS support in EVPN <https://tools.ietf.org/html/draft-ietf-bess-evpn-vpws-07>`_
3958 * `A Network Virtualization Overlay Solution using EVPN <https://tools.ietf.org/html/draft-ietf-bess-evpn-overlay-04>`_
3959 * `Interconnect Solution for EVPN Overlay networks <https://tools.ietf.org/html/draft-ietf-bess-dci-evpn-overlay-04>`_
3960 * `Usage and applicability of BGP MPLS based Ethernet VPN <https://tools.ietf.org/html/draft-ietf-bess-evpn-usage-03>`_
3964 The ADD-PATH capability allows to advertise multiple paths for the same address prefix.
3965 It can help with optimal routing and routing convergence in a network by providing potential alternate or backup paths.
3967 .. contents:: Contents
3973 This section shows a way to enable ADD-PATH capability in BGP speaker and peer configuration.
3975 .. note:: The capability is applicable for IP Unicast, IP Labeled Unicast and Flow Specification address families.
3979 To enable ADD-PATH capability in BGP plugin, first configure BGP speaker instance:
3981 **URL:** ``/restconf/config/openconfig-network-instance:network-instances/network-instance/global-bgp/openconfig-network-instance:protocols``
3983 **Method:** ``POST``
3985 **Content-Type:** ``application/xml``
3991 :emphasize-lines: 14
3993 <protocol xmlns="http://openconfig.net/yang/network-instance">
3994 <name>bgp-example</name>
3995 <identifier xmlns:x="http://openconfig.net/yang/policy-types">x:BGP</identifier>
3996 <bgp xmlns="urn:opendaylight:params:xml:ns:yang:bgp:openconfig-extensions">
3999 <router-id>192.0.2.2</router-id>
4004 <afi-safi-name xmlns:x="http://openconfig.net/yang/bgp-types">x:IPV4-UNICAST</afi-safi-name>
4005 <receive>true</receive>
4006 <send-max>2</send-max>
4013 @line 14: Defines path selection strategy: *send-max* > 1 -> Advertise N Paths or *send-max* = 0 -> Advertise All Paths
4015 Here is an example for update a specific family with enable ADD-PATH capability
4017 **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``
4021 **Content-Type:** ``application/xml``
4027 <afi-safi xmlns="urn:opendaylight:params:xml:ns:yang:bgp:openconfig-extensions">
4028 <afi-safi-name xmlns:x="http://openconfig.net/yang/bgp-types">x:IPV4-UNICAST</afi-safi-name>
4029 <receive>true</receive>
4030 <send-max>0</send-max>
4035 Here is an example for BGP peer configuration with enabled ADD-PATH capability.
4037 **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``
4039 **Method:** ``POST``
4041 **Content-Type:** ``application/xml``
4047 <neighbor xmlns="urn:opendaylight:params:xml:ns:yang:bgp:openconfig-extensions">
4048 <neighbor-address>192.0.2.1</neighbor-address>
4051 <afi-safi-name xmlns:x="http://openconfig.net/yang/bgp-types">x:IPV4-LABELLED-UNICAST</afi-safi-name>
4054 <afi-safi-name xmlns:x="http://openconfig.net/yang/bgp-types">x:IPV4-UNICAST</afi-safi-name>
4055 <receive>true</receive>
4056 <send-max>0</send-max>
4061 .. 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.
4063 Here is an example for update specific family BGP peer configuration with enabled ADD-PATH capability.
4065 **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``
4069 **Content-Type:** ``application/xml``
4075 <afi-safi xmlns="urn:opendaylight:params:xml:ns:yang:bgp:openconfig-extensions">
4076 <afi-safi-name xmlns:x="http://openconfig.net/yang/bgp-types">x:IPV4-UNICAST</afi-safi-name>
4077 <receive>true</receive>
4078 <send-max>0</send-max>
4083 The IPv4 Unicast table with enabled ADD-PATH capability in an instance of the speaker's Loc-RIB can be verified via REST:
4085 **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``
4095 <ipv4-routes xmlns="urn:opendaylight:params:xml:ns:yang:bgp-inet">
4097 <path-id>1</path-id>
4098 <prefix>193.0.2.1/32</prefix>
4108 <global>10.0.0.1</global>
4113 <path-id>2</path-id>
4114 <prefix>193.0.2.1/32</prefix>
4124 <global>10.0.0.2</global>
4130 @line 3: The routes with the same destination are distinguished by *path-id* attribute.
4134 * `Advertisement of Multiple Paths in BGP <https://tools.ietf.org/html/rfc7911>`_
4135 * `Best Practices for Advertisement of Multiple Paths in IBGP <https://tools.ietf.org/html/draft-ietf-idr-add-paths-guidelines-08>`_
4139 The Route Refresh Capability allows to dynamically request a re-advertisement of the Adj-RIB-Out from a BGP peer.
4140 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.
4142 .. contents:: Contents
4148 The capability is enabled by default, no additional configuration is required.
4152 To send a Route Refresh request from OpenDaylight BGP speaker instance to its neighbor, invoke RPC:
4154 **URL:** ``/restconf/operations/bgp-peer-rpc:route-refresh-request``
4156 **Method:** ``POST``
4158 **Content-Type:** ``application/xml``
4164 <input xmlns="urn:opendaylight:params:xml:ns:yang:bgp-peer-rpc">
4165 <afi xmlns:types="urn:opendaylight:params:xml:ns:yang:bgp-types">types:ipv4-address-family</afi>
4166 <safi xmlns:types="urn:opendaylight:params:xml:ns:yang:bgp-types">types:unicast-subsequent-address-family</safi>
4167 <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>
4172 * `Route Refresh Capability for BGP-4 <https://tools.ietf.org/html/rfc2918>`_
4177 The OpenDaylight BGP implementation provides a set of APIs (described below), that give its operational state refreshed periodically, by default every 5 seconds.
4178 The following APIs describe what is available starting with how to change the default refresh rate.
4180 .. contents:: Contents
4184 Operational State Configuration
4185 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
4187 **URL:** ``/restconf/config/bgp-state-config:bgp-state-config``
4191 **Content-Type:** ``application/xml``
4199 <bgp-state-config xmlns="urn:opendaylight:params:xml:ns:yang:controller:config">
4200 <config-name xmlns="urn:opendaylight:params:xml:ns:yang:bgp-state-config">operationalState</config-name>
4201 <timer xmlns="urn:opendaylight:params:xml:ns:yang:bgp-state-config">1</timer>
4204 @line 3: Time in seconds between operational state update.
4206 BGP RIB Operational State
4207 ^^^^^^^^^^^^^^^^^^^^^^^^^
4209 **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``
4213 **Content-Type:** ``application/xml``
4220 <state xmlns="urn:opendaylight:params:xml:ns:yang:bgp:openconfig-extensions">
4222 <router-id>192.0.2.2</router-id>
4223 <total-paths>0</total-paths>
4224 <total-prefixes>0</total-prefixes>
4227 @line 2: AS number of the remote peer.
4229 @line 3: The unique protocol instance identifier.
4231 @line 4: Total number of Paths installed on RIB (Loc-RIB)
4233 @line 5: Total number of Prefixes installed on RIB (Loc-RIB)
4235 BGP RIB Families Operational State
4236 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
4238 **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``
4242 **Content-Type:** ``application/xml``
4248 :emphasize-lines: 3,5,6
4250 <afi-safis xmlns="urn:opendaylight:params:xml:ns:yang:bgp:openconfig-extensions">
4252 <afi-safi-name xmlns:x="http://openconfig.net/yang/bgp-types">x:IPV4-UNICAST</afi-safi-name>
4254 <total-paths>0</total-paths>
4255 <total-prefixes>0</total-prefixes>
4259 <afi-safi-name xmlns:x="http://openconfig.net/yang/bgp-types">x:IPV6-UNICAST</afi-safi-name>
4261 <total-paths>0</total-paths>
4262 <total-prefixes>0</total-prefixes>
4268 @line 3: Family Identifier.
4270 @line 5: Total number of Paths installed on RIB (Loc-RIB) per specific family.
4272 @line 6: Total number of Prefixes installed on RIB (Loc-RIB) per specific family.
4274 BGP Neighbors Operational State
4275 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
4277 **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``
4281 **Content-Type:** ``application/xml``
4289 <neighbors xmlns="urn:opendaylight:params:xml:ns:yang:bgp:openconfig-extensions">
4291 <neighbor-address>192.0.2.1</neighbor-address>
4295 <neighbor-address>192.0.2.2</neighbor-address>
4300 @line 3: IP address of the remote BGP peer. Also serves as an unique identifier of a neighbor in a list of neighbors.
4302 BGP Neighbor Operational State
4303 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
4305 .. note:: Supported Capabilities only provided when session has been established.
4307 **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``
4311 **Content-Type:** ``application/xml``
4317 :emphasize-lines: 2,3,4,7,8,11,12
4319 <state xmlns="urn:opendaylight:params:xml:ns:yang:bgp:openconfig-extensions">
4320 <session-state>ESTABLISHED</session-state>
4321 <supported-capabilities xmlns:x="http://openconfig.net/yang/bgp-types">x:ASN32</supported-capabilities>
4322 <supported-capabilities xmlns:x="http://openconfig.net/yang/bgp-types">x:MPBGP</supported-capabilities>
4326 <NOTIFICATION>0</NOTIFICATION>
4330 <NOTIFICATION>0</NOTIFICATION>
4335 @line 2: Session status
4337 @line 3-4: BGP capabilities supported ( ASN32 / MPBGP / ROUTE_REFRESH / GRACEFUL_RESTART / ADD_PATHS)
4339 @line 7: Total count of Update Messages sent
4341 @line 8: Total count of Notification Messages sent
4343 @line 11: Total count of Update Messages received
4345 @line 12: Total count of Notification Messages received
4347 BGP Neighbor Families Operational State
4348 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
4350 .. note:: Graceful Restart not supported yet. Planned for Carbon.
4353 **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``
4357 **Content-Type:** ``application/xml``
4363 :emphasize-lines: 3,5,7,9,10
4365 <afi-safis xmlns="urn:opendaylight:params:xml:ns:yang:bgp:openconfig-extensions">
4367 <afi-safi-name xmlns:x="http://openconfig.net/yang/bgp-types">x:IPV4-UNICAST</afi-safi-name>
4369 <active>false</active>
4373 <received>false</received>
4374 <advertised>false</advertised>
4379 <afi-safi-name xmlns:x="http://openconfig.net/yang/bgp-types">x:IPV6-UNICAST</afi-safi-name>
4381 <active>false</active>
4385 <received>false</received>
4386 <advertised>false</advertised>
4392 @line 3: Family Identifier.
4394 @line 5: True if family is advertized by peer.
4396 @line 7: Graceful Restart Operational State per specific family.
4398 @line 9: True if the peer supports graceful restart.
4400 @line 10: True if we support graceful restart.
4402 BGP Neighbor Family Operational State
4403 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
4405 .. note:: Prefixes state is only provided once session is established.
4406 .. note:: Graceful Restart not supported yet. Planned to be implemented in Carbon.
4408 **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``
4412 **Content-Type:** ``application/xml``
4418 :emphasize-lines: 2,4,6,7,8
4420 <afi-safi xmlns="urn:opendaylight:params:xml:ns:yang:bgp:openconfig-extensions">
4421 <afi-safi-name xmlns:x="http://openconfig.net/yang/bgp-types">x:IPV4-UNICAST</afi-safi-name>
4423 <active>true</active>
4425 <installed>3</installed>
4427 <received>3</received>
4432 <received>false</received>
4433 <advertised>false</advertised>
4438 @line 2: Family Identifier.
4440 @line 4: True if family is advertized to and by peer.
4442 @line 6: Total count of prefixes advertized by peer and installed (effective-rib-in).
4444 @line 7: Total count of prefixes advertized to peer (adj-rib-out).
4446 @line 8: Total count of prefixes advertized by peer (adj-rib-in).
4448 BGP Neighbor Timers Operational State
4449 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
4451 .. note:: State is only provided once session is established.
4453 **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``
4457 **Content-Type:** ``application/xml``
4463 :emphasize-lines: 3,4
4465 <timers xmlns="urn:opendaylight:params:xml:ns:yang:bgp:openconfig-extensions">
4467 <negotiated-hold-time>180</negotiated-hold-time>
4468 <uptime>1580676</uptime>
4472 @line 3: The negotiated hold-time for the BGP session in seconds.
4474 @line 4: Session duration since establishment in milliseconds.
4476 BGP Neighbor Transport Operational State
4477 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
4479 .. note:: State is only provided once session is established.
4481 **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``
4485 **Content-Type:** ``application/xml``
4491 :emphasize-lines: 3,4,5
4493 <transport xmlns="urn:opendaylight:params:xml:ns:yang:bgp:openconfig-extensions">
4495 <remote-address>127.0.0.2</remote-address>
4496 <remote-port>44718</remote-port>
4497 <local-port>1790</local-port>
4501 @line 3: IP address of the remote BGP peer.
4503 @line 4: Port of the remote BGP peer.
4505 @line 5: Local port.
4507 BGP Neighbor Error Handling Operational State
4508 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
4510 .. note:: State is only provided once session is established.
4511 .. note:: Error handling not supported yet. Planned for Carbon.
4513 **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``
4517 **Content-Type:** ``application/xml``
4525 <error-handling xmlns="urn:opendaylight:params:xml:ns:yang:bgp:openconfig-extensions">
4527 <erroneous-update-messages>0</erroneous-update-messages>
4531 @line 3: The number of BGP UPDATE messages for which the treat-as-withdraw mechanism has been applied based on
4532 erroneous message contents
4534 BGP Neighbor Graceful Restart Operational State
4535 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
4537 .. note:: Graceful Restart not supported yet. Planned for Carbon.
4539 **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``
4543 **Content-Type:** ``application/xml``
4549 :emphasize-lines: 3,4,5
4551 <graceful-restart xmlns="urn:opendaylight:params:xml:ns:yang:bgp:openconfig-extensions">
4553 <peer-restart-time>0</peer-restart-time>
4554 <peer-restarting>false</peer-restarting>
4555 <local-restarting>false</local-restarting>
4559 @line 3: The period of time (advertised by the peer) that the peer expects a restart of a BGP session to take.
4561 @line 4: This flag indicates whether the remote neighbor is currently in the process of restarting, and hence
4562 received routes are currently stale.
4564 @line 5: This flag indicates whether the local neighbor is currently restarting. The flag is unset after all NLRI
4565 have been advertised to the peer, and the End-of-RIB (EOR) marker has been unset.
4567 BGP Peer Groups Operational State
4568 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
4570 **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``
4574 **Content-Type:** ``application/xml``
4580 :emphasize-lines: 3,5,6
4584 <peer-group-name>application-peers</peer-group-name>
4586 <total-paths>0</total-paths>
4587 <total-prefixes>0</total-prefixes>
4591 @line 3: Peer Group Identifier.
4593 @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.
4595 @line 6: Total Prefixes installed under by peers pertaining to this peer group (effective-rib-in).
4596 This count doesn't differentiate repeated prefixes.
4600 Running OpenDaylight BGP in clustered environment brings an advantage of the plugin's high availability (HA).
4601 This section illustrates a basic scenario for HA, also presents a configuration for clustered OpenDaylight BGP.
4603 .. contents:: Contents
4609 Following example shows a configuration for running BGP in clustered environment.
4611 #. As the first step, configure (replicated *deafult* shard and *topology* shard if needed) and run OpenDaylight in clustered environment, install BGP and RESTCONF.
4613 #. 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.
4615 #. Remote peer should be configured to accept/initiate connection from/to all OpenDaylight cluster nodes with configured BGP plugin.
4617 #. 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.
4621 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`):
4623 * In ``modules.conf`` add a new module:
4624 .. code-block:: console
4628 namespace = "urn:opendaylight:params:xml:ns:yang:bgp-rib"
4629 shard-strategy = "module"
4632 * In ``module-shards.conf`` define a new module shard:
4633 .. code-block:: console
4647 **Note:** Use correct member name in module shard configuration.
4651 Following section presents a basic BGP speaker failover scenario on 3-node OpenDaylight cluster setup.
4653 .. figure:: ./images/bgpcep/BGP_HA.png
4656 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.
4657 Routes advertised by remote peer are replicated, hence RIBs state on all nodes is the same.
4661 .. figure:: ./images/bgpcep/BGP_HA_failure.png
4662 :alt: Node went down.
4664 In a case a cluster node, where BGP instance is running, goes down (unexpected failure, restart), active BGP session is dropped.
4668 .. figure:: ./images/bgpcep/BGP_HA_recovery.png
4671 Now, one of the stand-by BGP speaker instances become active. Remote peer establishes new connection and advertises routes again.
4675 This section provides an overview of the BGP topology provider service.
4676 It shows how to configure and use all available BGP topology providers.
4677 Providers are building topology view of BGP routes stored in local BGP speaker's Loc-RIB.
4678 Output topologies are rendered in a form of standardised IETF network topology model.
4680 .. contents:: Contents
4684 Inet Reachability Topology
4685 ^^^^^^^^^^^^^^^^^^^^^^^^^^
4686 Inet reachability topology exporter offers a mapping service from IPv4/6 routes to network topology nodes.
4690 Following example shows how to create a new instance of IPv4 BGP topology exporter:
4692 **URL:** ``/restconf/config/network-topology:network-topology``
4694 **Method:** ``POST``
4696 **Content-Type:** ``application/xml``
4702 :emphasize-lines: 2,4,6
4704 <topology xmlns="urn:TBD:params:xml:ns:yang:network-topology">
4705 <topology-id>bgp-example-ipv4-topology</topology-id>
4707 <bgp-ipv4-reachability-topology xmlns="urn:opendaylight:params:xml:ns:yang:odl-bgp-topology-types"></bgp-ipv4-reachability-topology>
4709 <rib-id xmlns="urn:opendaylight:params:xml:ns:yang:odl-bgp-topology-config">bgp-example</rib-id>
4712 @line 2: An identifier for a topology.
4714 @line 4: Used to identify type of the topology. In this case BGP IPv4 reachability topology.
4716 @line 6: A name of the local BGP speaker instance.
4720 The topology exporter instance can be removed in a following way:
4722 **URL:** ``/restconf/config/network-topology:network-topology/topology/bgp-example-ipv4-topology``
4724 **Method:** ``DELETE``
4728 Following example shows how to create a new instance of IPv6 BGP topology exporter:
4730 **URL:** ``/restconf/config/network-topology:network-topology``
4732 **Method:** ``POST``
4734 **Content-Type:** ``application/xml``
4740 <topology xmlns="urn:TBD:params:xml:ns:yang:network-topology">
4741 <topology-id>bgp-example-ipv6-topology</topology-id>
4743 <bgp-ipv6-reachability-topology xmlns="urn:opendaylight:params:xml:ns:yang:odl-bgp-topology-types"></bgp-ipv6-reachability-topology>
4745 <rib-id xmlns="urn:opendaylight:params:xml:ns:yang:odl-bgp-topology-config">bgp-example</rib-id>
4750 Operational state of the topology can be verified via REST:
4752 **URL:** ``/restconf/operational/network-topology:network-topology/topology/bgp-example-ipv4-topology``
4760 :emphasize-lines: 8,11
4762 <topology xmlns="urn:TBD:params:xml:ns:yang:network-topology">
4763 <topology-id>bgp-example-ipv4-topology</topology-id>
4764 <server-provided>true</server-provided>
4766 <bgp-ipv4-reachability-topology xmlns="urn:opendaylight:params:xml:ns:yang:odl-bgp-topology-types"></bgp-ipv4-reachability-topology>
4769 <node-id>10.10.1.1</node-id>
4770 <igp-node-attributes xmlns="urn:TBD:params:xml:ns:yang:nt:l3-unicast-igp-topology">
4772 <prefix>10.0.0.10/32</prefix>
4774 </igp-node-attributes>
4778 @line 8: The identifier of a node in a topology. Its value is mapped from route's NEXT_HOP attribute.
4780 @line 11: The IP prefix attribute of the node. Its value is mapped from routes's destination IP prefix.
4782 BGP Linkstate Topology
4783 ^^^^^^^^^^^^^^^^^^^^^^
4784 BGP linkstate topology exporter offers a mapping service from BGP-LS routes to network topology nodes and links.
4788 Following example shows how to create a new instance of linkstate BGP topology exporter:
4790 **URL:** ``/restconf/config/network-topology:network-topology``
4792 **Method:** ``POST``
4794 **Content-Type:** ``application/xml``
4800 <topology xmlns="urn:TBD:params:xml:ns:yang:network-topology">
4801 <topology-id>bgp-example-linkstate-topology</topology-id>
4803 <bgp-linkstate-topology xmlns="urn:opendaylight:params:xml:ns:yang:odl-bgp-topology-types"></bgp-linkstate-topology>
4805 <rib-id xmlns="urn:opendaylight:params:xml:ns:yang:odl-bgp-topology-config">bgp-example</rib-id>
4810 Operational state of the topology can be verified via REST.
4811 A sample output below represents a two node topology with two unidirectional links interconnecting those nodes.
4813 **URL:** ``/restconf/operational/network-topology:network-topology/topology/bgp-example-linkstate-topology``
4821 <topology xmlns="urn:TBD:params:xml:ns:yang:network-topology">
4822 <topology-id>bgp-example-linkstate-topology</topology-id>
4823 <server-provided>true</server-provided>
4825 <bgp-linkstate-topology xmlns="urn:opendaylight:params:xml:ns:yang:odl-bgp-topology-types"></bgp-linkstate-topology>
4828 <node-id>bgpls://IsisLevel2:1/type=node&as=65000&domain=673720360&router=0000.0000.0040</node-id>
4830 <tp-id>bgpls://IsisLevel2:1/type=tp&ipv4=203.20.160.40</tp-id>
4831 <igp-termination-point-attributes xmlns="urn:TBD:params:xml:ns:yang:nt:l3-unicast-igp-topology"/>
4832 </termination-point>
4833 <igp-node-attributes xmlns="urn:TBD:params:xml:ns:yang:nt:l3-unicast-igp-topology">
4835 <prefix>40.40.40.40/32</prefix>
4839 <prefix>203.20.160.0/24</prefix>
4843 <router-id>40.40.40.40</router-id>
4844 <isis-node-attributes xmlns="urn:TBD:params:xml:ns:yang:network:isis-topology">
4846 <te-router-id-ipv4>40.40.40.40</te-router-id-ipv4>
4849 <iso-system-id>MDAwMDAwMDAwMDY0</iso-system-id>
4851 </isis-node-attributes>
4852 </igp-node-attributes>
4855 <node-id>bgpls://IsisLevel2:1/type=node&as=65000&domain=673720360&router=0000.0000.0039</node-id>
4857 <tp-id>bgpls://IsisLevel2:1/type=tp&ipv4=203.20.160.39</tp-id>
4858 <igp-termination-point-attributes xmlns="urn:TBD:params:xml:ns:yang:nt:l3-unicast-igp-topology"/>
4859 </termination-point>
4860 <igp-node-attributes xmlns="urn:TBD:params:xml:ns:yang:nt:l3-unicast-igp-topology">
4862 <prefix>39.39.39.39/32</prefix>
4866 <prefix>203.20.160.0/24</prefix>
4870 <router-id>39.39.39.39</router-id>
4871 <isis-node-attributes xmlns="urn:TBD:params:xml:ns:yang:network:isis-topology">
4873 <te-router-id-ipv4>39.39.39.39</te-router-id-ipv4>
4876 <iso-system-id>MDAwMDAwMDAwMDg3</iso-system-id>
4878 </isis-node-attributes>
4879 </igp-node-attributes>
4883 <dest-node>bgpls://IsisLevel2:1/type=node&as=65000&domain=673720360&router=0000.0000.0039</dest-node>
4884 <dest-tp>bgpls://IsisLevel2:1/type=tp&ipv4=203.20.160.39</dest-tp>
4886 <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>
4888 <source-node>bgpls://IsisLevel2:1/type=node&as=65000&domain=673720360&router=0000.0000.0040</source-node>
4889 <source-tp>bgpls://IsisLevel2:1/type=tp&ipv4=203.20.160.40</source-tp>
4891 <igp-link-attributes xmlns="urn:TBD:params:xml:ns:yang:nt:l3-unicast-igp-topology">
4893 <isis-link-attributes xmlns="urn:TBD:params:xml:ns:yang:network:isis-topology">
4896 <max-link-bandwidth>1250000.0</max-link-bandwidth>
4897 <max-resv-link-bandwidth>12500.0</max-resv-link-bandwidth>
4898 <te-default-metric>0</te-default-metric>
4899 <unreserved-bandwidth>
4900 <bandwidth>12500.0</bandwidth>
4901 <priority>0</priority>
4902 </unreserved-bandwidth>
4903 <unreserved-bandwidth>
4904 <bandwidth>12500.0</bandwidth>
4905 <priority>1</priority>
4906 </unreserved-bandwidth>
4907 <unreserved-bandwidth>
4908 <bandwidth>12500.0</bandwidth>
4909 <priority>2</priority>
4910 </unreserved-bandwidth>
4911 <unreserved-bandwidth>
4912 <bandwidth>12500.0</bandwidth>
4913 <priority>3</priority>
4914 </unreserved-bandwidth>
4915 <unreserved-bandwidth>
4916 <bandwidth>12500.0</bandwidth>
4917 <priority>4</priority>
4918 </unreserved-bandwidth>
4919 <unreserved-bandwidth>
4920 <bandwidth>12500.0</bandwidth>
4921 <priority>5</priority>
4922 </unreserved-bandwidth>
4923 <unreserved-bandwidth>
4924 <bandwidth>12500.0</bandwidth>
4925 <priority>6</priority>
4926 </unreserved-bandwidth>
4927 <unreserved-bandwidth>
4928 <bandwidth>12500.0</bandwidth>
4929 <priority>7</priority>
4930 </unreserved-bandwidth>
4932 </isis-link-attributes>
4933 </igp-link-attributes>
4937 <dest-node>bgpls://IsisLevel2:1/type=node&as=65000&domain=673720360&router=0000.0000.0040</dest-node>
4938 <dest-tp>bgpls://IsisLevel2:1/type=tp&ipv4=203.20.160.40</dest-tp>
4940 <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>
4942 <source-node>bgpls://IsisLevel2:1/type=node&as=65000&domain=673720360&router=0000.0000.0039</source-node>
4943 <source-tp>bgpls://IsisLevel2:1/type=tp&ipv4=203.20.160.39</source-tp>
4945 <igp-link-attributes xmlns="urn:TBD:params:xml:ns:yang:nt:l3-unicast-igp-topology">
4947 <isis-link-attributes xmlns="urn:TBD:params:xml:ns:yang:network:isis-topology">
4950 <max-link-bandwidth>1250000.0</max-link-bandwidth>
4951 <max-resv-link-bandwidth>12500.0</max-resv-link-bandwidth>
4952 <te-default-metric>0</te-default-metric>
4953 <unreserved-bandwidth>
4954 <bandwidth>12500.0</bandwidth>
4955 <priority>0</priority>
4956 </unreserved-bandwidth>
4957 <unreserved-bandwidth>
4958 <bandwidth>12500.0</bandwidth>
4959 <priority>1</priority>
4960 </unreserved-bandwidth>
4961 <unreserved-bandwidth>
4962 <bandwidth>12500.0</bandwidth>
4963 <priority>2</priority>
4964 </unreserved-bandwidth>
4965 <unreserved-bandwidth>
4966 <bandwidth>12500.0</bandwidth>
4967 <priority>3</priority>
4968 </unreserved-bandwidth>
4969 <unreserved-bandwidth>
4970 <bandwidth>12500.0</bandwidth>
4971 <priority>4</priority>
4972 </unreserved-bandwidth>
4973 <unreserved-bandwidth>
4974 <bandwidth>12500.0</bandwidth>
4975 <priority>5</priority>
4976 </unreserved-bandwidth>
4977 <unreserved-bandwidth>
4978 <bandwidth>12500.0</bandwidth>
4979 <priority>6</priority>
4980 </unreserved-bandwidth>
4981 <unreserved-bandwidth>
4982 <bandwidth>12500.0</bandwidth>
4983 <priority>7</priority>
4984 </unreserved-bandwidth>
4986 </isis-link-attributes>
4987 </igp-link-attributes>
4991 BGP Network Topology Configuration Loader
4992 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
4994 BGP Network Topology Configuration Loader allows user to define static initial configuration for a BGP protocol instance.
4995 This service will detect the creation of new configuration files following the pattern "network-topology-*.xml" under the path "etc/opendaylight/bgp".
4996 Once the file is processed, the defined configuration will be available from the configuration Data Store.
4998 .. note:: If the BGP topology instance is already present, no update or configuration will be applied.
5000 When installing BGP an example will be provided and a default configuration loaded.
5002 **PATH:** ``etc/opendaylight/bgp/network-topology-config.xml``
5006 <network-topology xmlns="urn:TBD:params:xml:ns:yang:network-topology">
5008 <topology-id>example-ipv4-topology</topology-id>
5010 <bgp-ipv4-reachability-topology xmlns="urn:opendaylight:params:xml:ns:yang:odl-bgp-topology-types"/>
5012 <rib-id xmlns="urn:opendaylight:params:xml:ns:yang:odl-bgp-topology-config">example-bgp-rib</rib-id>
5015 <topology-id>example-ipv6-topology</topology-id>
5017 <bgp-ipv6-reachability-topology xmlns="urn:opendaylight:params:xml:ns:yang:odl-bgp-topology-types"/>
5019 <rib-id xmlns="urn:opendaylight:params:xml:ns:yang:odl-bgp-topology-config">example-bgp-rib</rib-id>
5022 <topology-id>example-linkstate-topology</topology-id>
5024 <bgp-linkstate-topology xmlns="urn:opendaylight:params:xml:ns:yang:odl-bgp-topology-types"/>
5026 <rib-id xmlns="urn:opendaylight:params:xml:ns:yang:odl-bgp-topology-config">example-bgp-rib</rib-id>
5032 BGP test tools serves to test basic BGP functionality, scalability and performance.
5034 .. contents:: Contents
5040 The BGP Test Tool is a stand-alone Java application purposed to simulate remote BGP peers, that are capable to advertise sample routes.
5041 This application is not part of the OpenDaylight Karaf distribution, however it can be downloaded from OpenDaylight's Nexus (use latest release version):
5043 ``https://nexus.opendaylight.org/content/repositories/opendaylight.release/org/opendaylight/bgpcep/bgp-testtool``
5047 The application can be run from command line:
5049 .. code-block:: console
5051 java -jar bgp-testtool-*-executable.jar
5054 with optional input parameters:
5056 .. code-block:: console
5058 -i <BOOLEAN>, --active <BOOLEAN>
5059 Active initialisation of the connection, by default false.
5061 -ho <N>, --holdtimer <N>
5062 In seconds, value of the desired holdtimer, by default 90.
5064 -sc <N>, --speakersCount <N>
5065 Number of simulated BGP speakers, when creating each speaker, uses incremented local-address for binding, by default 0.
5067 -ra <IP_ADDRESS:PORT,...>, --remoteAddress <IP_ADDRESS:PORT,...>
5068 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.
5070 -la <IP_ADDRESS:PORT>, --localAddress <IP_ADDRESS:PORT>
5071 IP address of BGP speakers which the tools simulates, by default 192.0.2.2:0.
5073 -pr <N>, --prefixes <N>
5074 Number of prefixes to be advertised by each simulated speaker
5076 -mp <BOOLEAN>, --multiPathSupport <BOOLEAN>
5077 Active ADD-PATH support, by default false.
5080 Local AS Number, by default 64496.
5082 -ec <EXTENDED_COMMUNITIES>, --extended_communities <EXTENDED_COMMUNITIES>
5083 Extended communities to be send. Format: x,x,x where x is each extended community from bgp-types.yang, by default empty.
5085 -ll <LOG_LEVEL>, --log_level <LOG_LEVEL>
5086 Log level for console output, by default INFO.
5088 BGP Application Peer Benchmark
5089 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
5090 It is a simple OpenDaylight application which is capable to inject and remove specific amount of IPv4 routes.
5091 This application is part of the OpenDaylight Karaf distribution.
5095 As a first step install BGP and RESTCONF, then configure *Application Peer*.
5096 Install ``odl-bgpcep-bgp-benchmark`` feature and reconfigure BGP Application Peer Benchmark application as per following:
5098 **URL:** ``/restconf/config/odl-bgp-app-peer-benchmark-config:config``
5102 **Content-Type:** ``application/xml``
5110 <odl-bgp-app-peer-benchmark-config xmlns="urn:opendaylight:params:xml:ns:yang:odl-bgp-app-peer-benchmark-config">
5111 <app-peer-id xmlns="urn:opendaylight:params:xml:ns:yang:odl-bgp-app-peer-benchmark-config">10.25.1.9</app-peer-id>
5112 </odl-bgp-app-peer-benchmark-config>
5114 @line 2: The *Application Peer* identifier.
5118 Routes injection can be invoked via RPC:
5120 **URL:** ``/restconf/operations/odl-bgp-app-peer-benchmark:add-prefix``
5122 **Method:** ``POST``
5124 **Content-Type:** ``application/xml``
5130 :emphasize-lines: 2,3,4,5
5132 <input xmlns="urn:opendaylight:params:xml:ns:yang:odl-bgp-app-peer-benchmark">
5133 <prefix>1.1.1.1/32</prefix>
5134 <count>100000</count>
5135 <batchsize>2000</batchsize>
5136 <nexthop>192.0.2.2</nexthop>
5139 @line 2: A initial IPv4 prefix carried in route. Value is incremented for following routes.
5141 @line 3: An amount of routes to be added to *Application Peer's* programmable RIB.
5143 @line 4: A size of the transaction batch.
5145 @line 5: A NEXT_HOP attribute value used in all injected routes.
5151 :emphasize-lines: 3,4,5
5153 <output xmlns="urn:opendaylight:params:xml:ns:yang:odl-bgp-app-peer-benchmark">
5155 <duration>4301</duration>
5157 <count>100000</count>
5161 @line 3: Request duration in milliseconds.
5163 @line 4: Writes per second rate.
5165 @line 5: An amount of routes added to *Application Peer's* programmable RIB.
5169 Routes deletion can be invoked via RPC:
5171 **URL:** ``/restconf/operations/odl-bgp-app-peer-benchmark:delete-prefix``
5173 **Method:** ``POST``
5175 **Content-Type:** ``application/xml``
5181 :emphasize-lines: 2,3,4
5183 <input xmlns="urn:opendaylight:params:xml:ns:yang:odl-bgp-app-peer-benchmark">
5184 <prefix>1.1.1.1/32</prefix>
5185 <count>100000</count>
5186 <batchsize>2000</batchsize>
5189 @line 2: A initial IPv4 prefix carried in route to be removed. Value is incremented for following routes.
5191 @line 3: An amount of routes to be removed from *Application Peer's* programmable RIB.
5193 @line 4: A size of the transaction batch.
5199 <output xmlns="urn:opendaylight:params:xml:ns:yang:odl-bgp-app-peer-benchmark">
5201 <duration>1837</duration>
5203 <count>100000</count>
5209 This section offers advices in a case OpenDaylight BGP plugin is not working as expected.
5211 .. contents:: Contents
5215 BGP is not working...
5216 ^^^^^^^^^^^^^^^^^^^^^
5217 * First of all, ensure that all required features are installed, local and remote BGP configuration is correct.
5219 * Check OpenDaylight Karaf logs:
5223 .. code-block:: console
5227 or open log file: ``data/log/karaf.log``
5229 Possibly, a reason/hint for a cause of the problem can be found there.
5231 * Try to minimise effect of other OpenDaylight features, when searching for a reason of the problem.
5233 * Try to set DEBUG severity level for BGP logger via Karaf console commands, in order to collect more information:
5235 .. code-block:: console
5237 log:set DEBUG org.opendaylight.protocol.bgp
5239 .. code-block:: console
5241 log:set DEBUG org.opendaylight.bgpcep.bgp
5245 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.
5247 Write an e-mail to bgpcep-users@lists.opendaylight.org and provide following information:
5249 #. State OpenDaylight version
5251 #. Describe your use-case and provide as much details related to BGP as possible
5253 #. Steps to reproduce
5255 #. Attach Karaf log files, optionally packet captures, REST input/output