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>
2150 Linkstate path attribute
2151 ''''''''''''''''''''''''
2152 IANA allocation for BGP-LS path attribute is TYPE 29.
2153 Some older BGP-LS implementations might still require earliest asigned allocation TYPE 99.
2154 To use TYPE = 99, you need to set value bellow to false.
2156 **URL:** ``/restconf/config/bgp-linkstate-app-config:bgp-linkstate-app-config``
2160 **Content-Type:** ``application/xml``
2166 <bgp-linkstate-app-config xmlns="urn:opendaylight:params:xml:ns:yang:controller:bgp:linkstate-app-config">
2167 <iana-linkstate-attribute-type>false</iana-linkstate-attribute-type>
2168 </bgp-linkstate-app-config>
2172 Here is an example for BGP peer configuration with enabled BGP-LS family.
2174 **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``
2176 **Method:** ``POST``
2178 **Content-Type:** ``application/xml``
2184 <neighbor xmlns="urn:opendaylight:params:xml:ns:yang:bgp:openconfig-extensions">
2185 <neighbor-address>192.0.2.1</neighbor-address>
2188 <afi-safi-name>LINKSTATE</afi-safi-name>
2193 Link-State Route API
2194 ^^^^^^^^^^^^^^^^^^^^
2195 Following tree illustrate the BGP Link-State route structure.
2197 .. code-block:: console
2199 :(linkstate-routes-case)
2200 +--ro linkstate-routes
2201 +--ro linkstate-route* [route-key]
2202 +--ro route-key binary
2203 +--ro protocol-id protocol-id
2204 +--ro identifier identifier
2205 +--ro (object-type)?
2207 | | +--ro node-descriptors
2208 | | +--ro as-number? inet:as-number
2209 | | +--ro area-id? area-identifier
2210 | | +--ro domain-id? domain-identifier
2211 | | +--ro (c-router-identifier)?
2212 | | +--:(isis-node-case)
2213 | | | +--ro isis-node
2214 | | | +--ro iso-system-id netc:iso-system-identifier
2215 | | +--:(isis-pseudonode-case)
2216 | | | +--ro isis-pseudonode
2217 | | | +--ro is-is-router-identifier
2218 | | | | +--ro iso-system-id netc:iso-system-identifier
2219 | | | +--ro psn uint8
2220 | | +--:(ospf-node-case)
2221 | | | +--ro ospf-node
2222 | | | +--ro ospf-router-id uint32
2223 | | +--:(ospf-pseudonode-case)
2224 | | +--ro ospf-pseudonode
2225 | | +--ro ospf-router-id uint32
2226 | | +--ro lan-interface ospf-interface-identifier
2228 | | +--ro local-node-descriptors
2229 | | | +--ro as-number? inet:as-number
2230 | | | +--ro area-id? area-identifier
2231 | | | +--ro domain-id? domain-identifier
2232 | | | +--ro (c-router-identifier)?
2233 | | | | +--:(isis-node-case)
2234 | | | | | +--ro isis-node
2235 | | | | | +--ro iso-system-id netc:iso-system-identifier
2236 | | | | +--:(isis-pseudonode-case)
2237 | | | | | +--ro isis-pseudonode
2238 | | | | | +--ro is-is-router-identifier
2239 | | | | | | +--ro iso-system-id netc:iso-system-identifier
2240 | | | | | +--ro psn uint8
2241 | | | | +--:(ospf-node-case)
2242 | | | | | +--ro ospf-node
2243 | | | | | +--ro ospf-router-id uint32
2244 | | | | +--:(ospf-pseudonode-case)
2245 | | | | +--ro ospf-pseudonode
2246 | | | | +--ro ospf-router-id uint32
2247 | | | | +--ro lan-interface ospf-interface-identifier
2248 | | | +--ro bgp-router-id? inet:ipv4-address
2249 | | | +--ro member-asn? inet:as-number
2250 | | +--ro remote-node-descriptors
2251 | | | +--ro as-number? inet:as-number
2252 | | | +--ro area-id? area-identifier
2253 | | | +--ro domain-id? domain-identifier
2254 | | | +--ro (c-router-identifier)?
2255 | | | | +--:(isis-node-case)
2256 | | | | | +--ro isis-node
2257 | | | | | +--ro iso-system-id netc:iso-system-identifier
2258 | | | | +--:(isis-pseudonode-case)
2259 | | | | | +--ro isis-pseudonode
2260 | | | | | +--ro is-is-router-identifier
2261 | | | | | | +--ro iso-system-id netc:iso-system-identifier
2262 | | | | | +--ro psn uint8
2263 | | | | +--:(ospf-node-case)
2264 | | | | | +--ro ospf-node
2265 | | | | | +--ro ospf-router-id uint32
2266 | | | | +--:(ospf-pseudonode-case)
2267 | | | | +--ro ospf-pseudonode
2268 | | | | +--ro ospf-router-id uint32
2269 | | | | +--ro lan-interface ospf-interface-identifier
2270 | | | +--ro bgp-router-id? inet:ipv4-address
2271 | | | +--ro member-asn? inet:as-number
2272 | | +--ro link-descriptors
2273 | | +--ro link-local-identifier? uint32
2274 | | +--ro link-remote-identifier? uint32
2275 | | +--ro ipv4-interface-address? ipv4-interface-identifier
2276 | | +--ro ipv6-interface-address? ipv6-interface-identifier
2277 | | +--ro ipv4-neighbor-address? ipv4-interface-identifier
2278 | | +--ro ipv6-neighbor-address? ipv6-interface-identifier
2279 | | +--ro multi-topology-id? topology-identifier
2281 | | +--ro advertising-node-descriptors
2282 | | | +--ro as-number? inet:as-number
2283 | | | +--ro area-id? area-identifier
2284 | | | +--ro domain-id? domain-identifier
2285 | | | +--ro (c-router-identifier)?
2286 | | | +--:(isis-node-case)
2287 | | | | +--ro isis-node
2288 | | | | +--ro iso-system-id netc:iso-system-identifier
2289 | | | +--:(isis-pseudonode-case)
2290 | | | | +--ro isis-pseudonode
2291 | | | | +--ro is-is-router-identifier
2292 | | | | | +--ro iso-system-id netc:iso-system-identifier
2293 | | | | +--ro psn uint8
2294 | | | +--:(ospf-node-case)
2295 | | | | +--ro ospf-node
2296 | | | | +--ro ospf-router-id uint32
2297 | | | +--:(ospf-pseudonode-case)
2298 | | | +--ro ospf-pseudonode
2299 | | | +--ro ospf-router-id uint32
2300 | | | +--ro lan-interface ospf-interface-identifier
2301 | | +--ro prefix-descriptors
2302 | | +--ro multi-topology-id? topology-identifier
2303 | | +--ro ospf-route-type? ospf-route-type
2304 | | +--ro ip-reachability-information? inet:ip-prefix
2306 | +--ro (address-family)?
2308 | | | +--ro ipv4-tunnel-sender-address inet:ipv4-address
2309 | | | +--ro ipv4-tunnel-endpoint-address inet:ipv4-address
2311 | | +--ro ipv6-tunnel-sender-address inet:ipv6-address
2312 | | +--ro ipv6-tunnel-endpoint-address inet:ipv6-address
2313 | +--ro tunnel-id? rsvp:tunnel-id
2314 | +--ro lsp-id? rsvp:lsp-id
2316 +--ro (link-state-attribute)?
2317 +--:(node-attributes-case)
2318 | +--ro node-attributes
2319 | +--ro topology-identifier* topology-identifier
2320 | +--ro node-flags? node-flag-bits
2321 | +--ro isis-area-id* isis-area-identifier
2322 | +--ro dynamic-hostname? string
2323 | +--ro ipv4-router-id? ipv4-router-identifier
2324 | +--ro ipv6-router-id? ipv6-router-identifier
2325 | +--ro sr-capabilities
2326 | | +--ro mpls-ipv4? boolean
2327 | | +--ro mpls-ipv6? boolean
2328 | | +--ro sr-ipv6? boolean
2329 | | +--ro range-size? uint32
2330 | | +--ro (sid-label-index)?
2331 | | +--:(local-label-case)
2332 | | | +--ro local-label? netc:mpls-label
2333 | | +--:(ipv6-address-case)
2334 | | | +--ro ipv6-address? inet:ipv6-address
2336 | | +--ro sid? uint32
2337 | +--ro sr-algorithm
2338 | +--ro algorithms* algorithm
2339 +--:(link-attributes-case)
2340 | +--ro link-attributes
2341 | +--ro local-ipv4-router-id? ipv4-router-identifier
2342 | +--ro local-ipv6-router-id? ipv6-router-identifier
2343 | +--ro remote-ipv4-router-id? ipv4-router-identifier
2344 | +--ro remote-ipv6-router-id? ipv6-router-identifier
2345 | +--ro mpls-protocol? mpls-protocol-mask
2346 | +--ro te-metric? netc:te-metric
2347 | +--ro metric? netc:metric
2348 | +--ro shared-risk-link-groups* rsvp:srlg-id
2349 | +--ro link-name? string
2350 | +--ro max-link-bandwidth? netc:bandwidth
2351 | +--ro max-reservable-bandwidth? netc:bandwidth
2352 | +--ro unreserved-bandwidth* [priority]
2353 | | +--ro priority uint8
2354 | | +--ro bandwidth? netc:bandwidth
2355 | +--ro link-protection? link-protection-type
2356 | +--ro admin-group? administrative-group
2359 | | | +--:(ospf-adj-flags-case)
2360 | | | | +--ro backup? boolean
2361 | | | | +--ro set? boolean
2362 | | | +--:(isis-adj-flags-case)
2363 | | | +--ro backup? boolean
2364 | | | +--ro set? boolean
2365 | | | +--ro address-family? boolean
2366 | | +--ro weight? weight
2367 | | +--ro (sid-label-index)?
2368 | | +--:(local-label-case)
2369 | | | +--ro local-label? netc:mpls-label
2370 | | +--:(ipv6-address-case)
2371 | | | +--ro ipv6-address? inet:ipv6-address
2373 | | +--ro sid? uint32
2374 | +--ro sr-lan-adj-ids*
2376 | | | +--:(ospf-adj-flags-case)
2377 | | | | +--ro backup? boolean
2378 | | | | +--ro set? boolean
2379 | | | +--:(isis-adj-flags-case)
2380 | | | +--ro backup? boolean
2381 | | | +--ro set? boolean
2382 | | | +--ro address-family? boolean
2383 | | +--ro weight? weight
2384 | | +--ro iso-system-id? netc:iso-system-identifier
2385 | | +--ro neighbor-id? inet:ipv4-address
2386 | | +--ro (sid-label-index)?
2387 | | +--:(local-label-case)
2388 | | | +--ro local-label? netc:mpls-label
2389 | | +--:(ipv6-address-case)
2390 | | | +--ro ipv6-address? inet:ipv6-address
2392 | | +--ro sid? uint32
2393 | +--ro peer-node-sid
2394 | | +--ro weight? weight
2395 | | +--ro (sid-label-index)?
2396 | | +--:(local-label-case)
2397 | | | +--ro local-label? netc:mpls-label
2398 | | +--:(ipv6-address-case)
2399 | | | +--ro ipv6-address? inet:ipv6-address
2401 | | +--ro sid? uint32
2402 | +--ro peer-adj-sid
2403 | | +--ro weight? weight
2404 | | +--ro (sid-label-index)?
2405 | | +--:(local-label-case)
2406 | | | +--ro local-label? netc:mpls-label
2407 | | +--:(ipv6-address-case)
2408 | | | +--ro ipv6-address? inet:ipv6-address
2410 | | +--ro sid? uint32
2411 | +--ro peer-set-sids*
2412 | +--ro weight? weight
2413 | +--ro (sid-label-index)?
2414 | +--:(local-label-case)
2415 | | +--ro local-label? netc:mpls-label
2416 | +--:(ipv6-address-case)
2417 | | +--ro ipv6-address? inet:ipv6-address
2420 +--:(prefix-attributes-case)
2421 | +--ro prefix-attributes
2423 | | x--ro up-down? bits
2424 | | +--ro is-is-up-down? boolean
2425 | | +--ro ospf-no-unicast? boolean
2426 | | +--ro ospf-local-address? boolean
2427 | | +--ro ospf-propagate-nssa? boolean
2428 | +--ro route-tags* route-tag
2429 | +--ro extended-tags* extended-route-tag
2430 | +--ro prefix-metric? netc:igp-metric
2431 | +--ro ospf-forwarding-address? inet:ip-address
2434 | | | +--:(isis-prefix-flags-case)
2435 | | | | +--ro no-php? boolean
2436 | | | | +--ro explicit-null? boolean
2437 | | | | +--ro readvertisement? boolean
2438 | | | | +--ro node-sid? boolean
2439 | | | +--:(ospf-prefix-flags-case)
2440 | | | +--ro no-php? boolean
2441 | | | +--ro explicit-null? boolean
2442 | | | +--ro mapping-server? boolean
2443 | | +--ro algorithm? algorithm
2444 | | +--ro (sid-label-index)?
2445 | | +--:(local-label-case)
2446 | | | +--ro local-label? netc:mpls-label
2447 | | +--:(ipv6-address-case)
2448 | | | +--ro ipv6-address? inet:ipv6-address
2450 | | +--ro sid? uint32
2451 | +--ro ipv6-sr-prefix
2452 | | +--ro algorithm? algorithm
2454 | | +--ro inter-area? boolean
2455 | | +--ro range-size? uint16
2457 | | +--ro (range-sub-tlv)?
2458 | | +--:(binding-sid-tlv-case)
2459 | | | +--ro weight? weight
2460 | | | +--ro (flags)?
2461 | | | | +--:(isis-binding-flags-case)
2462 | | | | | +--ro address-family? boolean
2463 | | | | | +--ro mirror-context? boolean
2464 | | | | | +--ro spread-tlv? boolean
2465 | | | | | +--ro leaked-from-level-2? boolean
2466 | | | | | +--ro attached-flag? boolean
2467 | | | | +--:(ospf-binding-flags-case)
2468 | | | | +--ro mirroring? boolean
2469 | | | +--ro binding-sub-tlvs*
2470 | | | +--ro (binding-sub-tlv)?
2471 | | | +--:(prefix-sid-case)
2472 | | | | +--ro (flags)?
2473 | | | | | +--:(isis-prefix-flags-case)
2474 | | | | | | +--ro no-php? boolean
2475 | | | | | | +--ro explicit-null? boolean
2476 | | | | | | +--ro readvertisement? boolean
2477 | | | | | | +--ro node-sid? boolean
2478 | | | | | +--:(ospf-prefix-flags-case)
2479 | | | | | +--ro no-php? boolean
2480 | | | | | +--ro explicit-null? boolean
2481 | | | | | +--ro mapping-server? boolean
2482 | | | | +--ro algorithm? algorithm
2483 | | | | +--ro (sid-label-index)?
2484 | | | | +--:(local-label-case)
2485 | | | | | +--ro local-label? netc:mpls-label
2486 | | | | +--:(ipv6-address-case)
2487 | | | | | +--ro ipv6-address? inet:ipv6-address
2488 | | | | +--:(sid-case)
2489 | | | | +--ro sid? uint32
2490 | | | +--:(ipv6-prefix-sid-case)
2491 | | | | +--ro algorithm? algorithm
2492 | | | +--:(sid-label-case)
2493 | | | | +--ro (sid-label-index)?
2494 | | | | +--:(local-label-case)
2495 | | | | | +--ro local-label? netc:mpls-label
2496 | | | | +--:(ipv6-address-case)
2497 | | | | | +--ro ipv6-address? inet:ipv6-address
2498 | | | | +--:(sid-case)
2499 | | | | +--ro sid? uint32
2500 | | | +--:(ero-metric-case)
2501 | | | | +--ro ero-metric? netc:te-metric
2502 | | | +--:(ipv4-ero-case)
2503 | | | | +--ro loose? boolean
2504 | | | | +--ro address inet:ipv4-address
2505 | | | +--:(ipv6-ero-case)
2506 | | | | +--ro loose? boolean
2507 | | | | +--ro address inet:ipv6-address
2508 | | | +--:(unnumbered-interface-id-ero-case)
2509 | | | | +--ro loose? boolean
2510 | | | | +--ro router-id? uint32
2511 | | | | +--ro interface-id? uint32
2512 | | | +--:(ipv4-ero-backup-case)
2513 | | | | +--ro loose? boolean
2514 | | | | +--ro address inet:ipv4-address
2515 | | | +--:(ipv6-ero-backup-case)
2516 | | | | +--ro loose? boolean
2517 | | | | +--ro address inet:ipv6-address
2518 | | | +--:(unnumbered-interface-id-backup-ero-case)
2519 | | | +--ro loose? boolean
2520 | | | +--ro router-id? uint32
2521 | | | +--ro interface-id? uint32
2522 | | +--:(prefix-sid-tlv-case)
2523 | | | +--ro (flags)?
2524 | | | | +--:(isis-prefix-flags-case)
2525 | | | | | +--ro no-php? boolean
2526 | | | | | +--ro explicit-null? boolean
2527 | | | | | +--ro readvertisement? boolean
2528 | | | | | +--ro node-sid? boolean
2529 | | | | +--:(ospf-prefix-flags-case)
2530 | | | | +--ro no-php? boolean
2531 | | | | +--ro explicit-null? boolean
2532 | | | | +--ro mapping-server? boolean
2533 | | | +--ro algorithm? algorithm
2534 | | | +--ro (sid-label-index)?
2535 | | | +--:(local-label-case)
2536 | | | | +--ro local-label? netc:mpls-label
2537 | | | +--:(ipv6-address-case)
2538 | | | | +--ro ipv6-address? inet:ipv6-address
2539 | | | +--:(sid-case)
2540 | | | +--ro sid? uint32
2541 | | +--:(ipv6-prefix-sid-tlv-case)
2542 | | | +--ro algorithm? algorithm
2543 | | +--:(sid-label-tlv-case)
2544 | | +--ro (sid-label-index)?
2545 | | +--:(local-label-case)
2546 | | | +--ro local-label? netc:mpls-label
2547 | | +--:(ipv6-address-case)
2548 | | | +--ro ipv6-address? inet:ipv6-address
2550 | | +--ro sid? uint32
2551 | +--ro sr-binding-sid-labels*
2552 | +--ro weight? weight
2554 | | +--:(isis-binding-flags-case)
2555 | | | +--ro address-family? boolean
2556 | | | +--ro mirror-context? boolean
2557 | | | +--ro spread-tlv? boolean
2558 | | | +--ro leaked-from-level-2? boolean
2559 | | | +--ro attached-flag? boolean
2560 | | +--:(ospf-binding-flags-case)
2561 | | +--ro mirroring? boolean
2562 | +--ro binding-sub-tlvs*
2563 | +--ro (binding-sub-tlv)?
2564 | +--:(prefix-sid-case)
2566 | | | +--:(isis-prefix-flags-case)
2567 | | | | +--ro no-php? boolean
2568 | | | | +--ro explicit-null? boolean
2569 | | | | +--ro readvertisement? boolean
2570 | | | | +--ro node-sid? boolean
2571 | | | +--:(ospf-prefix-flags-case)
2572 | | | +--ro no-php? boolean
2573 | | | +--ro explicit-null? boolean
2574 | | | +--ro mapping-server? boolean
2575 | | +--ro algorithm? algorithm
2576 | | +--ro (sid-label-index)?
2577 | | +--:(local-label-case)
2578 | | | +--ro local-label? netc:mpls-label
2579 | | +--:(ipv6-address-case)
2580 | | | +--ro ipv6-address? inet:ipv6-address
2582 | | +--ro sid? uint32
2583 | +--:(ipv6-prefix-sid-case)
2584 | | +--ro algorithm? algorithm
2585 | +--:(sid-label-case)
2586 | | +--ro (sid-label-index)?
2587 | | +--:(local-label-case)
2588 | | | +--ro local-label? netc:mpls-label
2589 | | +--:(ipv6-address-case)
2590 | | | +--ro ipv6-address? inet:ipv6-address
2592 | | +--ro sid? uint32
2593 | +--:(ero-metric-case)
2594 | | +--ro ero-metric? netc:te-metric
2595 | +--:(ipv4-ero-case)
2596 | | +--ro loose? boolean
2597 | | +--ro address inet:ipv4-address
2598 | +--:(ipv6-ero-case)
2599 | | +--ro loose? boolean
2600 | | +--ro address inet:ipv6-address
2601 | +--:(unnumbered-interface-id-ero-case)
2602 | | +--ro loose? boolean
2603 | | +--ro router-id? uint32
2604 | | +--ro interface-id? uint32
2605 | +--:(ipv4-ero-backup-case)
2606 | | +--ro loose? boolean
2607 | | +--ro address inet:ipv4-address
2608 | +--:(ipv6-ero-backup-case)
2609 | | +--ro loose? boolean
2610 | | +--ro address inet:ipv6-address
2611 | +--:(unnumbered-interface-id-backup-ero-case)
2612 | +--ro loose? boolean
2613 | +--ro router-id? uint32
2614 | +--ro interface-id? uint32
2615 x--:(te-lsp-attributes-case)
2616 +--ro te-lsp-attributes
2621 The Link-State table in a instance of the speaker's Loc-RIB can be verified via REST:
2623 **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``
2631 <linkstate-routes xmlns="urn:opendaylight:params:xml:ns:yang:bgp-linkstate">
2635 .. note:: Link-State routes mapping to topology links/nodes/prefixes is supported by BGP Topology Provider.
2639 * `North-Bound Distribution of Link-State and Traffic Engineering (TE) Information Using BGP <https://tools.ietf.org/html/rfc7752>`_
2640 * `BGP Link-State extensions for Segment Routing <https://tools.ietf.org/html/draft-gredler-idr-bgp-ls-segment-routing-ext-03>`_
2641 * `Segment Routing BGP Egress Peer Engineering BGP-LS Extensions <https://tools.ietf.org/html/draft-ietf-idr-bgpls-segment-routing-epe-05>`_
2642 * `BGP Link-State Information Distribution Implementation Report <https://tools.ietf.org/html/draft-ietf-idr-ls-distribution-impl-04>`_
2644 Flow Specification Family
2645 -------------------------
2646 The BGP Flow Specification (BGP-FS) Multiprotocol extension can be used to distribute traffic flow specifications.
2647 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).
2649 .. contents:: Contents
2655 This section shows a way to enable BGP-FS family in BGP speaker and peer configuration.
2659 To enable BGP-FS support in BGP plugin, first configure BGP speaker instance:
2661 **URL:** ``/restconf/config/openconfig-network-instance:network-instances/network-instance/global-bgp/openconfig-network-instance:protocols``
2663 **Method:** ``POST``
2665 **Content-Type:** ``application/xml``
2671 <protocol xmlns="http://openconfig.net/yang/network-instance">
2672 <name>bgp-example</name>
2673 <identifier xmlns:x="http://openconfig.net/yang/policy-types">x:BGP</identifier>
2674 <bgp xmlns="urn:opendaylight:params:xml:ns:yang:bgp:openconfig-extensions">
2677 <router-id>192.0.2.2</router-id>
2682 <afi-safi-name>IPV4-FLOW</afi-safi-name>
2685 <afi-safi-name>IPV6-FLOW</afi-safi-name>
2688 <afi-safi-name>IPV4-L3VPN-FLOW</afi-safi-name>
2691 <afi-safi-name>IPV6-L3VPN-FLOW</afi-safi-name>
2700 Here is an example for BGP peer configuration with enabled BGP-FS family.
2702 **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``
2704 **Method:** ``POST``
2706 **Content-Type:** ``application/xml``
2712 <neighbor xmlns="urn:opendaylight:params:xml:ns:yang:bgp:openconfig-extensions">
2713 <neighbor-address>192.0.2.1</neighbor-address>
2716 <afi-safi-name>IPV4-FLOW</afi-safi-name>
2719 <afi-safi-name>IPV6-FLOW</afi-safi-name>
2722 <afi-safi-name>IPV4-L3VPN-FLOW</afi-safi-name>
2725 <afi-safi-name>IPV6-L3VPN-FLOW</afi-safi-name>
2730 Flow Specification API
2731 ^^^^^^^^^^^^^^^^^^^^^^
2732 Following trees illustrate the BGP Flow Specification routes structure.
2734 IPv4 Flow Specification Route
2735 '''''''''''''''''''''''''''''
2736 .. code-block:: console
2738 :(flowspec-routes-case)
2739 +--ro flowspec-routes
2740 +--ro flowspec-route* [route-key path-id]
2741 +--ro route-key string
2743 | +--ro (flowspec-type)?
2746 | | +--ro op? numeric-operand
2747 | | +--ro value? uint16
2748 | +--:(destination-port-case)
2749 | | +--ro destination-ports*
2750 | | +--ro op? numeric-operand
2751 | | +--ro value? uint16
2752 | +--:(source-port-case)
2753 | | +--ro source-ports*
2754 | | +--ro op? numeric-operand
2755 | | +--ro value? uint16
2756 | +--:(icmp-type-case)
2758 | | +--ro op? numeric-operand
2759 | | +--ro value? uint8
2760 | +--:(icmp-code-case)
2762 | | +--ro op? numeric-operand
2763 | | +--ro value? uint8
2764 | +--:(tcp-flags-case)
2765 | | +--ro tcp-flags*
2766 | | +--ro op? bitmask-operand
2767 | | +--ro value? uint16
2768 | +--:(packet-length-case)
2769 | | +--ro packet-lengths*
2770 | | +--ro op? numeric-operand
2771 | | +--ro value? uint16
2774 | | +--ro op? numeric-operand
2775 | | +--ro value? dscp
2776 | +--:(fragment-case)
2777 | | +--ro fragments*
2778 | | +--ro op? bitmask-operand
2779 | | +--ro value? fragment
2780 | +--:(destination-prefix-case)
2781 | | +--ro destination-prefix? inet:ipv4-prefix
2782 | +--:(source-prefix-case)
2783 | | +--ro source-prefix? inet:ipv4-prefix
2784 | +--:(protocol-ip-case)
2785 | +--ro protocol-ips*
2786 | +--ro op? numeric-operand
2787 | +--ro value? uint8
2788 +--ro path-id path-id
2790 +--ro extended-communities*
2791 +--ro transitive? boolean
2792 +--ro (extended-community)?
2793 +--:(traffic-rate-extended-community-case)
2794 | +--ro traffic-rate-extended-community
2795 | +--ro informative-as? bgp-t:short-as-number
2796 | +--ro local-administrator? netc:bandwidth
2797 +--:(traffic-action-extended-community-case)
2798 | +--ro traffic-action-extended-community
2799 | +--ro sample? boolean
2800 | +--ro terminal-action? boolean
2801 +--:(redirect-extended-community-case)
2802 | +--ro redirect-extended-community
2803 | +--ro global-administrator? bgp-t:short-as-number
2804 | +--ro local-administrator? binary
2805 +--:(traffic-marking-extended-community-case)
2806 | +--ro traffic-marking-extended-community
2807 | +--ro global-administrator? dscp
2808 +--:(redirect-ipv4-extended-community-case)
2809 | +--ro redirect-ipv4
2810 | +--ro global-administrator? inet:ipv4-address
2811 | +--ro local-administrator? uint16
2812 +--:(redirect-as4-extended-community-case)
2813 | +--ro redirect-as4
2814 | +--ro global-administrator? inet:as-number
2815 | +--ro local-administrator? uint16
2816 +--:(redirect-ip-nh-extended-community-case)
2817 +--ro redirect-ip-nh-extended-community
2818 +--ro next-hop-address? inet:ip-address
2822 IPv6 Flow Specification Route
2823 '''''''''''''''''''''''''''''
2824 .. code-block:: console
2826 :(flowspec-ipv6-routes-case)
2827 +--ro flowspec-ipv6-routes
2828 +--ro flowspec-route* [route-key path-id]
2830 | +--ro (flowspec-type)?
2833 | | +--ro op? numeric-operand
2834 | | +--ro value? uint16
2835 | +--:(destination-port-case)
2836 | | +--ro destination-ports*
2837 | | +--ro op? numeric-operand
2838 | | +--ro value? uint16
2839 | +--:(source-port-case)
2840 | | +--ro source-ports*
2841 | | +--ro op? numeric-operand
2842 | | +--ro value? uint16
2843 | +--:(icmp-type-case)
2845 | | +--ro op? numeric-operand
2846 | | +--ro value? uint8
2847 | +--:(icmp-code-case)
2849 | | +--ro op? numeric-operand
2850 | | +--ro value? uint8
2851 | +--:(tcp-flags-case)
2852 | | +--ro tcp-flags*
2853 | | +--ro op? bitmask-operand
2854 | | +--ro value? uint16
2855 | +--:(packet-length-case)
2856 | | +--ro packet-lengths*
2857 | | +--ro op? numeric-operand
2858 | | +--ro value? uint16
2861 | | +--ro op? numeric-operand
2862 | | +--ro value? dscp
2863 | +--:(fragment-case)
2864 | | +--ro fragments*
2865 | | +--ro op? bitmask-operand
2866 | | +--ro value? fragment
2867 | +--:(destination-ipv6-prefix-case)
2868 | | +--ro destination-prefix? inet:ipv6-prefix
2869 | +--:(source-ipv6-prefix-case)
2870 | | +--ro source-prefix? inet:ipv6-prefix
2871 | +--:(next-header-case)
2872 | | +--ro next-headers*
2873 | | +--ro op? numeric-operand
2874 | | +--ro value? uint8
2875 | +--:(flow-label-case)
2877 | +--ro op? numeric-operand
2878 | +--ro value? uint32
2879 +--ro path-id path-id
2881 +--ro extended-communities*
2882 +--ro transitive? boolean
2883 +--ro (extended-community)?
2884 +--:(traffic-rate-extended-community-case)
2885 | +--ro traffic-rate-extended-community
2886 | +--ro informative-as? bgp-t:short-as-number
2887 | +--ro local-administrator? netc:bandwidth
2888 +--:(traffic-action-extended-community-case)
2889 | +--ro traffic-action-extended-community
2890 | +--ro sample? boolean
2891 | +--ro terminal-action? boolean
2892 +--:(redirect-extended-community-case)
2893 | +--ro redirect-extended-community
2894 | +--ro global-administrator? bgp-t:short-as-number
2895 | +--ro local-administrator? binary
2896 +--:(traffic-marking-extended-community-case)
2897 | +--ro traffic-marking-extended-community
2898 | +--ro global-administrator? dscp
2899 +--:(redirect-ipv6-extended-community-case)
2900 | +--ro redirect-ipv6
2901 | +--ro global-administrator? inet:ipv6-address
2902 | +--ro local-administrator? uint16
2903 +--:(redirect-as4-extended-community-case)
2904 | +--ro redirect-as4
2905 | +--ro global-administrator? inet:as-number
2906 | +--ro local-administrator? uint16
2907 +--:(redirect-ip-nh-extended-community-case)
2908 +--ro redirect-ip-nh-extended-community
2909 +--ro next-hop-address? inet:ip-address
2914 The flowspec route represents rules and an action, defined as an extended community.
2916 IPv4 Flow Specification
2917 '''''''''''''''''''''''
2918 The IPv4 Flowspec table in an instance of the speaker's Loc-RIB can be verified via REST:
2920 **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``
2928 <flowspec-routes xmlns="urn:opendaylight:params:xml:ns:yang:bgp-flowspec">
2930 <path-id>0</path-id>
2931 <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>
2940 <extended-communities>
2941 <transitive>true</transitive>
2942 <redirect-extended-community>
2943 <local-administrator>AgMWLg==</local-administrator>
2944 <global-administrator>258</global-administrator>
2945 </redirect-extended-community>
2946 </extended-communities>
2949 <destination-prefix>192.168.0.1/32</destination-prefix>
2952 <source-prefix>10.0.0.2/32</source-prefix>
2960 <op>equals end-of-list</op>
2970 <op>equals end-of-list</op>
2976 <op>greater-than</op>
2978 </destination-ports>
2980 <op>less-than and-bit</op>
2982 </destination-ports>
2984 <op>equals end-of-list</op>
2986 </destination-ports>
2990 <op>end-of-list greater-than</op>
2997 IPv6 Flows Specification
2998 ''''''''''''''''''''''''
2999 The IPv6 Flowspec table in an instance of the speaker's Loc-RIB can be verified via REST:
3001 **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``
3009 <flowspec-ipv6-routes xmlns="urn:opendaylight:params:xml:ns:yang:bgp-flowspec">
3011 <path-id>0</path-id>
3012 <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>
3021 <extended-communities>
3022 <transitive>true</transitive>
3023 <traffic-rate-extended-community>
3024 <informative-as>0</informative-as>
3025 <local-administrator>AAAAAA==</local-administrator>
3026 </traffic-rate-extended-community>
3027 </extended-communities>
3030 <destination-prefix>2001:db8:31::/64</destination-prefix>
3033 <source-prefix>2001:db8:30::/64</source-prefix>
3037 <op>equals end-of-list</op>
3043 <op>equals end-of-list</op>
3049 <op>equals end-of-list</op>
3054 </flowspec-ipv6-routes>
3056 IPv4 L3VPN Flows Specification
3057 ''''''''''''''''''''''''''''''
3058 The IPv4 L3VPN Flowspec table in an instance of the speaker's Loc-RIB can be verified via REST:
3060 **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``
3068 <flowspec-l3vpn-ipv4-routes xmlns="urn:opendaylight:params:xml:ns:yang:bgp-flowspec">
3069 <flowspec-l3vpn-route>
3070 <path-id>0</path-id>
3071 <route-key>[l3vpn with route-distinguisher 172.16.0.44:101] all packets from 10.0.0.3/32</route-key>
3077 <global>5.6.7.8</global>
3083 <extended-communities>
3084 <transitive>true</transitive>
3085 <redirect-ip-nh-extended-community>
3087 <next-hop-address>0.0.0.0</next-hop-address>
3088 </redirect-ip-nh-extended-community>
3089 </extended-communities>
3091 <route-distinguisher>172.16.0.44:101</route-distinguisher>
3093 <source-prefix>10.0.0.3/32</source-prefix>
3095 </flowspec-l3vpn-route>
3096 </flowspec-l3vpn-ipv4-routes>
3100 IPv4 Flow Specification
3101 '''''''''''''''''''''''
3102 This examples show how to originate and remove IPv4 fowspec route via programmable RIB.
3103 Make sure the *Application Peer* is configured first.
3105 **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``
3107 **Method:** ``POST``
3109 **Content-Type:** ``application/xml``
3115 <flowspec-route xmlns="urn:opendaylight:params:xml:ns:yang:bgp-flowspec">
3116 <route-key>flow1</route-key>
3117 <path-id>0</path-id>
3119 <destination-prefix>192.168.0.1/32</destination-prefix>
3122 <source-prefix>10.0.0.1/32</source-prefix>
3126 <op>equals end-of-list</op>
3132 <op>equals end-of-list</op>
3138 <op>greater-than</op>
3140 </destination-ports>
3142 <op>and-bit less-than end-of-list</op>
3144 </destination-ports>
3148 <op>greater-than end-of-list</op>
3154 <op>equals end-of-list</op>
3160 <op>equals end-of-list</op>
3166 <op>match end-of-list</op>
3172 <op>greater-than</op>
3176 <op>and-bit less-than end-of-list</op>
3182 <op>equals end-of-list</op>
3188 <op>match end-of-list</op>
3189 <value>first</value>
3200 <extended-communities>
3202 </extended-communities>
3208 **Extended Communities**
3215 <extended-communities>
3216 <transitive>true</transitive>
3217 <traffic-rate-extended-community>
3218 <informative-as>123</informative-as>
3219 <local-administrator>AAAAAA==</local-administrator>
3220 </traffic-rate-extended-community>
3221 </extended-communities>
3223 @line 5: A rate in bytes per second, *AAAAAA==* (0) means traffic discard.
3225 * **Traffic Action**
3228 <extended-communities>
3229 <transitive>true</transitive>
3230 <traffic-action-extended-community>
3231 <sample>true</sample>
3232 <terminal-action>false</terminal-action>
3233 </traffic-action-extended-community>
3234 </extended-communities>
3237 * **Redirect to VRF AS 2byte format**
3240 <extended-communities>
3241 <transitive>true</transitive>
3242 <redirect-extended-community>
3243 <global-administrator>123</global-administrator>
3244 <local-administrator>AAAAew==</local-administrator>
3245 </redirect-extended-community>
3246 </extended-communities>
3248 * **Redirect to VRF IPv4 format**
3251 <extended-communities>
3252 <transitive>true</transitive>
3254 <global-administrator>192.168.0.1</global-administrator>
3255 <local-administrator>12345</local-administrator>
3257 </extended-communities>
3259 * **Redirect to VRF AS 4byte format**
3262 <extended-communities>
3263 <transitive>true</transitive>
3265 <global-administrator>64495</global-administrator>
3266 <local-administrator>12345</local-administrator>
3268 </extended-communities>
3270 * **Redirect to IP**
3273 <extended-communities>
3274 <transitive>true</transitive>
3275 <redirect-ip-nh-extended-community>
3277 </redirect-ip-nh-extended-community>
3278 </extended-communities>
3280 * **Traffic Marking**
3283 <extended-communities>
3284 <transitive>true</transitive>
3285 <traffic-marking-extended-community>
3286 <global-administrator>20</global-administrator>
3287 </traffic-marking-extended-community>
3288 </extended-communities>
3292 To remove the route added above, following request can be used:
3294 **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``
3296 **Method:** ``DELETE``
3298 IPv4 L3VPN Flow Specification
3299 '''''''''''''''''''''''''''''
3300 This examples show how to originate and remove IPv4 L3VPN fowspec route via programmable RIB.
3302 **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``
3304 **Method:** ``POST``
3306 **Content-Type:** ``application/xml``
3312 <flowspec-l3vpn-route xmlns="urn:opendaylight:params:xml:ns:yang:bgp-flowspec">
3313 <path-id>0</path-id>
3314 <route-key>flow-l3vpn</route-key>
3315 <route-distinguisher>172.16.0.44:101</route-distinguisher>
3317 <source-prefix>10.0.0.3/32</source-prefix>
3327 <extended-communities>
3328 <transitive>true</transitive>
3330 <global-administrator>172.16.0.44</global-administrator>
3331 <local-administrator>102</local-administrator>
3333 </extended-communities>
3335 </flowspec-l3vpn-route>
3339 To remove the route added above, following request can be used:
3341 **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``
3343 **Method:** ``DELETE``
3345 IPv6 Flow Specification
3346 '''''''''''''''''''''''
3347 This examples show how to originate and remove IPv6 fowspec route via programmable RIB.
3349 **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``
3351 **Method:** ``POST``
3353 **Content-Type:** ``application/xml``
3359 <flowspec-route xmlns="urn:opendaylight:params:xml:ns:yang:bgp-flowspec">
3360 <route-key>flow-v6</route-key>
3361 <path-id>0</path-id>
3363 <destination-prefix>2001:db8:30::3/128</destination-prefix>
3366 <source-prefix>2001:db8:31::3/128</source-prefix>
3370 <op>equals end-of-list</op>
3375 <extended-communities>
3376 <transitive>true</transitive>
3378 <global-administrator>2001:db8:1::6</global-administrator>
3379 <local-administrator>12345</local-administrator>
3381 </extended-communities>
3394 To remove the route added above, following request can be used:
3396 **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``
3398 **Method:** ``DELETE``
3402 * `Dissemination of Flow Specification Rules <https://tools.ietf.org/html/rfc5575>`_
3403 * `Dissemination of Flow Specification Rules for IPv6 <https://tools.ietf.org/html/draft-ietf-idr-flow-spec-v6-07>`_
3404 * `BGP Flow-Spec Extended Community for Traffic Redirect to IP Next Hop <https://tools.ietf.org/html/draft-ietf-idr-flowspec-redirect-ip-00>`_
3405 * `Clarification of the Flowspec Redirect Extended Community <https://tools.ietf.org/html/rfc7674>`_
3406 * `Revised Validation Procedure for BGP Flow Specifications <https://tools.ietf.org/html/draft-ietf-idr-bgp-flowspec-oid-03>`_
3410 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.
3411 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.
3412 In addition to MPLS, IP tunnelling encapsulation techniques like VXLAN, NVGRE, MPLSoGRE and others can be used for packet transportation.
3413 Also, Provider Backbone Bridging (PBB) can be combined with EVPN in order to reduce a number of MAC Advertisement routes.
3415 .. contents:: Contents
3421 This section shows a way to enable EVPN family in BGP speaker and peer configuration.
3425 To enable EVPN support in BGP plugin, first configure BGP speaker instance:
3427 **URL:** ``/restconf/config/openconfig-network-instance:network-instances/network-instance/global-bgp/openconfig-network-instance:protocols``
3429 **Method:** ``POST``
3431 **Content-Type:** ``application/xml``
3437 <protocol xmlns="http://openconfig.net/yang/network-instance">
3438 <name>bgp-example</name>
3439 <identifier xmlns:x="http://openconfig.net/yang/policy-types">x:BGP</identifier>
3440 <bgp xmlns="urn:opendaylight:params:xml:ns:yang:bgp:openconfig-extensions">
3443 <router-id>192.0.2.2</router-id>
3448 <afi-safi-name xmlns:x="http://openconfig.net/yang/bgp-types">x:L2VPN-EVPN</afi-safi-name>
3457 Here is an example for BGP peer configuration with enabled EVPN family.
3459 **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``
3461 **Method:** ``POST``
3463 **Content-Type:** ``application/xml``
3469 <neighbor xmlns="urn:opendaylight:params:xml:ns:yang:bgp:openconfig-extensions">
3470 <neighbor-address>192.0.2.1</neighbor-address>
3473 <afi-safi-name xmlns:x="http://openconfig.net/yang/bgp-types">x:L2VPN-EVPN</afi-safi-name>
3480 Following tree illustrate the BGP EVPN route structure.
3482 .. code-block:: console
3486 +--ro evpn-route* [route-key]
3487 +--ro route-key string
3489 | +--:(ethernet-a-d-route-case)
3490 | | +--ro ethernet-a-d-route
3492 | | | +--:(arbitrary-case)
3493 | | | | +--ro arbitrary
3494 | | | | +--ro arbitrary binary
3495 | | | +--:(lacp-auto-generated-case)
3496 | | | | +--ro lacp-auto-generated
3497 | | | | +--ro ce-lacp-mac-address yang:mac-address
3498 | | | | +--ro ce-lacp-port-key uint16
3499 | | | +--:(lan-auto-generated-case)
3500 | | | | +--ro lan-auto-generated
3501 | | | | +--ro root-bridge-mac-address yang:mac-address
3502 | | | | +--ro root-bridge-priority uint16
3503 | | | +--:(mac-auto-generated-case)
3504 | | | | +--ro mac-auto-generated
3505 | | | | +--ro system-mac-address yang:mac-address
3506 | | | | +--ro local-discriminator uint24
3507 | | | +--:(router-id-generated-case)
3508 | | | | +--ro router-id-generated
3509 | | | | +--ro router-id inet:ipv4-address
3510 | | | | +--ro local-discriminator uint32
3511 | | | +--:(as-generated-case)
3512 | | | +--ro as-generated
3513 | | | +--ro as inet:as-number
3514 | | | +--ro local-discriminator uint32
3515 | | +--ro ethernet-tag-id
3516 | | | +--ro vlan-id uint32
3517 | | +--ro mpls-label netc:mpls-label
3518 | +--:(mac-ip-adv-route-case)
3519 | | +--ro mac-ip-adv-route
3521 | | | +--:(arbitrary-case)
3522 | | | | +--ro arbitrary
3523 | | | | +--ro arbitrary binary
3524 | | | +--:(lacp-auto-generated-case)
3525 | | | | +--ro lacp-auto-generated
3526 | | | | +--ro ce-lacp-mac-address yang:mac-address
3527 | | | | +--ro ce-lacp-port-key uint16
3528 | | | +--:(lan-auto-generated-case)
3529 | | | | +--ro lan-auto-generated
3530 | | | | +--ro root-bridge-mac-address yang:mac-address
3531 | | | | +--ro root-bridge-priority uint16
3532 | | | +--:(mac-auto-generated-case)
3533 | | | | +--ro mac-auto-generated
3534 | | | | +--ro system-mac-address yang:mac-address
3535 | | | | +--ro local-discriminator uint24
3536 | | | +--:(router-id-generated-case)
3537 | | | | +--ro router-id-generated
3538 | | | | +--ro router-id inet:ipv4-address
3539 | | | | +--ro local-discriminator uint32
3540 | | | +--:(as-generated-case)
3541 | | | +--ro as-generated
3542 | | | +--ro as inet:as-number
3543 | | | +--ro local-discriminator uint32
3544 | | +--ro ethernet-tag-id
3545 | | | +--ro vlan-id uint32
3546 | | +--ro mac-address yang:mac-address
3547 | | +--ro ip-address? inet:ip-address
3548 | | +--ro mpls-label1 netc:mpls-label
3549 | | +--ro mpls-label2? netc:mpls-label
3550 | +--:(inc-multi-ethernet-tag-res-case)
3551 | | +--ro inc-multi-ethernet-tag-res
3552 | | +--ro ethernet-tag-id
3553 | | | +--ro vlan-id uint32
3554 | | +--ro orig-route-ip? inet:ip-address
3555 | +--:(es-route-case)
3558 | | +--:(arbitrary-case)
3559 | | | +--ro arbitrary
3560 | | | +--ro arbitrary binary
3561 | | +--:(lacp-auto-generated-case)
3562 | | | +--ro lacp-auto-generated
3563 | | | +--ro ce-lacp-mac-address yang:mac-address
3564 | | | +--ro ce-lacp-port-key uint16
3565 | | +--:(lan-auto-generated-case)
3566 | | | +--ro lan-auto-generated
3567 | | | +--ro root-bridge-mac-address yang:mac-address
3568 | | | +--ro root-bridge-priority uint16
3569 | | +--:(mac-auto-generated-case)
3570 | | | +--ro mac-auto-generated
3571 | | | +--ro system-mac-address yang:mac-address
3572 | | | +--ro local-discriminator uint24
3573 | | +--:(router-id-generated-case)
3574 | | | +--ro router-id-generated
3575 | | | +--ro router-id inet:ipv4-address
3576 | | | +--ro local-discriminator uint32
3577 | | +--:(as-generated-case)
3578 | | +--ro as-generated
3579 | | +--ro as inet:as-number
3580 | | +--ro local-discriminator uint32
3581 | +--ro orig-route-ip inet:ip-address
3582 +--ro route-distinguisher bgp-t:route-distinguisher
3584 +--ro extended-communities*
3585 | +--ro transitive? boolean
3586 | +--ro (extended-community)?
3587 | +--:(encapsulation-case)
3588 | | +--ro encapsulation-extended-community
3589 | | +--ro tunnel-type encapsulation-tunnel-type
3590 | +--:(esi-label-extended-community-case)
3591 | | +--ro esi-label-extended-community
3592 | | +--ro single-active-mode? boolean
3593 | | +--ro esi-label netc:mpls-label
3594 | +--:(es-import-route-extended-community-case)
3595 | | +--ro es-import-route-extended-community
3596 | | +--ro es-import yang:mac-address
3597 | +--:(mac-mobility-extended-community-case)
3598 | | +--ro mac-mobility-extended-community
3599 | | +--ro static? boolean
3600 | | +--ro seq-number uint32
3601 | +--:(default-gateway-extended-community-case)
3602 | | +--ro default-gateway-extended-community!
3603 | +--:(layer-2-attributes-extended-community-case)
3604 | +--ro layer-2-attributes-extended-community
3605 | +--ro primary-pe? boolean
3606 | +--ro backup-pe? boolean
3607 | +--ro control-word? boolean
3608 | +--ro l2-mtu uint16
3610 +--ro leaf-information-required boolean
3611 +--ro mpls-label? netc:mpls-label
3612 +--ro (tunnel-identifier)?
3613 +--:(rsvp-te-p2mp-lsp)
3614 | +--ro rsvp-te-p2mp-lps
3615 | +--ro p2mp-id uint32
3616 | +--ro tunnel-id uint16
3617 | +--ro extended-tunnel-id inet:ip-address
3619 | +--ro mldp-p2mp-lsp
3620 | +--ro address-family identityref
3621 | +--ro root-node-address inet:ip-address
3622 | +--ro opaque-value*
3623 | +--ro opaque-type uint8
3624 | +--ro opaque-extended-type? uint16
3625 | +--ro opaque yang:hex-string
3627 | +--ro pim-ssm-tree
3628 | +--ro p-address inet:ip-address
3629 | +--ro p-multicast-group inet:ip-address
3632 | +--ro p-address inet:ip-address
3633 | +--ro p-multicast-group inet:ip-address
3634 +--:(bidir-pim-tree)
3635 | +--ro bidir-pim-tree
3636 | +--ro p-address inet:ip-address
3637 | +--ro p-multicast-group inet:ip-address
3638 +--:(ingress-replication)
3639 | +--ro ingress-replication
3640 | +--ro receiving-endpoint-address? inet:ip-address
3641 +--:(mldp-mp2mp-lsp)
3642 +--ro mldp-mp2mp-lsp
3643 +--ro opaque-type uint8
3644 +--ro opaque-extended-type? uint16
3650 The L2VPN EVPN table in an instance of the speaker's Loc-RIB can be verified via REST:
3652 **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``
3660 <evpn-routes xmlns="urn:opendaylight:params:xml:ns:yang:bgp-evpn">
3662 <route-key>AxEAAcCoZAED6AAAAQAgwKhkAQ==</route-key>
3663 <route-distinguisher>192.168.100.1:1000</route-distinguisher>
3664 <inc-multi-ethernet-tag-res>
3666 <vlan-id>256</vlan-id>
3668 <orig-route-ip>192.168.100.1</orig-route-ip>
3669 </inc-multi-ethernet-tag-res>
3672 <global>172.23.29.104</global>
3678 <extended-communities>
3679 <extended-communities>
3680 <transitive>true</transitive>
3681 <route-target-extended-community>
3682 <global-administrator>65504</global-administrator>
3683 <local-administrator>AAAD6A==</local-administrator>
3684 </route-target-extended-community>
3685 </extended-communities>
3686 </extended-communities>
3688 <leaf-information-required>true</leaf-information-required>
3689 <mpls-label>20024</mpls-label>
3690 <ingress-replication>
3691 <receiving-endpoint-address>192.168.100.1</receiving-endpoint-address>
3692 </ingress-replication>
3700 This examples show how to originate and remove EVPN routes via programmable RIB.
3701 There are four different types of EVPN routes, and several extended communities.
3702 Routes can be used for variety of use-cases supported by BGP/MPLS EVPN, PBB EVPN and NVO EVPN.
3703 Make sure the *Application Peer* is configured first.
3705 **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``
3707 **Method:** ``POST``
3709 **Content-Type:** ``application/xml``
3715 :emphasize-lines: 3,4,14
3717 <evpn-route xmlns="urn:opendaylight:params:xml:ns:yang:bgp-evpn">
3718 <route-key>evpn</route-key>
3719 <route-distinguisher>172.12.123.3:200</route-distinguisher>
3723 <global>199.20.166.41</global>
3729 <extended-communities>
3731 </extended-communities>
3735 @line 3: Route Distinguisher (RD) - set to RD of the MAC-VRF advertising the NLRI, recommended format *<IP>:<VLAN_ID>*
3737 @line 4: One of the EVPN route must be set here.
3739 @line 14: In some cases, specific extended community presence is required. The route may carry one or more Route Target attributes.
3745 * **Ethernet AD per ESI**
3748 <ethernet-a-d-route>
3749 <mpls-label>0</mpls-label>
3751 <vlan-id>4294967295</vlan-id>
3754 <arbitrary>AAAAAAAAAAAA</arbitrary>
3756 </ethernet-a-d-route>
3758 * **Ethernet AD per EVI**
3761 <ethernet-a-d-route>
3762 <mpls-label>24001</mpls-label>
3764 <vlan-id>2200</vlan-id>
3767 <arbitrary>AAAAAAAAAAAA</arbitrary>
3769 </ethernet-a-d-route>
3771 * **MAC/IP Advertisement**
3776 <arbitrary>AAAAAAAAAAAA</arbitrary>
3779 <vlan-id>2100</vlan-id>
3781 <mac-address>f2:0c:dd:80:9f:f7</mac-address>
3782 <ip-address>10.0.1.12</ip-address>
3783 <mpls-label1>299776</mpls-label1>
3787 * **Inclusive Multicast Ethernet Tag**
3790 <inc-multi-ethernet-tag-res>
3792 <vlan-id>2100</vlan-id>
3794 <orig-route-ip>43.43.43.43</orig-route-ip>
3795 </inc-multi-ethernet-tag-res>
3797 * **Ethernet Segment**
3801 <orig-route-ip>43.43.43.43</orig-route-ip>
3803 <arbitrary>AAAAAAAAAAAA</arbitrary>
3807 **EVPN Ethernet Segment Identifier (ESI):**
3810 Indicates an arbitrary 9-octet ESI.
3815 <arbitrary>AAAAAAAAAAAA</arbitrary>
3819 IEEE 802.1AX LACP is used.
3823 <lacp-auto-generated>
3824 <ce-lacp-mac-address>f2:0c:dd:80:9f:f7</ce-lacp-mac-address>
3825 <ce-lacp-port-key>22</ce-lacp-port-key>
3826 </lacp-auto-generated>
3829 Indirectly connected hosts via a bridged LAN.
3833 <lan-auto-generated>
3834 <root-bridge-mac-address>f2:0c:dd:80:9f:f7</root-bridge-mac-address>
3835 <root-bridge-priority>20</root-bridge-priority>
3836 </lan-auto-generated>
3843 <mac-auto-generated>
3844 <system-mac-address>f2:0c:dd:80:9f:f7</system-mac-address>
3845 <local-discriminator>2000</local-discriminator>
3846 </mac-auto-generated>
3853 <router-id-generated>
3854 <router-id>43.43.43.43</router-id>
3855 <local-discriminator>2000</local-discriminator>
3856 </router-id-generated>
3865 <local-discriminator>2000</local-discriminator>
3868 **Extended Communities:**
3870 * **ESI Label Extended Community**
3873 <extended-communities>
3874 <transitive>true</transitive>
3875 <esi-label-extended-community>
3876 <single-active-mode>false</single-active-mode>
3877 <esi-label>24001</esi-label>
3878 </esi-label-extended-community >
3879 </extended-communities>
3881 * **ES-Import Route Target**
3884 <extended-communities>
3885 <transitive>true</transitive>
3886 <es-import-route-extended-community>
3887 <es-import>f2:0c:dd:80:9f:f7</es-import>
3888 </es-import-route-extended-community>
3889 </extended-communities>
3891 * **MAC Mobility Extended Community**
3894 <extended-communities>
3895 <transitive>true</transitive>
3896 <mac-mobility-extended-community>
3897 <static>true</static>
3898 <seq-number>200</seq-number>
3899 </mac-mobility-extended-community>
3900 </extended-communities>
3902 * **Default Gateway Extended Community**
3905 <extended-communities>
3906 <transitive>true</transitive>
3907 <default-gateway-extended-community>
3908 </default-gateway-extended-community>
3909 </extended-communities>
3911 * **EVPN Layer 2 attributes extended community**
3914 <extended-communities>
3915 <transitive>false</transitive>
3916 <layer-2-attributes-extended-community>
3917 <primary-pe>true</primary-pe>
3918 <backup-pe>true</backup-pe>
3919 <control-word >true</control-word>
3920 <l2-mtu>200</l2-mtu>
3921 </layer-2-attributes-extended-community>
3922 </extended-communities>
3924 * **BGP Encapsulation extended community**
3929 <extended-communities>
3930 <transitive>false</transitive>
3931 <encapsulation-extended-community>
3932 <tunnel-type>vxlan</tunnel-type>
3933 </encapsulation-extended-community>
3934 </extended-communities>
3936 @line 4: `full list of tunnel types <http://www.iana.org/assignments/bgp-parameters/bgp-parameters.xhtml#tunnel-types>`_
3938 * **P-Multicast Service Interface Tunnel (PMSI) attribute**
3942 <leaf-information-required>true</leaf-information-required>
3943 <mpls-label>20024</mpls-label>
3944 <ingress-replication>
3945 <receiving-endpoint-address>172.12.123.3</receiving-endpoint-address>
3946 </ingress-replication>
3951 To remove the route added above, following request can be used:
3953 **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``
3955 **Method:** ``DELETE``
3959 .. table:: EVPN Routes Usage.
3961 +--------------------------------------+-----------------------------------------------------+-------------------------------------------+
3962 | EVN Route Type | Extended Communities | Usage |
3963 +======================================+=====================================================+===========================================+
3964 | **Ethernet Auto-discovery** | ESI Label, BGP EncapsulationEVPN Layer 2 attributes | Fast Convergence, Split Horizon, Aliasing |
3965 +--------------------------------------+-----------------------------------------------------+-------------------------------------------+
3966 | **MAC/IP Advertisement** | BGP Encapsulation, MAC Mobility, Default Gateway | MAC address reachability |
3967 +--------------------------------------+-----------------------------------------------------+-------------------------------------------+
3968 | **Inclusive Multicast Ethernet Tag** | PMSI Tunnel, BGP Encapsulation | Handling of Multi-destination traffic |
3969 +--------------------------------------+-----------------------------------------------------+-------------------------------------------+
3970 | **Ethernet Segment** | BGP Encapsulation, ES-Import Route Target | Designated Forwarder Election |
3971 +--------------------------------------+-----------------------------------------------------+-------------------------------------------+
3975 * `BGP MPLS-Based Ethernet VPN <https://tools.ietf.org/html/rfc7432>`_
3976 * `Provider Backbone Bridging Combined with Ethernet VPN <https://tools.ietf.org/html/rfc7623>`_
3977 * `VPWS support in EVPN <https://tools.ietf.org/html/draft-ietf-bess-evpn-vpws-07>`_
3978 * `A Network Virtualization Overlay Solution using EVPN <https://tools.ietf.org/html/draft-ietf-bess-evpn-overlay-04>`_
3979 * `Interconnect Solution for EVPN Overlay networks <https://tools.ietf.org/html/draft-ietf-bess-dci-evpn-overlay-04>`_
3980 * `Usage and applicability of BGP MPLS based Ethernet VPN <https://tools.ietf.org/html/draft-ietf-bess-evpn-usage-03>`_
3984 The ADD-PATH capability allows to advertise multiple paths for the same address prefix.
3985 It can help with optimal routing and routing convergence in a network by providing potential alternate or backup paths.
3987 .. contents:: Contents
3993 This section shows a way to enable ADD-PATH capability in BGP speaker and peer configuration.
3995 .. note:: The capability is applicable for IP Unicast, IP Labeled Unicast and Flow Specification address families.
3999 To enable ADD-PATH capability in BGP plugin, first configure BGP speaker instance:
4001 **URL:** ``/restconf/config/openconfig-network-instance:network-instances/network-instance/global-bgp/openconfig-network-instance:protocols``
4003 **Method:** ``POST``
4005 **Content-Type:** ``application/xml``
4011 :emphasize-lines: 14
4013 <protocol xmlns="http://openconfig.net/yang/network-instance">
4014 <name>bgp-example</name>
4015 <identifier xmlns:x="http://openconfig.net/yang/policy-types">x:BGP</identifier>
4016 <bgp xmlns="urn:opendaylight:params:xml:ns:yang:bgp:openconfig-extensions">
4019 <router-id>192.0.2.2</router-id>
4024 <afi-safi-name xmlns:x="http://openconfig.net/yang/bgp-types">x:IPV4-UNICAST</afi-safi-name>
4025 <receive>true</receive>
4026 <send-max>2</send-max>
4033 @line 14: Defines path selection strategy: *send-max* > 1 -> Advertise N Paths or *send-max* = 0 -> Advertise All Paths
4035 Here is an example for update a specific family with enable 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/global/afi-safis/afi-safi/openconfig-bgp-types:IPV4%2DUNICAST``
4041 **Content-Type:** ``application/xml``
4047 <afi-safi xmlns="urn:opendaylight:params:xml:ns:yang:bgp:openconfig-extensions">
4048 <afi-safi-name xmlns:x="http://openconfig.net/yang/bgp-types">x:IPV4-UNICAST</afi-safi-name>
4049 <receive>true</receive>
4050 <send-max>0</send-max>
4055 Here is an example for BGP peer configuration with enabled ADD-PATH capability.
4057 **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``
4059 **Method:** ``POST``
4061 **Content-Type:** ``application/xml``
4067 <neighbor xmlns="urn:opendaylight:params:xml:ns:yang:bgp:openconfig-extensions">
4068 <neighbor-address>192.0.2.1</neighbor-address>
4071 <afi-safi-name xmlns:x="http://openconfig.net/yang/bgp-types">x:IPV4-LABELLED-UNICAST</afi-safi-name>
4074 <afi-safi-name xmlns:x="http://openconfig.net/yang/bgp-types">x:IPV4-UNICAST</afi-safi-name>
4075 <receive>true</receive>
4076 <send-max>0</send-max>
4081 .. 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.
4083 Here is an example for update specific family BGP peer configuration with enabled ADD-PATH capability.
4085 **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``
4089 **Content-Type:** ``application/xml``
4095 <afi-safi xmlns="urn:opendaylight:params:xml:ns:yang:bgp:openconfig-extensions">
4096 <afi-safi-name xmlns:x="http://openconfig.net/yang/bgp-types">x:IPV4-UNICAST</afi-safi-name>
4097 <receive>true</receive>
4098 <send-max>0</send-max>
4103 The IPv4 Unicast table with enabled ADD-PATH capability in an instance of the speaker's Loc-RIB can be verified via REST:
4105 **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``
4115 <ipv4-routes xmlns="urn:opendaylight:params:xml:ns:yang:bgp-inet">
4117 <path-id>1</path-id>
4118 <prefix>193.0.2.1/32</prefix>
4128 <global>10.0.0.1</global>
4133 <path-id>2</path-id>
4134 <prefix>193.0.2.1/32</prefix>
4144 <global>10.0.0.2</global>
4150 @line 3: The routes with the same destination are distinguished by *path-id* attribute.
4154 * `Advertisement of Multiple Paths in BGP <https://tools.ietf.org/html/rfc7911>`_
4155 * `Best Practices for Advertisement of Multiple Paths in IBGP <https://tools.ietf.org/html/draft-ietf-idr-add-paths-guidelines-08>`_
4159 The Route Refresh Capability allows to dynamically request a re-advertisement of the Adj-RIB-Out from a BGP peer.
4160 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.
4162 .. contents:: Contents
4168 The capability is enabled by default, no additional configuration is required.
4172 To send a Route Refresh request from OpenDaylight BGP speaker instance to its neighbor, invoke RPC:
4174 **URL:** ``/restconf/operations/bgp-peer-rpc:route-refresh-request``
4176 **Method:** ``POST``
4178 **Content-Type:** ``application/xml``
4184 <input xmlns="urn:opendaylight:params:xml:ns:yang:bgp-peer-rpc">
4185 <afi xmlns:types="urn:opendaylight:params:xml:ns:yang:bgp-types">types:ipv4-address-family</afi>
4186 <safi xmlns:types="urn:opendaylight:params:xml:ns:yang:bgp-types">types:unicast-subsequent-address-family</safi>
4187 <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>
4192 * `Route Refresh Capability for BGP-4 <https://tools.ietf.org/html/rfc2918>`_
4197 The OpenDaylight BGP implementation provides a set of APIs (described below), that give its operational state refreshed periodically, by default every 5 seconds.
4198 The following APIs describe what is available starting with how to change the default refresh rate.
4200 .. contents:: Contents
4204 Operational State Configuration
4205 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
4207 **URL:** ``/restconf/config/bgp-state-config:bgp-state-config``
4211 **Content-Type:** ``application/xml``
4219 <bgp-state-config xmlns="urn:opendaylight:params:xml:ns:yang:controller:config">
4220 <config-name xmlns="urn:opendaylight:params:xml:ns:yang:bgp-state-config">operationalState</config-name>
4221 <timer xmlns="urn:opendaylight:params:xml:ns:yang:bgp-state-config">1</timer>
4224 @line 3: Time in seconds between operational state update.
4226 BGP RIB Operational State
4227 ^^^^^^^^^^^^^^^^^^^^^^^^^
4229 **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``
4233 **Content-Type:** ``application/xml``
4240 <state xmlns="urn:opendaylight:params:xml:ns:yang:bgp:openconfig-extensions">
4242 <router-id>192.0.2.2</router-id>
4243 <total-paths>0</total-paths>
4244 <total-prefixes>0</total-prefixes>
4247 @line 2: AS number of the remote peer.
4249 @line 3: The unique protocol instance identifier.
4251 @line 4: Total number of Paths installed on RIB (Loc-RIB)
4253 @line 5: Total number of Prefixes installed on RIB (Loc-RIB)
4255 BGP RIB Families Operational State
4256 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
4258 **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``
4262 **Content-Type:** ``application/xml``
4268 :emphasize-lines: 3,5,6
4270 <afi-safis xmlns="urn:opendaylight:params:xml:ns:yang:bgp:openconfig-extensions">
4272 <afi-safi-name xmlns:x="http://openconfig.net/yang/bgp-types">x:IPV4-UNICAST</afi-safi-name>
4274 <total-paths>0</total-paths>
4275 <total-prefixes>0</total-prefixes>
4279 <afi-safi-name xmlns:x="http://openconfig.net/yang/bgp-types">x:IPV6-UNICAST</afi-safi-name>
4281 <total-paths>0</total-paths>
4282 <total-prefixes>0</total-prefixes>
4288 @line 3: Family Identifier.
4290 @line 5: Total number of Paths installed on RIB (Loc-RIB) per specific family.
4292 @line 6: Total number of Prefixes installed on RIB (Loc-RIB) per specific family.
4294 BGP Neighbors Operational State
4295 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
4297 **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``
4301 **Content-Type:** ``application/xml``
4309 <neighbors xmlns="urn:opendaylight:params:xml:ns:yang:bgp:openconfig-extensions">
4311 <neighbor-address>192.0.2.1</neighbor-address>
4315 <neighbor-address>192.0.2.2</neighbor-address>
4320 @line 3: IP address of the remote BGP peer. Also serves as an unique identifier of a neighbor in a list of neighbors.
4322 BGP Neighbor Operational State
4323 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
4325 .. note:: Supported Capabilities only provided when session has been established.
4327 **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``
4331 **Content-Type:** ``application/xml``
4337 :emphasize-lines: 2,3,4,7,8,11,12
4339 <state xmlns="urn:opendaylight:params:xml:ns:yang:bgp:openconfig-extensions">
4340 <session-state>ESTABLISHED</session-state>
4341 <supported-capabilities xmlns:x="http://openconfig.net/yang/bgp-types">x:ASN32</supported-capabilities>
4342 <supported-capabilities xmlns:x="http://openconfig.net/yang/bgp-types">x:MPBGP</supported-capabilities>
4346 <NOTIFICATION>0</NOTIFICATION>
4350 <NOTIFICATION>0</NOTIFICATION>
4355 @line 2: Session status
4357 @line 3-4: BGP capabilities supported ( ASN32 / MPBGP / ROUTE_REFRESH / GRACEFUL_RESTART / ADD_PATHS)
4359 @line 7: Total count of Update Messages sent
4361 @line 8: Total count of Notification Messages sent
4363 @line 11: Total count of Update Messages received
4365 @line 12: Total count of Notification Messages received
4367 BGP Neighbor Families Operational State
4368 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
4370 .. note:: Graceful Restart not supported yet. Planned for Carbon.
4373 **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``
4377 **Content-Type:** ``application/xml``
4383 :emphasize-lines: 3,5,7,9,10
4385 <afi-safis xmlns="urn:opendaylight:params:xml:ns:yang:bgp:openconfig-extensions">
4387 <afi-safi-name xmlns:x="http://openconfig.net/yang/bgp-types">x:IPV4-UNICAST</afi-safi-name>
4389 <active>false</active>
4393 <received>false</received>
4394 <advertised>false</advertised>
4399 <afi-safi-name xmlns:x="http://openconfig.net/yang/bgp-types">x:IPV6-UNICAST</afi-safi-name>
4401 <active>false</active>
4405 <received>false</received>
4406 <advertised>false</advertised>
4412 @line 3: Family Identifier.
4414 @line 5: True if family is advertized by peer.
4416 @line 7: Graceful Restart Operational State per specific family.
4418 @line 9: True if the peer supports graceful restart.
4420 @line 10: True if we support graceful restart.
4422 BGP Neighbor Family Operational State
4423 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
4425 .. note:: Prefixes state is only provided once session is established.
4426 .. note:: Graceful Restart not supported yet. Planned to be implemented in Carbon.
4428 **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``
4432 **Content-Type:** ``application/xml``
4438 :emphasize-lines: 2,4,6,7,8
4440 <afi-safi xmlns="urn:opendaylight:params:xml:ns:yang:bgp:openconfig-extensions">
4441 <afi-safi-name xmlns:x="http://openconfig.net/yang/bgp-types">x:IPV4-UNICAST</afi-safi-name>
4443 <active>true</active>
4445 <installed>3</installed>
4447 <received>3</received>
4452 <received>false</received>
4453 <advertised>false</advertised>
4458 @line 2: Family Identifier.
4460 @line 4: True if family is advertized to and by peer.
4462 @line 6: Total count of prefixes advertized by peer and installed (effective-rib-in).
4464 @line 7: Total count of prefixes advertized to peer (adj-rib-out).
4466 @line 8: Total count of prefixes advertized by peer (adj-rib-in).
4468 BGP Neighbor Timers Operational State
4469 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
4471 .. note:: State is only provided once session is established.
4473 **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``
4477 **Content-Type:** ``application/xml``
4483 :emphasize-lines: 3,4
4485 <timers xmlns="urn:opendaylight:params:xml:ns:yang:bgp:openconfig-extensions">
4487 <negotiated-hold-time>180</negotiated-hold-time>
4488 <uptime>1580676</uptime>
4492 @line 3: The negotiated hold-time for the BGP session in seconds.
4494 @line 4: Session duration since establishment in milliseconds.
4496 BGP Neighbor Transport Operational State
4497 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
4499 .. note:: State is only provided once session is established.
4501 **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``
4505 **Content-Type:** ``application/xml``
4511 :emphasize-lines: 3,4,5
4513 <transport xmlns="urn:opendaylight:params:xml:ns:yang:bgp:openconfig-extensions">
4515 <remote-address>127.0.0.2</remote-address>
4516 <remote-port>44718</remote-port>
4517 <local-port>1790</local-port>
4521 @line 3: IP address of the remote BGP peer.
4523 @line 4: Port of the remote BGP peer.
4525 @line 5: Local port.
4527 BGP Neighbor Error Handling Operational State
4528 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
4530 .. note:: State is only provided once session is established.
4531 .. note:: Error handling not supported yet. Planned for Carbon.
4533 **URL:** ``/restconf/operational/openconfig-network-instance:network-instances/network-instance/global-bgp/openconfig-network-instance:protocols/protocol/openconfig-policy-types:BGP/bgp-example/bgp/neighbors/neighbor/192.0.2.1/error-handling``
4537 **Content-Type:** ``application/xml``
4545 <error-handling xmlns="urn:opendaylight:params:xml:ns:yang:bgp:openconfig-extensions">
4547 <erroneous-update-messages>0</erroneous-update-messages>
4551 @line 3: The number of BGP UPDATE messages for which the treat-as-withdraw mechanism has been applied based on
4552 erroneous message contents
4554 BGP Neighbor Graceful Restart Operational State
4555 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
4557 .. note:: Graceful Restart not supported yet. Planned for Carbon.
4559 **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``
4563 **Content-Type:** ``application/xml``
4569 :emphasize-lines: 3,4,5
4571 <graceful-restart xmlns="urn:opendaylight:params:xml:ns:yang:bgp:openconfig-extensions">
4573 <peer-restart-time>0</peer-restart-time>
4574 <peer-restarting>false</peer-restarting>
4575 <local-restarting>false</local-restarting>
4579 @line 3: The period of time (advertised by the peer) that the peer expects a restart of a BGP session to take.
4581 @line 4: This flag indicates whether the remote neighbor is currently in the process of restarting, and hence
4582 received routes are currently stale.
4584 @line 5: This flag indicates whether the local neighbor is currently restarting. The flag is unset after all NLRI
4585 have been advertised to the peer, and the End-of-RIB (EOR) marker has been unset.
4587 BGP Peer Groups Operational State
4588 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
4590 **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``
4594 **Content-Type:** ``application/xml``
4600 :emphasize-lines: 3,5,6
4604 <peer-group-name>application-peers</peer-group-name>
4606 <total-paths>0</total-paths>
4607 <total-prefixes>0</total-prefixes>
4611 @line 3: Peer Group Identifier.
4613 @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.
4615 @line 6: Total Prefixes installed under by peers pertaining to this peer group (effective-rib-in).
4616 This count doesn't differentiate repeated prefixes.
4620 Running OpenDaylight BGP in clustered environment brings an advantage of the plugin's high availability (HA).
4621 This section illustrates a basic scenario for HA, also presents a configuration for clustered OpenDaylight BGP.
4623 .. contents:: Contents
4629 Following example shows a configuration for running BGP in clustered environment.
4631 #. As the first step, configure (replicated *deafult* shard and *topology* shard if needed) and run OpenDaylight in clustered environment, install BGP and RESTCONF.
4633 #. 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.
4635 #. Remote peer should be configured to accept/initiate connection from/to all OpenDaylight cluster nodes with configured BGP plugin.
4637 #. 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.
4641 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`):
4643 * In ``modules.conf`` add a new module:
4644 .. code-block:: console
4648 namespace = "urn:opendaylight:params:xml:ns:yang:bgp-rib"
4649 shard-strategy = "module"
4652 * In ``module-shards.conf`` define a new module shard:
4653 .. code-block:: console
4667 **Note:** Use correct member name in module shard configuration.
4671 Following section presents a basic BGP speaker failover scenario on 3-node OpenDaylight cluster setup.
4673 .. figure:: ./images/bgpcep/BGP_HA.png
4676 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.
4677 Routes advertised by remote peer are replicated, hence RIBs state on all nodes is the same.
4681 .. figure:: ./images/bgpcep/BGP_HA_failure.png
4682 :alt: Node went down.
4684 In a case a cluster node, where BGP instance is running, goes down (unexpected failure, restart), active BGP session is dropped.
4688 .. figure:: ./images/bgpcep/BGP_HA_recovery.png
4691 Now, one of the stand-by BGP speaker instances become active. Remote peer establishes new connection and advertises routes again.
4695 This section provides an overview of the BGP topology provider service.
4696 It shows how to configure and use all available BGP topology providers.
4697 Providers are building topology view of BGP routes stored in local BGP speaker's Loc-RIB.
4698 Output topologies are rendered in a form of standardised IETF network topology model.
4700 .. contents:: Contents
4704 Inet Reachability Topology
4705 ^^^^^^^^^^^^^^^^^^^^^^^^^^
4706 Inet reachability topology exporter offers a mapping service from IPv4/6 routes to network topology nodes.
4710 Following example shows how to create a new instance of IPv4 BGP topology exporter:
4712 **URL:** ``/restconf/config/network-topology:network-topology``
4714 **Method:** ``POST``
4716 **Content-Type:** ``application/xml``
4722 :emphasize-lines: 2,4,6
4724 <topology xmlns="urn:TBD:params:xml:ns:yang:network-topology">
4725 <topology-id>bgp-example-ipv4-topology</topology-id>
4727 <bgp-ipv4-reachability-topology xmlns="urn:opendaylight:params:xml:ns:yang:odl-bgp-topology-types"></bgp-ipv4-reachability-topology>
4729 <rib-id xmlns="urn:opendaylight:params:xml:ns:yang:odl-bgp-topology-config">bgp-example</rib-id>
4732 @line 2: An identifier for a topology.
4734 @line 4: Used to identify type of the topology. In this case BGP IPv4 reachability topology.
4736 @line 6: A name of the local BGP speaker instance.
4740 The topology exporter instance can be removed in a following way:
4742 **URL:** ``/restconf/config/network-topology:network-topology/topology/bgp-example-ipv4-topology``
4744 **Method:** ``DELETE``
4748 Following example shows how to create a new instance of IPv6 BGP topology exporter:
4750 **URL:** ``/restconf/config/network-topology:network-topology``
4752 **Method:** ``POST``
4754 **Content-Type:** ``application/xml``
4760 <topology xmlns="urn:TBD:params:xml:ns:yang:network-topology">
4761 <topology-id>bgp-example-ipv6-topology</topology-id>
4763 <bgp-ipv6-reachability-topology xmlns="urn:opendaylight:params:xml:ns:yang:odl-bgp-topology-types"></bgp-ipv6-reachability-topology>
4765 <rib-id xmlns="urn:opendaylight:params:xml:ns:yang:odl-bgp-topology-config">bgp-example</rib-id>
4770 Operational state of the topology can be verified via REST:
4772 **URL:** ``/restconf/operational/network-topology:network-topology/topology/bgp-example-ipv4-topology``
4780 :emphasize-lines: 8,11
4782 <topology xmlns="urn:TBD:params:xml:ns:yang:network-topology">
4783 <topology-id>bgp-example-ipv4-topology</topology-id>
4784 <server-provided>true</server-provided>
4786 <bgp-ipv4-reachability-topology xmlns="urn:opendaylight:params:xml:ns:yang:odl-bgp-topology-types"></bgp-ipv4-reachability-topology>
4789 <node-id>10.10.1.1</node-id>
4790 <igp-node-attributes xmlns="urn:TBD:params:xml:ns:yang:nt:l3-unicast-igp-topology">
4792 <prefix>10.0.0.10/32</prefix>
4794 </igp-node-attributes>
4798 @line 8: The identifier of a node in a topology. Its value is mapped from route's NEXT_HOP attribute.
4800 @line 11: The IP prefix attribute of the node. Its value is mapped from routes's destination IP prefix.
4802 BGP Linkstate Topology
4803 ^^^^^^^^^^^^^^^^^^^^^^
4804 BGP linkstate topology exporter offers a mapping service from BGP-LS routes to network topology nodes and links.
4808 Following example shows how to create a new instance of linkstate BGP topology exporter:
4810 **URL:** ``/restconf/config/network-topology:network-topology``
4812 **Method:** ``POST``
4814 **Content-Type:** ``application/xml``
4820 <topology xmlns="urn:TBD:params:xml:ns:yang:network-topology">
4821 <topology-id>bgp-example-linkstate-topology</topology-id>
4823 <bgp-linkstate-topology xmlns="urn:opendaylight:params:xml:ns:yang:odl-bgp-topology-types"></bgp-linkstate-topology>
4825 <rib-id xmlns="urn:opendaylight:params:xml:ns:yang:odl-bgp-topology-config">bgp-example</rib-id>
4830 Operational state of the topology can be verified via REST.
4831 A sample output below represents a two node topology with two unidirectional links interconnecting those nodes.
4833 **URL:** ``/restconf/operational/network-topology:network-topology/topology/bgp-example-linkstate-topology``
4841 <topology xmlns="urn:TBD:params:xml:ns:yang:network-topology">
4842 <topology-id>bgp-example-linkstate-topology</topology-id>
4843 <server-provided>true</server-provided>
4845 <bgp-linkstate-topology xmlns="urn:opendaylight:params:xml:ns:yang:odl-bgp-topology-types"></bgp-linkstate-topology>
4848 <node-id>bgpls://IsisLevel2:1/type=node&as=65000&domain=673720360&router=0000.0000.0040</node-id>
4850 <tp-id>bgpls://IsisLevel2:1/type=tp&ipv4=203.20.160.40</tp-id>
4851 <igp-termination-point-attributes xmlns="urn:TBD:params:xml:ns:yang:nt:l3-unicast-igp-topology"/>
4852 </termination-point>
4853 <igp-node-attributes xmlns="urn:TBD:params:xml:ns:yang:nt:l3-unicast-igp-topology">
4855 <prefix>40.40.40.40/32</prefix>
4859 <prefix>203.20.160.0/24</prefix>
4863 <router-id>40.40.40.40</router-id>
4864 <isis-node-attributes xmlns="urn:TBD:params:xml:ns:yang:network:isis-topology">
4866 <te-router-id-ipv4>40.40.40.40</te-router-id-ipv4>
4869 <iso-system-id>MDAwMDAwMDAwMDY0</iso-system-id>
4871 </isis-node-attributes>
4872 </igp-node-attributes>
4875 <node-id>bgpls://IsisLevel2:1/type=node&as=65000&domain=673720360&router=0000.0000.0039</node-id>
4877 <tp-id>bgpls://IsisLevel2:1/type=tp&ipv4=203.20.160.39</tp-id>
4878 <igp-termination-point-attributes xmlns="urn:TBD:params:xml:ns:yang:nt:l3-unicast-igp-topology"/>
4879 </termination-point>
4880 <igp-node-attributes xmlns="urn:TBD:params:xml:ns:yang:nt:l3-unicast-igp-topology">
4882 <prefix>39.39.39.39/32</prefix>
4886 <prefix>203.20.160.0/24</prefix>
4890 <router-id>39.39.39.39</router-id>
4891 <isis-node-attributes xmlns="urn:TBD:params:xml:ns:yang:network:isis-topology">
4893 <te-router-id-ipv4>39.39.39.39</te-router-id-ipv4>
4896 <iso-system-id>MDAwMDAwMDAwMDg3</iso-system-id>
4898 </isis-node-attributes>
4899 </igp-node-attributes>
4903 <dest-node>bgpls://IsisLevel2:1/type=node&as=65000&domain=673720360&router=0000.0000.0039</dest-node>
4904 <dest-tp>bgpls://IsisLevel2:1/type=tp&ipv4=203.20.160.39</dest-tp>
4906 <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>
4908 <source-node>bgpls://IsisLevel2:1/type=node&as=65000&domain=673720360&router=0000.0000.0040</source-node>
4909 <source-tp>bgpls://IsisLevel2:1/type=tp&ipv4=203.20.160.40</source-tp>
4911 <igp-link-attributes xmlns="urn:TBD:params:xml:ns:yang:nt:l3-unicast-igp-topology">
4913 <isis-link-attributes xmlns="urn:TBD:params:xml:ns:yang:network:isis-topology">
4916 <max-link-bandwidth>1250000.0</max-link-bandwidth>
4917 <max-resv-link-bandwidth>12500.0</max-resv-link-bandwidth>
4918 <te-default-metric>0</te-default-metric>
4919 <unreserved-bandwidth>
4920 <bandwidth>12500.0</bandwidth>
4921 <priority>0</priority>
4922 </unreserved-bandwidth>
4923 <unreserved-bandwidth>
4924 <bandwidth>12500.0</bandwidth>
4925 <priority>1</priority>
4926 </unreserved-bandwidth>
4927 <unreserved-bandwidth>
4928 <bandwidth>12500.0</bandwidth>
4929 <priority>2</priority>
4930 </unreserved-bandwidth>
4931 <unreserved-bandwidth>
4932 <bandwidth>12500.0</bandwidth>
4933 <priority>3</priority>
4934 </unreserved-bandwidth>
4935 <unreserved-bandwidth>
4936 <bandwidth>12500.0</bandwidth>
4937 <priority>4</priority>
4938 </unreserved-bandwidth>
4939 <unreserved-bandwidth>
4940 <bandwidth>12500.0</bandwidth>
4941 <priority>5</priority>
4942 </unreserved-bandwidth>
4943 <unreserved-bandwidth>
4944 <bandwidth>12500.0</bandwidth>
4945 <priority>6</priority>
4946 </unreserved-bandwidth>
4947 <unreserved-bandwidth>
4948 <bandwidth>12500.0</bandwidth>
4949 <priority>7</priority>
4950 </unreserved-bandwidth>
4952 </isis-link-attributes>
4953 </igp-link-attributes>
4957 <dest-node>bgpls://IsisLevel2:1/type=node&as=65000&domain=673720360&router=0000.0000.0040</dest-node>
4958 <dest-tp>bgpls://IsisLevel2:1/type=tp&ipv4=203.20.160.40</dest-tp>
4960 <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>
4962 <source-node>bgpls://IsisLevel2:1/type=node&as=65000&domain=673720360&router=0000.0000.0039</source-node>
4963 <source-tp>bgpls://IsisLevel2:1/type=tp&ipv4=203.20.160.39</source-tp>
4965 <igp-link-attributes xmlns="urn:TBD:params:xml:ns:yang:nt:l3-unicast-igp-topology">
4967 <isis-link-attributes xmlns="urn:TBD:params:xml:ns:yang:network:isis-topology">
4970 <max-link-bandwidth>1250000.0</max-link-bandwidth>
4971 <max-resv-link-bandwidth>12500.0</max-resv-link-bandwidth>
4972 <te-default-metric>0</te-default-metric>
4973 <unreserved-bandwidth>
4974 <bandwidth>12500.0</bandwidth>
4975 <priority>0</priority>
4976 </unreserved-bandwidth>
4977 <unreserved-bandwidth>
4978 <bandwidth>12500.0</bandwidth>
4979 <priority>1</priority>
4980 </unreserved-bandwidth>
4981 <unreserved-bandwidth>
4982 <bandwidth>12500.0</bandwidth>
4983 <priority>2</priority>
4984 </unreserved-bandwidth>
4985 <unreserved-bandwidth>
4986 <bandwidth>12500.0</bandwidth>
4987 <priority>3</priority>
4988 </unreserved-bandwidth>
4989 <unreserved-bandwidth>
4990 <bandwidth>12500.0</bandwidth>
4991 <priority>4</priority>
4992 </unreserved-bandwidth>
4993 <unreserved-bandwidth>
4994 <bandwidth>12500.0</bandwidth>
4995 <priority>5</priority>
4996 </unreserved-bandwidth>
4997 <unreserved-bandwidth>
4998 <bandwidth>12500.0</bandwidth>
4999 <priority>6</priority>
5000 </unreserved-bandwidth>
5001 <unreserved-bandwidth>
5002 <bandwidth>12500.0</bandwidth>
5003 <priority>7</priority>
5004 </unreserved-bandwidth>
5006 </isis-link-attributes>
5007 </igp-link-attributes>
5011 BGP Network Topology Configuration Loader
5012 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
5014 BGP Network Topology Configuration Loader allows user to define static initial configuration for a BGP protocol instance.
5015 This service will detect the creation of new configuration files following the pattern "network-topology-*.xml" under the path "etc/opendaylight/bgp".
5016 Once the file is processed, the defined configuration will be available from the configuration Data Store.
5018 .. note:: If the BGP topology instance is already present, no update or configuration will be applied.
5020 When installing BGP an example will be provided and a default configuration loaded.
5022 **PATH:** ``etc/opendaylight/bgp/network-topology-config.xml``
5026 <network-topology xmlns="urn:TBD:params:xml:ns:yang:network-topology">
5028 <topology-id>example-ipv4-topology</topology-id>
5030 <bgp-ipv4-reachability-topology xmlns="urn:opendaylight:params:xml:ns:yang:odl-bgp-topology-types"/>
5032 <rib-id xmlns="urn:opendaylight:params:xml:ns:yang:odl-bgp-topology-config">example-bgp-rib</rib-id>
5035 <topology-id>example-ipv6-topology</topology-id>
5037 <bgp-ipv6-reachability-topology xmlns="urn:opendaylight:params:xml:ns:yang:odl-bgp-topology-types"/>
5039 <rib-id xmlns="urn:opendaylight:params:xml:ns:yang:odl-bgp-topology-config">example-bgp-rib</rib-id>
5042 <topology-id>example-linkstate-topology</topology-id>
5044 <bgp-linkstate-topology xmlns="urn:opendaylight:params:xml:ns:yang:odl-bgp-topology-types"/>
5046 <rib-id xmlns="urn:opendaylight:params:xml:ns:yang:odl-bgp-topology-config">example-bgp-rib</rib-id>
5052 BGP test tools serves to test basic BGP functionality, scalability and performance.
5054 .. contents:: Contents
5060 The BGP Test Tool is a stand-alone Java application purposed to simulate remote BGP peers, that are capable to advertise sample routes.
5061 This application is not part of the OpenDaylight Karaf distribution, however it can be downloaded from OpenDaylight's Nexus (use latest release version):
5063 ``https://nexus.opendaylight.org/content/repositories/opendaylight.release/org/opendaylight/bgpcep/bgp-testtool``
5067 The application can be run from command line:
5069 .. code-block:: console
5071 java -jar bgp-testtool-*-executable.jar
5074 with optional input parameters:
5076 .. code-block:: console
5078 -i <BOOLEAN>, --active <BOOLEAN>
5079 Active initialisation of the connection, by default false.
5081 -ho <N>, --holdtimer <N>
5082 In seconds, value of the desired holdtimer, by default 90.
5084 -sc <N>, --speakersCount <N>
5085 Number of simulated BGP speakers, when creating each speaker, uses incremented local-address for binding, by default 0.
5087 -ra <IP_ADDRESS:PORT,...>, --remoteAddress <IP_ADDRESS:PORT,...>
5088 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.
5090 -la <IP_ADDRESS:PORT>, --localAddress <IP_ADDRESS:PORT>
5091 IP address of BGP speakers which the tools simulates, by default 192.0.2.2:0.
5093 -pr <N>, --prefixes <N>
5094 Number of prefixes to be advertised by each simulated speaker
5096 -mp <BOOLEAN>, --multiPathSupport <BOOLEAN>
5097 Active ADD-PATH support, by default false.
5100 Local AS Number, by default 64496.
5102 -ec <EXTENDED_COMMUNITIES>, --extended_communities <EXTENDED_COMMUNITIES>
5103 Extended communities to be send. Format: x,x,x where x is each extended community from bgp-types.yang, by default empty.
5105 -ll <LOG_LEVEL>, --log_level <LOG_LEVEL>
5106 Log level for console output, by default INFO.
5108 BGP Application Peer Benchmark
5109 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
5110 It is a simple OpenDaylight application which is capable to inject and remove specific amount of IPv4 routes.
5111 This application is part of the OpenDaylight Karaf distribution.
5115 As a first step install BGP and RESTCONF, then configure *Application Peer*.
5116 Install ``odl-bgpcep-bgp-benchmark`` feature and reconfigure BGP Application Peer Benchmark application as per following:
5118 **URL:** ``/restconf/config/odl-bgp-app-peer-benchmark-config:config``
5122 **Content-Type:** ``application/xml``
5130 <odl-bgp-app-peer-benchmark-config xmlns="urn:opendaylight:params:xml:ns:yang:odl-bgp-app-peer-benchmark-config">
5131 <app-peer-id xmlns="urn:opendaylight:params:xml:ns:yang:odl-bgp-app-peer-benchmark-config">10.25.1.9</app-peer-id>
5132 </odl-bgp-app-peer-benchmark-config>
5134 @line 2: The *Application Peer* identifier.
5138 Routes injection can be invoked via RPC:
5140 **URL:** ``/restconf/operations/odl-bgp-app-peer-benchmark:add-prefix``
5142 **Method:** ``POST``
5144 **Content-Type:** ``application/xml``
5150 :emphasize-lines: 2,3,4,5
5152 <input xmlns="urn:opendaylight:params:xml:ns:yang:odl-bgp-app-peer-benchmark">
5153 <prefix>1.1.1.1/32</prefix>
5154 <count>100000</count>
5155 <batchsize>2000</batchsize>
5156 <nexthop>192.0.2.2</nexthop>
5159 @line 2: A initial IPv4 prefix carried in route. Value is incremented for following routes.
5161 @line 3: An amount of routes to be added to *Application Peer's* programmable RIB.
5163 @line 4: A size of the transaction batch.
5165 @line 5: A NEXT_HOP attribute value used in all injected routes.
5171 :emphasize-lines: 3,4,5
5173 <output xmlns="urn:opendaylight:params:xml:ns:yang:odl-bgp-app-peer-benchmark">
5175 <duration>4301</duration>
5177 <count>100000</count>
5181 @line 3: Request duration in milliseconds.
5183 @line 4: Writes per second rate.
5185 @line 5: An amount of routes added to *Application Peer's* programmable RIB.
5189 Routes deletion can be invoked via RPC:
5191 **URL:** ``/restconf/operations/odl-bgp-app-peer-benchmark:delete-prefix``
5193 **Method:** ``POST``
5195 **Content-Type:** ``application/xml``
5201 :emphasize-lines: 2,3,4
5203 <input xmlns="urn:opendaylight:params:xml:ns:yang:odl-bgp-app-peer-benchmark">
5204 <prefix>1.1.1.1/32</prefix>
5205 <count>100000</count>
5206 <batchsize>2000</batchsize>
5209 @line 2: A initial IPv4 prefix carried in route to be removed. Value is incremented for following routes.
5211 @line 3: An amount of routes to be removed from *Application Peer's* programmable RIB.
5213 @line 4: A size of the transaction batch.
5219 <output xmlns="urn:opendaylight:params:xml:ns:yang:odl-bgp-app-peer-benchmark">
5221 <duration>1837</duration>
5223 <count>100000</count>
5229 This section offers advices in a case OpenDaylight BGP plugin is not working as expected.
5231 .. contents:: Contents
5235 BGP is not working...
5236 ^^^^^^^^^^^^^^^^^^^^^
5237 * First of all, ensure that all required features are installed, local and remote BGP configuration is correct.
5239 * Check OpenDaylight Karaf logs:
5243 .. code-block:: console
5247 or open log file: ``data/log/karaf.log``
5249 Possibly, a reason/hint for a cause of the problem can be found there.
5251 * Try to minimise effect of other OpenDaylight features, when searching for a reason of the problem.
5253 * Try to set DEBUG severity level for BGP logger via Karaf console commands, in order to collect more information:
5255 .. code-block:: console
5257 log:set DEBUG org.opendaylight.protocol.bgp
5259 .. code-block:: console
5261 log:set DEBUG org.opendaylight.bgpcep.bgp
5265 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.
5267 Write an e-mail to bgpcep-users@lists.opendaylight.org and provide following information:
5269 #. State OpenDaylight version
5271 #. Describe your use-case and provide as much details related to BGP as possible
5273 #. Steps to reproduce
5275 #. Attach Karaf log files, optionally packet captures, REST input/output