4 This guide contains information on how to use OpenDaylight Border Gateway Protocol (BGP) plugin.
5 The user should learn about BGP basic concepts, supported capabilities, configuration and usage.
13 This section provides high-level overview of the Border Gateway Protocol, OpenDaylight implementation and BGP usage in SDN era.
15 .. contents:: Contents
19 Border Gateway Protocol
20 ^^^^^^^^^^^^^^^^^^^^^^^
21 The Border Gateway Protocol (BGP) is an inter-Autonomous System (AS) routing protocol.
22 The primary role of the BGP is an exchange of routes among other BGP systems.
23 The route is an unit of information which pairs destination (IP address prefix) with attributes to the path with the destination.
24 One of the most interesting attributes is a list of ASes that the route traversed - essential when avoiding loop routing.
25 Advertised routes are stored in the Routing Information Bases (RIBs). Routes are later used to forward packets, stored in Routing Table for this purpose.
26 The main advantage of the BGP over other routing protocols is its scalability, thus it has become the standardized Internet routing protocol (Internet is a set of ASes).
30 However BGP evolved long time before SDN was born, it plays a significant role in many SDN use-cases.
31 Also, continuous evolution of the protocol brings extensions that are very well suited for SDN.
32 Nowadays, BGP can carry various types of routing information - L3VPN, L2VPN, IP multicast, linkstate, etc.
33 Here is a brief list of software-based/legacy-network technologies where BGP-based SDN solution get into an action:
35 * SDN WAN - WAN orchestration and optimization
36 * SDN router - Turns switch into an Internet router
37 * Virtual Route Reflector - High-performance server-based BGP Route Reflector
38 * SDX - A Software Defined Internet Exchange controller
39 * Large-Scale Data Centers - BGP Data Center Routing, MPLS/SR in DCs, DC interconnection
40 * DDoS mitigation - Traffic Filtering distribution with BGP
42 OpenDaylight BGP plugin
43 ^^^^^^^^^^^^^^^^^^^^^^^
44 The OpenDaylight controller provides an implementation of BGP (RFC 4271) as a south-bound protocol plugin.
45 The implementation renders all basic *BGP speaker capabilities*:
47 * inter/intra-AS peering
52 The plugin's **north-bound API** (``REST``/``Java``) provides to user:
54 * fully dynamic runtime standardized BGP configuration
55 * read-only access to all RIBs
56 * read-write programmable RIBs
57 * read-only reachability/linkstate topology view
59 .. note:: The BGP plugin is NOT a virtual router - does not construct Routing Tables, nor forward traffic.
61 List of supported capabilities
62 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
63 In addition to the base protocol implementation, the plugin provides many extensions to BGP, all based on IETF standards.
65 * `RFC4271 <https://tools.ietf.org/html/rfc4271>`_ - A Border Gateway Protocol 4 (BGP-4)
66 * `RFC4456 <https://tools.ietf.org/html/rfc4456>`_ - BGP Route Reflection: An Alternative to Full Mesh Internal BGP (IBGP)
67 * `RFC1997 <https://tools.ietf.org/html/rfc1997>`_ - BGP Communities Attribute
68 * `RFC4360 <https://tools.ietf.org/html/rfc4360>`_ - BGP Extended Communities Attribute
69 * `RFC4486 <https://tools.ietf.org/html/rfc4486>`_ - Subcodes for BGP Cease Notification Message
70 * `RFC5492 <https://tools.ietf.org/html/rfc5492>`_ - Capabilities Advertisement with BGP-4
71 * `RFC5004 <https://tools.ietf.org/html/rfc5004>`_ - Avoid BGP Best Path Transitions from One External to Another
72 * `RFC6286 <https://tools.ietf.org/html/rfc6286>`_ - Autonomous-System-Wide Unique BGP Identifier for BGP-4
73 * `RFC6793 <https://tools.ietf.org/html/rfc6793>`_ - BGP Support for Four-Octet Autonomous System (AS) Number Space
74 * `RFC7311 <https://tools.ietf.org/html/rfc7311>`_ - The Accumulated IGP Metric Attribute for BGP
75 * `RFC5668 <https://tools.ietf.org/html/rfc5668>`_ - 4-Octet AS Specific BGP Extended Community
76 * `draft-ietf-idr-link-bandwidth <https://tools.ietf.org/html/draft-ietf-idr-link-bandwidth-06>`_ - BGP Link Bandwidth Extended Community
77 * `draft-ietf-idr-bgp-extended-messages <https://tools.ietf.org/html/draft-ietf-idr-bgp-extended-messages-13>`_ - Extended Message support for BGP
78 * `RFC4760 <https://tools.ietf.org/html/rfc4760>`_ - Multiprotocol Extensions for BGP-4
79 * `RFC7752 <https://tools.ietf.org/html/rfc7752>`_ - North-Bound Distribution of Link-State and TE Information using BGP
80 * `draft-gredler-idr-bgp-ls-segment-routing-ext <https://tools.ietf.org/html/draft-gredler-idr-bgp-ls-segment-routing-ext-03>`_ - BGP Link-State extensions for Segment Routing
81 * `draft-ietf-idr-bgpls-segment-routing-epe <https://tools.ietf.org/html/draft-ietf-idr-bgpls-segment-routing-epe-05>`_ - Segment Routing Egress Peer Engineering BGP-LS Extensions
82 * `RFC5575 <https://tools.ietf.org/html/rfc5575>`_ - Dissemination of Flow Specification Rules
83 * `RFC7674 <http://tools.ietf.org/html/rfc7674>`_ - Clarification of the Flowspec Redirect Extended Community
84 * `draft-ietf-idr-flow-spec-v6 <https://tools.ietf.org/html/draft-ietf-idr-flow-spec-v6-07>`_ - Dissemination of Flow Specification Rules for IPv6
85 * `draft-ietf-idr-flowspec-redirect-ip <https://tools.ietf.org/html/draft-ietf-idr-flowspec-redirect-ip-00>`_ - BGP Flow-Spec Redirect to IP Action
86 * `RFC3107 <https://tools.ietf.org/html/rfc3107>`_ - Carrying Label Information in BGP-4
87 * `draft-ietf-idr-bgp-prefix-sid <https://tools.ietf.org/html/draft-ietf-idr-bgp-prefix-sid-03>`_ - Segment Routing Prefix SID extensions for BGP
88 * `RFC4364 <https://tools.ietf.org/html/rfc4364>`_ - BGP/MPLS IP Virtual Private Networks (VPNs)
89 * `RFC4659 <https://tools.ietf.org/html/rfc4659>`_ - BGP-MPLS IP Virtual Private Network (VPN) Extension for IPv6 VPN
90 * `RFC7432 <https://tools.ietf.org/html/rfc7432>`_ - BGP MPLS-Based Ethernet VPN
91 * `draft-ietf-bess-evpn-overlay <https://tools.ietf.org/html/draft-ietf-bess-evpn-overlay-04>`_ - A Network Virtualization Overlay Solution using EVPN
92 * `draft-ietf-bess-evpn-vpws <https://tools.ietf.org/html/draft-ietf-bess-evpn-vpws-07>`_ - VPWS support in EVPN
93 * `RFC7911 <https://tools.ietf.org/html/rfc7911>`_ - Advertisement of Multiple Paths in BGP
94 * `RFC2918 <https://tools.ietf.org/html/rfc2918>`_ - Route Refresh Capability for BGP-4
98 This section explains how to install BGP plugin.
100 1. Install BGP feature - ``odl-bgpcep-bgp``.
101 Also, for sake of this sample, it is required to install RESTCONF.
102 In the Karaf console, type command:
104 .. code-block:: console
106 feature:install odl-restconf odl-bgpcep-bgp
108 2. The BGP plugin contains a default configuration, which is applied after the feature starts up.
109 One instance of BGP plugin is created (named *example-bgp-rib*), and its presence can be verified via REST:
111 **URL:** ``/restconf/operational/bgp-rib:bgp-rib``
119 <bgp-rib xmlns="urn:opendaylight:params:xml:ns:yang:bgp-rib">
121 <id>example-bgp-rib</id>
128 Basic Configuration & Concepts
129 ------------------------------
130 The following section shows how to configure BGP basics, how to verify functionality and presents essential components of the plugin.
131 Next samples demonstrate the plugin's runtime configuration capability.
132 It shows the way to configure the plugin via REST, using standardized OpenConfig BGP APIs.
134 .. contents:: Contents
140 This tree illustrates the BGP RIBs organization in datastore.
142 .. code-block:: console
147 +--ro peer* [peer-id]
148 | +--ro peer-id peer-id
149 | +--ro peer-role peer-role
150 | +--ro simple-routing-policy? simple-routing-policy
151 | +--ro supported-tables* [afi safi]
152 | | +--ro afi identityref
153 | | +--ro safi identityref
154 | | +--ro send-receive? send-receive
156 | | +--ro tables* [afi safi]
157 | | +--ro afi identityref
158 | | +--ro safi identityref
160 | | | +--ro uptodate? boolean
162 | +--ro effective-rib-in
163 | | +--ro tables* [afi safi]
164 | | +--ro afi identityref
165 | | +--ro safi identityref
167 | | | +--ro uptodate? boolean
170 | +--ro tables* [afi safi]
171 | +--ro afi identityref
172 | +--ro safi identityref
174 | | +--ro uptodate? boolean
177 +--ro tables* [afi safi]
178 +--ro afi identityref
179 +--ro safi identityref
181 | +--ro uptodate? boolean
184 Protocol Configuration
185 ^^^^^^^^^^^^^^^^^^^^^^
186 As a first step, a new protocol instance needs to be configured.
187 It is a very basic configuration conforming with RFC4271.
189 **URL:** ``/restconf/config/openconfig-network-instance:network-instances/network-instance/global-bgp/openconfig-network-instance:protocols``
193 **Content-Type:** ``application/xml``
199 :emphasize-lines: 2,7,8
201 <protocol xmlns="http://openconfig.net/yang/network-instance">
202 <name>bgp-example</name>
203 <identifier xmlns:x="http://openconfig.net/yang/policy-types">x:BGP</identifier>
204 <bgp xmlns="urn:opendaylight:params:xml:ns:yang:bgp:openconfig-extensions">
207 <router-id>192.0.2.2</router-id>
214 @line 2: The unique protocol instance identifier.
216 @line 7: BGP Identifier of the speaker.
218 @line 8: Local autonomous system number of the speaker. Note that, OpenDaylight BGP implementation supports four-octet AS numbers only.
222 The new instance presence can be verified via REST:
224 **URL:** ``/restconf/operational/bgp-rib:bgp-rib/rib/bgp-example``
232 :emphasize-lines: 3,4
234 <rib xmlns="urn:opendaylight:params:xml:ns:yang:bgp-rib">
238 <afi xmlns:x="urn:opendaylight:params:xml:ns:yang:bgp-types">x:ipv4-address-family</afi>
239 <safi xmlns:x="urn:opendaylight:params:xml:ns:yang:bgp-types">x:unicast-subsequent-address-family</safi>
240 <ipv4-routes xmlns="urn:opendaylight:params:xml:ns:yang:bgp-inet"></ipv4-routes>
242 <uptodate>true</uptodate>
248 @line 3: Loc-RIB - Per-protocol instance RIB, which contains the routes that have been selected by local BGP speaker's decision process.
250 @line 4: The BGP-4 supports carrying IPv4 prefixes, such routes are stored in *ipv4-address-family*/*unicast-subsequent-address-family* table.
255 BGP uses TCP as its transport protocol, by default listens on port 179. OpenDaylight BGP plugin is configured to listen on port *1790*, due to
256 privileged ports restriction for non-root users.
257 One of the workarounds is to use port redirection. In case other port is desired to be used instead, we can reconfigure it.
259 Here is a sample of bgp port listening re-configuration:
261 **URL:** ``/restconf/config/odl-bgp-peer-acceptor-config:bgp-peer-acceptor-config/default``
265 **Content-Type:** ``application/xml``
271 :emphasize-lines: 3,4
273 <bgp-peer-acceptor-config xmlns="urn:opendaylight:params:xml:ns:yang:odl-bgp-peer-acceptor-config">
274 <config-name>default</config-name>
275 <binding-address>0.0.0.0</binding-address>
276 <binding-port>1791</binding-port>
277 </bgp-peer-acceptor-config>
279 @line 3: Binding address: By default is 0.0.0.0, so it is not a mandatory field.
281 @line 4: Binding Port: Port were BGP Server will listen.
285 To exchange routing information between two BGP systems (peers), it is required to configure a peering on both BGP speakers first.
286 This mean that each BGP speaker has a white list of neighbors, representing remote peers, with which the peering is allowed.
287 The TCP connection is established between two peers and they exchange messages to open and confirm the connection parameters followed by routes exchange.
289 Here is a sample basic neighbor configuration:
291 **URL:** ``/restconf/config/openconfig-network-instance:network-instances/network-instance/global-bgp/openconfig-network-instance:protocols/protocol/openconfig-policy-types:BGP/bgp-example/bgp/neighbors``
295 **Content-Type:** ``application/xml``
301 :emphasize-lines: 3,4
303 <neighbor xmlns="urn:opendaylight:params:xml:ns:yang:bgp:openconfig-extensions">
304 <neighbor-address>192.0.2.1</neighbor-address>
307 <hold-time>90</hold-time>
308 <connect-retry>10</connect-retry>
313 <remote-port>179</remote-port>
314 <passive-mode>false</passive-mode>
318 <peer-type>INTERNAL</peer-type>
322 @line 2: IP address of the remote BGP peer. Also serves as an unique identifier of a neighbor in a list of neighbors.
324 @line 5: Proposed number of seconds for value of the Hold Timer. Default value is **90**.
326 @line 6: Time interval in seconds between attempts to establish session with the peer. Effective in active mode only. Default value is **30**.
328 @line 11: Remote port number to which the local BGP is connecting. Effective in active mode only. Default value **179**.
330 @line 12: Wait for peers to issue requests to open a BGP session, rather than initiating sessions from the local router. Default value is **false**.
332 @line 16: Explicitly designate the peer as internal or external. Default value is **INTERNAL**.
336 Once the remote peer is connected and it advertised routes to local BGP system, routes are stored in peer's RIBs.
337 The RIBs can be checked via REST:
339 **URL:** ``/restconf/operational/bgp-rib:bgp-rib/rib/bgp-example/peer/bgp:%2F%2F192.0.2.1``
347 :emphasize-lines: 8,13,35,40,62,66
349 <peer xmlns="urn:opendaylight:params:xml:ns:yang:bgp-rib">
350 <peer-id>bgp://192.0.2.1</peer-id>
352 <afi xmlns:x="urn:opendaylight:params:xml:ns:yang:bgp-types">x:ipv4-address-family</afi>
353 <safi xmlns:x="urn:opendaylight:params:xml:ns:yang:bgp-types">x:unicast-subsequent-address-family</safi>
355 <peer-role>ibgp</peer-role>
358 <afi xmlns:x="urn:opendaylight:params:xml:ns:yang:bgp-types">x:ipv4-address-family</afi>
359 <safi xmlns:x="urn:opendaylight:params:xml:ns:yang:bgp-types">x:unicast-subsequent-address-family</safi>
360 <ipv4-routes xmlns="urn:opendaylight:params:xml:ns:yang:bgp-inet">
363 <prefix>10.0.0.10/32</prefix>
373 <global>10.10.1.1</global>
379 <uptodate>true</uptodate>
385 <afi xmlns:x="urn:opendaylight:params:xml:ns:yang:bgp-types">x:ipv4-address-family</afi>
386 <safi xmlns:x="urn:opendaylight:params:xml:ns:yang:bgp-types">x:unicast-subsequent-address-family</safi>
387 <ipv4-routes xmlns="urn:opendaylight:params:xml:ns:yang:bgp-inet">
390 <prefix>10.0.0.10/32</prefix>
400 <global>10.10.1.1</global>
406 <uptodate>true</uptodate>
412 <afi xmlns:x="urn:opendaylight:params:xml:ns:yang:bgp-types">x:ipv4-address-family</afi>
413 <safi xmlns:x="urn:opendaylight:params:xml:ns:yang:bgp-types">x:unicast-subsequent-address-family</safi>
414 <ipv4-routes xmlns="urn:opendaylight:params:xml:ns:yang:bgp-inet"></ipv4-routes>
415 <attributes></attributes>
420 @line 8: **Adj-RIB-In** - Per-peer RIB, which contains unprocessed routes that has been advertised to local BGP speaker by the remote peer.
422 @line 13: Here is the reported route with destination *10.0.0.10/32* in Adj-RIB-In.
424 @line 35: **Effective-RIB-In** - Per-peer RIB, which contains processed routes as a result of applying inbound policy to Adj-RIB-In routes.
426 @line 40: Here is the reported route with destination *10.0.0.10/32*, same as in Adj-RIB-In, as it was not touched by import policy.
428 @line 62: **Adj-RIB-Out** - Per-peer RIB, which contains routes for advertisement to the peer by means of the local speaker's UPDATE message.
430 @line 66: The peer's Adj-RIB-Out is empty as there are no routes to be advertise from local BGP speaker.
434 Also the same route should appeared in Loc-RIB now:
436 **URL:** ``/restconf/operational/bgp-rib:bgp-rib/rib/bgp-example/loc-rib/tables/bgp-types:ipv4-address-family/bgp-types:unicast-subsequent-address-family/ipv4-routes``
444 :emphasize-lines: 4,6,8,11,14
446 <ipv4-routes xmlns="urn:opendaylight:params:xml:ns:yang:bgp-inet">
449 <prefix>10.0.0.10/32</prefix>
459 <global>10.10.1.1</global>
465 @line 4: **Destination** - IPv4 Prefix Address.
467 @line 6: **AS_PATH** - mandatory attribute, contains a list of the autonomous system numbers through that routing information has traversed.
469 @line 8: **ORIGIN** - mandatory attribute, indicates an origin of the route - **ibgp**, **egp**, **incomplete**.
471 @line 11: **LOCAL_PREF** - indicates a degree of preference for external routes, higher value is preferred.
473 @line 14: **NEXT_HOP** - mandatory attribute, defines IP address of the router that should be used as the next hop to the destination.
477 There are much more attributes that may be carried along with the destination:
479 **BGP-4 Path Attributes**
481 * **MULTI_EXIT_DISC** (MED)
482 Optional attribute, to be used to discriminate among multiple exit/entry points on external links, lower number is preferred.
491 * **ATOMIC_AGGREGATE**
492 Indicates whether AS_SET was excluded from AS_PATH due to routes aggregation.
499 Optional attribute, contains AS number and IP address of a BGP speaker which performed routes aggregation.
504 <as-number>65000</as-number>
505 <network-address>192.0.2.2</network-address>
509 Optional attribute, used to store optional attributes, unrecognized by a local BGP speaker.
513 <unrecognized-attributes>
514 <partial>true</partial>
515 <transitive>true</transitive>
517 <value>0101010101010101</value>
518 </unrecognized-attributes>
520 **Route Reflector Attributes**
523 Optional attribute, carries BGP Identifier of the originator of the route.
528 <originator>41.41.41.41</originator>
532 Optional attribute, contains a list of CLUSTER_ID values representing the path that the route has traversed.
537 <cluster>40.40.40.40</cluster>
541 Optional attribute, may be used for policy routing.
546 <as-number>65000</as-number>
547 <semantics>30740</semantics>
550 **Extended Communities**
553 Identifies one or more routers that may receive a route.
557 <extended-communities>
558 <transitive>true</transitive>
560 <global-administrator>192.0.2.2</global-administrator>
561 <local-administrator>123</local-administrator>
563 </extended-communities>
564 <extended-communities>
565 <transitive>true</transitive>
566 <as-4-route-target-extended-community>
567 <as-4-specific-common>
568 <as-number>65000</as-number>
569 <local-administrator>123</local-administrator>
570 </as-4-specific-common>
571 </as-4-route-target-extended-community>
572 </extended-communities>
576 Identifies one or more routers that injected a route.
580 <extended-communities>
581 <transitive>true</transitive>
583 <global-administrator>192.0.2.2</global-administrator>
584 <local-administrator>123</local-administrator>
586 </extended-communities>
587 <extended-communities>
588 <transitive>true</transitive>
589 <as-4-route-origin-extended-community>
590 <as-4-specific-common>
591 <as-number>65000</as-number>
592 <local-administrator>123</local-administrator>
593 </as-4-origin-common>
594 </as-4-route-target-extended-community>
595 </extended-communities>
599 Carries the cost to reach external neighbor.
603 <extended-communities>
604 <transitive>true</transitive>
605 <link-bandwidth-extended-community>
606 <bandwidth>BH9CQAA=</bandwidth>
607 </link-bandwidth-extended-community>
608 </extended-communities>
611 Optional attribute, carries accumulated IGP metric.
622 .. note:: When the remote peer disconnects, it disappear from operational state of local speaker instance and advertised routes are removed too.
624 External peering configuration
625 ''''''''''''''''''''''''''''''
626 An example above provided configuration for internal peering only.
627 Following configuration sample is intended for external peering:
629 **URL:** ``/restconf/config/openconfig-network-instance:network-instances/network-instance/global-bgp/openconfig-network-instance:protocols/protocol/openconfig-policy-types:BGP/bgp-example/bgp/neighbors``
633 **Content-Type:** ``application/xml``
641 <neighbor xmlns="urn:opendaylight:params:xml:ns:yang:bgp:openconfig-extensions">
642 <neighbor-address>192.0.2.3</neighbor-address>
644 <peer-type>EXTERNAL</peer-type>
645 <peer-as>64999</peer-as>
649 @line 5: AS number of the remote peer.
651 Route reflector configuration
652 '''''''''''''''''''''''''''''
653 The local BGP speaker can be configured with a specific *cluster ID*.
654 Following example adds the cluster ID to the existing speaker instance:
656 **URL:** ``/restconf/config/openconfig-network-instance:network-instances/network-instance/global-bgp/openconfig-network-instance:protocols/protocol/openconfig-policy-types:BGP/bgp-example/bgp/global/config``
660 **Content-Type:** ``application/xml``
669 <router-id>192.0.2.2</router-id>
671 <route-reflector-cluster-id>192.0.2.1</route-reflector-cluster-id>
674 @line 4: Route-reflector cluster id to use when local router is configured as a route reflector.
675 The *router-id* is used as a default value.
679 Following configuration sample is intended for route reflector client peering:
681 **URL:** ``/restconf/config/openconfig-network-instance:network-instances/network-instance/global-bgp/openconfig-network-instance:protocols/protocol/openconfig-policy-types:BGP/bgp-example/bgp/neighbors``
685 **Content-Type:** ``application/xml``
693 <neighbor xmlns="urn:opendaylight:params:xml:ns:yang:bgp:openconfig-extensions">
694 <neighbor-address>192.0.2.4</neighbor-address>
696 <peer-type>INTERNAL</peer-type>
700 <route-reflector-client>true</route-reflector-client>
705 @line 8: Configure the neighbor as a route reflector client. Default value is *false*.
707 MD5 authentication configuration
708 ''''''''''''''''''''''''''''''''
709 The OpenDaylight BGP implementation is supporting TCP MD5 for authentication.
710 Sample configuration below shows how to set authentication password for a peer:
712 **URL:** ``/restconf/config/openconfig-network-instance:network-instances/network-instance/global-bgp/openconfig-network-instance:protocols/protocol/openconfig-policy-types:BGP/bgp-example/bgp/neighbors``
716 **Content-Type:** ``application/xml``
724 <neighbor xmlns="urn:opendaylight:params:xml:ns:yang:bgp:openconfig-extensions">
725 <neighbor-address>192.0.2.5</neighbor-address>
727 <auth-password>topsecret</auth-password>
731 @line 4: Configures an MD5 authentication password for use with neighboring devices.
733 Simple Routing Policy configuration
734 '''''''''''''''''''''''''''''''''''
735 The OpenDaylight BGP implementation is supporting *Simple Routing Policy*.
736 Sample configuration below shows how to set *Simple Routing Policy* for a peer:
738 **URL:** ``/restconf/config/openconfig-network-instance:network-instances/network-instance/global-bgp/openconfig-network-instance:protocols/protocol/openconfig-policy-types:BGP/bgp-example/bgp/neighbors``
742 **Content-Type:** ``application/xml``
750 <neighbor xmlns="urn:opendaylight:params:xml:ns:yang:bgp:openconfig-extensions">
751 <neighbor-address>192.0.2.7</neighbor-address>
753 <simple-routing-policy>learn-none</simple-routing-policy>
757 @line 4: *Simple Routing Policy*:
759 * ``learn-none`` - routes advertised by the peer are not propagated to Effective-RIB-In and Loc-RIB
760 * ``announce-none`` - routes from local Loc-RIB are not advertised to the peer
762 .. note:: Existing neighbor configuration can be reconfigured (change configuration parameters) anytime.
763 As a result, established connection is dropped, peer instance is recreated with a new configuration settings and connection re-established.
765 .. note:: The BGP configuration is persisted on OpendDaylight shutdown and restored after the re-start.
767 BGP Application Peer and programmable RIB
768 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
769 The OpenDaylight BGP implementation also supports routes injection via *Application Peer*.
770 Such peer has its own programmable RIB, which can be modified by user.
771 This concept allows user to originate new routes and advertise them to all connected peers.
773 Application Peer configuration
774 ''''''''''''''''''''''''''''''
775 Following configuration sample show a way to configure the *Application Peer*:
777 **URL:** ``/restconf/config/openconfig-network-instance:network-instances/network-instance/global-bgp/openconfig-network-instance:protocols/protocol/openconfig-policy-types:BGP/bgp-example/bgp/neighbors``
781 **Content-Type:** ``application/xml``
787 :emphasize-lines: 2,4
789 <neighbor xmlns="urn:opendaylight:params:xml:ns:yang:bgp:openconfig-extensions">
790 <neighbor-address>10.25.1.9</neighbor-address>
792 <peer-group>application-peers</peer-group>
796 @line 2: IP address is uniquely identifying *Application Peer* and its programmable RIB. Address is also used in local BGP speaker decision process.
798 @line 4: Indicates that peer is associated with *application-peers* group. It serves to distinguish *Application Peer's* from regular neighbors.
802 The *Application Peer* presence can be verified via REST:
804 **URL:** ``/restconf/operational/bgp-rib:bgp-rib/rib/bgp-example/peer/bgp:%2F%2F10.25.1.9``
812 :emphasize-lines: 3,8
814 <peer xmlns="urn:opendaylight:params:xml:ns:yang:bgp-rib">
815 <peer-id>bgp://10.25.1.9</peer-id>
816 <peer-role>internal</peer-role>
819 <afi xmlns:x="urn:opendaylight:params:xml:ns:yang:bgp-types">x:ipv4-address-family</afi>
820 <safi xmlns:x="urn:opendaylight:params:xml:ns:yang:bgp-types">x:unicast-subsequent-address-family</safi>
821 <ipv4-routes xmlns="urn:opendaylight:params:xml:ns:yang:bgp-inet"></ipv4-routes>
823 <uptodate>false</uptodate>
829 <afi xmlns:x="urn:opendaylight:params:xml:ns:yang:bgp-types">x:ipv4-address-family</afi>
830 <safi xmlns:x="urn:opendaylight:params:xml:ns:yang:bgp-types">x:unicast-subsequent-address-family</safi>
831 <ipv4-routes xmlns="urn:opendaylight:params:xml:ns:yang:bgp-inet"></ipv4-routes>
832 <attributes></attributes>
837 @line 3: Peer role for *Application Peer* is *internal*.
839 @line 8: Adj-RIB-In is empty, as no routes were originated yet.
841 .. note:: There is no Adj-RIB-Out for *Application Peer*.
845 Next example shows how to inject a route into the programmable RIB.
847 **URL:** ``/restconf/config/bgp-rib:application-rib/10.25.1.9/tables/bgp-types:ipv4-address-family/bgp-types:unicast-subsequent-address-family/bgp-inet:ipv4-routes``
851 **Content-Type:** ``application/xml``
857 <ipv4-route xmlns="urn:opendaylight:params:xml:ns:yang:bgp-inet">
859 <prefix>10.0.0.11/32</prefix>
869 <global>10.11.1.1</global>
876 Now the injected route appears in *Application Peer's* RIBs and in local speaker's Loc-RIB:
878 **URL:** ``/restconf/operational/bgp-rib:bgp-rib/rib/bgp-example/peer/bgp:%2F%2F10.25.1.9``
888 <peer xmlns="urn:opendaylight:params:xml:ns:yang:bgp-rib">
889 <peer-id>bgp://10.25.1.9</peer-id>
890 <peer-role>internal</peer-role>
893 <afi xmlns:x="urn:opendaylight:params:xml:ns:yang:bgp-types">x:ipv4-address-family</afi>
894 <safi xmlns:x="urn:opendaylight:params:xml:ns:yang:bgp-types">x:unicast-subsequent-address-family</safi>
895 <ipv4-routes xmlns="urn:opendaylight:params:xml:ns:yang:bgp-inet">
898 <prefix>10.0.0.11/32</prefix>
908 <global>10.11.1.1</global>
914 <uptodate>false</uptodate>
920 <afi xmlns:x="urn:opendaylight:params:xml:ns:yang:bgp-types">x:ipv4-address-family</afi>
921 <safi xmlns:x="urn:opendaylight:params:xml:ns:yang:bgp-types">x:unicast-subsequent-address-family</safi>
922 <ipv4-routes xmlns="urn:opendaylight:params:xml:ns:yang:bgp-inet">
925 <prefix>10.0.0.11/32</prefix>
935 <global>10.11.1.1</global>
940 <attributes></attributes>
945 @line 9: Injected route is present in *Application Peer's* Adj-RIB-In and Effective-RIB-In.
949 **URL:** ``/restconf/operational/bgp-rib:bgp-rib/rib/bgp-example/loc-rib/tables/bgp-types:ipv4-address-family/bgp-types:unicast-subsequent-address-family/ipv4-routes``
959 <ipv4-routes xmlns="urn:opendaylight:params:xml:ns:yang:bgp-inet">
962 <prefix>10.0.0.10/32</prefix>
972 <global>10.11.1.1</global>
978 <prefix>10.0.0.10/32</prefix>
988 <global>10.10.1.1</global>
994 @line 2: The injected route is now present in Loc-RIB along with a route (destination *10.0.0.10/32*) advertised by remote peer.
998 This route is also advertised to the remote peer (*192.0.2.1*), hence route appears in its Adj-RIB-Out:
1000 **URL:** ``/restconf/operational/bgp-rib:bgp-rib/rib/bgp-example/peer/bgp:%2F%2F192.0.2.1/adj-rib-out/tables/bgp-types:ipv4-address-family/bgp-types:unicast-subsequent-address-family/bgp-inet:ipv4-routes``
1008 <ipv4-route xmlns="urn:opendaylight:params:xml:ns:yang:bgp-inet">
1009 <path-id>0</path-id>
1010 <prefix>10.0.0.11/32</prefix>
1020 <global>10.11.1.1</global>
1027 The injected route can be modified (i.e. different path attribute):
1029 **URL:** ``/restconf/config/bgp-rib:application-rib/10.25.1.9/tables/bgp-types:ipv4-address-family/bgp-types:unicast-subsequent-address-family/bgp-inet:ipv4-routes/ipv4-route/10.0.0.11%2F32/0``
1033 **Content-Type:** ``application/xml``
1039 <ipv4-route xmlns="urn:opendaylight:params:xml:ns:yang:bgp-inet">
1040 <path-id>0</path-id>
1041 <prefix>10.0.0.11/32</prefix>
1051 <global>10.11.1.2</global>
1058 The route can be removed from programmable RIB in a following way:
1060 **URL:** ``/restconf/config/bgp-rib:application-rib/10.25.1.9/tables/bgp-types:ipv4-address-family/bgp-types:unicast-subsequent-address-family/bgp-inet:ipv4-routes/ipv4-route/10.0.0.11%2F32/0``
1062 **Method:** ``DELETE``
1066 Also it is possible to remove all routes from a particular table at once:
1068 **URL:** ``/restconf/config/bgp-rib:application-rib/10.25.1.9/tables/bgp-types:ipv4-address-family/bgp-types:unicast-subsequent-address-family/bgp-inet:ipv4-routes/``
1070 **Method:** ``DELETE``
1074 Consequently, route disappears from programmable RIB, *Application Peer's* RIBs, Loc-RIB and peer's Adj-RIB-Out (UPDATE message with prefix withdrawal is send).
1076 .. note:: Routes stored in programmable RIB are persisted on OpendDaylight shutdown and restored after the re-start.
1078 BGP Protocol Configuration Loader
1079 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1081 BGP Protocol Configuration Loader allows the user to define the static initial configuration for a BGP protocol instance.
1082 This service will detect the creation of new configuration files following the pattern "protocols-*.xml" under the path "etc/opendaylight/bgpcep".
1083 Once the file is processed, the defined configuration will be available from the configuration Data Store.
1085 .. note:: If the BGP instance is already present, no update or configuration will be applied.
1087 When installing BGP an example will be provided and a default configuration loaded.
1089 **PATH:** ``etc/opendaylight/bgp/protocols-config.xml``
1093 <protocols xmlns="http://openconfig.net/yang/network-instance">
1095 <name>example-bgp-rib</name>
1096 <identifier xmlns:x="http://openconfig.net/yang/policy-types">x:BGP</identifier>
1097 <bgp xmlns="urn:opendaylight:params:xml:ns:yang:bgp:openconfig-extensions">
1100 <router-id>192.0.2.2</router-id>
1102 <!-- if cluster-id is not present, it's value is the same as bgp-id -->
1103 <!-- <route-reflector-cluster-id>192.0.2.3</route-reflector-cluster-id> -->
1104 <!-- <read-only-limit>120</read-only-limit>-->
1108 <afi-safi-name xmlns:x="http://openconfig.net/yang/bgp-types">x:IPV4-UNICAST</afi-safi-name>
1109 <!--Advertise N Paths
1110 <receive>true</receive>
1111 <send-max>2</send-max>-->
1114 <afi-safi-name xmlns:x="http://openconfig.net/yang/bgp-types">x:IPV6-UNICAST</afi-safi-name>
1117 <afi-safi-name xmlns:x="http://openconfig.net/yang/bgp-types">x:IPV4-LABELLED-UNICAST</afi-safi-name>
1120 <afi-safi-name xmlns:x="http://openconfig.net/yang/bgp-types">x:IPV6-LABELLED-UNICAST</afi-safi-name>
1123 <afi-safi-name xmlns:x="http://openconfig.net/yang/bgp-types">x:L3VPN-IPV4-UNICAST</afi-safi-name>
1126 <afi-safi-name xmlns:x="http://openconfig.net/yang/bgp-types">x:L3VPN-IPV6-UNICAST</afi-safi-name>
1129 <afi-safi-name xmlns:x="http://openconfig.net/yang/bgp-types">x:L2VPN-EVPN</afi-safi-name>
1132 <afi-safi-name>LINKSTATE</afi-safi-name>
1135 <afi-safi-name>IPV4-FLOW</afi-safi-name>
1138 <afi-safi-name>IPV6-FLOW</afi-safi-name>
1141 <afi-safi-name>IPV4-L3VPN-FLOW</afi-safi-name>
1144 <afi-safi-name>IPV6-L3VPN-FLOW</afi-safi-name>
1148 <neighbors xmlns="urn:opendaylight:params:xml:ns:yang:bgp:openconfig-extensions">
1149 <neighbor xmlns="urn:opendaylight:params:xml:ns:yang:bgp:openconfig-extensions">
1150 <neighbor-address>192.0.2.1</neighbor-address>
1152 <peer-type>INTERNAL</peer-type>
1153 <peer-as>64496</peer-as>
1157 <remote-port>179</remote-port>
1158 <passive-mode>true</passive-mode>
1163 <hold-time>180</hold-time>
1164 <connect-retry>10</connect-retry>
1169 <route-reflector-client>false</route-reflector-client>
1174 <afi-safi-name xmlns:x="http://openconfig.net/yang/bgp-types">x:IPV4-UNICAST</afi-safi-name>
1175 <!--Advertise N Paths
1176 <receive>true</receive>
1177 <send-max>0</send-max>-->
1180 <afi-safi-name xmlns:x="http://openconfig.net/yang/bgp-types">x:IPV6-UNICAST</afi-safi-name>
1183 <afi-safi-name xmlns:x="http://openconfig.net/yang/bgp-types">x:IPV4-LABELLED-UNICAST</afi-safi-name>
1186 <afi-safi-name xmlns:x="http://openconfig.net/yang/bgp-types">x:IPV6-LABELLED-UNICAST</afi-safi-name>
1189 <afi-safi-name xmlns:x="http://openconfig.net/yang/bgp-types">x:L3VPN-IPV4-UNICAST</afi-safi-name>
1192 <afi-safi-name xmlns:x="http://openconfig.net/yang/bgp-types">x:L3VPN-IPV6-UNICAST</afi-safi-name>
1195 <afi-safi-name xmlns:x="http://openconfig.net/yang/bgp-types">x:L2VPN-EVPN</afi-safi-name>
1198 <afi-safi-name>LINKSTATE</afi-safi-name>
1201 <afi-safi-name>IPV4-FLOW</afi-safi-name>
1204 <afi-safi-name>IPV6-FLOW</afi-safi-name>
1207 <afi-safi-name>IPV4-L3VPN-FLOW</afi-safi-name>
1210 <afi-safi-name>IPV6-L3VPN-FLOW</afi-safi-name>
1214 <neighbor xmlns="urn:opendaylight:params:xml:ns:yang:bgp:openconfig-extensions">
1215 <neighbor-address>192.0.2.6</neighbor-address>
1217 <peer-group>application-peers</peer-group>
1225 BGP Configuration Example
1226 '''''''''''''''''''''''''
1228 BGP provides a feature providing a BGP Protocol and Network Topology configuration file example.
1229 Once feature is installed defined configuration will be loaded and setup.
1231 .. code-block:: console
1233 feature:install odl-bgpcep-bgp-config-example
1237 .. figure:: ./images/bgpcep/bgp-pipeline.png
1240 BGP pipeline - routes re-advertisement.
1242 .. figure:: ./images/bgpcep/bgp-app-pipeline.png
1243 :alt: BGP Application Peer pipeline.
1245 BGP applcaition peer pipeline - routes injection.
1249 * `A Border Gateway Protocol 4 (BGP-4) <https://tools.ietf.org/html/rfc4271>`_
1250 * `BGP Route Reflection <https://tools.ietf.org/html/rfc4456>`_
1251 * `BGP Communities Attribute <https://tools.ietf.org/html/rfc1997>`_
1252 * `BGP Support for Four-Octet Autonomous System (AS) Number Space <https://tools.ietf.org/html/rfc6793>`_
1253 * `The Accumulated IGP Metric Attribute for BGP <https://tools.ietf.org/html/rfc7311>`_
1254 * `4-Octet AS Specific BGP Extended Community <https://tools.ietf.org/html/rfc5668>`_
1255 * `BGP Link Bandwidth Extended Community <https://tools.ietf.org/html/draft-ietf-idr-link-bandwidth-06>`_
1256 * `Use of BGP for Routing in Large-Scale Data Centers <https://tools.ietf.org/html/rfc7938>`_
1260 The BGP-4 allows to carry IPv4 specific information only.
1261 The basic BGP Multiprotocol extension brings *Unicast* Subsequent Address Family (SAFI) - intended to be used for IP unicast forwarding.
1262 The combination of IPv4 and IPv6 Address Family (AF) and Unicast SAFI is essential for Internet routing.
1263 The IPv4 Unicast routes are interchangeable with BGP-4 routes, as they can carry the same type of routing information.
1265 .. contents:: Contents
1271 This section shows a way to enable IPv4 and IPv6 Unicast family in BGP speaker and peer configuration.
1275 To enable IPv4 and IPv6 Unicast support in BGP plugin, first configure BGP speaker instance:
1277 **URL:** ``/restconf/config/openconfig-network-instance:network-instances/network-instance/global-bgp/openconfig-network-instance:protocols``
1279 **Method:** ``POST``
1281 **Content-Type:** ``application/xml``
1287 <protocol xmlns="http://openconfig.net/yang/network-instance">
1288 <name>bgp-example</name>
1289 <identifier xmlns:x="http://openconfig.net/yang/policy-types">x:BGP</identifier>
1290 <bgp xmlns="urn:opendaylight:params:xml:ns:yang:bgp:openconfig-extensions">
1293 <router-id>192.0.2.2</router-id>
1298 <afi-safi-name xmlns:x="http://openconfig.net/yang/bgp-types">x:IPV4-UNICAST</afi-safi-name>
1301 <afi-safi-name xmlns:x="http://openconfig.net/yang/bgp-types">x:IPV6-UNICAST</afi-safi-name>
1310 Here is an example for BGP peer configuration with enabled IPv4 and IPv6 Unicast family.
1312 **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``
1314 **Method:** ``POST``
1316 **Content-Type:** ``application/xml``
1322 <neighbor xmlns="urn:opendaylight:params:xml:ns:yang:bgp:openconfig-extensions">
1323 <neighbor-address>192.0.2.1</neighbor-address>
1326 <afi-safi-name xmlns:x="http://openconfig.net/yang/bgp-types">x:IPV4-UNICAST</afi-safi-name>
1329 <afi-safi-name xmlns:x="http://openconfig.net/yang/bgp-types">x:IPV6-UNICAST</afi-safi-name>
1336 Following trees illustrate the BGP IP Unicast routes structures.
1340 .. code-block:: console
1344 +--ro ipv4-route* [prefix path-id]
1345 +--ro prefix inet:ipv4-prefix
1346 +--ro path-id path-id
1349 | +--ro value bgp-t:bgp-origin
1352 | +--ro as-sequence* inet:as-number
1353 | +--ro as-set* inet:as-number
1355 | +--:(ipv4-next-hop-case)
1356 | | +--ro ipv4-next-hop
1357 | | +--ro global? inet:ipv4-address
1358 | +--:(ipv6-next-hop-case)
1359 | | +--ro ipv6-next-hop
1360 | | +--ro global? inet:ipv6-address
1361 | | +--ro link-local? inet:ipv6-address
1362 | +--:(empty-next-hop-case)
1363 | +--ro empty-next-hop? empty
1364 +--ro multi-exit-disc
1367 | +--ro pref? uint32
1368 +--ro atomic-aggregate!
1370 | +--ro as-number? inet:as-number
1371 | +--ro network-address? inet:ipv4-address
1373 | +--ro as-number? inet:as-number
1374 | +--ro semantics? uint16
1375 +--ro extended-communities*
1376 | +--ro transitive? boolean
1377 | +--ro (extended-community)?
1378 | +--:(as-specific-extended-community-case)
1379 | | +--ro as-specific-extended-community
1380 | | +--ro global-administrator? short-as-number
1381 | | +--ro local-administrator? binary
1382 | +--:(inet4-specific-extended-community-case)
1383 | | +--ro inet4-specific-extended-community
1384 | | +--ro global-administrator? inet:ipv4-address
1385 | | +--ro local-administrator? binary
1386 | +--:(opaque-extended-community-case)
1387 | | +--ro opaque-extended-community
1388 | | +--ro value? binary
1389 | +--:(route-target-extended-community-case)
1390 | | +--ro route-target-extended-community
1391 | | +--ro global-administrator? short-as-number
1392 | | +--ro local-administrator? binary
1393 | +--:(route-origin-extended-community-case)
1394 | | +--ro route-origin-extended-community
1395 | | +--ro global-administrator? short-as-number
1396 | | +--ro local-administrator? binary
1397 | +--:(route-target-ipv4-case)
1398 | | +--ro route-target-ipv4
1399 | | +--ro global-administrator? inet:ipv4-address
1400 | | +--ro local-administrator? uint16
1401 | +--:(route-origin-ipv4-case)
1402 | | +--ro route-origin-ipv4
1403 | | +--ro global-administrator? inet:ipv4-address
1404 | | +--ro local-administrator? uint16
1405 | +--:(link-bandwidth-case)
1406 | | +--ro link-bandwidth-extended-community
1407 | | +--ro bandwidth netc:bandwidth
1408 | +--:(as-4-generic-spec-extended-community-case)
1409 | | +--ro as-4-generic-spec-extended-community
1410 | | +--ro as-4-specific-common
1411 | | +--ro as-number inet:as-number
1412 | | +--ro local-administrator uint16
1413 | +--:(as-4-route-target-extended-community-case)
1414 | | +--ro as-4-route-target-extended-community
1415 | | +--ro as-4-specific-common
1416 | | +--ro as-number inet:as-number
1417 | | +--ro local-administrator uint16
1418 | +--:(as-4-route-origin-extended-community-case)
1419 | | +--ro as-4-route-origin-extended-community
1420 | | +--ro as-4-specific-common
1421 | | +--ro as-number inet:as-number
1422 | | +--ro local-administrator uint16
1423 | +--:(encapsulation-case)
1424 | +--ro encapsulation-extended-community
1425 | +--ro tunnel-type encapsulation-tunnel-type
1427 | +--ro originator? inet:ipv4-address
1429 | +--ro cluster* bgp-t:cluster-identifier
1432 | +--ro metric? netc:accumulated-igp-metric
1433 +--ro unrecognized-attributes* [type]
1434 +--ro partial boolean
1435 +--ro transitive boolean
1441 .. code-block:: console
1445 +--ro ipv6-route* [prefix path-id]
1446 +--ro prefix inet:ipv6-prefix
1447 +--ro path-id path-id
1455 The IPv4 Unicast table in an instance of the speaker's Loc-RIB can be verified via REST:
1457 **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``
1465 <ipv4-routes xmlns="urn:opendaylight:params:xml:ns:yang:bgp-inet">
1467 <path-id>0</path-id>
1468 <prefix>193.0.2.1/32</prefix>
1478 <global>10.0.0.1</global>
1486 The IPv6 Unicast table in an instance of the speaker's Loc-RIB can be verified via REST:
1488 **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``
1496 <ipv6-routes xmlns="urn:opendaylight:params:xml:ns:yang:bgp-inet">
1498 <path-id>0</path-id>
1499 <prefix>2a02:b80:0:1::/64</prefix>
1509 <global>2a02:b80:0:2::1</global>
1515 .. note:: IPv4/6 routes mapping to topology nodes is supported by BGP Topology Provider.
1521 This examples show how to originate and remove IPv4 route via programmable RIB.
1522 Make sure the *Application Peer* is configured first.
1524 **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``
1526 **Method:** ``POST``
1528 **Content-Type:** ``application/xml``
1534 <ipv4-route xmlns="urn:opendaylight:params:xml:ns:yang:bgp-inet">
1535 <path-id>0</path-id>
1536 <prefix>10.0.0.11/32</prefix>
1546 <global>10.11.1.1</global>
1553 To remove the route added above, following request can be used:
1555 **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``
1557 **Method:** ``DELETE``
1561 This examples show how to originate and remove IPv6 route via programmable RIB:
1563 **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``
1565 **Method:** ``POST``
1567 **Content-Type:** ``application/xml``
1573 <ipv6-route xmlns="urn:opendaylight:params:xml:ns:yang:bgp-inet">
1574 <prefix>2001:db8:30::3/128</prefix>
1575 <path-id>0</path-id>
1578 <global>2001:db8:1::6</global>
1592 To remove the route added above, following request can be used:
1594 **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``
1596 **Method:** ``DELETE``
1600 * `Multiprotocol Extensions for BGP-4 <https://tools.ietf.org/html/rfc4760>`_
1602 IP Labeled Unicast Family
1603 -------------------------
1604 The BGP Labeled Unicast (BGP-LU) Multiprotocol extension is used to distribute a MPLS label that is mapped to a particular route.
1605 It can be used to advertise a MPLS transport path between IGP regions and Autonomous Systems.
1606 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.
1607 In addition, IPv6 Labeled Unicast can be used to interconnect IPv6 islands over IPv4/MPLS networks using 6PE.
1609 .. contents:: Contents
1615 This section shows a way to enable IPv4 and IPv6 Labeled Unicast family in BGP speaker and peer configuration.
1619 To enable IPv4 and IPv6 Labeled Unicast support in BGP plugin, first configure BGP speaker instance:
1621 **URL:** ``/restconf/config/openconfig-network-instance:network-instances/network-instance/global-bgp/openconfig-network-instance:protocols``
1623 **Method:** ``POST``
1625 **Content-Type:** ``application/xml``
1631 <protocol xmlns="http://openconfig.net/yang/network-instance">
1632 <name>bgp-example</name>
1633 <identifier xmlns:x="http://openconfig.net/yang/policy-types">x:BGP</identifier>
1634 <bgp xmlns="urn:opendaylight:params:xml:ns:yang:bgp:openconfig-extensions">
1637 <router-id>192.0.2.2</router-id>
1642 <afi-safi-name xmlns:x="http://openconfig.net/yang/bgp-types">x:IPV4-LABELLED-UNICAST</afi-safi-name>
1645 <afi-safi-name xmlns:x="http://openconfig.net/yang/bgp-types">x:IPV6-LABELLED-UNICAST</afi-safi-name>
1654 Here is an example for BGP peer configuration with enabled IPv4 and IPv6 Labeled Unicast family.
1656 **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``
1658 **Method:** ``POST``
1660 **Content-Type:** ``application/xml``
1666 <neighbor xmlns="urn:opendaylight:params:xml:ns:yang:bgp:openconfig-extensions">
1667 <neighbor-address>192.0.2.1</neighbor-address>
1670 <afi-safi-name xmlns:x="http://openconfig.net/yang/bgp-types">x:IPV4-LABELLED-UNICAST</afi-safi-name>
1673 <afi-safi-name xmlns:x="http://openconfig.net/yang/bgp-types">x:IPV6-LABELLED-UNICAST</afi-safi-name>
1678 IP Labeled Unicast API
1679 ^^^^^^^^^^^^^^^^^^^^^^
1680 Following trees illustrate the BGP IP Labeled Unicast routes structures.
1682 IPv4 Labeled Unicast Route
1683 ''''''''''''''''''''''''''
1684 .. code-block:: console
1686 :(labeled-unicast-routes-case)
1687 +--ro labeled-unicast-routes
1688 +--ro labeled-unicast-route* [route-key path-id]
1689 +--ro route-key string
1691 | +--ro label-value? netc:mpls-label
1692 +--ro prefix? inet:ip-prefix
1693 +--ro path-id path-id
1698 IPv6 Labeled Unicast Route
1699 ''''''''''''''''''''''''''
1700 .. code-block:: console
1702 :(labeled-unicast-ipv6-routes-case)
1703 +--ro labeled-unicast-ipv6-routes
1704 +--ro labeled-unicast-route* [route-key path-id]
1705 +--ro route-key string
1707 | +--ro label-value? netc:mpls-label
1708 +--ro prefix? inet:ip-prefix
1709 +--ro path-id path-id
1715 The IPv4 Labeled Unicast table in an instance of the speaker's Loc-RIB can be verified via REST:
1717 **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``
1725 <labeled-unicast-routes xmlns="urn:opendaylight:params:xml:ns:yang:bgp-labeled-unicast">
1726 <labeled-unicast-route>
1727 <path-id>0</path-id>
1728 <route-key>MAA+gRQAAA==</route-key>
1734 <global>200.10.0.101</global>
1742 <label-value>1000</label-value>
1744 <prefix>20.0.0.0/24</prefix>
1745 </labeled-unicast-route>
1746 </labeled-unicast-routes>
1752 This examples show how to originate and remove IPv4 labeled route via programmable RIB.
1753 Make sure the *Application Peer* is configured first.
1755 **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``
1757 **Method:** ``POST``
1759 **Content-Type:** ``application/xml``
1765 <labeled-unicast-route xmlns="urn:opendaylight:params:xml:ns:yang:bgp-labeled-unicast">
1766 <route-key>label1</route-key>
1767 <prefix>1.1.1.1/32</prefix>
1768 <path-id>0</path-id>
1770 <label-value>800322</label-value>
1774 <global>199.20.160.41</global>
1784 </labeled-unicast-route>
1788 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.
1793 <bgp-prefix-sid-tlvs>
1794 <label-index-tlv xmlns="urn:opendaylight:params:xml:ns:yang:bgp-labeled-unicast">322</label-index-tlv>
1795 </bgp-prefix-sid-tlvs>
1796 <bgp-prefix-sid-tlvs>
1797 <srgb-value xmlns="urn:opendaylight:params:xml:ns:yang:bgp-labeled-unicast">
1801 </bgp-prefix-sid-tlvs>
1806 To remove the route added above, following request can be used:
1808 **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``
1810 **Method:** ``DELETE``
1814 This examples show how to originate and remove IPv6 labeled route via programmable RIB.
1816 **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``
1818 **Method:** ``POST``
1820 **Content-Type:** ``application/xml``
1826 <labeled-unicast-route xmlns="urn:opendaylight:params:xml:ns:yang:bgp-labeled-unicast">
1827 <route-key>label1</route-key>
1828 <prefix>2001:db8:30::3/128</prefix>
1829 <path-id>0</path-id>
1831 <label-value>123</label-value>
1835 <global>2003:4:5:6::7</global>
1845 </labeled-unicast-route>
1849 To remove the route added above, following request can be used:
1851 **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``
1853 **Method:** ``DELETE``
1857 * `Carrying Label Information in BGP-4 <https://tools.ietf.org/html/rfc3107>`_
1858 * `Segment Routing Prefix SID extensions for BGP <https://tools.ietf.org/html/draft-ietf-idr-bgp-prefix-sid-03>`_
1859 * `Connecting IPv6 Islands over IPv4 MPLS Using IPv6 Provider Edge Routers (6PE) <https://tools.ietf.org/html/rfc4798>`_
1860 * `BGP-Prefix Segment in large-scale data centers <https://tools.ietf.org/html/draft-ietf-spring-segment-routing-msdc-01>`_
1861 * `Egress Peer Engineering using BGP-LU <https://tools.ietf.org/html/draft-gredler-idr-bgplu-epe-06>`_
1865 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.
1866 Also, routes are distributed to specific VPN remote sites.
1868 .. contents:: Contents
1874 This section shows a way to enable IPv4 and IPv6 L3VPN family in BGP speaker and peer configuration.
1878 To enable IPv4 and IPv6 L3VPN support in BGP plugin, first configure BGP speaker instance:
1880 **URL:** ``/restconf/config/openconfig-network-instance:network-instances/network-instance/global-bgp/openconfig-network-instance:protocols``
1882 **Method:** ``POST``
1884 **Content-Type:** ``application/xml``
1890 <protocol xmlns="http://openconfig.net/yang/network-instance">
1891 <name>bgp-example</name>
1892 <identifier xmlns:x="http://openconfig.net/yang/policy-types">x:BGP</identifier>
1893 <bgp xmlns="urn:opendaylight:params:xml:ns:yang:bgp:openconfig-extensions">
1896 <router-id>192.0.2.2</router-id>
1901 <afi-safi-name xmlns:x="http://openconfig.net/yang/bgp-types">x:L3VPN-IPV4-UNICAST</afi-safi-name>
1904 <afi-safi-name xmlns:x="http://openconfig.net/yang/bgp-types">x:L3VPN-IPV6-UNICAST</afi-safi-name>
1913 Here is an example for BGP peer configuration with enabled IPv4 and IPv6 L3VPN family.
1915 **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``
1917 **Method:** ``POST``
1919 **Content-Type:** ``application/xml``
1925 <neighbor xmlns="urn:opendaylight:params:xml:ns:yang:bgp:openconfig-extensions">
1926 <neighbor-address>192.0.2.1</neighbor-address>
1929 <afi-safi-name xmlns:x="http://openconfig.net/yang/bgp-types">x:L3VPN-IPV4-UNICAST</afi-safi-name>
1932 <afi-safi-name xmlns:x="http://openconfig.net/yang/bgp-types">x:L3VPN-IPV6-UNICAST</afi-safi-name>
1939 Following trees illustrate the BGP IP L3VPN routes structures.
1943 .. code-block:: console
1945 :(vpn-ipv4-routes-case)
1946 +--ro vpn-ipv4-routes
1947 +--ro vpn-route* [route-key]
1948 +--ro route-key string
1950 | +--ro label-value? netc:mpls-label
1951 +--ro prefix? inet:ip-prefix
1952 +--ro path-id? path-id
1953 +--ro route-distinguisher? bgp-t:route-distinguisher
1959 .. code-block:: console
1961 :(vpn-ipv6-routes-case)
1962 +--ro vpn-ipv6-routes
1963 +--ro vpn-route* [route-key]
1964 +--ro route-key string
1966 | +--ro label-value? netc:mpls-label
1967 +--ro prefix? inet:ip-prefix
1968 +--ro path-id? path-id
1969 +--ro route-distinguisher? bgp-t:route-distinguisher
1977 The IPv4 L3VPN table in an instance of the speaker's Loc-RIB can be verified via REST:
1979 **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``
1987 <vpn-ipv4-routes xmlns="urn:opendaylight:params:xml:ns:yang:bgp-vpn-ipv4">
1989 <route-key>cAXdYQABrBAALABlCgIi</route-key>
1991 <label-value>24022</label-value>
1994 <extended-communities>
1995 <transitive>true</transitive>
1996 <route-target-extended-community>
1997 <global-administrator>65000</global-administrator>
1998 <local-administrator>AAAAZQ==</local-administrator>
1999 </route-target-extended-community>
2000 </extended-communities>
2009 <global>127.16.0.44</global>
2012 <route-distinguisher>172.16.0.44:101</route-distinguisher>
2013 <prefix>10.2.34.0/24</prefix>
2019 The IPv6 L3VPN table in an instance of the speaker's Loc-RIB can be verified via REST:
2021 **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``
2029 <vpn-ipv6-routes xmlns="urn:opendaylight:params:xml:ns:yang:bgp-vpn-ipv6">
2031 <route-key>mAXdcQABrBAALABlKgILgAAAAAE=</route-key>
2033 <label-value>24023</label-value>
2039 <extended-communities>
2040 <route-target-extended-community>
2041 <global-administrator>65000</global-administrator>
2042 <local-administrator>AAAAZQ==</local-administrator>
2043 </route-target-extended-community>
2044 <transitive>true</transitive>
2045 </extended-communities>
2047 <global>2a02:b80:0:2::1</global>
2054 <route-distinguisher>172.16.0.44:101</route-distinguisher>
2055 <prefix>2a02:b80:0:1::/64</prefix>
2061 This examples show how to originate and remove IPv4 L3VPN route via programmable RIB.
2062 Make sure the *Application Peer* is configured first.
2064 **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``
2066 **Method:** ``POST``
2068 **Content-Type:** ``application/xml``
2074 <vpn-route xmlns="urn:opendaylight:params:xml:ns:yang:bgp-vpn-ipv4">
2075 <route-key>vpn1</route-key>
2077 <label-value>123</label-value>
2079 <route-distinguisher>429496729:1</route-distinguisher>
2080 <prefix>2.2.2.2/32</prefix>
2083 <global>199.20.166.41</global>
2089 <extended-communities>
2090 <route-target-extended-community>
2091 <global-administrator>65000</global-administrator>
2092 <local-administrator>AAAAZQ==</local-administrator>
2093 </route-target-extended-community>
2094 <transitive>true</transitive>
2095 </extended-communities>
2101 To remove the route added above, following request can be used:
2103 **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``
2105 **Method:** ``DELETE``
2109 * `BGP/MPLS IP Virtual Private Networks (VPNs) <https://tools.ietf.org/html/rfc4364>`_
2110 * `BGP-MPLS IP Virtual Private Network (VPN) Extension for IPv6 VPN <https://tools.ietf.org/html/rfc4659>`_
2111 * `BGP/MPLS VPN Virtual PE <https://tools.ietf.org/html/draft-ietf-bess-virtual-pe-00>`_
2115 The BGP Link-State (BGP-LS) Multiprotocol extension allows to distribute Link-State and Traffic Engineering (TE) information.
2116 This information is typically distributed by IGP routing protocols with in the network, limiting LSDB or TED visibility to the IGP area.
2117 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).
2118 The information is applicable in ALTO servers and PCEs, as both need to gather information about topologies.
2119 In addition, link-state information is extended to carry segment information (Spring).
2121 .. contents:: Contents
2127 This section shows a way to enable IPv4 and IPv6 Labeled Unicast family in BGP speaker and peer configuration.
2131 To enable BGP-LS support in BGP plugin, first configure BGP speaker instance:
2133 **URL:** ``/restconf/config/openconfig-network-instance:network-instances/network-instance/global-bgp/openconfig-network-instance:protocols``
2135 **Method:** ``POST``
2137 **Content-Type:** ``application/xml``
2143 <protocol xmlns="http://openconfig.net/yang/network-instance">
2144 <name>bgp-example</name>
2145 <identifier xmlns:x="http://openconfig.net/yang/policy-types">x:BGP</identifier>
2146 <bgp xmlns="urn:opendaylight:params:xml:ns:yang:bgp:openconfig-extensions">
2149 <router-id>192.0.2.2</router-id>
2154 <afi-safi-name>LINKSTATE</afi-safi-name>
2161 Linkstate path attribute
2162 ''''''''''''''''''''''''
2163 IANA allocation for BGP-LS path attribute is TYPE 29.
2164 Some older BGP-LS implementations might still require earliest asigned allocation TYPE 99.
2165 To use TYPE = 99, you need to set value bellow to false.
2167 **URL:** ``/restconf/config/bgp-linkstate-app-config:bgp-linkstate-app-config``
2171 **Content-Type:** ``application/xml``
2177 <bgp-linkstate-app-config xmlns="urn:opendaylight:params:xml:ns:yang:controller:bgp:linkstate-app-config">
2178 <iana-linkstate-attribute-type>false</iana-linkstate-attribute-type>
2179 </bgp-linkstate-app-config>
2183 Here is an example for BGP peer configuration with enabled BGP-LS family.
2185 **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``
2187 **Method:** ``POST``
2189 **Content-Type:** ``application/xml``
2195 <neighbor xmlns="urn:opendaylight:params:xml:ns:yang:bgp:openconfig-extensions">
2196 <neighbor-address>192.0.2.1</neighbor-address>
2199 <afi-safi-name>LINKSTATE</afi-safi-name>
2204 Link-State Route API
2205 ^^^^^^^^^^^^^^^^^^^^
2206 Following tree illustrate the BGP Link-State route structure.
2208 .. code-block:: console
2210 :(linkstate-routes-case)
2211 +--ro linkstate-routes
2212 +--ro linkstate-route* [route-key]
2213 +--ro route-key binary
2214 +--ro protocol-id protocol-id
2215 +--ro identifier identifier
2216 +--ro (object-type)?
2218 | | +--ro node-descriptors
2219 | | +--ro as-number? inet:as-number
2220 | | +--ro area-id? area-identifier
2221 | | +--ro domain-id? domain-identifier
2222 | | +--ro (c-router-identifier)?
2223 | | +--:(isis-node-case)
2224 | | | +--ro isis-node
2225 | | | +--ro iso-system-id netc:iso-system-identifier
2226 | | +--:(isis-pseudonode-case)
2227 | | | +--ro isis-pseudonode
2228 | | | +--ro is-is-router-identifier
2229 | | | | +--ro iso-system-id netc:iso-system-identifier
2230 | | | +--ro psn uint8
2231 | | +--:(ospf-node-case)
2232 | | | +--ro ospf-node
2233 | | | +--ro ospf-router-id uint32
2234 | | +--:(ospf-pseudonode-case)
2235 | | +--ro ospf-pseudonode
2236 | | +--ro ospf-router-id uint32
2237 | | +--ro lan-interface ospf-interface-identifier
2239 | | +--ro local-node-descriptors
2240 | | | +--ro as-number? inet:as-number
2241 | | | +--ro area-id? area-identifier
2242 | | | +--ro domain-id? domain-identifier
2243 | | | +--ro (c-router-identifier)?
2244 | | | | +--:(isis-node-case)
2245 | | | | | +--ro isis-node
2246 | | | | | +--ro iso-system-id netc:iso-system-identifier
2247 | | | | +--:(isis-pseudonode-case)
2248 | | | | | +--ro isis-pseudonode
2249 | | | | | +--ro is-is-router-identifier
2250 | | | | | | +--ro iso-system-id netc:iso-system-identifier
2251 | | | | | +--ro psn uint8
2252 | | | | +--:(ospf-node-case)
2253 | | | | | +--ro ospf-node
2254 | | | | | +--ro ospf-router-id uint32
2255 | | | | +--:(ospf-pseudonode-case)
2256 | | | | +--ro ospf-pseudonode
2257 | | | | +--ro ospf-router-id uint32
2258 | | | | +--ro lan-interface ospf-interface-identifier
2259 | | | +--ro bgp-router-id? inet:ipv4-address
2260 | | | +--ro member-asn? inet:as-number
2261 | | +--ro remote-node-descriptors
2262 | | | +--ro as-number? inet:as-number
2263 | | | +--ro area-id? area-identifier
2264 | | | +--ro domain-id? domain-identifier
2265 | | | +--ro (c-router-identifier)?
2266 | | | | +--:(isis-node-case)
2267 | | | | | +--ro isis-node
2268 | | | | | +--ro iso-system-id netc:iso-system-identifier
2269 | | | | +--:(isis-pseudonode-case)
2270 | | | | | +--ro isis-pseudonode
2271 | | | | | +--ro is-is-router-identifier
2272 | | | | | | +--ro iso-system-id netc:iso-system-identifier
2273 | | | | | +--ro psn uint8
2274 | | | | +--:(ospf-node-case)
2275 | | | | | +--ro ospf-node
2276 | | | | | +--ro ospf-router-id uint32
2277 | | | | +--:(ospf-pseudonode-case)
2278 | | | | +--ro ospf-pseudonode
2279 | | | | +--ro ospf-router-id uint32
2280 | | | | +--ro lan-interface ospf-interface-identifier
2281 | | | +--ro bgp-router-id? inet:ipv4-address
2282 | | | +--ro member-asn? inet:as-number
2283 | | +--ro link-descriptors
2284 | | +--ro link-local-identifier? uint32
2285 | | +--ro link-remote-identifier? uint32
2286 | | +--ro ipv4-interface-address? ipv4-interface-identifier
2287 | | +--ro ipv6-interface-address? ipv6-interface-identifier
2288 | | +--ro ipv4-neighbor-address? ipv4-interface-identifier
2289 | | +--ro ipv6-neighbor-address? ipv6-interface-identifier
2290 | | +--ro multi-topology-id? topology-identifier
2292 | | +--ro advertising-node-descriptors
2293 | | | +--ro as-number? inet:as-number
2294 | | | +--ro area-id? area-identifier
2295 | | | +--ro domain-id? domain-identifier
2296 | | | +--ro (c-router-identifier)?
2297 | | | +--:(isis-node-case)
2298 | | | | +--ro isis-node
2299 | | | | +--ro iso-system-id netc:iso-system-identifier
2300 | | | +--:(isis-pseudonode-case)
2301 | | | | +--ro isis-pseudonode
2302 | | | | +--ro is-is-router-identifier
2303 | | | | | +--ro iso-system-id netc:iso-system-identifier
2304 | | | | +--ro psn uint8
2305 | | | +--:(ospf-node-case)
2306 | | | | +--ro ospf-node
2307 | | | | +--ro ospf-router-id uint32
2308 | | | +--:(ospf-pseudonode-case)
2309 | | | +--ro ospf-pseudonode
2310 | | | +--ro ospf-router-id uint32
2311 | | | +--ro lan-interface ospf-interface-identifier
2312 | | +--ro prefix-descriptors
2313 | | +--ro multi-topology-id? topology-identifier
2314 | | +--ro ospf-route-type? ospf-route-type
2315 | | +--ro ip-reachability-information? inet:ip-prefix
2317 | +--ro (address-family)?
2319 | | | +--ro ipv4-tunnel-sender-address inet:ipv4-address
2320 | | | +--ro ipv4-tunnel-endpoint-address inet:ipv4-address
2322 | | +--ro ipv6-tunnel-sender-address inet:ipv6-address
2323 | | +--ro ipv6-tunnel-endpoint-address inet:ipv6-address
2324 | +--ro tunnel-id? rsvp:tunnel-id
2325 | +--ro lsp-id? rsvp:lsp-id
2327 +--ro (link-state-attribute)?
2328 +--:(node-attributes-case)
2329 | +--ro node-attributes
2330 | +--ro topology-identifier* topology-identifier
2331 | +--ro node-flags? node-flag-bits
2332 | +--ro isis-area-id* isis-area-identifier
2333 | +--ro dynamic-hostname? string
2334 | +--ro ipv4-router-id? ipv4-router-identifier
2335 | +--ro ipv6-router-id? ipv6-router-identifier
2336 | +--ro sr-capabilities
2337 | | +--ro mpls-ipv4? boolean
2338 | | +--ro mpls-ipv6? boolean
2339 | | +--ro sr-ipv6? boolean
2340 | | +--ro range-size? uint32
2341 | | +--ro (sid-label-index)?
2342 | | +--:(local-label-case)
2343 | | | +--ro local-label? netc:mpls-label
2344 | | +--:(ipv6-address-case)
2345 | | | +--ro ipv6-address? inet:ipv6-address
2347 | | +--ro sid? uint32
2348 | +--ro sr-algorithm
2349 | +--ro algorithms* algorithm
2350 +--:(link-attributes-case)
2351 | +--ro link-attributes
2352 | +--ro local-ipv4-router-id? ipv4-router-identifier
2353 | +--ro local-ipv6-router-id? ipv6-router-identifier
2354 | +--ro remote-ipv4-router-id? ipv4-router-identifier
2355 | +--ro remote-ipv6-router-id? ipv6-router-identifier
2356 | +--ro mpls-protocol? mpls-protocol-mask
2357 | +--ro te-metric? netc:te-metric
2358 | +--ro metric? netc:metric
2359 | +--ro shared-risk-link-groups* rsvp:srlg-id
2360 | +--ro link-name? string
2361 | +--ro max-link-bandwidth? netc:bandwidth
2362 | +--ro max-reservable-bandwidth? netc:bandwidth
2363 | +--ro unreserved-bandwidth* [priority]
2364 | | +--ro priority uint8
2365 | | +--ro bandwidth? netc:bandwidth
2366 | +--ro link-protection? link-protection-type
2367 | +--ro admin-group? administrative-group
2370 | | | +--:(ospf-adj-flags-case)
2371 | | | | +--ro backup? boolean
2372 | | | | +--ro set? boolean
2373 | | | +--:(isis-adj-flags-case)
2374 | | | +--ro backup? boolean
2375 | | | +--ro set? boolean
2376 | | | +--ro address-family? boolean
2377 | | +--ro weight? weight
2378 | | +--ro (sid-label-index)?
2379 | | +--:(local-label-case)
2380 | | | +--ro local-label? netc:mpls-label
2381 | | +--:(ipv6-address-case)
2382 | | | +--ro ipv6-address? inet:ipv6-address
2384 | | +--ro sid? uint32
2385 | +--ro sr-lan-adj-ids*
2387 | | | +--:(ospf-adj-flags-case)
2388 | | | | +--ro backup? boolean
2389 | | | | +--ro set? boolean
2390 | | | +--:(isis-adj-flags-case)
2391 | | | +--ro backup? boolean
2392 | | | +--ro set? boolean
2393 | | | +--ro address-family? boolean
2394 | | +--ro weight? weight
2395 | | +--ro iso-system-id? netc:iso-system-identifier
2396 | | +--ro neighbor-id? inet:ipv4-address
2397 | | +--ro (sid-label-index)?
2398 | | +--:(local-label-case)
2399 | | | +--ro local-label? netc:mpls-label
2400 | | +--:(ipv6-address-case)
2401 | | | +--ro ipv6-address? inet:ipv6-address
2403 | | +--ro sid? uint32
2404 | +--ro peer-node-sid
2405 | | +--ro weight? weight
2406 | | +--ro (sid-label-index)?
2407 | | +--:(local-label-case)
2408 | | | +--ro local-label? netc:mpls-label
2409 | | +--:(ipv6-address-case)
2410 | | | +--ro ipv6-address? inet:ipv6-address
2412 | | +--ro sid? uint32
2413 | +--ro peer-adj-sid
2414 | | +--ro weight? weight
2415 | | +--ro (sid-label-index)?
2416 | | +--:(local-label-case)
2417 | | | +--ro local-label? netc:mpls-label
2418 | | +--:(ipv6-address-case)
2419 | | | +--ro ipv6-address? inet:ipv6-address
2421 | | +--ro sid? uint32
2422 | +--ro peer-set-sids*
2423 | +--ro weight? weight
2424 | +--ro (sid-label-index)?
2425 | +--:(local-label-case)
2426 | | +--ro local-label? netc:mpls-label
2427 | +--:(ipv6-address-case)
2428 | | +--ro ipv6-address? inet:ipv6-address
2431 +--:(prefix-attributes-case)
2432 | +--ro prefix-attributes
2434 | | x--ro up-down? bits
2435 | | +--ro is-is-up-down? boolean
2436 | | +--ro ospf-no-unicast? boolean
2437 | | +--ro ospf-local-address? boolean
2438 | | +--ro ospf-propagate-nssa? boolean
2439 | +--ro route-tags* route-tag
2440 | +--ro extended-tags* extended-route-tag
2441 | +--ro prefix-metric? netc:igp-metric
2442 | +--ro ospf-forwarding-address? inet:ip-address
2445 | | | +--:(isis-prefix-flags-case)
2446 | | | | +--ro no-php? boolean
2447 | | | | +--ro explicit-null? boolean
2448 | | | | +--ro readvertisement? boolean
2449 | | | | +--ro node-sid? boolean
2450 | | | +--:(ospf-prefix-flags-case)
2451 | | | +--ro no-php? boolean
2452 | | | +--ro explicit-null? boolean
2453 | | | +--ro mapping-server? boolean
2454 | | +--ro algorithm? algorithm
2455 | | +--ro (sid-label-index)?
2456 | | +--:(local-label-case)
2457 | | | +--ro local-label? netc:mpls-label
2458 | | +--:(ipv6-address-case)
2459 | | | +--ro ipv6-address? inet:ipv6-address
2461 | | +--ro sid? uint32
2462 | +--ro ipv6-sr-prefix
2463 | | +--ro algorithm? algorithm
2465 | | +--ro inter-area? boolean
2466 | | +--ro range-size? uint16
2468 | | +--ro (range-sub-tlv)?
2469 | | +--:(binding-sid-tlv-case)
2470 | | | +--ro weight? weight
2471 | | | +--ro (flags)?
2472 | | | | +--:(isis-binding-flags-case)
2473 | | | | | +--ro address-family? boolean
2474 | | | | | +--ro mirror-context? boolean
2475 | | | | | +--ro spread-tlv? boolean
2476 | | | | | +--ro leaked-from-level-2? boolean
2477 | | | | | +--ro attached-flag? boolean
2478 | | | | +--:(ospf-binding-flags-case)
2479 | | | | +--ro mirroring? boolean
2480 | | | +--ro binding-sub-tlvs*
2481 | | | +--ro (binding-sub-tlv)?
2482 | | | +--:(prefix-sid-case)
2483 | | | | +--ro (flags)?
2484 | | | | | +--:(isis-prefix-flags-case)
2485 | | | | | | +--ro no-php? boolean
2486 | | | | | | +--ro explicit-null? boolean
2487 | | | | | | +--ro readvertisement? boolean
2488 | | | | | | +--ro node-sid? boolean
2489 | | | | | +--:(ospf-prefix-flags-case)
2490 | | | | | +--ro no-php? boolean
2491 | | | | | +--ro explicit-null? boolean
2492 | | | | | +--ro mapping-server? boolean
2493 | | | | +--ro algorithm? algorithm
2494 | | | | +--ro (sid-label-index)?
2495 | | | | +--:(local-label-case)
2496 | | | | | +--ro local-label? netc:mpls-label
2497 | | | | +--:(ipv6-address-case)
2498 | | | | | +--ro ipv6-address? inet:ipv6-address
2499 | | | | +--:(sid-case)
2500 | | | | +--ro sid? uint32
2501 | | | +--:(ipv6-prefix-sid-case)
2502 | | | | +--ro algorithm? algorithm
2503 | | | +--:(sid-label-case)
2504 | | | | +--ro (sid-label-index)?
2505 | | | | +--:(local-label-case)
2506 | | | | | +--ro local-label? netc:mpls-label
2507 | | | | +--:(ipv6-address-case)
2508 | | | | | +--ro ipv6-address? inet:ipv6-address
2509 | | | | +--:(sid-case)
2510 | | | | +--ro sid? uint32
2511 | | | +--:(ero-metric-case)
2512 | | | | +--ro ero-metric? netc:te-metric
2513 | | | +--:(ipv4-ero-case)
2514 | | | | +--ro loose? boolean
2515 | | | | +--ro address inet:ipv4-address
2516 | | | +--:(ipv6-ero-case)
2517 | | | | +--ro loose? boolean
2518 | | | | +--ro address inet:ipv6-address
2519 | | | +--:(unnumbered-interface-id-ero-case)
2520 | | | | +--ro loose? boolean
2521 | | | | +--ro router-id? uint32
2522 | | | | +--ro interface-id? uint32
2523 | | | +--:(ipv4-ero-backup-case)
2524 | | | | +--ro loose? boolean
2525 | | | | +--ro address inet:ipv4-address
2526 | | | +--:(ipv6-ero-backup-case)
2527 | | | | +--ro loose? boolean
2528 | | | | +--ro address inet:ipv6-address
2529 | | | +--:(unnumbered-interface-id-backup-ero-case)
2530 | | | +--ro loose? boolean
2531 | | | +--ro router-id? uint32
2532 | | | +--ro interface-id? uint32
2533 | | +--:(prefix-sid-tlv-case)
2534 | | | +--ro (flags)?
2535 | | | | +--:(isis-prefix-flags-case)
2536 | | | | | +--ro no-php? boolean
2537 | | | | | +--ro explicit-null? boolean
2538 | | | | | +--ro readvertisement? boolean
2539 | | | | | +--ro node-sid? boolean
2540 | | | | +--:(ospf-prefix-flags-case)
2541 | | | | +--ro no-php? boolean
2542 | | | | +--ro explicit-null? boolean
2543 | | | | +--ro mapping-server? boolean
2544 | | | +--ro algorithm? algorithm
2545 | | | +--ro (sid-label-index)?
2546 | | | +--:(local-label-case)
2547 | | | | +--ro local-label? netc:mpls-label
2548 | | | +--:(ipv6-address-case)
2549 | | | | +--ro ipv6-address? inet:ipv6-address
2550 | | | +--:(sid-case)
2551 | | | +--ro sid? uint32
2552 | | +--:(ipv6-prefix-sid-tlv-case)
2553 | | | +--ro algorithm? algorithm
2554 | | +--:(sid-label-tlv-case)
2555 | | +--ro (sid-label-index)?
2556 | | +--:(local-label-case)
2557 | | | +--ro local-label? netc:mpls-label
2558 | | +--:(ipv6-address-case)
2559 | | | +--ro ipv6-address? inet:ipv6-address
2561 | | +--ro sid? uint32
2562 | +--ro sr-binding-sid-labels*
2563 | +--ro weight? weight
2565 | | +--:(isis-binding-flags-case)
2566 | | | +--ro address-family? boolean
2567 | | | +--ro mirror-context? boolean
2568 | | | +--ro spread-tlv? boolean
2569 | | | +--ro leaked-from-level-2? boolean
2570 | | | +--ro attached-flag? boolean
2571 | | +--:(ospf-binding-flags-case)
2572 | | +--ro mirroring? boolean
2573 | +--ro binding-sub-tlvs*
2574 | +--ro (binding-sub-tlv)?
2575 | +--:(prefix-sid-case)
2577 | | | +--:(isis-prefix-flags-case)
2578 | | | | +--ro no-php? boolean
2579 | | | | +--ro explicit-null? boolean
2580 | | | | +--ro readvertisement? boolean
2581 | | | | +--ro node-sid? boolean
2582 | | | +--:(ospf-prefix-flags-case)
2583 | | | +--ro no-php? boolean
2584 | | | +--ro explicit-null? boolean
2585 | | | +--ro mapping-server? boolean
2586 | | +--ro algorithm? algorithm
2587 | | +--ro (sid-label-index)?
2588 | | +--:(local-label-case)
2589 | | | +--ro local-label? netc:mpls-label
2590 | | +--:(ipv6-address-case)
2591 | | | +--ro ipv6-address? inet:ipv6-address
2593 | | +--ro sid? uint32
2594 | +--:(ipv6-prefix-sid-case)
2595 | | +--ro algorithm? algorithm
2596 | +--:(sid-label-case)
2597 | | +--ro (sid-label-index)?
2598 | | +--:(local-label-case)
2599 | | | +--ro local-label? netc:mpls-label
2600 | | +--:(ipv6-address-case)
2601 | | | +--ro ipv6-address? inet:ipv6-address
2603 | | +--ro sid? uint32
2604 | +--:(ero-metric-case)
2605 | | +--ro ero-metric? netc:te-metric
2606 | +--:(ipv4-ero-case)
2607 | | +--ro loose? boolean
2608 | | +--ro address inet:ipv4-address
2609 | +--:(ipv6-ero-case)
2610 | | +--ro loose? boolean
2611 | | +--ro address inet:ipv6-address
2612 | +--:(unnumbered-interface-id-ero-case)
2613 | | +--ro loose? boolean
2614 | | +--ro router-id? uint32
2615 | | +--ro interface-id? uint32
2616 | +--:(ipv4-ero-backup-case)
2617 | | +--ro loose? boolean
2618 | | +--ro address inet:ipv4-address
2619 | +--:(ipv6-ero-backup-case)
2620 | | +--ro loose? boolean
2621 | | +--ro address inet:ipv6-address
2622 | +--:(unnumbered-interface-id-backup-ero-case)
2623 | +--ro loose? boolean
2624 | +--ro router-id? uint32
2625 | +--ro interface-id? uint32
2626 x--:(te-lsp-attributes-case)
2627 +--ro te-lsp-attributes
2632 The Link-State table in a instance of the speaker's Loc-RIB can be verified via REST:
2634 **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``
2642 <linkstate-routes xmlns="urn:opendaylight:params:xml:ns:yang:bgp-linkstate">
2646 .. note:: Link-State routes mapping to topology links/nodes/prefixes is supported by BGP Topology Provider.
2650 * `North-Bound Distribution of Link-State and Traffic Engineering (TE) Information Using BGP <https://tools.ietf.org/html/rfc7752>`_
2651 * `BGP Link-State extensions for Segment Routing <https://tools.ietf.org/html/draft-gredler-idr-bgp-ls-segment-routing-ext-03>`_
2652 * `Segment Routing BGP Egress Peer Engineering BGP-LS Extensions <https://tools.ietf.org/html/draft-ietf-idr-bgpls-segment-routing-epe-05>`_
2653 * `BGP Link-State Information Distribution Implementation Report <https://tools.ietf.org/html/draft-ietf-idr-ls-distribution-impl-04>`_
2655 Flow Specification Family
2656 -------------------------
2657 The BGP Flow Specification (BGP-FS) Multiprotocol extension can be used to distribute traffic flow specifications.
2658 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).
2660 .. contents:: Contents
2666 This section shows a way to enable BGP-FS family in BGP speaker and peer configuration.
2670 To enable BGP-FS support in BGP plugin, first configure BGP speaker instance:
2672 **URL:** ``/restconf/config/openconfig-network-instance:network-instances/network-instance/global-bgp/openconfig-network-instance:protocols``
2674 **Method:** ``POST``
2676 **Content-Type:** ``application/xml``
2682 <protocol xmlns="http://openconfig.net/yang/network-instance">
2683 <name>bgp-example</name>
2684 <identifier xmlns:x="http://openconfig.net/yang/policy-types">x:BGP</identifier>
2685 <bgp xmlns="urn:opendaylight:params:xml:ns:yang:bgp:openconfig-extensions">
2688 <router-id>192.0.2.2</router-id>
2693 <afi-safi-name>IPV4-FLOW</afi-safi-name>
2696 <afi-safi-name>IPV6-FLOW</afi-safi-name>
2699 <afi-safi-name>IPV4-L3VPN-FLOW</afi-safi-name>
2702 <afi-safi-name>IPV6-L3VPN-FLOW</afi-safi-name>
2711 Here is an example for BGP peer configuration with enabled BGP-FS family.
2713 **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``
2715 **Method:** ``POST``
2717 **Content-Type:** ``application/xml``
2723 <neighbor xmlns="urn:opendaylight:params:xml:ns:yang:bgp:openconfig-extensions">
2724 <neighbor-address>192.0.2.1</neighbor-address>
2727 <afi-safi-name>IPV4-FLOW</afi-safi-name>
2730 <afi-safi-name>IPV6-FLOW</afi-safi-name>
2733 <afi-safi-name>IPV4-L3VPN-FLOW</afi-safi-name>
2736 <afi-safi-name>IPV6-L3VPN-FLOW</afi-safi-name>
2741 Flow Specification API
2742 ^^^^^^^^^^^^^^^^^^^^^^
2743 Following trees illustrate the BGP Flow Specification routes structure.
2745 IPv4 Flow Specification Route
2746 '''''''''''''''''''''''''''''
2747 .. code-block:: console
2749 :(flowspec-routes-case)
2750 +--ro flowspec-routes
2751 +--ro flowspec-route* [route-key path-id]
2752 +--ro route-key string
2754 | +--ro (flowspec-type)?
2757 | | +--ro op? numeric-operand
2758 | | +--ro value? uint16
2759 | +--:(destination-port-case)
2760 | | +--ro destination-ports*
2761 | | +--ro op? numeric-operand
2762 | | +--ro value? uint16
2763 | +--:(source-port-case)
2764 | | +--ro source-ports*
2765 | | +--ro op? numeric-operand
2766 | | +--ro value? uint16
2767 | +--:(icmp-type-case)
2769 | | +--ro op? numeric-operand
2770 | | +--ro value? uint8
2771 | +--:(icmp-code-case)
2773 | | +--ro op? numeric-operand
2774 | | +--ro value? uint8
2775 | +--:(tcp-flags-case)
2776 | | +--ro tcp-flags*
2777 | | +--ro op? bitmask-operand
2778 | | +--ro value? uint16
2779 | +--:(packet-length-case)
2780 | | +--ro packet-lengths*
2781 | | +--ro op? numeric-operand
2782 | | +--ro value? uint16
2785 | | +--ro op? numeric-operand
2786 | | +--ro value? dscp
2787 | +--:(fragment-case)
2788 | | +--ro fragments*
2789 | | +--ro op? bitmask-operand
2790 | | +--ro value? fragment
2791 | +--:(destination-prefix-case)
2792 | | +--ro destination-prefix? inet:ipv4-prefix
2793 | +--:(source-prefix-case)
2794 | | +--ro source-prefix? inet:ipv4-prefix
2795 | +--:(protocol-ip-case)
2796 | +--ro protocol-ips*
2797 | +--ro op? numeric-operand
2798 | +--ro value? uint8
2799 +--ro path-id path-id
2801 +--ro extended-communities*
2802 +--ro transitive? boolean
2803 +--ro (extended-community)?
2804 +--:(traffic-rate-extended-community-case)
2805 | +--ro traffic-rate-extended-community
2806 | +--ro informative-as? bgp-t:short-as-number
2807 | +--ro local-administrator? netc:bandwidth
2808 +--:(traffic-action-extended-community-case)
2809 | +--ro traffic-action-extended-community
2810 | +--ro sample? boolean
2811 | +--ro terminal-action? boolean
2812 +--:(redirect-extended-community-case)
2813 | +--ro redirect-extended-community
2814 | +--ro global-administrator? bgp-t:short-as-number
2815 | +--ro local-administrator? binary
2816 +--:(traffic-marking-extended-community-case)
2817 | +--ro traffic-marking-extended-community
2818 | +--ro global-administrator? dscp
2819 +--:(redirect-ipv4-extended-community-case)
2820 | +--ro redirect-ipv4
2821 | +--ro global-administrator? inet:ipv4-address
2822 | +--ro local-administrator? uint16
2823 +--:(redirect-as4-extended-community-case)
2824 | +--ro redirect-as4
2825 | +--ro global-administrator? inet:as-number
2826 | +--ro local-administrator? uint16
2827 +--:(redirect-ip-nh-extended-community-case)
2828 +--ro redirect-ip-nh-extended-community
2829 +--ro next-hop-address? inet:ip-address
2833 IPv6 Flow Specification Route
2834 '''''''''''''''''''''''''''''
2835 .. code-block:: console
2837 :(flowspec-ipv6-routes-case)
2838 +--ro flowspec-ipv6-routes
2839 +--ro flowspec-route* [route-key path-id]
2841 | +--ro (flowspec-type)?
2844 | | +--ro op? numeric-operand
2845 | | +--ro value? uint16
2846 | +--:(destination-port-case)
2847 | | +--ro destination-ports*
2848 | | +--ro op? numeric-operand
2849 | | +--ro value? uint16
2850 | +--:(source-port-case)
2851 | | +--ro source-ports*
2852 | | +--ro op? numeric-operand
2853 | | +--ro value? uint16
2854 | +--:(icmp-type-case)
2856 | | +--ro op? numeric-operand
2857 | | +--ro value? uint8
2858 | +--:(icmp-code-case)
2860 | | +--ro op? numeric-operand
2861 | | +--ro value? uint8
2862 | +--:(tcp-flags-case)
2863 | | +--ro tcp-flags*
2864 | | +--ro op? bitmask-operand
2865 | | +--ro value? uint16
2866 | +--:(packet-length-case)
2867 | | +--ro packet-lengths*
2868 | | +--ro op? numeric-operand
2869 | | +--ro value? uint16
2872 | | +--ro op? numeric-operand
2873 | | +--ro value? dscp
2874 | +--:(fragment-case)
2875 | | +--ro fragments*
2876 | | +--ro op? bitmask-operand
2877 | | +--ro value? fragment
2878 | +--:(destination-ipv6-prefix-case)
2879 | | +--ro destination-prefix? inet:ipv6-prefix
2880 | +--:(source-ipv6-prefix-case)
2881 | | +--ro source-prefix? inet:ipv6-prefix
2882 | +--:(next-header-case)
2883 | | +--ro next-headers*
2884 | | +--ro op? numeric-operand
2885 | | +--ro value? uint8
2886 | +--:(flow-label-case)
2888 | +--ro op? numeric-operand
2889 | +--ro value? uint32
2890 +--ro path-id path-id
2892 +--ro extended-communities*
2893 +--ro transitive? boolean
2894 +--ro (extended-community)?
2895 +--:(traffic-rate-extended-community-case)
2896 | +--ro traffic-rate-extended-community
2897 | +--ro informative-as? bgp-t:short-as-number
2898 | +--ro local-administrator? netc:bandwidth
2899 +--:(traffic-action-extended-community-case)
2900 | +--ro traffic-action-extended-community
2901 | +--ro sample? boolean
2902 | +--ro terminal-action? boolean
2903 +--:(redirect-extended-community-case)
2904 | +--ro redirect-extended-community
2905 | +--ro global-administrator? bgp-t:short-as-number
2906 | +--ro local-administrator? binary
2907 +--:(traffic-marking-extended-community-case)
2908 | +--ro traffic-marking-extended-community
2909 | +--ro global-administrator? dscp
2910 +--:(redirect-ipv6-extended-community-case)
2911 | +--ro redirect-ipv6
2912 | +--ro global-administrator? inet:ipv6-address
2913 | +--ro local-administrator? uint16
2914 +--:(redirect-as4-extended-community-case)
2915 | +--ro redirect-as4
2916 | +--ro global-administrator? inet:as-number
2917 | +--ro local-administrator? uint16
2918 +--:(redirect-ip-nh-extended-community-case)
2919 +--ro redirect-ip-nh-extended-community
2920 +--ro next-hop-address? inet:ip-address
2925 The flowspec route represents rules and an action, defined as an extended community.
2927 IPv4 Flow Specification
2928 '''''''''''''''''''''''
2929 The IPv4 Flowspec table in an instance of the speaker's Loc-RIB can be verified via REST:
2931 **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``
2939 <flowspec-routes xmlns="urn:opendaylight:params:xml:ns:yang:bgp-flowspec">
2941 <path-id>0</path-id>
2942 <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>
2951 <extended-communities>
2952 <transitive>true</transitive>
2953 <redirect-extended-community>
2954 <local-administrator>AgMWLg==</local-administrator>
2955 <global-administrator>258</global-administrator>
2956 </redirect-extended-community>
2957 </extended-communities>
2960 <destination-prefix>192.168.0.1/32</destination-prefix>
2963 <source-prefix>10.0.0.2/32</source-prefix>
2971 <op>equals end-of-list</op>
2981 <op>equals end-of-list</op>
2987 <op>greater-than</op>
2989 </destination-ports>
2991 <op>less-than and-bit</op>
2993 </destination-ports>
2995 <op>equals end-of-list</op>
2997 </destination-ports>
3001 <op>end-of-list greater-than</op>
3008 IPv6 Flows Specification
3009 ''''''''''''''''''''''''
3010 The IPv6 Flowspec table in an instance of the speaker's Loc-RIB can be verified via REST:
3012 **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``
3020 <flowspec-ipv6-routes xmlns="urn:opendaylight:params:xml:ns:yang:bgp-flowspec">
3022 <path-id>0</path-id>
3023 <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>
3032 <extended-communities>
3033 <transitive>true</transitive>
3034 <traffic-rate-extended-community>
3035 <informative-as>0</informative-as>
3036 <local-administrator>AAAAAA==</local-administrator>
3037 </traffic-rate-extended-community>
3038 </extended-communities>
3041 <destination-prefix>2001:db8:31::/64</destination-prefix>
3044 <source-prefix>2001:db8:30::/64</source-prefix>
3048 <op>equals end-of-list</op>
3054 <op>equals end-of-list</op>
3060 <op>equals end-of-list</op>
3065 </flowspec-ipv6-routes>
3067 IPv4 L3VPN Flows Specification
3068 ''''''''''''''''''''''''''''''
3069 The IPv4 L3VPN Flowspec table in an instance of the speaker's Loc-RIB can be verified via REST:
3071 **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``
3079 <flowspec-l3vpn-ipv4-routes xmlns="urn:opendaylight:params:xml:ns:yang:bgp-flowspec">
3080 <flowspec-l3vpn-route>
3081 <path-id>0</path-id>
3082 <route-key>[l3vpn with route-distinguisher 172.16.0.44:101] all packets from 10.0.0.3/32</route-key>
3088 <global>5.6.7.8</global>
3094 <extended-communities>
3095 <transitive>true</transitive>
3096 <redirect-ip-nh-extended-community>
3098 <next-hop-address>0.0.0.0</next-hop-address>
3099 </redirect-ip-nh-extended-community>
3100 </extended-communities>
3102 <route-distinguisher>172.16.0.44:101</route-distinguisher>
3104 <source-prefix>10.0.0.3/32</source-prefix>
3106 </flowspec-l3vpn-route>
3107 </flowspec-l3vpn-ipv4-routes>
3111 IPv4 Flow Specification
3112 '''''''''''''''''''''''
3113 This examples show how to originate and remove IPv4 fowspec route via programmable RIB.
3114 Make sure the *Application Peer* is configured first.
3116 **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``
3118 **Method:** ``POST``
3120 **Content-Type:** ``application/xml``
3126 <flowspec-route xmlns="urn:opendaylight:params:xml:ns:yang:bgp-flowspec">
3127 <route-key>flow1</route-key>
3128 <path-id>0</path-id>
3130 <destination-prefix>192.168.0.1/32</destination-prefix>
3133 <source-prefix>10.0.0.1/32</source-prefix>
3137 <op>equals end-of-list</op>
3143 <op>equals end-of-list</op>
3149 <op>greater-than</op>
3151 </destination-ports>
3153 <op>and-bit less-than end-of-list</op>
3155 </destination-ports>
3159 <op>greater-than end-of-list</op>
3165 <op>equals end-of-list</op>
3171 <op>equals end-of-list</op>
3177 <op>match end-of-list</op>
3183 <op>greater-than</op>
3187 <op>and-bit less-than end-of-list</op>
3193 <op>equals end-of-list</op>
3199 <op>match end-of-list</op>
3200 <value>first</value>
3211 <extended-communities>
3213 </extended-communities>
3219 **Extended Communities**
3226 <extended-communities>
3227 <transitive>true</transitive>
3228 <traffic-rate-extended-community>
3229 <informative-as>123</informative-as>
3230 <local-administrator>AAAAAA==</local-administrator>
3231 </traffic-rate-extended-community>
3232 </extended-communities>
3234 @line 5: A rate in bytes per second, *AAAAAA==* (0) means traffic discard.
3236 * **Traffic Action**
3239 <extended-communities>
3240 <transitive>true</transitive>
3241 <traffic-action-extended-community>
3242 <sample>true</sample>
3243 <terminal-action>false</terminal-action>
3244 </traffic-action-extended-community>
3245 </extended-communities>
3248 * **Redirect to VRF AS 2byte format**
3251 <extended-communities>
3252 <transitive>true</transitive>
3253 <redirect-extended-community>
3254 <global-administrator>123</global-administrator>
3255 <local-administrator>AAAAew==</local-administrator>
3256 </redirect-extended-community>
3257 </extended-communities>
3259 * **Redirect to VRF IPv4 format**
3262 <extended-communities>
3263 <transitive>true</transitive>
3265 <global-administrator>192.168.0.1</global-administrator>
3266 <local-administrator>12345</local-administrator>
3268 </extended-communities>
3270 * **Redirect to VRF AS 4byte format**
3273 <extended-communities>
3274 <transitive>true</transitive>
3276 <global-administrator>64495</global-administrator>
3277 <local-administrator>12345</local-administrator>
3279 </extended-communities>
3281 * **Redirect to IP**
3284 <extended-communities>
3285 <transitive>true</transitive>
3286 <redirect-ip-nh-extended-community>
3288 </redirect-ip-nh-extended-community>
3289 </extended-communities>
3291 * **Traffic Marking**
3294 <extended-communities>
3295 <transitive>true</transitive>
3296 <traffic-marking-extended-community>
3297 <global-administrator>20</global-administrator>
3298 </traffic-marking-extended-community>
3299 </extended-communities>
3303 To remove the route added above, following request can be used:
3305 **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``
3307 **Method:** ``DELETE``
3309 IPv4 L3VPN Flow Specification
3310 '''''''''''''''''''''''''''''
3311 This examples show how to originate and remove IPv4 L3VPN fowspec route via programmable RIB.
3313 **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``
3315 **Method:** ``POST``
3317 **Content-Type:** ``application/xml``
3323 <flowspec-l3vpn-route xmlns="urn:opendaylight:params:xml:ns:yang:bgp-flowspec">
3324 <path-id>0</path-id>
3325 <route-key>flow-l3vpn</route-key>
3326 <route-distinguisher>172.16.0.44:101</route-distinguisher>
3328 <source-prefix>10.0.0.3/32</source-prefix>
3338 <extended-communities>
3339 <transitive>true</transitive>
3341 <global-administrator>172.16.0.44</global-administrator>
3342 <local-administrator>102</local-administrator>
3344 </extended-communities>
3346 </flowspec-l3vpn-route>
3350 To remove the route added above, following request can be used:
3352 **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``
3354 **Method:** ``DELETE``
3356 IPv6 Flow Specification
3357 '''''''''''''''''''''''
3358 This examples show how to originate and remove IPv6 fowspec route via programmable RIB.
3360 **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``
3362 **Method:** ``POST``
3364 **Content-Type:** ``application/xml``
3370 <flowspec-route xmlns="urn:opendaylight:params:xml:ns:yang:bgp-flowspec">
3371 <route-key>flow-v6</route-key>
3372 <path-id>0</path-id>
3374 <destination-prefix>2001:db8:30::3/128</destination-prefix>
3377 <source-prefix>2001:db8:31::3/128</source-prefix>
3381 <op>equals end-of-list</op>
3386 <extended-communities>
3387 <transitive>true</transitive>
3389 <global-administrator>2001:db8:1::6</global-administrator>
3390 <local-administrator>12345</local-administrator>
3392 </extended-communities>
3405 To remove the route added above, following request can be used:
3407 **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``
3409 **Method:** ``DELETE``
3413 * `Dissemination of Flow Specification Rules <https://tools.ietf.org/html/rfc5575>`_
3414 * `Dissemination of Flow Specification Rules for IPv6 <https://tools.ietf.org/html/draft-ietf-idr-flow-spec-v6-07>`_
3415 * `BGP Flow-Spec Extended Community for Traffic Redirect to IP Next Hop <https://tools.ietf.org/html/draft-ietf-idr-flowspec-redirect-ip-00>`_
3416 * `Clarification of the Flowspec Redirect Extended Community <https://tools.ietf.org/html/rfc7674>`_
3417 * `Revised Validation Procedure for BGP Flow Specifications <https://tools.ietf.org/html/draft-ietf-idr-bgp-flowspec-oid-03>`_
3421 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.
3422 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.
3423 In addition to MPLS, IP tunnelling encapsulation techniques like VXLAN, NVGRE, MPLSoGRE and others can be used for packet transportation.
3424 Also, Provider Backbone Bridging (PBB) can be combined with EVPN in order to reduce a number of MAC Advertisement routes.
3426 .. contents:: Contents
3432 This section shows a way to enable EVPN family in BGP speaker and peer configuration.
3436 To enable EVPN support in BGP plugin, first configure BGP speaker instance:
3438 **URL:** ``/restconf/config/openconfig-network-instance:network-instances/network-instance/global-bgp/openconfig-network-instance:protocols``
3440 **Method:** ``POST``
3442 **Content-Type:** ``application/xml``
3448 <protocol xmlns="http://openconfig.net/yang/network-instance">
3449 <name>bgp-example</name>
3450 <identifier xmlns:x="http://openconfig.net/yang/policy-types">x:BGP</identifier>
3451 <bgp xmlns="urn:opendaylight:params:xml:ns:yang:bgp:openconfig-extensions">
3454 <router-id>192.0.2.2</router-id>
3459 <afi-safi-name xmlns:x="http://openconfig.net/yang/bgp-types">x:L2VPN-EVPN</afi-safi-name>
3468 Here is an example for BGP peer configuration with enabled EVPN family.
3470 **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``
3472 **Method:** ``POST``
3474 **Content-Type:** ``application/xml``
3480 <neighbor xmlns="urn:opendaylight:params:xml:ns:yang:bgp:openconfig-extensions">
3481 <neighbor-address>192.0.2.1</neighbor-address>
3484 <afi-safi-name xmlns:x="http://openconfig.net/yang/bgp-types">x:L2VPN-EVPN</afi-safi-name>
3491 Following tree illustrate the BGP EVPN route structure.
3493 .. code-block:: console
3497 +--ro evpn-route* [route-key]
3498 +--ro route-key string
3500 | +--:(ethernet-a-d-route-case)
3501 | | +--ro ethernet-a-d-route
3503 | | | +--:(arbitrary-case)
3504 | | | | +--ro arbitrary
3505 | | | | +--ro arbitrary binary
3506 | | | +--:(lacp-auto-generated-case)
3507 | | | | +--ro lacp-auto-generated
3508 | | | | +--ro ce-lacp-mac-address yang:mac-address
3509 | | | | +--ro ce-lacp-port-key uint16
3510 | | | +--:(lan-auto-generated-case)
3511 | | | | +--ro lan-auto-generated
3512 | | | | +--ro root-bridge-mac-address yang:mac-address
3513 | | | | +--ro root-bridge-priority uint16
3514 | | | +--:(mac-auto-generated-case)
3515 | | | | +--ro mac-auto-generated
3516 | | | | +--ro system-mac-address yang:mac-address
3517 | | | | +--ro local-discriminator uint24
3518 | | | +--:(router-id-generated-case)
3519 | | | | +--ro router-id-generated
3520 | | | | +--ro router-id inet:ipv4-address
3521 | | | | +--ro local-discriminator uint32
3522 | | | +--:(as-generated-case)
3523 | | | +--ro as-generated
3524 | | | +--ro as inet:as-number
3525 | | | +--ro local-discriminator uint32
3526 | | +--ro ethernet-tag-id
3527 | | | +--ro vlan-id uint32
3528 | | +--ro mpls-label netc:mpls-label
3529 | +--:(mac-ip-adv-route-case)
3530 | | +--ro mac-ip-adv-route
3532 | | | +--:(arbitrary-case)
3533 | | | | +--ro arbitrary
3534 | | | | +--ro arbitrary binary
3535 | | | +--:(lacp-auto-generated-case)
3536 | | | | +--ro lacp-auto-generated
3537 | | | | +--ro ce-lacp-mac-address yang:mac-address
3538 | | | | +--ro ce-lacp-port-key uint16
3539 | | | +--:(lan-auto-generated-case)
3540 | | | | +--ro lan-auto-generated
3541 | | | | +--ro root-bridge-mac-address yang:mac-address
3542 | | | | +--ro root-bridge-priority uint16
3543 | | | +--:(mac-auto-generated-case)
3544 | | | | +--ro mac-auto-generated
3545 | | | | +--ro system-mac-address yang:mac-address
3546 | | | | +--ro local-discriminator uint24
3547 | | | +--:(router-id-generated-case)
3548 | | | | +--ro router-id-generated
3549 | | | | +--ro router-id inet:ipv4-address
3550 | | | | +--ro local-discriminator uint32
3551 | | | +--:(as-generated-case)
3552 | | | +--ro as-generated
3553 | | | +--ro as inet:as-number
3554 | | | +--ro local-discriminator uint32
3555 | | +--ro ethernet-tag-id
3556 | | | +--ro vlan-id uint32
3557 | | +--ro mac-address yang:mac-address
3558 | | +--ro ip-address? inet:ip-address
3559 | | +--ro mpls-label1 netc:mpls-label
3560 | | +--ro mpls-label2? netc:mpls-label
3561 | +--:(inc-multi-ethernet-tag-res-case)
3562 | | +--ro inc-multi-ethernet-tag-res
3563 | | +--ro ethernet-tag-id
3564 | | | +--ro vlan-id uint32
3565 | | +--ro orig-route-ip? inet:ip-address
3566 | +--:(es-route-case)
3569 | | +--:(arbitrary-case)
3570 | | | +--ro arbitrary
3571 | | | +--ro arbitrary binary
3572 | | +--:(lacp-auto-generated-case)
3573 | | | +--ro lacp-auto-generated
3574 | | | +--ro ce-lacp-mac-address yang:mac-address
3575 | | | +--ro ce-lacp-port-key uint16
3576 | | +--:(lan-auto-generated-case)
3577 | | | +--ro lan-auto-generated
3578 | | | +--ro root-bridge-mac-address yang:mac-address
3579 | | | +--ro root-bridge-priority uint16
3580 | | +--:(mac-auto-generated-case)
3581 | | | +--ro mac-auto-generated
3582 | | | +--ro system-mac-address yang:mac-address
3583 | | | +--ro local-discriminator uint24
3584 | | +--:(router-id-generated-case)
3585 | | | +--ro router-id-generated
3586 | | | +--ro router-id inet:ipv4-address
3587 | | | +--ro local-discriminator uint32
3588 | | +--:(as-generated-case)
3589 | | +--ro as-generated
3590 | | +--ro as inet:as-number
3591 | | +--ro local-discriminator uint32
3592 | +--ro orig-route-ip inet:ip-address
3593 +--ro route-distinguisher bgp-t:route-distinguisher
3595 +--ro extended-communities*
3596 | +--ro transitive? boolean
3597 | +--ro (extended-community)?
3598 | +--:(encapsulation-case)
3599 | | +--ro encapsulation-extended-community
3600 | | +--ro tunnel-type encapsulation-tunnel-type
3601 | +--:(esi-label-extended-community-case)
3602 | | +--ro esi-label-extended-community
3603 | | +--ro single-active-mode? boolean
3604 | | +--ro esi-label netc:mpls-label
3605 | +--:(es-import-route-extended-community-case)
3606 | | +--ro es-import-route-extended-community
3607 | | +--ro es-import yang:mac-address
3608 | +--:(mac-mobility-extended-community-case)
3609 | | +--ro mac-mobility-extended-community
3610 | | +--ro static? boolean
3611 | | +--ro seq-number uint32
3612 | +--:(default-gateway-extended-community-case)
3613 | | +--ro default-gateway-extended-community!
3614 | +--:(layer-2-attributes-extended-community-case)
3615 | +--ro layer-2-attributes-extended-community
3616 | +--ro primary-pe? boolean
3617 | +--ro backup-pe? boolean
3618 | +--ro control-word? boolean
3619 | +--ro l2-mtu uint16
3621 +--ro leaf-information-required boolean
3622 +--ro mpls-label? netc:mpls-label
3623 +--ro (tunnel-identifier)?
3624 +--:(rsvp-te-p2mp-lsp)
3625 | +--ro rsvp-te-p2mp-lps
3626 | +--ro p2mp-id uint32
3627 | +--ro tunnel-id uint16
3628 | +--ro extended-tunnel-id inet:ip-address
3630 | +--ro mldp-p2mp-lsp
3631 | +--ro address-family identityref
3632 | +--ro root-node-address inet:ip-address
3633 | +--ro opaque-value*
3634 | +--ro opaque-type uint8
3635 | +--ro opaque-extended-type? uint16
3636 | +--ro opaque yang:hex-string
3638 | +--ro pim-ssm-tree
3639 | +--ro p-address inet:ip-address
3640 | +--ro p-multicast-group inet:ip-address
3643 | +--ro p-address inet:ip-address
3644 | +--ro p-multicast-group inet:ip-address
3645 +--:(bidir-pim-tree)
3646 | +--ro bidir-pim-tree
3647 | +--ro p-address inet:ip-address
3648 | +--ro p-multicast-group inet:ip-address
3649 +--:(ingress-replication)
3650 | +--ro ingress-replication
3651 | +--ro receiving-endpoint-address? inet:ip-address
3652 +--:(mldp-mp2mp-lsp)
3653 +--ro mldp-mp2mp-lsp
3654 +--ro opaque-type uint8
3655 +--ro opaque-extended-type? uint16
3661 The L2VPN EVPN table in an instance of the speaker's Loc-RIB can be verified via REST:
3663 **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``
3671 <evpn-routes xmlns="urn:opendaylight:params:xml:ns:yang:bgp-evpn">
3673 <route-key>AxEAAcCoZAED6AAAAQAgwKhkAQ==</route-key>
3674 <route-distinguisher>192.168.100.1:1000</route-distinguisher>
3675 <inc-multi-ethernet-tag-res>
3677 <vlan-id>256</vlan-id>
3679 <orig-route-ip>192.168.100.1</orig-route-ip>
3680 </inc-multi-ethernet-tag-res>
3683 <global>172.23.29.104</global>
3689 <extended-communities>
3690 <extended-communities>
3691 <transitive>true</transitive>
3692 <route-target-extended-community>
3693 <global-administrator>65504</global-administrator>
3694 <local-administrator>AAAD6A==</local-administrator>
3695 </route-target-extended-community>
3696 </extended-communities>
3697 </extended-communities>
3699 <leaf-information-required>true</leaf-information-required>
3700 <mpls-label>20024</mpls-label>
3701 <ingress-replication>
3702 <receiving-endpoint-address>192.168.100.1</receiving-endpoint-address>
3703 </ingress-replication>
3711 This examples show how to originate and remove EVPN routes via programmable RIB.
3712 There are four different types of EVPN routes, and several extended communities.
3713 Routes can be used for variety of use-cases supported by BGP/MPLS EVPN, PBB EVPN and NVO EVPN.
3714 Make sure the *Application Peer* is configured first.
3716 **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``
3718 **Method:** ``POST``
3720 **Content-Type:** ``application/xml``
3726 :emphasize-lines: 3,4,14
3728 <evpn-route xmlns="urn:opendaylight:params:xml:ns:yang:bgp-evpn">
3729 <route-key>evpn</route-key>
3730 <route-distinguisher>172.12.123.3:200</route-distinguisher>
3734 <global>199.20.166.41</global>
3740 <extended-communities>
3742 </extended-communities>
3746 @line 3: Route Distinguisher (RD) - set to RD of the MAC-VRF advertising the NLRI, recommended format *<IP>:<VLAN_ID>*
3748 @line 4: One of the EVPN route must be set here.
3750 @line 14: In some cases, specific extended community presence is required. The route may carry one or more Route Target attributes.
3756 * **Ethernet AD per ESI**
3759 <ethernet-a-d-route>
3760 <mpls-label>0</mpls-label>
3762 <vlan-id>4294967295</vlan-id>
3765 <arbitrary>AAAAAAAAAAAA</arbitrary>
3767 </ethernet-a-d-route>
3769 * **Ethernet AD per EVI**
3772 <ethernet-a-d-route>
3773 <mpls-label>24001</mpls-label>
3775 <vlan-id>2200</vlan-id>
3778 <arbitrary>AAAAAAAAAAAA</arbitrary>
3780 </ethernet-a-d-route>
3782 * **MAC/IP Advertisement**
3787 <arbitrary>AAAAAAAAAAAA</arbitrary>
3790 <vlan-id>2100</vlan-id>
3792 <mac-address>f2:0c:dd:80:9f:f7</mac-address>
3793 <ip-address>10.0.1.12</ip-address>
3794 <mpls-label1>299776</mpls-label1>
3798 * **Inclusive Multicast Ethernet Tag**
3801 <inc-multi-ethernet-tag-res>
3803 <vlan-id>2100</vlan-id>
3805 <orig-route-ip>43.43.43.43</orig-route-ip>
3806 </inc-multi-ethernet-tag-res>
3808 * **Ethernet Segment**
3812 <orig-route-ip>43.43.43.43</orig-route-ip>
3814 <arbitrary>AAAAAAAAAAAA</arbitrary>
3818 **EVPN Ethernet Segment Identifier (ESI):**
3821 Indicates an arbitrary 9-octet ESI.
3826 <arbitrary>AAAAAAAAAAAA</arbitrary>
3830 IEEE 802.1AX LACP is used.
3834 <lacp-auto-generated>
3835 <ce-lacp-mac-address>f2:0c:dd:80:9f:f7</ce-lacp-mac-address>
3836 <ce-lacp-port-key>22</ce-lacp-port-key>
3837 </lacp-auto-generated>
3840 Indirectly connected hosts via a bridged LAN.
3844 <lan-auto-generated>
3845 <root-bridge-mac-address>f2:0c:dd:80:9f:f7</root-bridge-mac-address>
3846 <root-bridge-priority>20</root-bridge-priority>
3847 </lan-auto-generated>
3854 <mac-auto-generated>
3855 <system-mac-address>f2:0c:dd:80:9f:f7</system-mac-address>
3856 <local-discriminator>2000</local-discriminator>
3857 </mac-auto-generated>
3864 <router-id-generated>
3865 <router-id>43.43.43.43</router-id>
3866 <local-discriminator>2000</local-discriminator>
3867 </router-id-generated>
3876 <local-discriminator>2000</local-discriminator>
3879 **Extended Communities:**
3881 * **ESI Label Extended Community**
3884 <extended-communities>
3885 <transitive>true</transitive>
3886 <esi-label-extended-community>
3887 <single-active-mode>false</single-active-mode>
3888 <esi-label>24001</esi-label>
3889 </esi-label-extended-community >
3890 </extended-communities>
3892 * **ES-Import Route Target**
3895 <extended-communities>
3896 <transitive>true</transitive>
3897 <es-import-route-extended-community>
3898 <es-import>f2:0c:dd:80:9f:f7</es-import>
3899 </es-import-route-extended-community>
3900 </extended-communities>
3902 * **MAC Mobility Extended Community**
3905 <extended-communities>
3906 <transitive>true</transitive>
3907 <mac-mobility-extended-community>
3908 <static>true</static>
3909 <seq-number>200</seq-number>
3910 </mac-mobility-extended-community>
3911 </extended-communities>
3913 * **Default Gateway Extended Community**
3916 <extended-communities>
3917 <transitive>true</transitive>
3918 <default-gateway-extended-community>
3919 </default-gateway-extended-community>
3920 </extended-communities>
3922 * **EVPN Layer 2 attributes extended community**
3925 <extended-communities>
3926 <transitive>false</transitive>
3927 <layer-2-attributes-extended-community>
3928 <primary-pe>true</primary-pe>
3929 <backup-pe>true</backup-pe>
3930 <control-word >true</control-word>
3931 <l2-mtu>200</l2-mtu>
3932 </layer-2-attributes-extended-community>
3933 </extended-communities>
3935 * **BGP Encapsulation extended community**
3940 <extended-communities>
3941 <transitive>false</transitive>
3942 <encapsulation-extended-community>
3943 <tunnel-type>vxlan</tunnel-type>
3944 </encapsulation-extended-community>
3945 </extended-communities>
3947 @line 4: `full list of tunnel types <http://www.iana.org/assignments/bgp-parameters/bgp-parameters.xhtml#tunnel-types>`_
3949 * **P-Multicast Service Interface Tunnel (PMSI) attribute**
3953 <leaf-information-required>true</leaf-information-required>
3954 <mpls-label>20024</mpls-label>
3955 <ingress-replication>
3956 <receiving-endpoint-address>172.12.123.3</receiving-endpoint-address>
3957 </ingress-replication>
3962 To remove the route added above, following request can be used:
3964 **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``
3966 **Method:** ``DELETE``
3970 .. table:: EVPN Routes Usage.
3972 +--------------------------------------+-----------------------------------------------------+-------------------------------------------+
3973 | EVN Route Type | Extended Communities | Usage |
3974 +======================================+=====================================================+===========================================+
3975 | **Ethernet Auto-discovery** | ESI Label, BGP EncapsulationEVPN Layer 2 attributes | Fast Convergence, Split Horizon, Aliasing |
3976 +--------------------------------------+-----------------------------------------------------+-------------------------------------------+
3977 | **MAC/IP Advertisement** | BGP Encapsulation, MAC Mobility, Default Gateway | MAC address reachability |
3978 +--------------------------------------+-----------------------------------------------------+-------------------------------------------+
3979 | **Inclusive Multicast Ethernet Tag** | PMSI Tunnel, BGP Encapsulation | Handling of Multi-destination traffic |
3980 +--------------------------------------+-----------------------------------------------------+-------------------------------------------+
3981 | **Ethernet Segment** | BGP Encapsulation, ES-Import Route Target | Designated Forwarder Election |
3982 +--------------------------------------+-----------------------------------------------------+-------------------------------------------+
3986 * `BGP MPLS-Based Ethernet VPN <https://tools.ietf.org/html/rfc7432>`_
3987 * `Provider Backbone Bridging Combined with Ethernet VPN <https://tools.ietf.org/html/rfc7623>`_
3988 * `VPWS support in EVPN <https://tools.ietf.org/html/draft-ietf-bess-evpn-vpws-07>`_
3989 * `A Network Virtualization Overlay Solution using EVPN <https://tools.ietf.org/html/draft-ietf-bess-evpn-overlay-04>`_
3990 * `Interconnect Solution for EVPN Overlay networks <https://tools.ietf.org/html/draft-ietf-bess-dci-evpn-overlay-04>`_
3991 * `Usage and applicability of BGP MPLS based Ethernet VPN <https://tools.ietf.org/html/draft-ietf-bess-evpn-usage-03>`_
3995 The ADD-PATH capability allows to advertise multiple paths for the same address prefix.
3996 It can help with optimal routing and routing convergence in a network by providing potential alternate or backup paths.
3998 .. contents:: Contents
4004 This section shows a way to enable ADD-PATH capability in BGP speaker and peer configuration.
4006 .. note:: The capability is applicable for IP Unicast, IP Labeled Unicast and Flow Specification address families.
4010 To enable ADD-PATH capability in BGP plugin, first configure BGP speaker instance:
4012 **URL:** ``/restconf/config/openconfig-network-instance:network-instances/network-instance/global-bgp/openconfig-network-instance:protocols``
4014 **Method:** ``POST``
4016 **Content-Type:** ``application/xml``
4022 :emphasize-lines: 14
4024 <protocol xmlns="http://openconfig.net/yang/network-instance">
4025 <name>bgp-example</name>
4026 <identifier xmlns:x="http://openconfig.net/yang/policy-types">x:BGP</identifier>
4027 <bgp xmlns="urn:opendaylight:params:xml:ns:yang:bgp:openconfig-extensions">
4030 <router-id>192.0.2.2</router-id>
4035 <afi-safi-name xmlns:x="http://openconfig.net/yang/bgp-types">x:IPV4-UNICAST</afi-safi-name>
4036 <receive>true</receive>
4037 <send-max>2</send-max>
4044 @line 14: Defines path selection strategy: *send-max* > 1 -> Advertise N Paths or *send-max* = 0 -> Advertise All Paths
4046 Here is an example for update a specific family with enable ADD-PATH capability
4048 **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``
4052 **Content-Type:** ``application/xml``
4058 <afi-safi xmlns="urn:opendaylight:params:xml:ns:yang:bgp:openconfig-extensions">
4059 <afi-safi-name xmlns:x="http://openconfig.net/yang/bgp-types">x:IPV4-UNICAST</afi-safi-name>
4060 <receive>true</receive>
4061 <send-max>0</send-max>
4066 Here is an example for BGP peer configuration with enabled ADD-PATH capability.
4068 **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``
4070 **Method:** ``POST``
4072 **Content-Type:** ``application/xml``
4078 <neighbor xmlns="urn:opendaylight:params:xml:ns:yang:bgp:openconfig-extensions">
4079 <neighbor-address>192.0.2.1</neighbor-address>
4082 <afi-safi-name xmlns:x="http://openconfig.net/yang/bgp-types">x:IPV4-LABELLED-UNICAST</afi-safi-name>
4085 <afi-safi-name xmlns:x="http://openconfig.net/yang/bgp-types">x:IPV4-UNICAST</afi-safi-name>
4086 <receive>true</receive>
4087 <send-max>0</send-max>
4092 .. 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.
4094 Here is an example for update specific family BGP peer configuration with enabled ADD-PATH capability.
4096 **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``
4100 **Content-Type:** ``application/xml``
4106 <afi-safi xmlns="urn:opendaylight:params:xml:ns:yang:bgp:openconfig-extensions">
4107 <afi-safi-name xmlns:x="http://openconfig.net/yang/bgp-types">x:IPV4-UNICAST</afi-safi-name>
4108 <receive>true</receive>
4109 <send-max>0</send-max>
4114 The IPv4 Unicast table with enabled ADD-PATH capability in an instance of the speaker's Loc-RIB can be verified via REST:
4116 **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``
4126 <ipv4-routes xmlns="urn:opendaylight:params:xml:ns:yang:bgp-inet">
4128 <path-id>1</path-id>
4129 <prefix>193.0.2.1/32</prefix>
4139 <global>10.0.0.1</global>
4144 <path-id>2</path-id>
4145 <prefix>193.0.2.1/32</prefix>
4155 <global>10.0.0.2</global>
4161 @line 3: The routes with the same destination are distinguished by *path-id* attribute.
4165 * `Advertisement of Multiple Paths in BGP <https://tools.ietf.org/html/rfc7911>`_
4166 * `Best Practices for Advertisement of Multiple Paths in IBGP <https://tools.ietf.org/html/draft-ietf-idr-add-paths-guidelines-08>`_
4170 The Route Refresh Capability allows to dynamically request a re-advertisement of the Adj-RIB-Out from a BGP peer.
4171 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.
4173 .. contents:: Contents
4179 The capability is enabled by default, no additional configuration is required.
4183 To send a Route Refresh request from OpenDaylight BGP speaker instance to its neighbor, invoke RPC:
4185 **URL:** ``/restconf/operations/bgp-peer-rpc:route-refresh-request``
4187 **Method:** ``POST``
4189 **Content-Type:** ``application/xml``
4195 <input xmlns="urn:opendaylight:params:xml:ns:yang:bgp-peer-rpc">
4196 <afi xmlns:types="urn:opendaylight:params:xml:ns:yang:bgp-types">types:ipv4-address-family</afi>
4197 <safi xmlns:types="urn:opendaylight:params:xml:ns:yang:bgp-types">types:unicast-subsequent-address-family</safi>
4198 <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>
4203 * `Route Refresh Capability for BGP-4 <https://tools.ietf.org/html/rfc2918>`_
4205 Peer Session Release
4208 BGP provides a RPC feature to release a Neighbor session.
4210 .. contents:: Contents
4216 The capability is enabled by default, no additional configuration is required.
4220 To release neighbor session, invoke RPC:
4222 **URL:** ``/restconf/operations/bgp-peer-rpc:release-session``
4224 **Method:** ``POST``
4226 **Content-Type:** ``application/xml``
4232 <input xmlns="urn:opendaylight:params:xml:ns:yang:bgp-peer-rpc">
4233 <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>
4239 The OpenDaylight BGP implementation provides a set of APIs (described below), that give its operational state refreshed periodically, by default every 5 seconds.
4240 The following APIs describe what is available starting with how to change the default refresh rate.
4242 .. contents:: Contents
4246 Operational State Configuration
4247 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
4249 **URL:** ``/restconf/config/bgp-state-config:bgp-state-config``
4253 **Content-Type:** ``application/xml``
4261 <bgp-state-config xmlns="urn:opendaylight:params:xml:ns:yang:controller:config">
4262 <config-name xmlns="urn:opendaylight:params:xml:ns:yang:bgp-state-config">operationalState</config-name>
4263 <timer xmlns="urn:opendaylight:params:xml:ns:yang:bgp-state-config">1</timer>
4266 @line 3: Time in seconds between operational state update.
4268 BGP RIB Operational State
4269 ^^^^^^^^^^^^^^^^^^^^^^^^^
4271 **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``
4275 **Content-Type:** ``application/xml``
4282 <state xmlns="urn:opendaylight:params:xml:ns:yang:bgp:openconfig-extensions">
4284 <router-id>192.0.2.2</router-id>
4285 <total-paths>0</total-paths>
4286 <total-prefixes>0</total-prefixes>
4289 @line 2: AS number of the remote peer.
4291 @line 3: The unique protocol instance identifier.
4293 @line 4: Total number of Paths installed on RIB (Loc-RIB)
4295 @line 5: Total number of Prefixes installed on RIB (Loc-RIB)
4297 BGP RIB Families Operational State
4298 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
4300 **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``
4304 **Content-Type:** ``application/xml``
4310 :emphasize-lines: 3,5,6
4312 <afi-safis xmlns="urn:opendaylight:params:xml:ns:yang:bgp:openconfig-extensions">
4314 <afi-safi-name xmlns:x="http://openconfig.net/yang/bgp-types">x:IPV4-UNICAST</afi-safi-name>
4316 <total-paths>0</total-paths>
4317 <total-prefixes>0</total-prefixes>
4321 <afi-safi-name xmlns:x="http://openconfig.net/yang/bgp-types">x:IPV6-UNICAST</afi-safi-name>
4323 <total-paths>0</total-paths>
4324 <total-prefixes>0</total-prefixes>
4330 @line 3: Family Identifier.
4332 @line 5: Total number of Paths installed on RIB (Loc-RIB) per specific family.
4334 @line 6: Total number of Prefixes installed on RIB (Loc-RIB) per specific family.
4336 BGP Neighbors Operational State
4337 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
4339 **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``
4343 **Content-Type:** ``application/xml``
4351 <neighbors xmlns="urn:opendaylight:params:xml:ns:yang:bgp:openconfig-extensions">
4353 <neighbor-address>192.0.2.1</neighbor-address>
4357 <neighbor-address>192.0.2.2</neighbor-address>
4362 @line 3: IP address of the remote BGP peer. Also serves as an unique identifier of a neighbor in a list of neighbors.
4364 BGP Neighbor Operational State
4365 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
4367 .. note:: Supported Capabilities only provided when session has been established.
4369 **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``
4373 **Content-Type:** ``application/xml``
4379 :emphasize-lines: 2,3,4,7,8,11,12
4381 <state xmlns="urn:opendaylight:params:xml:ns:yang:bgp:openconfig-extensions">
4382 <session-state>ESTABLISHED</session-state>
4383 <supported-capabilities xmlns:x="http://openconfig.net/yang/bgp-types">x:ASN32</supported-capabilities>
4384 <supported-capabilities xmlns:x="http://openconfig.net/yang/bgp-types">x:MPBGP</supported-capabilities>
4388 <NOTIFICATION>0</NOTIFICATION>
4392 <NOTIFICATION>0</NOTIFICATION>
4397 @line 2: Session status
4399 @line 3-4: BGP capabilities supported ( ASN32 / MPBGP / ROUTE_REFRESH / GRACEFUL_RESTART / ADD_PATHS)
4401 @line 7: Total count of Update Messages sent
4403 @line 8: Total count of Notification Messages sent
4405 @line 11: Total count of Update Messages received
4407 @line 12: Total count of Notification Messages received
4409 BGP Neighbor Families Operational State
4410 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
4412 .. note:: Graceful Restart not supported yet. Planned for Carbon.
4415 **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``
4419 **Content-Type:** ``application/xml``
4425 :emphasize-lines: 3,5,7,9,10
4427 <afi-safis xmlns="urn:opendaylight:params:xml:ns:yang:bgp:openconfig-extensions">
4429 <afi-safi-name xmlns:x="http://openconfig.net/yang/bgp-types">x:IPV4-UNICAST</afi-safi-name>
4431 <active>false</active>
4435 <received>false</received>
4436 <advertised>false</advertised>
4441 <afi-safi-name xmlns:x="http://openconfig.net/yang/bgp-types">x:IPV6-UNICAST</afi-safi-name>
4443 <active>false</active>
4447 <received>false</received>
4448 <advertised>false</advertised>
4454 @line 3: Family Identifier.
4456 @line 5: True if family is advertized by peer.
4458 @line 7: Graceful Restart Operational State per specific family.
4460 @line 9: True if the peer supports graceful restart.
4462 @line 10: True if we support graceful restart.
4464 BGP Neighbor Family Operational State
4465 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
4467 .. note:: Prefixes state is only provided once session is established.
4468 .. note:: Graceful Restart not supported yet. Planned to be implemented in Carbon.
4470 **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``
4474 **Content-Type:** ``application/xml``
4480 :emphasize-lines: 2,4,6,7,8
4482 <afi-safi xmlns="urn:opendaylight:params:xml:ns:yang:bgp:openconfig-extensions">
4483 <afi-safi-name xmlns:x="http://openconfig.net/yang/bgp-types">x:IPV4-UNICAST</afi-safi-name>
4485 <active>true</active>
4487 <installed>3</installed>
4489 <received>3</received>
4494 <received>false</received>
4495 <advertised>false</advertised>
4500 @line 2: Family Identifier.
4502 @line 4: True if family is advertized to and by peer.
4504 @line 6: Total count of prefixes advertized by peer and installed (effective-rib-in).
4506 @line 7: Total count of prefixes advertized to peer (adj-rib-out).
4508 @line 8: Total count of prefixes advertized by peer (adj-rib-in).
4510 BGP Neighbor Timers Operational State
4511 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
4513 .. note:: State is only provided once session is established.
4515 **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``
4519 **Content-Type:** ``application/xml``
4525 :emphasize-lines: 3,4
4527 <timers xmlns="urn:opendaylight:params:xml:ns:yang:bgp:openconfig-extensions">
4529 <negotiated-hold-time>180</negotiated-hold-time>
4530 <uptime>1580676</uptime>
4534 @line 3: The negotiated hold-time for the BGP session in seconds.
4536 @line 4: Session duration since establishment in milliseconds.
4538 BGP Neighbor Transport Operational State
4539 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
4541 .. note:: State is only provided once session is established.
4543 **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``
4547 **Content-Type:** ``application/xml``
4553 :emphasize-lines: 3,4,5
4555 <transport xmlns="urn:opendaylight:params:xml:ns:yang:bgp:openconfig-extensions">
4557 <remote-address>127.0.0.2</remote-address>
4558 <remote-port>44718</remote-port>
4559 <local-port>1790</local-port>
4563 @line 3: IP address of the remote BGP peer.
4565 @line 4: Port of the remote BGP peer.
4567 @line 5: Local port.
4569 BGP Neighbor Error Handling Operational State
4570 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
4572 .. note:: State is only provided once session is established.
4573 .. note:: Error handling not supported yet. Planned for Carbon.
4575 **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``
4579 **Content-Type:** ``application/xml``
4587 <error-handling xmlns="urn:opendaylight:params:xml:ns:yang:bgp:openconfig-extensions">
4589 <erroneous-update-messages>0</erroneous-update-messages>
4593 @line 3: The number of BGP UPDATE messages for which the treat-as-withdraw mechanism has been applied based on
4594 erroneous message contents
4596 BGP Neighbor Graceful Restart Operational State
4597 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
4599 .. note:: Graceful Restart not supported yet. Planned for Carbon.
4601 **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``
4605 **Content-Type:** ``application/xml``
4611 :emphasize-lines: 3,4,5
4613 <graceful-restart xmlns="urn:opendaylight:params:xml:ns:yang:bgp:openconfig-extensions">
4615 <peer-restart-time>0</peer-restart-time>
4616 <peer-restarting>false</peer-restarting>
4617 <local-restarting>false</local-restarting>
4621 @line 3: The period of time (advertised by the peer) that the peer expects a restart of a BGP session to take.
4623 @line 4: This flag indicates whether the remote neighbor is currently in the process of restarting, and hence
4624 received routes are currently stale.
4626 @line 5: This flag indicates whether the local neighbor is currently restarting. The flag is unset after all NLRI
4627 have been advertised to the peer, and the End-of-RIB (EOR) marker has been unset.
4629 BGP Peer Groups Operational State
4630 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
4632 **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``
4636 **Content-Type:** ``application/xml``
4642 :emphasize-lines: 3,5,6
4646 <peer-group-name>application-peers</peer-group-name>
4648 <total-paths>0</total-paths>
4649 <total-prefixes>0</total-prefixes>
4653 @line 3: Peer Group Identifier.
4655 @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.
4657 @line 6: Total Prefixes installed under by peers pertaining to this peer group (effective-rib-in).
4658 This count doesn't differentiate repeated prefixes.
4663 BGP Karaf Console (odl-bgpcep-bgp-cli) provides a CLI feature to read operational state per RIB, Neighbor and Peer Group.
4665 .. code-block:: bash
4668 opendaylight-user@root> bgp:operational-state -rib example-bgp-rib
4670 .. code-block:: bash
4673 opendaylight-user@root> bgp:operational-state -rib example-bgp-rib -neighbor 192.0.2.1
4675 .. code-block:: bash
4678 opendaylight-user@root> bgp:operational-state -rib -peer-group application-peers
4682 Running OpenDaylight BGP in clustered environment brings an advantage of the plugin's high availability (HA).
4683 This section illustrates a basic scenario for HA, also presents a configuration for clustered OpenDaylight BGP.
4685 .. contents:: Contents
4691 Following example shows a configuration for running BGP in clustered environment.
4693 #. As the first step, configure (replicated *deafult* shard and *topology* shard if needed) and run OpenDaylight in clustered environment, install BGP and RESTCONF.
4695 #. 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.
4697 #. Remote peer should be configured to accept/initiate connection from/to all OpenDaylight cluster nodes with configured BGP plugin.
4699 #. 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.
4703 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`):
4705 * In ``modules.conf`` add a new module:
4706 .. code-block:: console
4710 namespace = "urn:opendaylight:params:xml:ns:yang:bgp-rib"
4711 shard-strategy = "module"
4714 * In ``module-shards.conf`` define a new module shard:
4715 .. code-block:: console
4729 **Note:** Use correct member name in module shard configuration.
4733 Following section presents a basic BGP speaker failover scenario on 3-node OpenDaylight cluster setup.
4735 .. figure:: ./images/bgpcep/BGP_HA.png
4738 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.
4739 Routes advertised by remote peer are replicated, hence RIBs state on all nodes is the same.
4743 .. figure:: ./images/bgpcep/BGP_HA_failure.png
4744 :alt: Node went down.
4746 In a case a cluster node, where BGP instance is running, goes down (unexpected failure, restart), active BGP session is dropped.
4750 .. figure:: ./images/bgpcep/BGP_HA_recovery.png
4753 Now, one of the stand-by BGP speaker instances become active. Remote peer establishes new connection and advertises routes again.
4757 This section provides an overview of the BGP topology provider service.
4758 It shows how to configure and use all available BGP topology providers.
4759 Providers are building topology view of BGP routes stored in local BGP speaker's Loc-RIB.
4760 Output topologies are rendered in a form of standardised IETF network topology model.
4762 .. contents:: Contents
4766 Inet Reachability Topology
4767 ^^^^^^^^^^^^^^^^^^^^^^^^^^
4768 Inet reachability topology exporter offers a mapping service from IPv4/6 routes to network topology nodes.
4772 Following example shows how to create a new instance of IPv4 BGP topology exporter:
4774 **URL:** ``/restconf/config/network-topology:network-topology``
4776 **Method:** ``POST``
4778 **Content-Type:** ``application/xml``
4784 :emphasize-lines: 2,4,6
4786 <topology xmlns="urn:TBD:params:xml:ns:yang:network-topology">
4787 <topology-id>bgp-example-ipv4-topology</topology-id>
4789 <bgp-ipv4-reachability-topology xmlns="urn:opendaylight:params:xml:ns:yang:odl-bgp-topology-types"></bgp-ipv4-reachability-topology>
4791 <rib-id xmlns="urn:opendaylight:params:xml:ns:yang:odl-bgp-topology-config">bgp-example</rib-id>
4794 @line 2: An identifier for a topology.
4796 @line 4: Used to identify type of the topology. In this case BGP IPv4 reachability topology.
4798 @line 6: A name of the local BGP speaker instance.
4802 The topology exporter instance can be removed in a following way:
4804 **URL:** ``/restconf/config/network-topology:network-topology/topology/bgp-example-ipv4-topology``
4806 **Method:** ``DELETE``
4810 Following example shows how to create a new instance of IPv6 BGP topology exporter:
4812 **URL:** ``/restconf/config/network-topology:network-topology``
4814 **Method:** ``POST``
4816 **Content-Type:** ``application/xml``
4822 <topology xmlns="urn:TBD:params:xml:ns:yang:network-topology">
4823 <topology-id>bgp-example-ipv6-topology</topology-id>
4825 <bgp-ipv6-reachability-topology xmlns="urn:opendaylight:params:xml:ns:yang:odl-bgp-topology-types"></bgp-ipv6-reachability-topology>
4827 <rib-id xmlns="urn:opendaylight:params:xml:ns:yang:odl-bgp-topology-config">bgp-example</rib-id>
4832 Operational state of the topology can be verified via REST:
4834 **URL:** ``/restconf/operational/network-topology:network-topology/topology/bgp-example-ipv4-topology``
4842 :emphasize-lines: 8,11
4844 <topology xmlns="urn:TBD:params:xml:ns:yang:network-topology">
4845 <topology-id>bgp-example-ipv4-topology</topology-id>
4846 <server-provided>true</server-provided>
4848 <bgp-ipv4-reachability-topology xmlns="urn:opendaylight:params:xml:ns:yang:odl-bgp-topology-types"></bgp-ipv4-reachability-topology>
4851 <node-id>10.10.1.1</node-id>
4852 <igp-node-attributes xmlns="urn:TBD:params:xml:ns:yang:nt:l3-unicast-igp-topology">
4854 <prefix>10.0.0.10/32</prefix>
4856 </igp-node-attributes>
4860 @line 8: The identifier of a node in a topology. Its value is mapped from route's NEXT_HOP attribute.
4862 @line 11: The IP prefix attribute of the node. Its value is mapped from routes's destination IP prefix.
4864 BGP Linkstate Topology
4865 ^^^^^^^^^^^^^^^^^^^^^^
4866 BGP linkstate topology exporter offers a mapping service from BGP-LS routes to network topology nodes and links.
4870 Following example shows how to create a new instance of linkstate BGP topology exporter:
4872 **URL:** ``/restconf/config/network-topology:network-topology``
4874 **Method:** ``POST``
4876 **Content-Type:** ``application/xml``
4882 <topology xmlns="urn:TBD:params:xml:ns:yang:network-topology">
4883 <topology-id>bgp-example-linkstate-topology</topology-id>
4885 <bgp-linkstate-topology xmlns="urn:opendaylight:params:xml:ns:yang:odl-bgp-topology-types"></bgp-linkstate-topology>
4887 <rib-id xmlns="urn:opendaylight:params:xml:ns:yang:odl-bgp-topology-config">bgp-example</rib-id>
4892 Operational state of the topology can be verified via REST.
4893 A sample output below represents a two node topology with two unidirectional links interconnecting those nodes.
4895 **URL:** ``/restconf/operational/network-topology:network-topology/topology/bgp-example-linkstate-topology``
4903 <topology xmlns="urn:TBD:params:xml:ns:yang:network-topology">
4904 <topology-id>bgp-example-linkstate-topology</topology-id>
4905 <server-provided>true</server-provided>
4907 <bgp-linkstate-topology xmlns="urn:opendaylight:params:xml:ns:yang:odl-bgp-topology-types"></bgp-linkstate-topology>
4910 <node-id>bgpls://IsisLevel2:1/type=node&as=65000&domain=673720360&router=0000.0000.0040</node-id>
4912 <tp-id>bgpls://IsisLevel2:1/type=tp&ipv4=203.20.160.40</tp-id>
4913 <igp-termination-point-attributes xmlns="urn:TBD:params:xml:ns:yang:nt:l3-unicast-igp-topology"/>
4914 </termination-point>
4915 <igp-node-attributes xmlns="urn:TBD:params:xml:ns:yang:nt:l3-unicast-igp-topology">
4917 <prefix>40.40.40.40/32</prefix>
4921 <prefix>203.20.160.0/24</prefix>
4925 <router-id>40.40.40.40</router-id>
4926 <isis-node-attributes xmlns="urn:TBD:params:xml:ns:yang:network:isis-topology">
4928 <te-router-id-ipv4>40.40.40.40</te-router-id-ipv4>
4931 <iso-system-id>MDAwMDAwMDAwMDY0</iso-system-id>
4933 </isis-node-attributes>
4934 </igp-node-attributes>
4937 <node-id>bgpls://IsisLevel2:1/type=node&as=65000&domain=673720360&router=0000.0000.0039</node-id>
4939 <tp-id>bgpls://IsisLevel2:1/type=tp&ipv4=203.20.160.39</tp-id>
4940 <igp-termination-point-attributes xmlns="urn:TBD:params:xml:ns:yang:nt:l3-unicast-igp-topology"/>
4941 </termination-point>
4942 <igp-node-attributes xmlns="urn:TBD:params:xml:ns:yang:nt:l3-unicast-igp-topology">
4944 <prefix>39.39.39.39/32</prefix>
4948 <prefix>203.20.160.0/24</prefix>
4952 <router-id>39.39.39.39</router-id>
4953 <isis-node-attributes xmlns="urn:TBD:params:xml:ns:yang:network:isis-topology">
4955 <te-router-id-ipv4>39.39.39.39</te-router-id-ipv4>
4958 <iso-system-id>MDAwMDAwMDAwMDg3</iso-system-id>
4960 </isis-node-attributes>
4961 </igp-node-attributes>
4965 <dest-node>bgpls://IsisLevel2:1/type=node&as=65000&domain=673720360&router=0000.0000.0039</dest-node>
4966 <dest-tp>bgpls://IsisLevel2:1/type=tp&ipv4=203.20.160.39</dest-tp>
4968 <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>
4970 <source-node>bgpls://IsisLevel2:1/type=node&as=65000&domain=673720360&router=0000.0000.0040</source-node>
4971 <source-tp>bgpls://IsisLevel2:1/type=tp&ipv4=203.20.160.40</source-tp>
4973 <igp-link-attributes xmlns="urn:TBD:params:xml:ns:yang:nt:l3-unicast-igp-topology">
4975 <isis-link-attributes xmlns="urn:TBD:params:xml:ns:yang:network:isis-topology">
4978 <max-link-bandwidth>1250000.0</max-link-bandwidth>
4979 <max-resv-link-bandwidth>12500.0</max-resv-link-bandwidth>
4980 <te-default-metric>0</te-default-metric>
4981 <unreserved-bandwidth>
4982 <bandwidth>12500.0</bandwidth>
4983 <priority>0</priority>
4984 </unreserved-bandwidth>
4985 <unreserved-bandwidth>
4986 <bandwidth>12500.0</bandwidth>
4987 <priority>1</priority>
4988 </unreserved-bandwidth>
4989 <unreserved-bandwidth>
4990 <bandwidth>12500.0</bandwidth>
4991 <priority>2</priority>
4992 </unreserved-bandwidth>
4993 <unreserved-bandwidth>
4994 <bandwidth>12500.0</bandwidth>
4995 <priority>3</priority>
4996 </unreserved-bandwidth>
4997 <unreserved-bandwidth>
4998 <bandwidth>12500.0</bandwidth>
4999 <priority>4</priority>
5000 </unreserved-bandwidth>
5001 <unreserved-bandwidth>
5002 <bandwidth>12500.0</bandwidth>
5003 <priority>5</priority>
5004 </unreserved-bandwidth>
5005 <unreserved-bandwidth>
5006 <bandwidth>12500.0</bandwidth>
5007 <priority>6</priority>
5008 </unreserved-bandwidth>
5009 <unreserved-bandwidth>
5010 <bandwidth>12500.0</bandwidth>
5011 <priority>7</priority>
5012 </unreserved-bandwidth>
5014 </isis-link-attributes>
5015 </igp-link-attributes>
5019 <dest-node>bgpls://IsisLevel2:1/type=node&as=65000&domain=673720360&router=0000.0000.0040</dest-node>
5020 <dest-tp>bgpls://IsisLevel2:1/type=tp&ipv4=203.20.160.40</dest-tp>
5022 <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>
5024 <source-node>bgpls://IsisLevel2:1/type=node&as=65000&domain=673720360&router=0000.0000.0039</source-node>
5025 <source-tp>bgpls://IsisLevel2:1/type=tp&ipv4=203.20.160.39</source-tp>
5027 <igp-link-attributes xmlns="urn:TBD:params:xml:ns:yang:nt:l3-unicast-igp-topology">
5029 <isis-link-attributes xmlns="urn:TBD:params:xml:ns:yang:network:isis-topology">
5032 <max-link-bandwidth>1250000.0</max-link-bandwidth>
5033 <max-resv-link-bandwidth>12500.0</max-resv-link-bandwidth>
5034 <te-default-metric>0</te-default-metric>
5035 <unreserved-bandwidth>
5036 <bandwidth>12500.0</bandwidth>
5037 <priority>0</priority>
5038 </unreserved-bandwidth>
5039 <unreserved-bandwidth>
5040 <bandwidth>12500.0</bandwidth>
5041 <priority>1</priority>
5042 </unreserved-bandwidth>
5043 <unreserved-bandwidth>
5044 <bandwidth>12500.0</bandwidth>
5045 <priority>2</priority>
5046 </unreserved-bandwidth>
5047 <unreserved-bandwidth>
5048 <bandwidth>12500.0</bandwidth>
5049 <priority>3</priority>
5050 </unreserved-bandwidth>
5051 <unreserved-bandwidth>
5052 <bandwidth>12500.0</bandwidth>
5053 <priority>4</priority>
5054 </unreserved-bandwidth>
5055 <unreserved-bandwidth>
5056 <bandwidth>12500.0</bandwidth>
5057 <priority>5</priority>
5058 </unreserved-bandwidth>
5059 <unreserved-bandwidth>
5060 <bandwidth>12500.0</bandwidth>
5061 <priority>6</priority>
5062 </unreserved-bandwidth>
5063 <unreserved-bandwidth>
5064 <bandwidth>12500.0</bandwidth>
5065 <priority>7</priority>
5066 </unreserved-bandwidth>
5068 </isis-link-attributes>
5069 </igp-link-attributes>
5073 BGP Network Topology Configuration Loader
5074 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
5076 BGP Network Topology Configuration Loader allows user to define static initial configuration for a BGP protocol instance.
5077 This service will detect the creation of new configuration files following the pattern "network-topology-*.xml" under the path "etc/opendaylight/bgpcep".
5078 Once the file is processed, the defined configuration will be available from the configuration Data Store.
5080 .. note:: If the BGP topology instance is already present, no update or configuration will be applied.
5082 When installing BGP an example will be provided and a default configuration loaded.
5084 **PATH:** ``etc/opendaylight/bgp/network-topology-config.xml``
5088 <network-topology xmlns="urn:TBD:params:xml:ns:yang:network-topology">
5090 <topology-id>example-ipv4-topology</topology-id>
5092 <bgp-ipv4-reachability-topology xmlns="urn:opendaylight:params:xml:ns:yang:odl-bgp-topology-types"/>
5094 <rib-id xmlns="urn:opendaylight:params:xml:ns:yang:odl-bgp-topology-config">example-bgp-rib</rib-id>
5097 <topology-id>example-ipv6-topology</topology-id>
5099 <bgp-ipv6-reachability-topology xmlns="urn:opendaylight:params:xml:ns:yang:odl-bgp-topology-types"/>
5101 <rib-id xmlns="urn:opendaylight:params:xml:ns:yang:odl-bgp-topology-config">example-bgp-rib</rib-id>
5104 <topology-id>example-linkstate-topology</topology-id>
5106 <bgp-linkstate-topology xmlns="urn:opendaylight:params:xml:ns:yang:odl-bgp-topology-types"/>
5108 <rib-id xmlns="urn:opendaylight:params:xml:ns:yang:odl-bgp-topology-config">example-bgp-rib</rib-id>
5114 BGP test tools serves to test basic BGP functionality, scalability and performance.
5116 .. contents:: Contents
5122 The BGP Test Tool is a stand-alone Java application purposed to simulate remote BGP peers, that are capable to advertise sample routes.
5123 This application is not part of the OpenDaylight Karaf distribution, however it can be downloaded from OpenDaylight's Nexus (use latest release version):
5125 ``https://nexus.opendaylight.org/content/repositories/opendaylight.release/org/opendaylight/bgpcep/bgp-testtool``
5129 The application can be run from command line:
5131 .. code-block:: console
5133 java -jar bgp-testtool-*-executable.jar
5136 with optional input parameters:
5138 .. code-block:: console
5140 -i <BOOLEAN>, --active <BOOLEAN>
5141 Active initialisation of the connection, by default false.
5143 -ho <N>, --holdtimer <N>
5144 In seconds, value of the desired holdtimer, by default 90.
5146 -sc <N>, --speakersCount <N>
5147 Number of simulated BGP speakers, when creating each speaker, uses incremented local-address for binding, by default 0.
5149 -ra <IP_ADDRESS:PORT,...>, --remoteAddress <IP_ADDRESS:PORT,...>
5150 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.
5152 -la <IP_ADDRESS:PORT>, --localAddress <IP_ADDRESS:PORT>
5153 IP address of BGP speakers which the tools simulates, by default 192.0.2.2:0.
5155 -pr <N>, --prefixes <N>
5156 Number of prefixes to be advertised by each simulated speaker
5158 -mp <BOOLEAN>, --multiPathSupport <BOOLEAN>
5159 Active ADD-PATH support, by default false.
5162 Local AS Number, by default 64496.
5164 -ec <EXTENDED_COMMUNITIES>, --extended_communities <EXTENDED_COMMUNITIES>
5165 Extended communities to be send. Format: x,x,x where x is each extended community from bgp-types.yang, by default empty.
5167 -ll <LOG_LEVEL>, --log_level <LOG_LEVEL>
5168 Log level for console output, by default INFO.
5170 BGP Application Peer Benchmark
5171 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
5172 It is a simple OpenDaylight application which is capable to inject and remove specific amount of IPv4 routes.
5173 This application is part of the OpenDaylight Karaf distribution.
5177 As a first step install BGP and RESTCONF, then configure *Application Peer*.
5178 Install ``odl-bgpcep-bgp-benchmark`` feature and reconfigure BGP Application Peer Benchmark application as per following:
5180 **URL:** ``/restconf/config/odl-bgp-app-peer-benchmark-config:config``
5184 **Content-Type:** ``application/xml``
5192 <odl-bgp-app-peer-benchmark-config xmlns="urn:opendaylight:params:xml:ns:yang:odl-bgp-app-peer-benchmark-config">
5193 <app-peer-id xmlns="urn:opendaylight:params:xml:ns:yang:odl-bgp-app-peer-benchmark-config">10.25.1.9</app-peer-id>
5194 </odl-bgp-app-peer-benchmark-config>
5196 @line 2: The *Application Peer* identifier.
5200 Routes injection can be invoked via RPC:
5202 **URL:** ``/restconf/operations/odl-bgp-app-peer-benchmark:add-prefix``
5204 **Method:** ``POST``
5206 **Content-Type:** ``application/xml``
5212 :emphasize-lines: 2,3,4,5
5214 <input xmlns="urn:opendaylight:params:xml:ns:yang:odl-bgp-app-peer-benchmark">
5215 <prefix>1.1.1.1/32</prefix>
5216 <count>100000</count>
5217 <batchsize>2000</batchsize>
5218 <nexthop>192.0.2.2</nexthop>
5221 @line 2: A initial IPv4 prefix carried in route. Value is incremented for following routes.
5223 @line 3: An amount of routes to be added to *Application Peer's* programmable RIB.
5225 @line 4: A size of the transaction batch.
5227 @line 5: A NEXT_HOP attribute value used in all injected routes.
5233 :emphasize-lines: 3,4,5
5235 <output xmlns="urn:opendaylight:params:xml:ns:yang:odl-bgp-app-peer-benchmark">
5237 <duration>4301</duration>
5239 <count>100000</count>
5243 @line 3: Request duration in milliseconds.
5245 @line 4: Writes per second rate.
5247 @line 5: An amount of routes added to *Application Peer's* programmable RIB.
5251 Routes deletion can be invoked via RPC:
5253 **URL:** ``/restconf/operations/odl-bgp-app-peer-benchmark:delete-prefix``
5255 **Method:** ``POST``
5257 **Content-Type:** ``application/xml``
5263 :emphasize-lines: 2,3,4
5265 <input xmlns="urn:opendaylight:params:xml:ns:yang:odl-bgp-app-peer-benchmark">
5266 <prefix>1.1.1.1/32</prefix>
5267 <count>100000</count>
5268 <batchsize>2000</batchsize>
5271 @line 2: A initial IPv4 prefix carried in route to be removed. Value is incremented for following routes.
5273 @line 3: An amount of routes to be removed from *Application Peer's* programmable RIB.
5275 @line 4: A size of the transaction batch.
5281 <output xmlns="urn:opendaylight:params:xml:ns:yang:odl-bgp-app-peer-benchmark">
5283 <duration>1837</duration>
5285 <count>100000</count>
5291 This section offers advices in a case OpenDaylight BGP plugin is not working as expected.
5293 .. contents:: Contents
5297 BGP is not working...
5298 ^^^^^^^^^^^^^^^^^^^^^
5299 * First of all, ensure that all required features are installed, local and remote BGP configuration is correct.
5301 * Check OpenDaylight Karaf logs:
5305 .. code-block:: console
5309 or open log file: ``data/log/karaf.log``
5311 Possibly, a reason/hint for a cause of the problem can be found there.
5313 * Try to minimise effect of other OpenDaylight features, when searching for a reason of the problem.
5315 * Try to set DEBUG severity level for BGP logger via Karaf console commands, in order to collect more information:
5317 .. code-block:: console
5319 log:set DEBUG org.opendaylight.protocol.bgp
5321 .. code-block:: console
5323 log:set DEBUG org.opendaylight.bgpcep.bgp
5327 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.
5329 Write an e-mail to bgpcep-users@lists.opendaylight.org and provide following information:
5331 #. State OpenDaylight version
5333 #. Describe your use-case and provide as much details related to BGP as possible
5335 #. Steps to reproduce
5337 #. Attach Karaf log files, optionally packet captures, REST input/output