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 **PATH:** ``etc/opendaylight/bgpcep/protocols-config.xml``
1091 <protocols xmlns="http://openconfig.net/yang/network-instance">
1093 <name>example-bgp-rib</name>
1094 <identifier xmlns:x="http://openconfig.net/yang/policy-types">x:BGP</identifier>
1095 <bgp xmlns="urn:opendaylight:params:xml:ns:yang:bgp:openconfig-extensions">
1098 <router-id>192.0.2.2</router-id>
1100 <!-- if cluster-id is not present, it's value is the same as bgp-id -->
1101 <!-- <route-reflector-cluster-id>192.0.2.3</route-reflector-cluster-id> -->
1102 <!-- <read-only-limit>120</read-only-limit>-->
1106 <afi-safi-name xmlns:x="http://openconfig.net/yang/bgp-types">x:IPV4-UNICAST</afi-safi-name>
1107 <!--Advertise N Paths
1108 <receive>true</receive>
1109 <send-max>2</send-max>-->
1112 <afi-safi-name xmlns:x="http://openconfig.net/yang/bgp-types">x:IPV6-UNICAST</afi-safi-name>
1115 <afi-safi-name xmlns:x="http://openconfig.net/yang/bgp-types">x:IPV4-LABELLED-UNICAST</afi-safi-name>
1118 <afi-safi-name xmlns:x="http://openconfig.net/yang/bgp-types">x:IPV6-LABELLED-UNICAST</afi-safi-name>
1121 <afi-safi-name xmlns:x="http://openconfig.net/yang/bgp-types">x:L3VPN-IPV4-UNICAST</afi-safi-name>
1124 <afi-safi-name xmlns:x="http://openconfig.net/yang/bgp-types">x:L3VPN-IPV6-UNICAST</afi-safi-name>
1127 <afi-safi-name xmlns:x="http://openconfig.net/yang/bgp-types">x:L2VPN-EVPN</afi-safi-name>
1130 <afi-safi-name>LINKSTATE</afi-safi-name>
1133 <afi-safi-name>IPV4-FLOW</afi-safi-name>
1136 <afi-safi-name>IPV6-FLOW</afi-safi-name>
1139 <afi-safi-name>IPV4-L3VPN-FLOW</afi-safi-name>
1142 <afi-safi-name>IPV6-L3VPN-FLOW</afi-safi-name>
1146 <neighbors xmlns="urn:opendaylight:params:xml:ns:yang:bgp:openconfig-extensions">
1147 <neighbor xmlns="urn:opendaylight:params:xml:ns:yang:bgp:openconfig-extensions">
1148 <neighbor-address>192.0.2.1</neighbor-address>
1150 <peer-type>INTERNAL</peer-type>
1151 <peer-as>64496</peer-as>
1155 <remote-port>179</remote-port>
1156 <passive-mode>true</passive-mode>
1161 <hold-time>180</hold-time>
1162 <connect-retry>10</connect-retry>
1167 <route-reflector-client>false</route-reflector-client>
1172 <afi-safi-name xmlns:x="http://openconfig.net/yang/bgp-types">x:IPV4-UNICAST</afi-safi-name>
1173 <!--Advertise N Paths
1174 <receive>true</receive>
1175 <send-max>0</send-max>-->
1178 <afi-safi-name xmlns:x="http://openconfig.net/yang/bgp-types">x:IPV6-UNICAST</afi-safi-name>
1181 <afi-safi-name xmlns:x="http://openconfig.net/yang/bgp-types">x:IPV4-LABELLED-UNICAST</afi-safi-name>
1184 <afi-safi-name xmlns:x="http://openconfig.net/yang/bgp-types">x:IPV6-LABELLED-UNICAST</afi-safi-name>
1187 <afi-safi-name xmlns:x="http://openconfig.net/yang/bgp-types">x:L3VPN-IPV4-UNICAST</afi-safi-name>
1190 <afi-safi-name xmlns:x="http://openconfig.net/yang/bgp-types">x:L3VPN-IPV6-UNICAST</afi-safi-name>
1193 <afi-safi-name xmlns:x="http://openconfig.net/yang/bgp-types">x:L2VPN-EVPN</afi-safi-name>
1196 <afi-safi-name>LINKSTATE</afi-safi-name>
1199 <afi-safi-name>IPV4-FLOW</afi-safi-name>
1202 <afi-safi-name>IPV6-FLOW</afi-safi-name>
1205 <afi-safi-name>IPV4-L3VPN-FLOW</afi-safi-name>
1208 <afi-safi-name>IPV6-L3VPN-FLOW</afi-safi-name>
1212 <neighbor xmlns="urn:opendaylight:params:xml:ns:yang:bgp:openconfig-extensions">
1213 <neighbor-address>192.0.2.6</neighbor-address>
1215 <peer-group>application-peers</peer-group>
1223 BGP Configuration Example
1224 '''''''''''''''''''''''''
1226 BGP provides a feature providing a BGP Protocol and Network Topology configuration file example.
1227 Once feature is installed defined configuration will be loaded and setup.
1229 .. code-block:: console
1231 feature:install odl-bgpcep-bgp-config-example
1235 .. figure:: ./images/bgpcep/bgp-pipeline.png
1238 BGP pipeline - routes re-advertisement.
1240 .. figure:: ./images/bgpcep/bgp-app-pipeline.png
1241 :alt: BGP Application Peer pipeline.
1243 BGP applcaition peer pipeline - routes injection.
1247 * `A Border Gateway Protocol 4 (BGP-4) <https://tools.ietf.org/html/rfc4271>`_
1248 * `BGP Route Reflection <https://tools.ietf.org/html/rfc4456>`_
1249 * `BGP Communities Attribute <https://tools.ietf.org/html/rfc1997>`_
1250 * `BGP Support for Four-Octet Autonomous System (AS) Number Space <https://tools.ietf.org/html/rfc6793>`_
1251 * `The Accumulated IGP Metric Attribute for BGP <https://tools.ietf.org/html/rfc7311>`_
1252 * `4-Octet AS Specific BGP Extended Community <https://tools.ietf.org/html/rfc5668>`_
1253 * `BGP Link Bandwidth Extended Community <https://tools.ietf.org/html/draft-ietf-idr-link-bandwidth-06>`_
1254 * `Use of BGP for Routing in Large-Scale Data Centers <https://tools.ietf.org/html/rfc7938>`_
1258 The BGP-4 allows to carry IPv4 specific information only.
1259 The basic BGP Multiprotocol extension brings *Unicast* Subsequent Address Family (SAFI) - intended to be used for IP unicast forwarding.
1260 The combination of IPv4 and IPv6 Address Family (AF) and Unicast SAFI is essential for Internet routing.
1261 The IPv4 Unicast routes are interchangeable with BGP-4 routes, as they can carry the same type of routing information.
1263 .. contents:: Contents
1269 This section shows a way to enable IPv4 and IPv6 Unicast family in BGP speaker and peer configuration.
1273 To enable IPv4 and IPv6 Unicast support in BGP plugin, first configure BGP speaker instance:
1275 **URL:** ``/restconf/config/openconfig-network-instance:network-instances/network-instance/global-bgp/openconfig-network-instance:protocols``
1277 **Method:** ``POST``
1279 **Content-Type:** ``application/xml``
1285 <protocol xmlns="http://openconfig.net/yang/network-instance">
1286 <name>bgp-example</name>
1287 <identifier xmlns:x="http://openconfig.net/yang/policy-types">x:BGP</identifier>
1288 <bgp xmlns="urn:opendaylight:params:xml:ns:yang:bgp:openconfig-extensions">
1291 <router-id>192.0.2.2</router-id>
1296 <afi-safi-name xmlns:x="http://openconfig.net/yang/bgp-types">x:IPV4-UNICAST</afi-safi-name>
1299 <afi-safi-name xmlns:x="http://openconfig.net/yang/bgp-types">x:IPV6-UNICAST</afi-safi-name>
1308 Here is an example for BGP peer configuration with enabled IPv4 and IPv6 Unicast family.
1310 **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``
1312 **Method:** ``POST``
1314 **Content-Type:** ``application/xml``
1320 <neighbor xmlns="urn:opendaylight:params:xml:ns:yang:bgp:openconfig-extensions">
1321 <neighbor-address>192.0.2.1</neighbor-address>
1324 <afi-safi-name xmlns:x="http://openconfig.net/yang/bgp-types">x:IPV4-UNICAST</afi-safi-name>
1327 <afi-safi-name xmlns:x="http://openconfig.net/yang/bgp-types">x:IPV6-UNICAST</afi-safi-name>
1334 Following trees illustrate the BGP IP Unicast routes structures.
1338 .. code-block:: console
1342 +--ro ipv4-route* [prefix path-id]
1343 +--ro prefix inet:ipv4-prefix
1344 +--ro path-id path-id
1347 | +--ro value bgp-t:bgp-origin
1350 | +--ro as-sequence* inet:as-number
1351 | +--ro as-set* inet:as-number
1353 | +--:(ipv4-next-hop-case)
1354 | | +--ro ipv4-next-hop
1355 | | +--ro global? inet:ipv4-address
1356 | +--:(ipv6-next-hop-case)
1357 | | +--ro ipv6-next-hop
1358 | | +--ro global? inet:ipv6-address
1359 | | +--ro link-local? inet:ipv6-address
1360 | +--:(empty-next-hop-case)
1361 | +--ro empty-next-hop? empty
1362 +--ro multi-exit-disc
1365 | +--ro pref? uint32
1366 +--ro atomic-aggregate!
1368 | +--ro as-number? inet:as-number
1369 | +--ro network-address? inet:ipv4-address
1371 | +--ro as-number? inet:as-number
1372 | +--ro semantics? uint16
1373 +--ro extended-communities*
1374 | +--ro transitive? boolean
1375 | +--ro (extended-community)?
1376 | +--:(as-specific-extended-community-case)
1377 | | +--ro as-specific-extended-community
1378 | | +--ro global-administrator? short-as-number
1379 | | +--ro local-administrator? binary
1380 | +--:(inet4-specific-extended-community-case)
1381 | | +--ro inet4-specific-extended-community
1382 | | +--ro global-administrator? inet:ipv4-address
1383 | | +--ro local-administrator? binary
1384 | +--:(opaque-extended-community-case)
1385 | | +--ro opaque-extended-community
1386 | | +--ro value? binary
1387 | +--:(route-target-extended-community-case)
1388 | | +--ro route-target-extended-community
1389 | | +--ro global-administrator? short-as-number
1390 | | +--ro local-administrator? binary
1391 | +--:(route-origin-extended-community-case)
1392 | | +--ro route-origin-extended-community
1393 | | +--ro global-administrator? short-as-number
1394 | | +--ro local-administrator? binary
1395 | +--:(route-target-ipv4-case)
1396 | | +--ro route-target-ipv4
1397 | | +--ro global-administrator? inet:ipv4-address
1398 | | +--ro local-administrator? uint16
1399 | +--:(route-origin-ipv4-case)
1400 | | +--ro route-origin-ipv4
1401 | | +--ro global-administrator? inet:ipv4-address
1402 | | +--ro local-administrator? uint16
1403 | +--:(link-bandwidth-case)
1404 | | +--ro link-bandwidth-extended-community
1405 | | +--ro bandwidth netc:bandwidth
1406 | +--:(as-4-generic-spec-extended-community-case)
1407 | | +--ro as-4-generic-spec-extended-community
1408 | | +--ro as-4-specific-common
1409 | | +--ro as-number inet:as-number
1410 | | +--ro local-administrator uint16
1411 | +--:(as-4-route-target-extended-community-case)
1412 | | +--ro as-4-route-target-extended-community
1413 | | +--ro as-4-specific-common
1414 | | +--ro as-number inet:as-number
1415 | | +--ro local-administrator uint16
1416 | +--:(as-4-route-origin-extended-community-case)
1417 | | +--ro as-4-route-origin-extended-community
1418 | | +--ro as-4-specific-common
1419 | | +--ro as-number inet:as-number
1420 | | +--ro local-administrator uint16
1421 | +--:(encapsulation-case)
1422 | +--ro encapsulation-extended-community
1423 | +--ro tunnel-type encapsulation-tunnel-type
1425 | +--ro originator? inet:ipv4-address
1427 | +--ro cluster* bgp-t:cluster-identifier
1430 | +--ro metric? netc:accumulated-igp-metric
1431 +--ro unrecognized-attributes* [type]
1432 +--ro partial boolean
1433 +--ro transitive boolean
1439 .. code-block:: console
1443 +--ro ipv6-route* [prefix path-id]
1444 +--ro prefix inet:ipv6-prefix
1445 +--ro path-id path-id
1453 The IPv4 Unicast table in an instance of the speaker's Loc-RIB can be verified via REST:
1455 **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``
1463 <ipv4-routes xmlns="urn:opendaylight:params:xml:ns:yang:bgp-inet">
1465 <path-id>0</path-id>
1466 <prefix>193.0.2.1/32</prefix>
1476 <global>10.0.0.1</global>
1484 The IPv6 Unicast table in an instance of the speaker's Loc-RIB can be verified via REST:
1486 **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``
1494 <ipv6-routes xmlns="urn:opendaylight:params:xml:ns:yang:bgp-inet">
1496 <path-id>0</path-id>
1497 <prefix>2a02:b80:0:1::/64</prefix>
1507 <global>2a02:b80:0:2::1</global>
1513 .. note:: IPv4/6 routes mapping to topology nodes is supported by BGP Topology Provider.
1519 This examples show how to originate and remove IPv4 route via programmable RIB.
1520 Make sure the *Application Peer* is configured first.
1522 **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``
1524 **Method:** ``POST``
1526 **Content-Type:** ``application/xml``
1532 <ipv4-route xmlns="urn:opendaylight:params:xml:ns:yang:bgp-inet">
1533 <path-id>0</path-id>
1534 <prefix>10.0.0.11/32</prefix>
1544 <global>10.11.1.1</global>
1551 To remove the route added above, following request can be used:
1553 **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``
1555 **Method:** ``DELETE``
1559 This examples show how to originate and remove IPv6 route via programmable RIB:
1561 **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``
1563 **Method:** ``POST``
1565 **Content-Type:** ``application/xml``
1571 <ipv6-route xmlns="urn:opendaylight:params:xml:ns:yang:bgp-inet">
1572 <prefix>2001:db8:30::3/128</prefix>
1573 <path-id>0</path-id>
1576 <global>2001:db8:1::6</global>
1590 To remove the route added above, following request can be used:
1592 **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``
1594 **Method:** ``DELETE``
1598 * `Multiprotocol Extensions for BGP-4 <https://tools.ietf.org/html/rfc4760>`_
1600 IP Labeled Unicast Family
1601 -------------------------
1602 The BGP Labeled Unicast (BGP-LU) Multiprotocol extension is used to distribute a MPLS label that is mapped to a particular route.
1603 It can be used to advertise a MPLS transport path between IGP regions and Autonomous Systems.
1604 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.
1605 In addition, IPv6 Labeled Unicast can be used to interconnect IPv6 islands over IPv4/MPLS networks using 6PE.
1607 .. contents:: Contents
1613 This section shows a way to enable IPv4 and IPv6 Labeled Unicast family in BGP speaker and peer configuration.
1617 To enable IPv4 and IPv6 Labeled Unicast support in BGP plugin, first configure BGP speaker instance:
1619 **URL:** ``/restconf/config/openconfig-network-instance:network-instances/network-instance/global-bgp/openconfig-network-instance:protocols``
1621 **Method:** ``POST``
1623 **Content-Type:** ``application/xml``
1629 <protocol xmlns="http://openconfig.net/yang/network-instance">
1630 <name>bgp-example</name>
1631 <identifier xmlns:x="http://openconfig.net/yang/policy-types">x:BGP</identifier>
1632 <bgp xmlns="urn:opendaylight:params:xml:ns:yang:bgp:openconfig-extensions">
1635 <router-id>192.0.2.2</router-id>
1640 <afi-safi-name xmlns:x="http://openconfig.net/yang/bgp-types">x:IPV4-LABELLED-UNICAST</afi-safi-name>
1643 <afi-safi-name xmlns:x="http://openconfig.net/yang/bgp-types">x:IPV6-LABELLED-UNICAST</afi-safi-name>
1652 Here is an example for BGP peer configuration with enabled IPv4 and IPv6 Labeled Unicast family.
1654 **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``
1656 **Method:** ``POST``
1658 **Content-Type:** ``application/xml``
1664 <neighbor xmlns="urn:opendaylight:params:xml:ns:yang:bgp:openconfig-extensions">
1665 <neighbor-address>192.0.2.1</neighbor-address>
1668 <afi-safi-name xmlns:x="http://openconfig.net/yang/bgp-types">x:IPV4-LABELLED-UNICAST</afi-safi-name>
1671 <afi-safi-name xmlns:x="http://openconfig.net/yang/bgp-types">x:IPV6-LABELLED-UNICAST</afi-safi-name>
1676 IP Labeled Unicast API
1677 ^^^^^^^^^^^^^^^^^^^^^^
1678 Following trees illustrate the BGP IP Labeled Unicast routes structures.
1680 IPv4 Labeled Unicast Route
1681 ''''''''''''''''''''''''''
1682 .. code-block:: console
1684 :(labeled-unicast-routes-case)
1685 +--ro labeled-unicast-routes
1686 +--ro labeled-unicast-route* [route-key path-id]
1687 +--ro route-key string
1689 | +--ro label-value? netc:mpls-label
1690 +--ro prefix? inet:ip-prefix
1691 +--ro path-id path-id
1696 IPv6 Labeled Unicast Route
1697 ''''''''''''''''''''''''''
1698 .. code-block:: console
1700 :(labeled-unicast-ipv6-routes-case)
1701 +--ro labeled-unicast-ipv6-routes
1702 +--ro labeled-unicast-route* [route-key path-id]
1703 +--ro route-key string
1705 | +--ro label-value? netc:mpls-label
1706 +--ro prefix? inet:ip-prefix
1707 +--ro path-id path-id
1713 The IPv4 Labeled Unicast table in an instance of the speaker's Loc-RIB can be verified via REST:
1715 **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``
1723 <labeled-unicast-routes xmlns="urn:opendaylight:params:xml:ns:yang:bgp-labeled-unicast">
1724 <labeled-unicast-route>
1725 <path-id>0</path-id>
1726 <route-key>MAA+gRQAAA==</route-key>
1732 <global>200.10.0.101</global>
1740 <label-value>1000</label-value>
1742 <prefix>20.0.0.0/24</prefix>
1743 </labeled-unicast-route>
1744 </labeled-unicast-routes>
1750 This examples show how to originate and remove IPv4 labeled route via programmable RIB.
1751 Make sure the *Application Peer* is configured first.
1753 **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``
1755 **Method:** ``POST``
1757 **Content-Type:** ``application/xml``
1763 <labeled-unicast-route xmlns="urn:opendaylight:params:xml:ns:yang:bgp-labeled-unicast">
1764 <route-key>label1</route-key>
1765 <prefix>1.1.1.1/32</prefix>
1766 <path-id>0</path-id>
1768 <label-value>800322</label-value>
1772 <global>199.20.160.41</global>
1782 </labeled-unicast-route>
1786 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.
1791 <bgp-prefix-sid-tlvs>
1792 <label-index-tlv xmlns="urn:opendaylight:params:xml:ns:yang:bgp-labeled-unicast">322</label-index-tlv>
1793 </bgp-prefix-sid-tlvs>
1794 <bgp-prefix-sid-tlvs>
1795 <srgb-value xmlns="urn:opendaylight:params:xml:ns:yang:bgp-labeled-unicast">
1799 </bgp-prefix-sid-tlvs>
1804 To remove the route added above, following request can be used:
1806 **URL:** ``/restconf/config/bgp-rib:application-rib/10.25.1.9/tables/bgp-types:ipv4-address-family/bgp-labeled-unicast:labeled-unicast-subsequent-address-family/bgp-labeled-unicast:labeled-unicast-routes/bgp-labeled-unicast:labeled-unicast-route/label1/0``
1808 **Method:** ``DELETE``
1812 This examples show how to originate and remove IPv6 labeled route via programmable RIB.
1814 **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``
1816 **Method:** ``POST``
1818 **Content-Type:** ``application/xml``
1824 <labeled-unicast-route xmlns="urn:opendaylight:params:xml:ns:yang:bgp-labeled-unicast">
1825 <route-key>label1</route-key>
1826 <prefix>2001:db8:30::3/128</prefix>
1827 <path-id>0</path-id>
1829 <label-value>123</label-value>
1833 <global>2003:4:5:6::7</global>
1843 </labeled-unicast-route>
1847 To remove the route added above, following request can be used:
1849 **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``
1851 **Method:** ``DELETE``
1855 * `Carrying Label Information in BGP-4 <https://tools.ietf.org/html/rfc3107>`_
1856 * `Segment Routing Prefix SID extensions for BGP <https://tools.ietf.org/html/draft-ietf-idr-bgp-prefix-sid-03>`_
1857 * `Connecting IPv6 Islands over IPv4 MPLS Using IPv6 Provider Edge Routers (6PE) <https://tools.ietf.org/html/rfc4798>`_
1858 * `BGP-Prefix Segment in large-scale data centers <https://tools.ietf.org/html/draft-ietf-spring-segment-routing-msdc-01>`_
1859 * `Egress Peer Engineering using BGP-LU <https://tools.ietf.org/html/draft-gredler-idr-bgplu-epe-06>`_
1863 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.
1864 Also, routes are distributed to specific VPN remote sites.
1866 .. contents:: Contents
1872 This section shows a way to enable IPv4 and IPv6 L3VPN family in BGP speaker and peer configuration.
1876 To enable IPv4 and IPv6 L3VPN support in BGP plugin, first configure BGP speaker instance:
1878 **URL:** ``/restconf/config/openconfig-network-instance:network-instances/network-instance/global-bgp/openconfig-network-instance:protocols``
1880 **Method:** ``POST``
1882 **Content-Type:** ``application/xml``
1888 <protocol xmlns="http://openconfig.net/yang/network-instance">
1889 <name>bgp-example</name>
1890 <identifier xmlns:x="http://openconfig.net/yang/policy-types">x:BGP</identifier>
1891 <bgp xmlns="urn:opendaylight:params:xml:ns:yang:bgp:openconfig-extensions">
1894 <router-id>192.0.2.2</router-id>
1899 <afi-safi-name xmlns:x="http://openconfig.net/yang/bgp-types">x:L3VPN-IPV4-UNICAST</afi-safi-name>
1902 <afi-safi-name xmlns:x="http://openconfig.net/yang/bgp-types">x:L3VPN-IPV6-UNICAST</afi-safi-name>
1911 Here is an example for BGP peer configuration with enabled IPv4 and IPv6 L3VPN family.
1913 **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``
1915 **Method:** ``POST``
1917 **Content-Type:** ``application/xml``
1923 <neighbor xmlns="urn:opendaylight:params:xml:ns:yang:bgp:openconfig-extensions">
1924 <neighbor-address>192.0.2.1</neighbor-address>
1927 <afi-safi-name xmlns:x="http://openconfig.net/yang/bgp-types">x:L3VPN-IPV4-UNICAST</afi-safi-name>
1930 <afi-safi-name xmlns:x="http://openconfig.net/yang/bgp-types">x:L3VPN-IPV6-UNICAST</afi-safi-name>
1937 Following trees illustrate the BGP IP L3VPN routes structures.
1941 .. code-block:: console
1943 :(vpn-ipv4-routes-case)
1944 +--ro vpn-ipv4-routes
1945 +--ro vpn-route* [route-key]
1946 +--ro route-key string
1948 | +--ro label-value? netc:mpls-label
1949 +--ro prefix? inet:ip-prefix
1950 +--ro path-id? path-id
1951 +--ro route-distinguisher? bgp-t:route-distinguisher
1957 .. code-block:: console
1959 :(vpn-ipv6-routes-case)
1960 +--ro vpn-ipv6-routes
1961 +--ro vpn-route* [route-key]
1962 +--ro route-key string
1964 | +--ro label-value? netc:mpls-label
1965 +--ro prefix? inet:ip-prefix
1966 +--ro path-id? path-id
1967 +--ro route-distinguisher? bgp-t:route-distinguisher
1975 The IPv4 L3VPN table in an instance of the speaker's Loc-RIB can be verified via REST:
1977 **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``
1985 <vpn-ipv4-routes xmlns="urn:opendaylight:params:xml:ns:yang:bgp-vpn-ipv4">
1987 <route-key>cAXdYQABrBAALABlCgIi</route-key>
1989 <label-value>24022</label-value>
1992 <extended-communities>
1993 <transitive>true</transitive>
1994 <route-target-extended-community>
1995 <global-administrator>65000</global-administrator>
1996 <local-administrator>AAAAZQ==</local-administrator>
1997 </route-target-extended-community>
1998 </extended-communities>
2007 <global>127.16.0.44</global>
2010 <route-distinguisher>172.16.0.44:101</route-distinguisher>
2011 <prefix>10.2.34.0/24</prefix>
2017 The IPv6 L3VPN table in an instance of the speaker's Loc-RIB can be verified via REST:
2019 **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``
2027 <vpn-ipv6-routes xmlns="urn:opendaylight:params:xml:ns:yang:bgp-vpn-ipv6">
2029 <route-key>mAXdcQABrBAALABlKgILgAAAAAE=</route-key>
2031 <label-value>24023</label-value>
2037 <extended-communities>
2038 <route-target-extended-community>
2039 <global-administrator>65000</global-administrator>
2040 <local-administrator>AAAAZQ==</local-administrator>
2041 </route-target-extended-community>
2042 <transitive>true</transitive>
2043 </extended-communities>
2045 <global>2a02:b80:0:2::1</global>
2052 <route-distinguisher>172.16.0.44:101</route-distinguisher>
2053 <prefix>2a02:b80:0:1::/64</prefix>
2059 This examples show how to originate and remove IPv4 L3VPN route via programmable RIB.
2060 Make sure the *Application Peer* is configured first.
2062 **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``
2064 **Method:** ``POST``
2066 **Content-Type:** ``application/xml``
2072 <vpn-route xmlns="urn:opendaylight:params:xml:ns:yang:bgp-vpn-ipv4">
2073 <route-key>vpn1</route-key>
2075 <label-value>123</label-value>
2077 <route-distinguisher>429496729:1</route-distinguisher>
2078 <prefix>2.2.2.2/32</prefix>
2081 <global>199.20.166.41</global>
2087 <extended-communities>
2088 <route-target-extended-community>
2089 <global-administrator>65000</global-administrator>
2090 <local-administrator>AAAAZQ==</local-administrator>
2091 </route-target-extended-community>
2092 <transitive>true</transitive>
2093 </extended-communities>
2099 To remove the route added above, following request can be used:
2101 **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``
2103 **Method:** ``DELETE``
2107 * `BGP/MPLS IP Virtual Private Networks (VPNs) <https://tools.ietf.org/html/rfc4364>`_
2108 * `BGP-MPLS IP Virtual Private Network (VPN) Extension for IPv6 VPN <https://tools.ietf.org/html/rfc4659>`_
2109 * `BGP/MPLS VPN Virtual PE <https://tools.ietf.org/html/draft-ietf-bess-virtual-pe-00>`_
2113 The BGP Link-State (BGP-LS) Multiprotocol extension allows to distribute Link-State and Traffic Engineering (TE) information.
2114 This information is typically distributed by IGP routing protocols with in the network, limiting LSDB or TED visibility to the IGP area.
2115 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).
2116 The information is applicable in ALTO servers and PCEs, as both need to gather information about topologies.
2117 In addition, link-state information is extended to carry segment information (Spring).
2119 .. contents:: Contents
2125 This section shows a way to enable IPv4 and IPv6 Labeled Unicast family in BGP speaker and peer configuration.
2129 To enable BGP-LS support in BGP plugin, first configure BGP speaker instance:
2131 **URL:** ``/restconf/config/openconfig-network-instance:network-instances/network-instance/global-bgp/openconfig-network-instance:protocols``
2133 **Method:** ``POST``
2135 **Content-Type:** ``application/xml``
2141 <protocol xmlns="http://openconfig.net/yang/network-instance">
2142 <name>bgp-example</name>
2143 <identifier xmlns:x="http://openconfig.net/yang/policy-types">x:BGP</identifier>
2144 <bgp xmlns="urn:opendaylight:params:xml:ns:yang:bgp:openconfig-extensions">
2147 <router-id>192.0.2.2</router-id>
2152 <afi-safi-name>LINKSTATE</afi-safi-name>
2159 Linkstate path attribute
2160 ''''''''''''''''''''''''
2161 IANA allocation for BGP-LS path attribute is TYPE 29.
2162 Some older BGP-LS implementations might still require earliest asigned allocation TYPE 99.
2163 To use TYPE = 99, you need to set value bellow to false.
2165 **URL:** ``/restconf/config/bgp-linkstate-app-config:bgp-linkstate-app-config``
2169 **Content-Type:** ``application/xml``
2175 <bgp-linkstate-app-config xmlns="urn:opendaylight:params:xml:ns:yang:controller:bgp:linkstate-app-config">
2176 <iana-linkstate-attribute-type>false</iana-linkstate-attribute-type>
2177 </bgp-linkstate-app-config>
2181 Here is an example for BGP peer configuration with enabled BGP-LS family.
2183 **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``
2185 **Method:** ``POST``
2187 **Content-Type:** ``application/xml``
2193 <neighbor xmlns="urn:opendaylight:params:xml:ns:yang:bgp:openconfig-extensions">
2194 <neighbor-address>192.0.2.1</neighbor-address>
2197 <afi-safi-name>LINKSTATE</afi-safi-name>
2202 Link-State Route API
2203 ^^^^^^^^^^^^^^^^^^^^
2204 Following tree illustrate the BGP Link-State route structure.
2206 .. code-block:: console
2208 :(linkstate-routes-case)
2209 +--ro linkstate-routes
2210 +--ro linkstate-route* [route-key]
2211 +--ro route-key binary
2212 +--ro protocol-id protocol-id
2213 +--ro identifier identifier
2214 +--ro (object-type)?
2216 | | +--ro node-descriptors
2217 | | +--ro as-number? inet:as-number
2218 | | +--ro area-id? area-identifier
2219 | | +--ro domain-id? domain-identifier
2220 | | +--ro (c-router-identifier)?
2221 | | +--:(isis-node-case)
2222 | | | +--ro isis-node
2223 | | | +--ro iso-system-id netc:iso-system-identifier
2224 | | +--:(isis-pseudonode-case)
2225 | | | +--ro isis-pseudonode
2226 | | | +--ro is-is-router-identifier
2227 | | | | +--ro iso-system-id netc:iso-system-identifier
2228 | | | +--ro psn uint8
2229 | | +--:(ospf-node-case)
2230 | | | +--ro ospf-node
2231 | | | +--ro ospf-router-id uint32
2232 | | +--:(ospf-pseudonode-case)
2233 | | +--ro ospf-pseudonode
2234 | | +--ro ospf-router-id uint32
2235 | | +--ro lan-interface ospf-interface-identifier
2237 | | +--ro local-node-descriptors
2238 | | | +--ro as-number? inet:as-number
2239 | | | +--ro area-id? area-identifier
2240 | | | +--ro domain-id? domain-identifier
2241 | | | +--ro (c-router-identifier)?
2242 | | | | +--:(isis-node-case)
2243 | | | | | +--ro isis-node
2244 | | | | | +--ro iso-system-id netc:iso-system-identifier
2245 | | | | +--:(isis-pseudonode-case)
2246 | | | | | +--ro isis-pseudonode
2247 | | | | | +--ro is-is-router-identifier
2248 | | | | | | +--ro iso-system-id netc:iso-system-identifier
2249 | | | | | +--ro psn uint8
2250 | | | | +--:(ospf-node-case)
2251 | | | | | +--ro ospf-node
2252 | | | | | +--ro ospf-router-id uint32
2253 | | | | +--:(ospf-pseudonode-case)
2254 | | | | +--ro ospf-pseudonode
2255 | | | | +--ro ospf-router-id uint32
2256 | | | | +--ro lan-interface ospf-interface-identifier
2257 | | | +--ro bgp-router-id? inet:ipv4-address
2258 | | | +--ro member-asn? inet:as-number
2259 | | +--ro remote-node-descriptors
2260 | | | +--ro as-number? inet:as-number
2261 | | | +--ro area-id? area-identifier
2262 | | | +--ro domain-id? domain-identifier
2263 | | | +--ro (c-router-identifier)?
2264 | | | | +--:(isis-node-case)
2265 | | | | | +--ro isis-node
2266 | | | | | +--ro iso-system-id netc:iso-system-identifier
2267 | | | | +--:(isis-pseudonode-case)
2268 | | | | | +--ro isis-pseudonode
2269 | | | | | +--ro is-is-router-identifier
2270 | | | | | | +--ro iso-system-id netc:iso-system-identifier
2271 | | | | | +--ro psn uint8
2272 | | | | +--:(ospf-node-case)
2273 | | | | | +--ro ospf-node
2274 | | | | | +--ro ospf-router-id uint32
2275 | | | | +--:(ospf-pseudonode-case)
2276 | | | | +--ro ospf-pseudonode
2277 | | | | +--ro ospf-router-id uint32
2278 | | | | +--ro lan-interface ospf-interface-identifier
2279 | | | +--ro bgp-router-id? inet:ipv4-address
2280 | | | +--ro member-asn? inet:as-number
2281 | | +--ro link-descriptors
2282 | | +--ro link-local-identifier? uint32
2283 | | +--ro link-remote-identifier? uint32
2284 | | +--ro ipv4-interface-address? ipv4-interface-identifier
2285 | | +--ro ipv6-interface-address? ipv6-interface-identifier
2286 | | +--ro ipv4-neighbor-address? ipv4-interface-identifier
2287 | | +--ro ipv6-neighbor-address? ipv6-interface-identifier
2288 | | +--ro multi-topology-id? topology-identifier
2290 | | +--ro advertising-node-descriptors
2291 | | | +--ro as-number? inet:as-number
2292 | | | +--ro area-id? area-identifier
2293 | | | +--ro domain-id? domain-identifier
2294 | | | +--ro (c-router-identifier)?
2295 | | | +--:(isis-node-case)
2296 | | | | +--ro isis-node
2297 | | | | +--ro iso-system-id netc:iso-system-identifier
2298 | | | +--:(isis-pseudonode-case)
2299 | | | | +--ro isis-pseudonode
2300 | | | | +--ro is-is-router-identifier
2301 | | | | | +--ro iso-system-id netc:iso-system-identifier
2302 | | | | +--ro psn uint8
2303 | | | +--:(ospf-node-case)
2304 | | | | +--ro ospf-node
2305 | | | | +--ro ospf-router-id uint32
2306 | | | +--:(ospf-pseudonode-case)
2307 | | | +--ro ospf-pseudonode
2308 | | | +--ro ospf-router-id uint32
2309 | | | +--ro lan-interface ospf-interface-identifier
2310 | | +--ro prefix-descriptors
2311 | | +--ro multi-topology-id? topology-identifier
2312 | | +--ro ospf-route-type? ospf-route-type
2313 | | +--ro ip-reachability-information? inet:ip-prefix
2315 | +--ro (address-family)?
2317 | | | +--ro ipv4-tunnel-sender-address inet:ipv4-address
2318 | | | +--ro ipv4-tunnel-endpoint-address inet:ipv4-address
2320 | | +--ro ipv6-tunnel-sender-address inet:ipv6-address
2321 | | +--ro ipv6-tunnel-endpoint-address inet:ipv6-address
2322 | +--ro tunnel-id? rsvp:tunnel-id
2323 | +--ro lsp-id? rsvp:lsp-id
2325 +--ro (link-state-attribute)?
2326 +--:(node-attributes-case)
2327 | +--ro node-attributes
2328 | +--ro topology-identifier* topology-identifier
2329 | +--ro node-flags? node-flag-bits
2330 | +--ro isis-area-id* isis-area-identifier
2331 | +--ro dynamic-hostname? string
2332 | +--ro ipv4-router-id? ipv4-router-identifier
2333 | +--ro ipv6-router-id? ipv6-router-identifier
2334 | +--ro sr-capabilities
2335 | | +--ro mpls-ipv4? boolean
2336 | | +--ro mpls-ipv6? boolean
2337 | | +--ro sr-ipv6? boolean
2338 | | +--ro range-size? uint32
2339 | | +--ro (sid-label-index)?
2340 | | +--:(local-label-case)
2341 | | | +--ro local-label? netc:mpls-label
2342 | | +--:(ipv6-address-case)
2343 | | | +--ro ipv6-address? inet:ipv6-address
2345 | | +--ro sid? uint32
2346 | +--ro sr-algorithm
2347 | +--ro algorithms* algorithm
2348 +--:(link-attributes-case)
2349 | +--ro link-attributes
2350 | +--ro local-ipv4-router-id? ipv4-router-identifier
2351 | +--ro local-ipv6-router-id? ipv6-router-identifier
2352 | +--ro remote-ipv4-router-id? ipv4-router-identifier
2353 | +--ro remote-ipv6-router-id? ipv6-router-identifier
2354 | +--ro mpls-protocol? mpls-protocol-mask
2355 | +--ro te-metric? netc:te-metric
2356 | +--ro metric? netc:metric
2357 | +--ro shared-risk-link-groups* rsvp:srlg-id
2358 | +--ro link-name? string
2359 | +--ro max-link-bandwidth? netc:bandwidth
2360 | +--ro max-reservable-bandwidth? netc:bandwidth
2361 | +--ro unreserved-bandwidth* [priority]
2362 | | +--ro priority uint8
2363 | | +--ro bandwidth? netc:bandwidth
2364 | +--ro link-protection? link-protection-type
2365 | +--ro admin-group? administrative-group
2368 | | | +--:(ospf-adj-flags-case)
2369 | | | | +--ro backup? boolean
2370 | | | | +--ro set? boolean
2371 | | | +--:(isis-adj-flags-case)
2372 | | | +--ro backup? boolean
2373 | | | +--ro set? boolean
2374 | | | +--ro address-family? boolean
2375 | | +--ro weight? weight
2376 | | +--ro (sid-label-index)?
2377 | | +--:(local-label-case)
2378 | | | +--ro local-label? netc:mpls-label
2379 | | +--:(ipv6-address-case)
2380 | | | +--ro ipv6-address? inet:ipv6-address
2382 | | +--ro sid? uint32
2383 | +--ro sr-lan-adj-ids*
2385 | | | +--:(ospf-adj-flags-case)
2386 | | | | +--ro backup? boolean
2387 | | | | +--ro set? boolean
2388 | | | +--:(isis-adj-flags-case)
2389 | | | +--ro backup? boolean
2390 | | | +--ro set? boolean
2391 | | | +--ro address-family? boolean
2392 | | +--ro weight? weight
2393 | | +--ro iso-system-id? netc:iso-system-identifier
2394 | | +--ro neighbor-id? inet:ipv4-address
2395 | | +--ro (sid-label-index)?
2396 | | +--:(local-label-case)
2397 | | | +--ro local-label? netc:mpls-label
2398 | | +--:(ipv6-address-case)
2399 | | | +--ro ipv6-address? inet:ipv6-address
2401 | | +--ro sid? uint32
2402 | +--ro peer-node-sid
2403 | | +--ro weight? weight
2404 | | +--ro (sid-label-index)?
2405 | | +--:(local-label-case)
2406 | | | +--ro local-label? netc:mpls-label
2407 | | +--:(ipv6-address-case)
2408 | | | +--ro ipv6-address? inet:ipv6-address
2410 | | +--ro sid? uint32
2411 | +--ro peer-adj-sid
2412 | | +--ro weight? weight
2413 | | +--ro (sid-label-index)?
2414 | | +--:(local-label-case)
2415 | | | +--ro local-label? netc:mpls-label
2416 | | +--:(ipv6-address-case)
2417 | | | +--ro ipv6-address? inet:ipv6-address
2419 | | +--ro sid? uint32
2420 | +--ro peer-set-sids*
2421 | +--ro weight? weight
2422 | +--ro (sid-label-index)?
2423 | +--:(local-label-case)
2424 | | +--ro local-label? netc:mpls-label
2425 | +--:(ipv6-address-case)
2426 | | +--ro ipv6-address? inet:ipv6-address
2429 +--:(prefix-attributes-case)
2430 | +--ro prefix-attributes
2432 | | x--ro up-down? bits
2433 | | +--ro is-is-up-down? boolean
2434 | | +--ro ospf-no-unicast? boolean
2435 | | +--ro ospf-local-address? boolean
2436 | | +--ro ospf-propagate-nssa? boolean
2437 | +--ro route-tags* route-tag
2438 | +--ro extended-tags* extended-route-tag
2439 | +--ro prefix-metric? netc:igp-metric
2440 | +--ro ospf-forwarding-address? inet:ip-address
2443 | | | +--:(isis-prefix-flags-case)
2444 | | | | +--ro no-php? boolean
2445 | | | | +--ro explicit-null? boolean
2446 | | | | +--ro readvertisement? boolean
2447 | | | | +--ro node-sid? boolean
2448 | | | +--:(ospf-prefix-flags-case)
2449 | | | +--ro no-php? boolean
2450 | | | +--ro explicit-null? boolean
2451 | | | +--ro mapping-server? boolean
2452 | | +--ro algorithm? algorithm
2453 | | +--ro (sid-label-index)?
2454 | | +--:(local-label-case)
2455 | | | +--ro local-label? netc:mpls-label
2456 | | +--:(ipv6-address-case)
2457 | | | +--ro ipv6-address? inet:ipv6-address
2459 | | +--ro sid? uint32
2460 | +--ro ipv6-sr-prefix
2461 | | +--ro algorithm? algorithm
2463 | | +--ro inter-area? boolean
2464 | | +--ro range-size? uint16
2466 | | +--ro (range-sub-tlv)?
2467 | | +--:(binding-sid-tlv-case)
2468 | | | +--ro weight? weight
2469 | | | +--ro (flags)?
2470 | | | | +--:(isis-binding-flags-case)
2471 | | | | | +--ro address-family? boolean
2472 | | | | | +--ro mirror-context? boolean
2473 | | | | | +--ro spread-tlv? boolean
2474 | | | | | +--ro leaked-from-level-2? boolean
2475 | | | | | +--ro attached-flag? boolean
2476 | | | | +--:(ospf-binding-flags-case)
2477 | | | | +--ro mirroring? boolean
2478 | | | +--ro binding-sub-tlvs*
2479 | | | +--ro (binding-sub-tlv)?
2480 | | | +--:(prefix-sid-case)
2481 | | | | +--ro (flags)?
2482 | | | | | +--:(isis-prefix-flags-case)
2483 | | | | | | +--ro no-php? boolean
2484 | | | | | | +--ro explicit-null? boolean
2485 | | | | | | +--ro readvertisement? boolean
2486 | | | | | | +--ro node-sid? boolean
2487 | | | | | +--:(ospf-prefix-flags-case)
2488 | | | | | +--ro no-php? boolean
2489 | | | | | +--ro explicit-null? boolean
2490 | | | | | +--ro mapping-server? boolean
2491 | | | | +--ro algorithm? algorithm
2492 | | | | +--ro (sid-label-index)?
2493 | | | | +--:(local-label-case)
2494 | | | | | +--ro local-label? netc:mpls-label
2495 | | | | +--:(ipv6-address-case)
2496 | | | | | +--ro ipv6-address? inet:ipv6-address
2497 | | | | +--:(sid-case)
2498 | | | | +--ro sid? uint32
2499 | | | +--:(ipv6-prefix-sid-case)
2500 | | | | +--ro algorithm? algorithm
2501 | | | +--:(sid-label-case)
2502 | | | | +--ro (sid-label-index)?
2503 | | | | +--:(local-label-case)
2504 | | | | | +--ro local-label? netc:mpls-label
2505 | | | | +--:(ipv6-address-case)
2506 | | | | | +--ro ipv6-address? inet:ipv6-address
2507 | | | | +--:(sid-case)
2508 | | | | +--ro sid? uint32
2509 | | | +--:(ero-metric-case)
2510 | | | | +--ro ero-metric? netc:te-metric
2511 | | | +--:(ipv4-ero-case)
2512 | | | | +--ro loose? boolean
2513 | | | | +--ro address inet:ipv4-address
2514 | | | +--:(ipv6-ero-case)
2515 | | | | +--ro loose? boolean
2516 | | | | +--ro address inet:ipv6-address
2517 | | | +--:(unnumbered-interface-id-ero-case)
2518 | | | | +--ro loose? boolean
2519 | | | | +--ro router-id? uint32
2520 | | | | +--ro interface-id? uint32
2521 | | | +--:(ipv4-ero-backup-case)
2522 | | | | +--ro loose? boolean
2523 | | | | +--ro address inet:ipv4-address
2524 | | | +--:(ipv6-ero-backup-case)
2525 | | | | +--ro loose? boolean
2526 | | | | +--ro address inet:ipv6-address
2527 | | | +--:(unnumbered-interface-id-backup-ero-case)
2528 | | | +--ro loose? boolean
2529 | | | +--ro router-id? uint32
2530 | | | +--ro interface-id? uint32
2531 | | +--:(prefix-sid-tlv-case)
2532 | | | +--ro (flags)?
2533 | | | | +--:(isis-prefix-flags-case)
2534 | | | | | +--ro no-php? boolean
2535 | | | | | +--ro explicit-null? boolean
2536 | | | | | +--ro readvertisement? boolean
2537 | | | | | +--ro node-sid? boolean
2538 | | | | +--:(ospf-prefix-flags-case)
2539 | | | | +--ro no-php? boolean
2540 | | | | +--ro explicit-null? boolean
2541 | | | | +--ro mapping-server? boolean
2542 | | | +--ro algorithm? algorithm
2543 | | | +--ro (sid-label-index)?
2544 | | | +--:(local-label-case)
2545 | | | | +--ro local-label? netc:mpls-label
2546 | | | +--:(ipv6-address-case)
2547 | | | | +--ro ipv6-address? inet:ipv6-address
2548 | | | +--:(sid-case)
2549 | | | +--ro sid? uint32
2550 | | +--:(ipv6-prefix-sid-tlv-case)
2551 | | | +--ro algorithm? algorithm
2552 | | +--:(sid-label-tlv-case)
2553 | | +--ro (sid-label-index)?
2554 | | +--:(local-label-case)
2555 | | | +--ro local-label? netc:mpls-label
2556 | | +--:(ipv6-address-case)
2557 | | | +--ro ipv6-address? inet:ipv6-address
2559 | | +--ro sid? uint32
2560 | +--ro sr-binding-sid-labels*
2561 | +--ro weight? weight
2563 | | +--:(isis-binding-flags-case)
2564 | | | +--ro address-family? boolean
2565 | | | +--ro mirror-context? boolean
2566 | | | +--ro spread-tlv? boolean
2567 | | | +--ro leaked-from-level-2? boolean
2568 | | | +--ro attached-flag? boolean
2569 | | +--:(ospf-binding-flags-case)
2570 | | +--ro mirroring? boolean
2571 | +--ro binding-sub-tlvs*
2572 | +--ro (binding-sub-tlv)?
2573 | +--:(prefix-sid-case)
2575 | | | +--:(isis-prefix-flags-case)
2576 | | | | +--ro no-php? boolean
2577 | | | | +--ro explicit-null? boolean
2578 | | | | +--ro readvertisement? boolean
2579 | | | | +--ro node-sid? boolean
2580 | | | +--:(ospf-prefix-flags-case)
2581 | | | +--ro no-php? boolean
2582 | | | +--ro explicit-null? boolean
2583 | | | +--ro mapping-server? boolean
2584 | | +--ro algorithm? algorithm
2585 | | +--ro (sid-label-index)?
2586 | | +--:(local-label-case)
2587 | | | +--ro local-label? netc:mpls-label
2588 | | +--:(ipv6-address-case)
2589 | | | +--ro ipv6-address? inet:ipv6-address
2591 | | +--ro sid? uint32
2592 | +--:(ipv6-prefix-sid-case)
2593 | | +--ro algorithm? algorithm
2594 | +--:(sid-label-case)
2595 | | +--ro (sid-label-index)?
2596 | | +--:(local-label-case)
2597 | | | +--ro local-label? netc:mpls-label
2598 | | +--:(ipv6-address-case)
2599 | | | +--ro ipv6-address? inet:ipv6-address
2601 | | +--ro sid? uint32
2602 | +--:(ero-metric-case)
2603 | | +--ro ero-metric? netc:te-metric
2604 | +--:(ipv4-ero-case)
2605 | | +--ro loose? boolean
2606 | | +--ro address inet:ipv4-address
2607 | +--:(ipv6-ero-case)
2608 | | +--ro loose? boolean
2609 | | +--ro address inet:ipv6-address
2610 | +--:(unnumbered-interface-id-ero-case)
2611 | | +--ro loose? boolean
2612 | | +--ro router-id? uint32
2613 | | +--ro interface-id? uint32
2614 | +--:(ipv4-ero-backup-case)
2615 | | +--ro loose? boolean
2616 | | +--ro address inet:ipv4-address
2617 | +--:(ipv6-ero-backup-case)
2618 | | +--ro loose? boolean
2619 | | +--ro address inet:ipv6-address
2620 | +--:(unnumbered-interface-id-backup-ero-case)
2621 | +--ro loose? boolean
2622 | +--ro router-id? uint32
2623 | +--ro interface-id? uint32
2624 x--:(te-lsp-attributes-case)
2625 +--ro te-lsp-attributes
2630 The Link-State table in a instance of the speaker's Loc-RIB can be verified via REST:
2632 **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``
2640 <linkstate-routes xmlns="urn:opendaylight:params:xml:ns:yang:bgp-linkstate">
2644 .. note:: Link-State routes mapping to topology links/nodes/prefixes is supported by BGP Topology Provider.
2648 * `North-Bound Distribution of Link-State and Traffic Engineering (TE) Information Using BGP <https://tools.ietf.org/html/rfc7752>`_
2649 * `BGP Link-State extensions for Segment Routing <https://tools.ietf.org/html/draft-gredler-idr-bgp-ls-segment-routing-ext-03>`_
2650 * `Segment Routing BGP Egress Peer Engineering BGP-LS Extensions <https://tools.ietf.org/html/draft-ietf-idr-bgpls-segment-routing-epe-05>`_
2651 * `BGP Link-State Information Distribution Implementation Report <https://tools.ietf.org/html/draft-ietf-idr-ls-distribution-impl-04>`_
2653 Flow Specification Family
2654 -------------------------
2655 The BGP Flow Specification (BGP-FS) Multiprotocol extension can be used to distribute traffic flow specifications.
2656 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).
2658 .. contents:: Contents
2664 This section shows a way to enable BGP-FS family in BGP speaker and peer configuration.
2668 To enable BGP-FS support in BGP plugin, first configure BGP speaker instance:
2670 **URL:** ``/restconf/config/openconfig-network-instance:network-instances/network-instance/global-bgp/openconfig-network-instance:protocols``
2672 **Method:** ``POST``
2674 **Content-Type:** ``application/xml``
2680 <protocol xmlns="http://openconfig.net/yang/network-instance">
2681 <name>bgp-example</name>
2682 <identifier xmlns:x="http://openconfig.net/yang/policy-types">x:BGP</identifier>
2683 <bgp xmlns="urn:opendaylight:params:xml:ns:yang:bgp:openconfig-extensions">
2686 <router-id>192.0.2.2</router-id>
2691 <afi-safi-name>IPV4-FLOW</afi-safi-name>
2694 <afi-safi-name>IPV6-FLOW</afi-safi-name>
2697 <afi-safi-name>IPV4-L3VPN-FLOW</afi-safi-name>
2700 <afi-safi-name>IPV6-L3VPN-FLOW</afi-safi-name>
2709 Here is an example for BGP peer configuration with enabled BGP-FS family.
2711 **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``
2713 **Method:** ``POST``
2715 **Content-Type:** ``application/xml``
2721 <neighbor xmlns="urn:opendaylight:params:xml:ns:yang:bgp:openconfig-extensions">
2722 <neighbor-address>192.0.2.1</neighbor-address>
2725 <afi-safi-name>IPV4-FLOW</afi-safi-name>
2728 <afi-safi-name>IPV6-FLOW</afi-safi-name>
2731 <afi-safi-name>IPV4-L3VPN-FLOW</afi-safi-name>
2734 <afi-safi-name>IPV6-L3VPN-FLOW</afi-safi-name>
2739 Flow Specification API
2740 ^^^^^^^^^^^^^^^^^^^^^^
2741 Following trees illustrate the BGP Flow Specification routes structure.
2743 IPv4 Flow Specification Route
2744 '''''''''''''''''''''''''''''
2745 .. code-block:: console
2747 :(flowspec-routes-case)
2748 +--ro flowspec-routes
2749 +--ro flowspec-route* [route-key path-id]
2750 +--ro route-key string
2752 | +--ro (flowspec-type)?
2755 | | +--ro op? numeric-operand
2756 | | +--ro value? uint16
2757 | +--:(destination-port-case)
2758 | | +--ro destination-ports*
2759 | | +--ro op? numeric-operand
2760 | | +--ro value? uint16
2761 | +--:(source-port-case)
2762 | | +--ro source-ports*
2763 | | +--ro op? numeric-operand
2764 | | +--ro value? uint16
2765 | +--:(icmp-type-case)
2767 | | +--ro op? numeric-operand
2768 | | +--ro value? uint8
2769 | +--:(icmp-code-case)
2771 | | +--ro op? numeric-operand
2772 | | +--ro value? uint8
2773 | +--:(tcp-flags-case)
2774 | | +--ro tcp-flags*
2775 | | +--ro op? bitmask-operand
2776 | | +--ro value? uint16
2777 | +--:(packet-length-case)
2778 | | +--ro packet-lengths*
2779 | | +--ro op? numeric-operand
2780 | | +--ro value? uint16
2783 | | +--ro op? numeric-operand
2784 | | +--ro value? dscp
2785 | +--:(fragment-case)
2786 | | +--ro fragments*
2787 | | +--ro op? bitmask-operand
2788 | | +--ro value? fragment
2789 | +--:(destination-prefix-case)
2790 | | +--ro destination-prefix? inet:ipv4-prefix
2791 | +--:(source-prefix-case)
2792 | | +--ro source-prefix? inet:ipv4-prefix
2793 | +--:(protocol-ip-case)
2794 | +--ro protocol-ips*
2795 | +--ro op? numeric-operand
2796 | +--ro value? uint8
2797 +--ro path-id path-id
2799 +--ro extended-communities*
2800 +--ro transitive? boolean
2801 +--ro (extended-community)?
2802 +--:(traffic-rate-extended-community-case)
2803 | +--ro traffic-rate-extended-community
2804 | +--ro informative-as? bgp-t:short-as-number
2805 | +--ro local-administrator? netc:bandwidth
2806 +--:(traffic-action-extended-community-case)
2807 | +--ro traffic-action-extended-community
2808 | +--ro sample? boolean
2809 | +--ro terminal-action? boolean
2810 +--:(redirect-extended-community-case)
2811 | +--ro redirect-extended-community
2812 | +--ro global-administrator? bgp-t:short-as-number
2813 | +--ro local-administrator? binary
2814 +--:(traffic-marking-extended-community-case)
2815 | +--ro traffic-marking-extended-community
2816 | +--ro global-administrator? dscp
2817 +--:(redirect-ipv4-extended-community-case)
2818 | +--ro redirect-ipv4
2819 | +--ro global-administrator? inet:ipv4-address
2820 | +--ro local-administrator? uint16
2821 +--:(redirect-as4-extended-community-case)
2822 | +--ro redirect-as4
2823 | +--ro global-administrator? inet:as-number
2824 | +--ro local-administrator? uint16
2825 +--:(redirect-ip-nh-extended-community-case)
2826 +--ro redirect-ip-nh-extended-community
2827 +--ro next-hop-address? inet:ip-address
2831 IPv6 Flow Specification Route
2832 '''''''''''''''''''''''''''''
2833 .. code-block:: console
2835 :(flowspec-ipv6-routes-case)
2836 +--ro flowspec-ipv6-routes
2837 +--ro flowspec-route* [route-key path-id]
2839 | +--ro (flowspec-type)?
2842 | | +--ro op? numeric-operand
2843 | | +--ro value? uint16
2844 | +--:(destination-port-case)
2845 | | +--ro destination-ports*
2846 | | +--ro op? numeric-operand
2847 | | +--ro value? uint16
2848 | +--:(source-port-case)
2849 | | +--ro source-ports*
2850 | | +--ro op? numeric-operand
2851 | | +--ro value? uint16
2852 | +--:(icmp-type-case)
2854 | | +--ro op? numeric-operand
2855 | | +--ro value? uint8
2856 | +--:(icmp-code-case)
2858 | | +--ro op? numeric-operand
2859 | | +--ro value? uint8
2860 | +--:(tcp-flags-case)
2861 | | +--ro tcp-flags*
2862 | | +--ro op? bitmask-operand
2863 | | +--ro value? uint16
2864 | +--:(packet-length-case)
2865 | | +--ro packet-lengths*
2866 | | +--ro op? numeric-operand
2867 | | +--ro value? uint16
2870 | | +--ro op? numeric-operand
2871 | | +--ro value? dscp
2872 | +--:(fragment-case)
2873 | | +--ro fragments*
2874 | | +--ro op? bitmask-operand
2875 | | +--ro value? fragment
2876 | +--:(destination-ipv6-prefix-case)
2877 | | +--ro destination-prefix? inet:ipv6-prefix
2878 | +--:(source-ipv6-prefix-case)
2879 | | +--ro source-prefix? inet:ipv6-prefix
2880 | +--:(next-header-case)
2881 | | +--ro next-headers*
2882 | | +--ro op? numeric-operand
2883 | | +--ro value? uint8
2884 | +--:(flow-label-case)
2886 | +--ro op? numeric-operand
2887 | +--ro value? uint32
2888 +--ro path-id path-id
2890 +--ro extended-communities*
2891 +--ro transitive? boolean
2892 +--ro (extended-community)?
2893 +--:(traffic-rate-extended-community-case)
2894 | +--ro traffic-rate-extended-community
2895 | +--ro informative-as? bgp-t:short-as-number
2896 | +--ro local-administrator? netc:bandwidth
2897 +--:(traffic-action-extended-community-case)
2898 | +--ro traffic-action-extended-community
2899 | +--ro sample? boolean
2900 | +--ro terminal-action? boolean
2901 +--:(redirect-extended-community-case)
2902 | +--ro redirect-extended-community
2903 | +--ro global-administrator? bgp-t:short-as-number
2904 | +--ro local-administrator? binary
2905 +--:(traffic-marking-extended-community-case)
2906 | +--ro traffic-marking-extended-community
2907 | +--ro global-administrator? dscp
2908 +--:(redirect-ipv6-extended-community-case)
2909 | +--ro redirect-ipv6
2910 | +--ro global-administrator? inet:ipv6-address
2911 | +--ro local-administrator? uint16
2912 +--:(redirect-as4-extended-community-case)
2913 | +--ro redirect-as4
2914 | +--ro global-administrator? inet:as-number
2915 | +--ro local-administrator? uint16
2916 +--:(redirect-ip-nh-extended-community-case)
2917 +--ro redirect-ip-nh-extended-community
2918 +--ro next-hop-address? inet:ip-address
2923 The flowspec route represents rules and an action, defined as an extended community.
2925 IPv4 Flow Specification
2926 '''''''''''''''''''''''
2927 The IPv4 Flowspec table in an instance of the speaker's Loc-RIB can be verified via REST:
2929 **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``
2937 <flowspec-routes xmlns="urn:opendaylight:params:xml:ns:yang:bgp-flowspec">
2939 <path-id>0</path-id>
2940 <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>
2949 <extended-communities>
2950 <transitive>true</transitive>
2951 <redirect-extended-community>
2952 <local-administrator>AgMWLg==</local-administrator>
2953 <global-administrator>258</global-administrator>
2954 </redirect-extended-community>
2955 </extended-communities>
2958 <destination-prefix>192.168.0.1/32</destination-prefix>
2961 <source-prefix>10.0.0.2/32</source-prefix>
2969 <op>equals end-of-list</op>
2979 <op>equals end-of-list</op>
2985 <op>greater-than</op>
2987 </destination-ports>
2989 <op>less-than and-bit</op>
2991 </destination-ports>
2993 <op>equals end-of-list</op>
2995 </destination-ports>
2999 <op>end-of-list greater-than</op>
3006 IPv6 Flows Specification
3007 ''''''''''''''''''''''''
3008 The IPv6 Flowspec table in an instance of the speaker's Loc-RIB can be verified via REST:
3010 **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``
3018 <flowspec-ipv6-routes xmlns="urn:opendaylight:params:xml:ns:yang:bgp-flowspec">
3020 <path-id>0</path-id>
3021 <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>
3030 <extended-communities>
3031 <transitive>true</transitive>
3032 <traffic-rate-extended-community>
3033 <informative-as>0</informative-as>
3034 <local-administrator>AAAAAA==</local-administrator>
3035 </traffic-rate-extended-community>
3036 </extended-communities>
3039 <destination-prefix>2001:db8:31::/64</destination-prefix>
3042 <source-prefix>2001:db8:30::/64</source-prefix>
3046 <op>equals end-of-list</op>
3052 <op>equals end-of-list</op>
3058 <op>equals end-of-list</op>
3063 </flowspec-ipv6-routes>
3065 IPv4 L3VPN Flows Specification
3066 ''''''''''''''''''''''''''''''
3067 The IPv4 L3VPN Flowspec table in an instance of the speaker's Loc-RIB can be verified via REST:
3069 **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``
3077 <flowspec-l3vpn-ipv4-routes xmlns="urn:opendaylight:params:xml:ns:yang:bgp-flowspec">
3078 <flowspec-l3vpn-route>
3079 <path-id>0</path-id>
3080 <route-key>[l3vpn with route-distinguisher 172.16.0.44:101] all packets from 10.0.0.3/32</route-key>
3086 <global>5.6.7.8</global>
3092 <extended-communities>
3093 <transitive>true</transitive>
3094 <redirect-ip-nh-extended-community>
3096 <next-hop-address>0.0.0.0</next-hop-address>
3097 </redirect-ip-nh-extended-community>
3098 </extended-communities>
3100 <route-distinguisher>172.16.0.44:101</route-distinguisher>
3102 <source-prefix>10.0.0.3/32</source-prefix>
3104 </flowspec-l3vpn-route>
3105 </flowspec-l3vpn-ipv4-routes>
3109 IPv4 Flow Specification
3110 '''''''''''''''''''''''
3111 This examples show how to originate and remove IPv4 fowspec route via programmable RIB.
3112 Make sure the *Application Peer* is configured first.
3114 **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``
3116 **Method:** ``POST``
3118 **Content-Type:** ``application/xml``
3124 <flowspec-route xmlns="urn:opendaylight:params:xml:ns:yang:bgp-flowspec">
3125 <route-key>flow1</route-key>
3126 <path-id>0</path-id>
3128 <destination-prefix>192.168.0.1/32</destination-prefix>
3131 <source-prefix>10.0.0.1/32</source-prefix>
3135 <op>equals end-of-list</op>
3141 <op>equals end-of-list</op>
3147 <op>greater-than</op>
3149 </destination-ports>
3151 <op>and-bit less-than end-of-list</op>
3153 </destination-ports>
3157 <op>greater-than end-of-list</op>
3163 <op>equals end-of-list</op>
3169 <op>equals end-of-list</op>
3175 <op>match end-of-list</op>
3181 <op>greater-than</op>
3185 <op>and-bit less-than end-of-list</op>
3191 <op>equals end-of-list</op>
3197 <op>match end-of-list</op>
3198 <value>first</value>
3209 <extended-communities>
3211 </extended-communities>
3217 **Extended Communities**
3224 <extended-communities>
3225 <transitive>true</transitive>
3226 <traffic-rate-extended-community>
3227 <informative-as>123</informative-as>
3228 <local-administrator>AAAAAA==</local-administrator>
3229 </traffic-rate-extended-community>
3230 </extended-communities>
3232 @line 5: A rate in bytes per second, *AAAAAA==* (0) means traffic discard.
3234 * **Traffic Action**
3237 <extended-communities>
3238 <transitive>true</transitive>
3239 <traffic-action-extended-community>
3240 <sample>true</sample>
3241 <terminal-action>false</terminal-action>
3242 </traffic-action-extended-community>
3243 </extended-communities>
3246 * **Redirect to VRF AS 2byte format**
3249 <extended-communities>
3250 <transitive>true</transitive>
3251 <redirect-extended-community>
3252 <global-administrator>123</global-administrator>
3253 <local-administrator>AAAAew==</local-administrator>
3254 </redirect-extended-community>
3255 </extended-communities>
3257 * **Redirect to VRF IPv4 format**
3260 <extended-communities>
3261 <transitive>true</transitive>
3263 <global-administrator>192.168.0.1</global-administrator>
3264 <local-administrator>12345</local-administrator>
3266 </extended-communities>
3268 * **Redirect to VRF AS 4byte format**
3271 <extended-communities>
3272 <transitive>true</transitive>
3274 <global-administrator>64495</global-administrator>
3275 <local-administrator>12345</local-administrator>
3277 </extended-communities>
3279 * **Redirect to IP**
3282 <extended-communities>
3283 <transitive>true</transitive>
3284 <redirect-ip-nh-extended-community>
3286 </redirect-ip-nh-extended-community>
3287 </extended-communities>
3289 * **Traffic Marking**
3292 <extended-communities>
3293 <transitive>true</transitive>
3294 <traffic-marking-extended-community>
3295 <global-administrator>20</global-administrator>
3296 </traffic-marking-extended-community>
3297 </extended-communities>
3301 To remove the route added above, following request can be used:
3303 **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``
3305 **Method:** ``DELETE``
3307 IPv4 L3VPN Flow Specification
3308 '''''''''''''''''''''''''''''
3309 This examples show how to originate and remove IPv4 L3VPN fowspec route via programmable RIB.
3311 **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``
3313 **Method:** ``POST``
3315 **Content-Type:** ``application/xml``
3321 <flowspec-l3vpn-route xmlns="urn:opendaylight:params:xml:ns:yang:bgp-flowspec">
3322 <path-id>0</path-id>
3323 <route-key>flow-l3vpn</route-key>
3324 <route-distinguisher>172.16.0.44:101</route-distinguisher>
3326 <source-prefix>10.0.0.3/32</source-prefix>
3336 <extended-communities>
3337 <transitive>true</transitive>
3339 <global-administrator>172.16.0.44</global-administrator>
3340 <local-administrator>102</local-administrator>
3342 </extended-communities>
3344 </flowspec-l3vpn-route>
3348 To remove the route added above, following request can be used:
3350 **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``
3352 **Method:** ``DELETE``
3354 IPv6 Flow Specification
3355 '''''''''''''''''''''''
3356 This examples show how to originate and remove IPv6 fowspec route via programmable RIB.
3358 **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``
3360 **Method:** ``POST``
3362 **Content-Type:** ``application/xml``
3368 <flowspec-route xmlns="urn:opendaylight:params:xml:ns:yang:bgp-flowspec">
3369 <route-key>flow-v6</route-key>
3370 <path-id>0</path-id>
3372 <destination-prefix>2001:db8:30::3/128</destination-prefix>
3375 <source-prefix>2001:db8:31::3/128</source-prefix>
3379 <op>equals end-of-list</op>
3384 <extended-communities>
3385 <transitive>true</transitive>
3387 <global-administrator>2001:db8:1::6</global-administrator>
3388 <local-administrator>12345</local-administrator>
3390 </extended-communities>
3403 To remove the route added above, following request can be used:
3405 **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``
3407 **Method:** ``DELETE``
3411 * `Dissemination of Flow Specification Rules <https://tools.ietf.org/html/rfc5575>`_
3412 * `Dissemination of Flow Specification Rules for IPv6 <https://tools.ietf.org/html/draft-ietf-idr-flow-spec-v6-07>`_
3413 * `BGP Flow-Spec Extended Community for Traffic Redirect to IP Next Hop <https://tools.ietf.org/html/draft-ietf-idr-flowspec-redirect-ip-00>`_
3414 * `Clarification of the Flowspec Redirect Extended Community <https://tools.ietf.org/html/rfc7674>`_
3415 * `Revised Validation Procedure for BGP Flow Specifications <https://tools.ietf.org/html/draft-ietf-idr-bgp-flowspec-oid-03>`_
3419 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.
3420 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.
3421 In addition to MPLS, IP tunnelling encapsulation techniques like VXLAN, NVGRE, MPLSoGRE and others can be used for packet transportation.
3422 Also, Provider Backbone Bridging (PBB) can be combined with EVPN in order to reduce a number of MAC Advertisement routes.
3424 .. contents:: Contents
3430 This section shows a way to enable EVPN family in BGP speaker and peer configuration.
3434 To enable EVPN support in BGP plugin, first configure BGP speaker instance:
3436 **URL:** ``/restconf/config/openconfig-network-instance:network-instances/network-instance/global-bgp/openconfig-network-instance:protocols``
3438 **Method:** ``POST``
3440 **Content-Type:** ``application/xml``
3446 <protocol xmlns="http://openconfig.net/yang/network-instance">
3447 <name>bgp-example</name>
3448 <identifier xmlns:x="http://openconfig.net/yang/policy-types">x:BGP</identifier>
3449 <bgp xmlns="urn:opendaylight:params:xml:ns:yang:bgp:openconfig-extensions">
3452 <router-id>192.0.2.2</router-id>
3457 <afi-safi-name xmlns:x="http://openconfig.net/yang/bgp-types">x:L2VPN-EVPN</afi-safi-name>
3466 Here is an example for BGP peer configuration with enabled EVPN family.
3468 **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``
3470 **Method:** ``POST``
3472 **Content-Type:** ``application/xml``
3478 <neighbor xmlns="urn:opendaylight:params:xml:ns:yang:bgp:openconfig-extensions">
3479 <neighbor-address>192.0.2.1</neighbor-address>
3482 <afi-safi-name xmlns:x="http://openconfig.net/yang/bgp-types">x:L2VPN-EVPN</afi-safi-name>
3489 Following tree illustrate the BGP EVPN route structure.
3491 .. code-block:: console
3495 +--ro evpn-route* [route-key]
3496 +--ro route-key string
3498 | +--:(ethernet-a-d-route-case)
3499 | | +--ro ethernet-a-d-route
3501 | | | +--:(arbitrary-case)
3502 | | | | +--ro arbitrary
3503 | | | | +--ro arbitrary binary
3504 | | | +--:(lacp-auto-generated-case)
3505 | | | | +--ro lacp-auto-generated
3506 | | | | +--ro ce-lacp-mac-address yang:mac-address
3507 | | | | +--ro ce-lacp-port-key uint16
3508 | | | +--:(lan-auto-generated-case)
3509 | | | | +--ro lan-auto-generated
3510 | | | | +--ro root-bridge-mac-address yang:mac-address
3511 | | | | +--ro root-bridge-priority uint16
3512 | | | +--:(mac-auto-generated-case)
3513 | | | | +--ro mac-auto-generated
3514 | | | | +--ro system-mac-address yang:mac-address
3515 | | | | +--ro local-discriminator uint24
3516 | | | +--:(router-id-generated-case)
3517 | | | | +--ro router-id-generated
3518 | | | | +--ro router-id inet:ipv4-address
3519 | | | | +--ro local-discriminator uint32
3520 | | | +--:(as-generated-case)
3521 | | | +--ro as-generated
3522 | | | +--ro as inet:as-number
3523 | | | +--ro local-discriminator uint32
3524 | | +--ro ethernet-tag-id
3525 | | | +--ro vlan-id uint32
3526 | | +--ro mpls-label netc:mpls-label
3527 | +--:(mac-ip-adv-route-case)
3528 | | +--ro mac-ip-adv-route
3530 | | | +--:(arbitrary-case)
3531 | | | | +--ro arbitrary
3532 | | | | +--ro arbitrary binary
3533 | | | +--:(lacp-auto-generated-case)
3534 | | | | +--ro lacp-auto-generated
3535 | | | | +--ro ce-lacp-mac-address yang:mac-address
3536 | | | | +--ro ce-lacp-port-key uint16
3537 | | | +--:(lan-auto-generated-case)
3538 | | | | +--ro lan-auto-generated
3539 | | | | +--ro root-bridge-mac-address yang:mac-address
3540 | | | | +--ro root-bridge-priority uint16
3541 | | | +--:(mac-auto-generated-case)
3542 | | | | +--ro mac-auto-generated
3543 | | | | +--ro system-mac-address yang:mac-address
3544 | | | | +--ro local-discriminator uint24
3545 | | | +--:(router-id-generated-case)
3546 | | | | +--ro router-id-generated
3547 | | | | +--ro router-id inet:ipv4-address
3548 | | | | +--ro local-discriminator uint32
3549 | | | +--:(as-generated-case)
3550 | | | +--ro as-generated
3551 | | | +--ro as inet:as-number
3552 | | | +--ro local-discriminator uint32
3553 | | +--ro ethernet-tag-id
3554 | | | +--ro vlan-id uint32
3555 | | +--ro mac-address yang:mac-address
3556 | | +--ro ip-address? inet:ip-address
3557 | | +--ro mpls-label1 netc:mpls-label
3558 | | +--ro mpls-label2? netc:mpls-label
3559 | +--:(inc-multi-ethernet-tag-res-case)
3560 | | +--ro inc-multi-ethernet-tag-res
3561 | | +--ro ethernet-tag-id
3562 | | | +--ro vlan-id uint32
3563 | | +--ro orig-route-ip? inet:ip-address
3564 | +--:(es-route-case)
3567 | | +--:(arbitrary-case)
3568 | | | +--ro arbitrary
3569 | | | +--ro arbitrary binary
3570 | | +--:(lacp-auto-generated-case)
3571 | | | +--ro lacp-auto-generated
3572 | | | +--ro ce-lacp-mac-address yang:mac-address
3573 | | | +--ro ce-lacp-port-key uint16
3574 | | +--:(lan-auto-generated-case)
3575 | | | +--ro lan-auto-generated
3576 | | | +--ro root-bridge-mac-address yang:mac-address
3577 | | | +--ro root-bridge-priority uint16
3578 | | +--:(mac-auto-generated-case)
3579 | | | +--ro mac-auto-generated
3580 | | | +--ro system-mac-address yang:mac-address
3581 | | | +--ro local-discriminator uint24
3582 | | +--:(router-id-generated-case)
3583 | | | +--ro router-id-generated
3584 | | | +--ro router-id inet:ipv4-address
3585 | | | +--ro local-discriminator uint32
3586 | | +--:(as-generated-case)
3587 | | +--ro as-generated
3588 | | +--ro as inet:as-number
3589 | | +--ro local-discriminator uint32
3590 | +--ro orig-route-ip inet:ip-address
3591 +--ro route-distinguisher bgp-t:route-distinguisher
3593 +--ro extended-communities*
3594 | +--ro transitive? boolean
3595 | +--ro (extended-community)?
3596 | +--:(encapsulation-case)
3597 | | +--ro encapsulation-extended-community
3598 | | +--ro tunnel-type encapsulation-tunnel-type
3599 | +--:(esi-label-extended-community-case)
3600 | | +--ro esi-label-extended-community
3601 | | +--ro single-active-mode? boolean
3602 | | +--ro esi-label netc:mpls-label
3603 | +--:(es-import-route-extended-community-case)
3604 | | +--ro es-import-route-extended-community
3605 | | +--ro es-import yang:mac-address
3606 | +--:(mac-mobility-extended-community-case)
3607 | | +--ro mac-mobility-extended-community
3608 | | +--ro static? boolean
3609 | | +--ro seq-number uint32
3610 | +--:(default-gateway-extended-community-case)
3611 | | +--ro default-gateway-extended-community!
3612 | +--:(layer-2-attributes-extended-community-case)
3613 | +--ro layer-2-attributes-extended-community
3614 | +--ro primary-pe? boolean
3615 | +--ro backup-pe? boolean
3616 | +--ro control-word? boolean
3617 | +--ro l2-mtu uint16
3619 +--ro leaf-information-required boolean
3620 +--ro mpls-label? netc:mpls-label
3621 +--ro (tunnel-identifier)?
3622 +--:(rsvp-te-p2mp-lsp)
3623 | +--ro rsvp-te-p2mp-lps
3624 | +--ro p2mp-id uint32
3625 | +--ro tunnel-id uint16
3626 | +--ro extended-tunnel-id inet:ip-address
3628 | +--ro mldp-p2mp-lsp
3629 | +--ro address-family identityref
3630 | +--ro root-node-address inet:ip-address
3631 | +--ro opaque-value*
3632 | +--ro opaque-type uint8
3633 | +--ro opaque-extended-type? uint16
3634 | +--ro opaque yang:hex-string
3636 | +--ro pim-ssm-tree
3637 | +--ro p-address inet:ip-address
3638 | +--ro p-multicast-group inet:ip-address
3641 | +--ro p-address inet:ip-address
3642 | +--ro p-multicast-group inet:ip-address
3643 +--:(bidir-pim-tree)
3644 | +--ro bidir-pim-tree
3645 | +--ro p-address inet:ip-address
3646 | +--ro p-multicast-group inet:ip-address
3647 +--:(ingress-replication)
3648 | +--ro ingress-replication
3649 | +--ro receiving-endpoint-address? inet:ip-address
3650 +--:(mldp-mp2mp-lsp)
3651 +--ro mldp-mp2mp-lsp
3652 +--ro opaque-type uint8
3653 +--ro opaque-extended-type? uint16
3659 The L2VPN EVPN table in an instance of the speaker's Loc-RIB can be verified via REST:
3661 **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``
3669 <evpn-routes xmlns="urn:opendaylight:params:xml:ns:yang:bgp-evpn">
3671 <route-key>AxEAAcCoZAED6AAAAQAgwKhkAQ==</route-key>
3672 <route-distinguisher>192.168.100.1:1000</route-distinguisher>
3673 <inc-multi-ethernet-tag-res>
3675 <vlan-id>256</vlan-id>
3677 <orig-route-ip>192.168.100.1</orig-route-ip>
3678 </inc-multi-ethernet-tag-res>
3681 <global>172.23.29.104</global>
3687 <extended-communities>
3688 <extended-communities>
3689 <transitive>true</transitive>
3690 <route-target-extended-community>
3691 <global-administrator>65504</global-administrator>
3692 <local-administrator>AAAD6A==</local-administrator>
3693 </route-target-extended-community>
3694 </extended-communities>
3695 </extended-communities>
3697 <leaf-information-required>true</leaf-information-required>
3698 <mpls-label>20024</mpls-label>
3699 <ingress-replication>
3700 <receiving-endpoint-address>192.168.100.1</receiving-endpoint-address>
3701 </ingress-replication>
3709 This examples show how to originate and remove EVPN routes via programmable RIB.
3710 There are four different types of EVPN routes, and several extended communities.
3711 Routes can be used for variety of use-cases supported by BGP/MPLS EVPN, PBB EVPN and NVO EVPN.
3712 Make sure the *Application Peer* is configured first.
3714 **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``
3716 **Method:** ``POST``
3718 **Content-Type:** ``application/xml``
3724 :emphasize-lines: 3,4,14
3726 <evpn-route xmlns="urn:opendaylight:params:xml:ns:yang:bgp-evpn">
3727 <route-key>evpn</route-key>
3728 <route-distinguisher>172.12.123.3:200</route-distinguisher>
3732 <global>199.20.166.41</global>
3738 <extended-communities>
3740 </extended-communities>
3744 @line 3: Route Distinguisher (RD) - set to RD of the MAC-VRF advertising the NLRI, recommended format *<IP>:<VLAN_ID>*
3746 @line 4: One of the EVPN route must be set here.
3748 @line 14: In some cases, specific extended community presence is required. The route may carry one or more Route Target attributes.
3754 * **Ethernet AD per ESI**
3757 <ethernet-a-d-route>
3758 <mpls-label>0</mpls-label>
3760 <vlan-id>4294967295</vlan-id>
3763 <arbitrary>AAAAAAAAAAAA</arbitrary>
3765 </ethernet-a-d-route>
3767 * **Ethernet AD per EVI**
3770 <ethernet-a-d-route>
3771 <mpls-label>24001</mpls-label>
3773 <vlan-id>2200</vlan-id>
3776 <arbitrary>AAAAAAAAAAAA</arbitrary>
3778 </ethernet-a-d-route>
3780 * **MAC/IP Advertisement**
3785 <arbitrary>AAAAAAAAAAAA</arbitrary>
3788 <vlan-id>2100</vlan-id>
3790 <mac-address>f2:0c:dd:80:9f:f7</mac-address>
3791 <ip-address>10.0.1.12</ip-address>
3792 <mpls-label1>299776</mpls-label1>
3796 * **Inclusive Multicast Ethernet Tag**
3799 <inc-multi-ethernet-tag-res>
3801 <vlan-id>2100</vlan-id>
3803 <orig-route-ip>43.43.43.43</orig-route-ip>
3804 </inc-multi-ethernet-tag-res>
3806 * **Ethernet Segment**
3810 <orig-route-ip>43.43.43.43</orig-route-ip>
3812 <arbitrary>AAAAAAAAAAAA</arbitrary>
3816 **EVPN Ethernet Segment Identifier (ESI):**
3819 Indicates an arbitrary 9-octet ESI.
3824 <arbitrary>AAAAAAAAAAAA</arbitrary>
3828 IEEE 802.1AX LACP is used.
3832 <lacp-auto-generated>
3833 <ce-lacp-mac-address>f2:0c:dd:80:9f:f7</ce-lacp-mac-address>
3834 <ce-lacp-port-key>22</ce-lacp-port-key>
3835 </lacp-auto-generated>
3838 Indirectly connected hosts via a bridged LAN.
3842 <lan-auto-generated>
3843 <root-bridge-mac-address>f2:0c:dd:80:9f:f7</root-bridge-mac-address>
3844 <root-bridge-priority>20</root-bridge-priority>
3845 </lan-auto-generated>
3852 <mac-auto-generated>
3853 <system-mac-address>f2:0c:dd:80:9f:f7</system-mac-address>
3854 <local-discriminator>2000</local-discriminator>
3855 </mac-auto-generated>
3862 <router-id-generated>
3863 <router-id>43.43.43.43</router-id>
3864 <local-discriminator>2000</local-discriminator>
3865 </router-id-generated>
3874 <local-discriminator>2000</local-discriminator>
3877 **Extended Communities:**
3879 * **ESI Label Extended Community**
3882 <extended-communities>
3883 <transitive>true</transitive>
3884 <esi-label-extended-community>
3885 <single-active-mode>false</single-active-mode>
3886 <esi-label>24001</esi-label>
3887 </esi-label-extended-community >
3888 </extended-communities>
3890 * **ES-Import Route Target**
3893 <extended-communities>
3894 <transitive>true</transitive>
3895 <es-import-route-extended-community>
3896 <es-import>f2:0c:dd:80:9f:f7</es-import>
3897 </es-import-route-extended-community>
3898 </extended-communities>
3900 * **MAC Mobility Extended Community**
3903 <extended-communities>
3904 <transitive>true</transitive>
3905 <mac-mobility-extended-community>
3906 <static>true</static>
3907 <seq-number>200</seq-number>
3908 </mac-mobility-extended-community>
3909 </extended-communities>
3911 * **Default Gateway Extended Community**
3914 <extended-communities>
3915 <transitive>true</transitive>
3916 <default-gateway-extended-community>
3917 </default-gateway-extended-community>
3918 </extended-communities>
3920 * **EVPN Layer 2 attributes extended community**
3923 <extended-communities>
3924 <transitive>false</transitive>
3925 <layer-2-attributes-extended-community>
3926 <primary-pe>true</primary-pe>
3927 <backup-pe>true</backup-pe>
3928 <control-word >true</control-word>
3929 <l2-mtu>200</l2-mtu>
3930 </layer-2-attributes-extended-community>
3931 </extended-communities>
3933 * **BGP Encapsulation extended community**
3938 <extended-communities>
3939 <transitive>false</transitive>
3940 <encapsulation-extended-community>
3941 <tunnel-type>vxlan</tunnel-type>
3942 </encapsulation-extended-community>
3943 </extended-communities>
3945 @line 4: `full list of tunnel types <http://www.iana.org/assignments/bgp-parameters/bgp-parameters.xhtml#tunnel-types>`_
3947 * **P-Multicast Service Interface Tunnel (PMSI) attribute**
3951 <leaf-information-required>true</leaf-information-required>
3952 <mpls-label>20024</mpls-label>
3953 <ingress-replication>
3954 <receiving-endpoint-address>172.12.123.3</receiving-endpoint-address>
3955 </ingress-replication>
3960 To remove the route added above, following request can be used:
3962 **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``
3964 **Method:** ``DELETE``
3968 .. table:: EVPN Routes Usage.
3970 +--------------------------------------+-----------------------------------------------------+-------------------------------------------+
3971 | EVN Route Type | Extended Communities | Usage |
3972 +======================================+=====================================================+===========================================+
3973 | **Ethernet Auto-discovery** | ESI Label, BGP EncapsulationEVPN Layer 2 attributes | Fast Convergence, Split Horizon, Aliasing |
3974 +--------------------------------------+-----------------------------------------------------+-------------------------------------------+
3975 | **MAC/IP Advertisement** | BGP Encapsulation, MAC Mobility, Default Gateway | MAC address reachability |
3976 +--------------------------------------+-----------------------------------------------------+-------------------------------------------+
3977 | **Inclusive Multicast Ethernet Tag** | PMSI Tunnel, BGP Encapsulation | Handling of Multi-destination traffic |
3978 +--------------------------------------+-----------------------------------------------------+-------------------------------------------+
3979 | **Ethernet Segment** | BGP Encapsulation, ES-Import Route Target | Designated Forwarder Election |
3980 +--------------------------------------+-----------------------------------------------------+-------------------------------------------+
3984 * `BGP MPLS-Based Ethernet VPN <https://tools.ietf.org/html/rfc7432>`_
3985 * `Provider Backbone Bridging Combined with Ethernet VPN <https://tools.ietf.org/html/rfc7623>`_
3986 * `VPWS support in EVPN <https://tools.ietf.org/html/draft-ietf-bess-evpn-vpws-07>`_
3987 * `A Network Virtualization Overlay Solution using EVPN <https://tools.ietf.org/html/draft-ietf-bess-evpn-overlay-04>`_
3988 * `Interconnect Solution for EVPN Overlay networks <https://tools.ietf.org/html/draft-ietf-bess-dci-evpn-overlay-04>`_
3989 * `Usage and applicability of BGP MPLS based Ethernet VPN <https://tools.ietf.org/html/draft-ietf-bess-evpn-usage-03>`_
3993 The ADD-PATH capability allows to advertise multiple paths for the same address prefix.
3994 It can help with optimal routing and routing convergence in a network by providing potential alternate or backup paths.
3996 .. contents:: Contents
4002 This section shows a way to enable ADD-PATH capability in BGP speaker and peer configuration.
4004 .. note:: The capability is applicable for IP Unicast, IP Labeled Unicast and Flow Specification address families.
4008 To enable ADD-PATH capability in BGP plugin, first configure BGP speaker instance:
4010 **URL:** ``/restconf/config/openconfig-network-instance:network-instances/network-instance/global-bgp/openconfig-network-instance:protocols``
4012 **Method:** ``POST``
4014 **Content-Type:** ``application/xml``
4020 :emphasize-lines: 14
4022 <protocol xmlns="http://openconfig.net/yang/network-instance">
4023 <name>bgp-example</name>
4024 <identifier xmlns:x="http://openconfig.net/yang/policy-types">x:BGP</identifier>
4025 <bgp xmlns="urn:opendaylight:params:xml:ns:yang:bgp:openconfig-extensions">
4028 <router-id>192.0.2.2</router-id>
4033 <afi-safi-name xmlns:x="http://openconfig.net/yang/bgp-types">x:IPV4-UNICAST</afi-safi-name>
4034 <receive>true</receive>
4035 <send-max>2</send-max>
4042 @line 14: Defines path selection strategy: *send-max* > 1 -> Advertise N Paths or *send-max* = 0 -> Advertise All Paths
4044 Here is an example for update a specific family with enable ADD-PATH capability
4046 **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``
4050 **Content-Type:** ``application/xml``
4056 <afi-safi xmlns="urn:opendaylight:params:xml:ns:yang:bgp:openconfig-extensions">
4057 <afi-safi-name xmlns:x="http://openconfig.net/yang/bgp-types">x:IPV4-UNICAST</afi-safi-name>
4058 <receive>true</receive>
4059 <send-max>0</send-max>
4064 Here is an example for BGP peer configuration with enabled ADD-PATH capability.
4066 **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``
4068 **Method:** ``POST``
4070 **Content-Type:** ``application/xml``
4076 <neighbor xmlns="urn:opendaylight:params:xml:ns:yang:bgp:openconfig-extensions">
4077 <neighbor-address>192.0.2.1</neighbor-address>
4080 <afi-safi-name xmlns:x="http://openconfig.net/yang/bgp-types">x:IPV4-LABELLED-UNICAST</afi-safi-name>
4083 <afi-safi-name xmlns:x="http://openconfig.net/yang/bgp-types">x:IPV4-UNICAST</afi-safi-name>
4084 <receive>true</receive>
4085 <send-max>0</send-max>
4090 .. 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.
4092 Here is an example for update specific family BGP peer configuration with enabled ADD-PATH capability.
4094 **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``
4098 **Content-Type:** ``application/xml``
4104 <afi-safi xmlns="urn:opendaylight:params:xml:ns:yang:bgp:openconfig-extensions">
4105 <afi-safi-name xmlns:x="http://openconfig.net/yang/bgp-types">x:IPV4-UNICAST</afi-safi-name>
4106 <receive>true</receive>
4107 <send-max>0</send-max>
4112 The IPv4 Unicast table with enabled ADD-PATH capability in an instance of the speaker's Loc-RIB can be verified via REST:
4114 **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``
4124 <ipv4-routes xmlns="urn:opendaylight:params:xml:ns:yang:bgp-inet">
4126 <path-id>1</path-id>
4127 <prefix>193.0.2.1/32</prefix>
4137 <global>10.0.0.1</global>
4142 <path-id>2</path-id>
4143 <prefix>193.0.2.1/32</prefix>
4153 <global>10.0.0.2</global>
4159 @line 3: The routes with the same destination are distinguished by *path-id* attribute.
4163 * `Advertisement of Multiple Paths in BGP <https://tools.ietf.org/html/rfc7911>`_
4164 * `Best Practices for Advertisement of Multiple Paths in IBGP <https://tools.ietf.org/html/draft-ietf-idr-add-paths-guidelines-08>`_
4168 The Route Refresh Capability allows to dynamically request a re-advertisement of the Adj-RIB-Out from a BGP peer.
4169 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.
4171 .. contents:: Contents
4177 The capability is enabled by default, no additional configuration is required.
4181 To send a Route Refresh request from OpenDaylight BGP speaker instance to its neighbor, invoke RPC:
4183 **URL:** ``/restconf/operations/bgp-peer-rpc:route-refresh-request``
4185 **Method:** ``POST``
4187 **Content-Type:** ``application/xml``
4193 <input xmlns="urn:opendaylight:params:xml:ns:yang:bgp-peer-rpc">
4194 <afi xmlns:types="urn:opendaylight:params:xml:ns:yang:bgp-types">types:ipv4-address-family</afi>
4195 <safi xmlns:types="urn:opendaylight:params:xml:ns:yang:bgp-types">types:unicast-subsequent-address-family</safi>
4196 <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>
4201 * `Route Refresh Capability for BGP-4 <https://tools.ietf.org/html/rfc2918>`_
4203 Peer Session Release
4206 BGP provides a RPC feature to release a Neighbor session.
4208 .. contents:: Contents
4214 The capability is enabled by default, no additional configuration is required.
4218 To release neighbor session, invoke RPC:
4220 **URL:** ``/restconf/operations/bgp-peer-rpc:release-session``
4222 **Method:** ``POST``
4224 **Content-Type:** ``application/xml``
4230 <input xmlns="urn:opendaylight:params:xml:ns:yang:bgp-peer-rpc">
4231 <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>
4237 The OpenDaylight BGP implementation provides a set of APIs (described below), that give its operational state refreshed periodically, by default every 5 seconds.
4238 The following APIs describe what is available starting with how to change the default refresh rate.
4240 .. contents:: Contents
4244 Operational State Configuration
4245 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
4247 **URL:** ``/restconf/config/bgp-state-config:bgp-state-config``
4251 **Content-Type:** ``application/xml``
4259 <bgp-state-config xmlns="urn:opendaylight:params:xml:ns:yang:controller:config">
4260 <config-name xmlns="urn:opendaylight:params:xml:ns:yang:bgp-state-config">operationalState</config-name>
4261 <timer xmlns="urn:opendaylight:params:xml:ns:yang:bgp-state-config">1</timer>
4264 @line 3: Time in seconds between operational state update.
4266 BGP RIB Operational State
4267 ^^^^^^^^^^^^^^^^^^^^^^^^^
4269 **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``
4273 **Content-Type:** ``application/xml``
4280 <state xmlns="urn:opendaylight:params:xml:ns:yang:bgp:openconfig-extensions">
4282 <router-id>192.0.2.2</router-id>
4283 <total-paths>0</total-paths>
4284 <total-prefixes>0</total-prefixes>
4287 @line 2: AS number of the remote peer.
4289 @line 3: The unique protocol instance identifier.
4291 @line 4: Total number of Paths installed on RIB (Loc-RIB)
4293 @line 5: Total number of Prefixes installed on RIB (Loc-RIB)
4295 BGP RIB Families Operational State
4296 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
4298 **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``
4302 **Content-Type:** ``application/xml``
4308 :emphasize-lines: 3,5,6
4310 <afi-safis xmlns="urn:opendaylight:params:xml:ns:yang:bgp:openconfig-extensions">
4312 <afi-safi-name xmlns:x="http://openconfig.net/yang/bgp-types">x:IPV4-UNICAST</afi-safi-name>
4314 <total-paths>0</total-paths>
4315 <total-prefixes>0</total-prefixes>
4319 <afi-safi-name xmlns:x="http://openconfig.net/yang/bgp-types">x:IPV6-UNICAST</afi-safi-name>
4321 <total-paths>0</total-paths>
4322 <total-prefixes>0</total-prefixes>
4328 @line 3: Family Identifier.
4330 @line 5: Total number of Paths installed on RIB (Loc-RIB) per specific family.
4332 @line 6: Total number of Prefixes installed on RIB (Loc-RIB) per specific family.
4334 BGP Neighbors Operational State
4335 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
4337 **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``
4341 **Content-Type:** ``application/xml``
4349 <neighbors xmlns="urn:opendaylight:params:xml:ns:yang:bgp:openconfig-extensions">
4351 <neighbor-address>192.0.2.1</neighbor-address>
4355 <neighbor-address>192.0.2.2</neighbor-address>
4360 @line 3: IP address of the remote BGP peer. Also serves as an unique identifier of a neighbor in a list of neighbors.
4362 BGP Neighbor Operational State
4363 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
4365 .. note:: Supported Capabilities only provided when session has been established.
4367 **URL:** ``/restconf/operational/openconfig-network-instance:network-instances/network-instance/global-bgp/openconfig-network-instance:protocols/protocol/openconfig-policy-types:BGP/bgp-example/bgp/neighbors/neighbor/127.0.0.2/state``
4371 **Content-Type:** ``application/xml``
4377 :emphasize-lines: 2,3,4,7,8,11,12
4379 <state xmlns="urn:opendaylight:params:xml:ns:yang:bgp:openconfig-extensions">
4380 <session-state>ESTABLISHED</session-state>
4381 <supported-capabilities xmlns:x="http://openconfig.net/yang/bgp-types">x:ASN32</supported-capabilities>
4382 <supported-capabilities xmlns:x="http://openconfig.net/yang/bgp-types">x:MPBGP</supported-capabilities>
4386 <NOTIFICATION>0</NOTIFICATION>
4390 <NOTIFICATION>0</NOTIFICATION>
4395 @line 2: Session status
4397 @line 3-4: BGP capabilities supported ( ASN32 / MPBGP / ROUTE_REFRESH / GRACEFUL_RESTART / ADD_PATHS)
4399 @line 7: Total count of Update Messages sent
4401 @line 8: Total count of Notification Messages sent
4403 @line 11: Total count of Update Messages received
4405 @line 12: Total count of Notification Messages received
4407 BGP Neighbor Families Operational State
4408 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
4410 .. note:: Graceful Restart not supported yet. Planned for Carbon.
4413 **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``
4417 **Content-Type:** ``application/xml``
4423 :emphasize-lines: 3,5,7,9,10
4425 <afi-safis xmlns="urn:opendaylight:params:xml:ns:yang:bgp:openconfig-extensions">
4427 <afi-safi-name xmlns:x="http://openconfig.net/yang/bgp-types">x:IPV4-UNICAST</afi-safi-name>
4429 <active>false</active>
4433 <received>false</received>
4434 <advertised>false</advertised>
4439 <afi-safi-name xmlns:x="http://openconfig.net/yang/bgp-types">x:IPV6-UNICAST</afi-safi-name>
4441 <active>false</active>
4445 <received>false</received>
4446 <advertised>false</advertised>
4452 @line 3: Family Identifier.
4454 @line 5: True if family is advertized by peer.
4456 @line 7: Graceful Restart Operational State per specific family.
4458 @line 9: True if the peer supports graceful restart.
4460 @line 10: True if we support graceful restart.
4462 BGP Neighbor Family Operational State
4463 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
4465 .. note:: Prefixes state is only provided once session is established.
4466 .. note:: Graceful Restart not supported yet. Planned to be implemented in Carbon.
4468 **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``
4472 **Content-Type:** ``application/xml``
4478 :emphasize-lines: 2,4,6,7,8
4480 <afi-safi xmlns="urn:opendaylight:params:xml:ns:yang:bgp:openconfig-extensions">
4481 <afi-safi-name xmlns:x="http://openconfig.net/yang/bgp-types">x:IPV4-UNICAST</afi-safi-name>
4483 <active>true</active>
4485 <installed>3</installed>
4487 <received>3</received>
4492 <received>false</received>
4493 <advertised>false</advertised>
4498 @line 2: Family Identifier.
4500 @line 4: True if family is advertized to and by peer.
4502 @line 6: Total count of prefixes advertized by peer and installed (effective-rib-in).
4504 @line 7: Total count of prefixes advertized to peer (adj-rib-out).
4506 @line 8: Total count of prefixes advertized by peer (adj-rib-in).
4508 BGP Neighbor Timers Operational State
4509 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
4511 .. note:: State is only provided once session is established.
4513 **URL:** ``/restconf/operational/openconfig-network-instance:network-instances/network-instance/global-bgp/openconfig-network-instance:protocols/protocol/openconfig-policy-types:BGP/bgp-example/bgp/neighbors/neighbor/192.0.2.1/timers``
4517 **Content-Type:** ``application/xml``
4523 :emphasize-lines: 3,4
4525 <timers xmlns="urn:opendaylight:params:xml:ns:yang:bgp:openconfig-extensions">
4527 <negotiated-hold-time>180</negotiated-hold-time>
4528 <uptime>1580676</uptime>
4532 @line 3: The negotiated hold-time for the BGP session in seconds.
4534 @line 4: Session duration since establishment in milliseconds.
4536 BGP Neighbor Transport Operational State
4537 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
4539 .. note:: State is only provided once session is established.
4541 **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``
4545 **Content-Type:** ``application/xml``
4551 :emphasize-lines: 3,4,5
4553 <transport xmlns="urn:opendaylight:params:xml:ns:yang:bgp:openconfig-extensions">
4555 <remote-address>127.0.0.2</remote-address>
4556 <remote-port>44718</remote-port>
4557 <local-port>1790</local-port>
4561 @line 3: IP address of the remote BGP peer.
4563 @line 4: Port of the remote BGP peer.
4565 @line 5: Local port.
4567 BGP Neighbor Error Handling Operational State
4568 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
4570 .. note:: State is only provided once session is established.
4571 .. note:: Error handling not supported yet. Planned for Carbon.
4573 **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``
4577 **Content-Type:** ``application/xml``
4585 <error-handling xmlns="urn:opendaylight:params:xml:ns:yang:bgp:openconfig-extensions">
4587 <erroneous-update-messages>0</erroneous-update-messages>
4591 @line 3: The number of BGP UPDATE messages for which the treat-as-withdraw mechanism has been applied based on
4592 erroneous message contents
4594 BGP Neighbor Graceful Restart Operational State
4595 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
4597 .. note:: Graceful Restart not supported yet. Planned for Carbon.
4599 **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``
4603 **Content-Type:** ``application/xml``
4609 :emphasize-lines: 3,4,5
4611 <graceful-restart xmlns="urn:opendaylight:params:xml:ns:yang:bgp:openconfig-extensions">
4613 <peer-restart-time>0</peer-restart-time>
4614 <peer-restarting>false</peer-restarting>
4615 <local-restarting>false</local-restarting>
4619 @line 3: The period of time (advertised by the peer) that the peer expects a restart of a BGP session to take.
4621 @line 4: This flag indicates whether the remote neighbor is currently in the process of restarting, and hence
4622 received routes are currently stale.
4624 @line 5: This flag indicates whether the local neighbor is currently restarting. The flag is unset after all NLRI
4625 have been advertised to the peer, and the End-of-RIB (EOR) marker has been unset.
4627 BGP Peer Groups Operational State
4628 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
4630 **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``
4634 **Content-Type:** ``application/xml``
4640 :emphasize-lines: 3,5,6
4644 <peer-group-name>application-peers</peer-group-name>
4646 <total-paths>0</total-paths>
4647 <total-prefixes>0</total-prefixes>
4651 @line 3: Peer Group Identifier.
4653 @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.
4655 @line 6: Total Prefixes installed under by peers pertaining to this peer group (effective-rib-in).
4656 This count doesn't differentiate repeated prefixes.
4661 BGP Karaf Console (odl-bgpcep-bgp-cli) provides a CLI feature to read operational state per RIB, Neighbor and Peer Group.
4663 .. code-block:: bash
4666 opendaylight-user@root> bgp:operational-state -rib example-bgp-rib
4668 .. code-block:: bash
4671 opendaylight-user@root> bgp:operational-state -rib example-bgp-rib -neighbor 192.0.2.1
4673 .. code-block:: bash
4676 opendaylight-user@root> bgp:operational-state -rib -peer-group application-peers
4680 Running OpenDaylight BGP in clustered environment brings an advantage of the plugin's high availability (HA).
4681 This section illustrates a basic scenario for HA, also presents a configuration for clustered OpenDaylight BGP.
4683 .. contents:: Contents
4689 Following example shows a configuration for running BGP in clustered environment.
4691 #. As the first step, configure (replicated *deafult* shard and *topology* shard if needed) and run OpenDaylight in clustered environment, install BGP and RESTCONF.
4693 #. 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.
4695 #. Remote peer should be configured to accept/initiate connection from/to all OpenDaylight cluster nodes with configured BGP plugin.
4697 #. 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.
4701 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`):
4703 * In ``modules.conf`` add a new module:
4704 .. code-block:: console
4708 namespace = "urn:opendaylight:params:xml:ns:yang:bgp-rib"
4709 shard-strategy = "module"
4712 * In ``module-shards.conf`` define a new module shard:
4713 .. code-block:: console
4727 **Note:** Use correct member name in module shard configuration.
4731 Following section presents a basic BGP speaker failover scenario on 3-node OpenDaylight cluster setup.
4733 .. figure:: ./images/bgpcep/BGP_HA.png
4736 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.
4737 Routes advertised by remote peer are replicated, hence RIBs state on all nodes is the same.
4741 .. figure:: ./images/bgpcep/BGP_HA_failure.png
4742 :alt: Node went down.
4744 In a case a cluster node, where BGP instance is running, goes down (unexpected failure, restart), active BGP session is dropped.
4748 .. figure:: ./images/bgpcep/BGP_HA_recovery.png
4751 Now, one of the stand-by BGP speaker instances become active. Remote peer establishes new connection and advertises routes again.
4755 This section provides an overview of the BGP topology provider service.
4756 It shows how to configure and use all available BGP topology providers.
4757 Providers are building topology view of BGP routes stored in local BGP speaker's Loc-RIB.
4758 Output topologies are rendered in a form of standardised IETF network topology model.
4760 .. contents:: Contents
4764 Inet Reachability Topology
4765 ^^^^^^^^^^^^^^^^^^^^^^^^^^
4766 Inet reachability topology exporter offers a mapping service from IPv4/6 routes to network topology nodes.
4770 Following example shows how to create a new instance of IPv4 BGP topology exporter:
4772 **URL:** ``/restconf/config/network-topology:network-topology``
4774 **Method:** ``POST``
4776 **Content-Type:** ``application/xml``
4782 :emphasize-lines: 2,4,6
4784 <topology xmlns="urn:TBD:params:xml:ns:yang:network-topology">
4785 <topology-id>bgp-example-ipv4-topology</topology-id>
4787 <bgp-ipv4-reachability-topology xmlns="urn:opendaylight:params:xml:ns:yang:odl-bgp-topology-types"></bgp-ipv4-reachability-topology>
4789 <rib-id xmlns="urn:opendaylight:params:xml:ns:yang:odl-bgp-topology-config">bgp-example</rib-id>
4792 @line 2: An identifier for a topology.
4794 @line 4: Used to identify type of the topology. In this case BGP IPv4 reachability topology.
4796 @line 6: A name of the local BGP speaker instance.
4800 The topology exporter instance can be removed in a following way:
4802 **URL:** ``/restconf/config/network-topology:network-topology/topology/bgp-example-ipv4-topology``
4804 **Method:** ``DELETE``
4808 Following example shows how to create a new instance of IPv6 BGP topology exporter:
4810 **URL:** ``/restconf/config/network-topology:network-topology``
4812 **Method:** ``POST``
4814 **Content-Type:** ``application/xml``
4820 <topology xmlns="urn:TBD:params:xml:ns:yang:network-topology">
4821 <topology-id>bgp-example-ipv6-topology</topology-id>
4823 <bgp-ipv6-reachability-topology xmlns="urn:opendaylight:params:xml:ns:yang:odl-bgp-topology-types"></bgp-ipv6-reachability-topology>
4825 <rib-id xmlns="urn:opendaylight:params:xml:ns:yang:odl-bgp-topology-config">bgp-example</rib-id>
4830 Operational state of the topology can be verified via REST:
4832 **URL:** ``/restconf/operational/network-topology:network-topology/topology/bgp-example-ipv4-topology``
4840 :emphasize-lines: 8,11
4842 <topology xmlns="urn:TBD:params:xml:ns:yang:network-topology">
4843 <topology-id>bgp-example-ipv4-topology</topology-id>
4844 <server-provided>true</server-provided>
4846 <bgp-ipv4-reachability-topology xmlns="urn:opendaylight:params:xml:ns:yang:odl-bgp-topology-types"></bgp-ipv4-reachability-topology>
4849 <node-id>10.10.1.1</node-id>
4850 <igp-node-attributes xmlns="urn:TBD:params:xml:ns:yang:nt:l3-unicast-igp-topology">
4852 <prefix>10.0.0.10/32</prefix>
4854 </igp-node-attributes>
4858 @line 8: The identifier of a node in a topology. Its value is mapped from route's NEXT_HOP attribute.
4860 @line 11: The IP prefix attribute of the node. Its value is mapped from routes's destination IP prefix.
4862 BGP Linkstate Topology
4863 ^^^^^^^^^^^^^^^^^^^^^^
4864 BGP linkstate topology exporter offers a mapping service from BGP-LS routes to network topology nodes and links.
4868 Following example shows how to create a new instance of linkstate BGP topology exporter:
4870 **URL:** ``/restconf/config/network-topology:network-topology``
4872 **Method:** ``POST``
4874 **Content-Type:** ``application/xml``
4880 <topology xmlns="urn:TBD:params:xml:ns:yang:network-topology">
4881 <topology-id>bgp-example-linkstate-topology</topology-id>
4883 <bgp-linkstate-topology xmlns="urn:opendaylight:params:xml:ns:yang:odl-bgp-topology-types"></bgp-linkstate-topology>
4885 <rib-id xmlns="urn:opendaylight:params:xml:ns:yang:odl-bgp-topology-config">bgp-example</rib-id>
4890 Operational state of the topology can be verified via REST.
4891 A sample output below represents a two node topology with two unidirectional links interconnecting those nodes.
4893 **URL:** ``/restconf/operational/network-topology:network-topology/topology/bgp-example-linkstate-topology``
4901 <topology xmlns="urn:TBD:params:xml:ns:yang:network-topology">
4902 <topology-id>bgp-example-linkstate-topology</topology-id>
4903 <server-provided>true</server-provided>
4905 <bgp-linkstate-topology xmlns="urn:opendaylight:params:xml:ns:yang:odl-bgp-topology-types"></bgp-linkstate-topology>
4908 <node-id>bgpls://IsisLevel2:1/type=node&as=65000&domain=673720360&router=0000.0000.0040</node-id>
4910 <tp-id>bgpls://IsisLevel2:1/type=tp&ipv4=203.20.160.40</tp-id>
4911 <igp-termination-point-attributes xmlns="urn:TBD:params:xml:ns:yang:nt:l3-unicast-igp-topology"/>
4912 </termination-point>
4913 <igp-node-attributes xmlns="urn:TBD:params:xml:ns:yang:nt:l3-unicast-igp-topology">
4915 <prefix>40.40.40.40/32</prefix>
4919 <prefix>203.20.160.0/24</prefix>
4923 <router-id>40.40.40.40</router-id>
4924 <isis-node-attributes xmlns="urn:TBD:params:xml:ns:yang:network:isis-topology">
4926 <te-router-id-ipv4>40.40.40.40</te-router-id-ipv4>
4929 <iso-system-id>MDAwMDAwMDAwMDY0</iso-system-id>
4931 </isis-node-attributes>
4932 </igp-node-attributes>
4935 <node-id>bgpls://IsisLevel2:1/type=node&as=65000&domain=673720360&router=0000.0000.0039</node-id>
4937 <tp-id>bgpls://IsisLevel2:1/type=tp&ipv4=203.20.160.39</tp-id>
4938 <igp-termination-point-attributes xmlns="urn:TBD:params:xml:ns:yang:nt:l3-unicast-igp-topology"/>
4939 </termination-point>
4940 <igp-node-attributes xmlns="urn:TBD:params:xml:ns:yang:nt:l3-unicast-igp-topology">
4942 <prefix>39.39.39.39/32</prefix>
4946 <prefix>203.20.160.0/24</prefix>
4950 <router-id>39.39.39.39</router-id>
4951 <isis-node-attributes xmlns="urn:TBD:params:xml:ns:yang:network:isis-topology">
4953 <te-router-id-ipv4>39.39.39.39</te-router-id-ipv4>
4956 <iso-system-id>MDAwMDAwMDAwMDg3</iso-system-id>
4958 </isis-node-attributes>
4959 </igp-node-attributes>
4963 <dest-node>bgpls://IsisLevel2:1/type=node&as=65000&domain=673720360&router=0000.0000.0039</dest-node>
4964 <dest-tp>bgpls://IsisLevel2:1/type=tp&ipv4=203.20.160.39</dest-tp>
4966 <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>
4968 <source-node>bgpls://IsisLevel2:1/type=node&as=65000&domain=673720360&router=0000.0000.0040</source-node>
4969 <source-tp>bgpls://IsisLevel2:1/type=tp&ipv4=203.20.160.40</source-tp>
4971 <igp-link-attributes xmlns="urn:TBD:params:xml:ns:yang:nt:l3-unicast-igp-topology">
4973 <isis-link-attributes xmlns="urn:TBD:params:xml:ns:yang:network:isis-topology">
4976 <max-link-bandwidth>1250000.0</max-link-bandwidth>
4977 <max-resv-link-bandwidth>12500.0</max-resv-link-bandwidth>
4978 <te-default-metric>0</te-default-metric>
4979 <unreserved-bandwidth>
4980 <bandwidth>12500.0</bandwidth>
4981 <priority>0</priority>
4982 </unreserved-bandwidth>
4983 <unreserved-bandwidth>
4984 <bandwidth>12500.0</bandwidth>
4985 <priority>1</priority>
4986 </unreserved-bandwidth>
4987 <unreserved-bandwidth>
4988 <bandwidth>12500.0</bandwidth>
4989 <priority>2</priority>
4990 </unreserved-bandwidth>
4991 <unreserved-bandwidth>
4992 <bandwidth>12500.0</bandwidth>
4993 <priority>3</priority>
4994 </unreserved-bandwidth>
4995 <unreserved-bandwidth>
4996 <bandwidth>12500.0</bandwidth>
4997 <priority>4</priority>
4998 </unreserved-bandwidth>
4999 <unreserved-bandwidth>
5000 <bandwidth>12500.0</bandwidth>
5001 <priority>5</priority>
5002 </unreserved-bandwidth>
5003 <unreserved-bandwidth>
5004 <bandwidth>12500.0</bandwidth>
5005 <priority>6</priority>
5006 </unreserved-bandwidth>
5007 <unreserved-bandwidth>
5008 <bandwidth>12500.0</bandwidth>
5009 <priority>7</priority>
5010 </unreserved-bandwidth>
5012 </isis-link-attributes>
5013 </igp-link-attributes>
5017 <dest-node>bgpls://IsisLevel2:1/type=node&as=65000&domain=673720360&router=0000.0000.0040</dest-node>
5018 <dest-tp>bgpls://IsisLevel2:1/type=tp&ipv4=203.20.160.40</dest-tp>
5020 <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>
5022 <source-node>bgpls://IsisLevel2:1/type=node&as=65000&domain=673720360&router=0000.0000.0039</source-node>
5023 <source-tp>bgpls://IsisLevel2:1/type=tp&ipv4=203.20.160.39</source-tp>
5025 <igp-link-attributes xmlns="urn:TBD:params:xml:ns:yang:nt:l3-unicast-igp-topology">
5027 <isis-link-attributes xmlns="urn:TBD:params:xml:ns:yang:network:isis-topology">
5030 <max-link-bandwidth>1250000.0</max-link-bandwidth>
5031 <max-resv-link-bandwidth>12500.0</max-resv-link-bandwidth>
5032 <te-default-metric>0</te-default-metric>
5033 <unreserved-bandwidth>
5034 <bandwidth>12500.0</bandwidth>
5035 <priority>0</priority>
5036 </unreserved-bandwidth>
5037 <unreserved-bandwidth>
5038 <bandwidth>12500.0</bandwidth>
5039 <priority>1</priority>
5040 </unreserved-bandwidth>
5041 <unreserved-bandwidth>
5042 <bandwidth>12500.0</bandwidth>
5043 <priority>2</priority>
5044 </unreserved-bandwidth>
5045 <unreserved-bandwidth>
5046 <bandwidth>12500.0</bandwidth>
5047 <priority>3</priority>
5048 </unreserved-bandwidth>
5049 <unreserved-bandwidth>
5050 <bandwidth>12500.0</bandwidth>
5051 <priority>4</priority>
5052 </unreserved-bandwidth>
5053 <unreserved-bandwidth>
5054 <bandwidth>12500.0</bandwidth>
5055 <priority>5</priority>
5056 </unreserved-bandwidth>
5057 <unreserved-bandwidth>
5058 <bandwidth>12500.0</bandwidth>
5059 <priority>6</priority>
5060 </unreserved-bandwidth>
5061 <unreserved-bandwidth>
5062 <bandwidth>12500.0</bandwidth>
5063 <priority>7</priority>
5064 </unreserved-bandwidth>
5066 </isis-link-attributes>
5067 </igp-link-attributes>
5071 BGP Network Topology Configuration Loader
5072 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
5074 BGP Network Topology Configuration Loader allows user to define static initial configuration for a BGP protocol instance.
5075 This service will detect the creation of new configuration files following the pattern "network-topology-*.xml" under the path "etc/opendaylight/bgpcep".
5076 Once the file is processed, the defined configuration will be available from the configuration Data Store.
5078 .. note:: If the BGP topology instance is already present, no update or configuration will be applied.
5080 **PATH:** ``etc/opendaylight/bgpcep/network-topology-config.xml``
5084 <network-topology xmlns="urn:TBD:params:xml:ns:yang:network-topology">
5086 <topology-id>example-ipv4-topology</topology-id>
5088 <bgp-ipv4-reachability-topology xmlns="urn:opendaylight:params:xml:ns:yang:odl-bgp-topology-types"/>
5090 <rib-id xmlns="urn:opendaylight:params:xml:ns:yang:odl-bgp-topology-config">example-bgp-rib</rib-id>
5093 <topology-id>example-ipv6-topology</topology-id>
5095 <bgp-ipv6-reachability-topology xmlns="urn:opendaylight:params:xml:ns:yang:odl-bgp-topology-types"/>
5097 <rib-id xmlns="urn:opendaylight:params:xml:ns:yang:odl-bgp-topology-config">example-bgp-rib</rib-id>
5100 <topology-id>example-linkstate-topology</topology-id>
5102 <bgp-linkstate-topology xmlns="urn:opendaylight:params:xml:ns:yang:odl-bgp-topology-types"/>
5104 <rib-id xmlns="urn:opendaylight:params:xml:ns:yang:odl-bgp-topology-config">example-bgp-rib</rib-id>
5110 BGP test tools serves to test basic BGP functionality, scalability and performance.
5112 .. contents:: Contents
5118 The BGP Test Tool is a stand-alone Java application purposed to simulate remote BGP peers, that are capable to advertise sample routes.
5119 This application is not part of the OpenDaylight Karaf distribution, however it can be downloaded from OpenDaylight's Nexus (use latest release version):
5121 ``https://nexus.opendaylight.org/content/repositories/opendaylight.release/org/opendaylight/bgpcep/bgp-testtool``
5125 The application can be run from command line:
5127 .. code-block:: console
5129 java -jar bgp-testtool-*-executable.jar
5132 with optional input parameters:
5134 .. code-block:: console
5136 -i <BOOLEAN>, --active <BOOLEAN>
5137 Active initialisation of the connection, by default false.
5139 -ho <N>, --holdtimer <N>
5140 In seconds, value of the desired holdtimer, by default 90.
5142 -sc <N>, --speakersCount <N>
5143 Number of simulated BGP speakers, when creating each speaker, uses incremented local-address for binding, by default 0.
5145 -ra <IP_ADDRESS:PORT,...>, --remote-address <IP_ADDRESS:PORT,...>
5146 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.
5148 -la <IP_ADDRESS:PORT>, --localAddress <IP_ADDRESS:PORT>
5149 IP address of BGP speakers which the tools simulates, by default 192.0.2.2:0.
5151 -pr <N>, --prefixes <N>
5152 Number of prefixes to be advertised by each simulated speaker
5154 -mp <BOOLEAN>, --multiPathSupport <BOOLEAN>
5155 Active ADD-PATH support, by default false.
5158 Local AS Number, by default 64496.
5160 -ec <EXTENDED_COMMUNITIES>, --extended_communities <EXTENDED_COMMUNITIES>
5161 Extended communities to be send. Format: x,x,x where x is each extended community from bgp-types.yang, by default empty.
5163 -ll <LOG_LEVEL>, --log_level <LOG_LEVEL>
5164 Log level for console output, by default INFO.
5166 BGP Application Peer Benchmark
5167 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
5168 It is a simple OpenDaylight application which is capable to inject and remove specific amount of IPv4 routes.
5169 This application is part of the OpenDaylight Karaf distribution.
5173 As a first step install BGP and RESTCONF, then configure *Application Peer*.
5174 Install ``odl-bgpcep-bgp-benchmark`` feature and reconfigure BGP Application Peer Benchmark application as per following:
5176 **URL:** ``/restconf/config/odl-bgp-app-peer-benchmark-config:config``
5180 **Content-Type:** ``application/xml``
5188 <odl-bgp-app-peer-benchmark-config xmlns="urn:opendaylight:params:xml:ns:yang:odl-bgp-app-peer-benchmark-config">
5189 <app-peer-id xmlns="urn:opendaylight:params:xml:ns:yang:odl-bgp-app-peer-benchmark-config">10.25.1.9</app-peer-id>
5190 </odl-bgp-app-peer-benchmark-config>
5192 @line 2: The *Application Peer* identifier.
5196 Routes injection can be invoked via RPC:
5198 **URL:** ``/restconf/operations/odl-bgp-app-peer-benchmark:add-prefix``
5200 **Method:** ``POST``
5202 **Content-Type:** ``application/xml``
5208 :emphasize-lines: 2,3,4,5
5210 <input xmlns="urn:opendaylight:params:xml:ns:yang:odl-bgp-app-peer-benchmark">
5211 <prefix>1.1.1.1/32</prefix>
5212 <count>100000</count>
5213 <batchsize>2000</batchsize>
5214 <nexthop>192.0.2.2</nexthop>
5217 @line 2: A initial IPv4 prefix carried in route. Value is incremented for following routes.
5219 @line 3: An amount of routes to be added to *Application Peer's* programmable RIB.
5221 @line 4: A size of the transaction batch.
5223 @line 5: A NEXT_HOP attribute value used in all injected routes.
5229 :emphasize-lines: 3,4,5
5231 <output xmlns="urn:opendaylight:params:xml:ns:yang:odl-bgp-app-peer-benchmark">
5233 <duration>4301</duration>
5235 <count>100000</count>
5239 @line 3: Request duration in milliseconds.
5241 @line 4: Writes per second rate.
5243 @line 5: An amount of routes added to *Application Peer's* programmable RIB.
5247 Routes deletion can be invoked via RPC:
5249 **URL:** ``/restconf/operations/odl-bgp-app-peer-benchmark:delete-prefix``
5251 **Method:** ``POST``
5253 **Content-Type:** ``application/xml``
5259 :emphasize-lines: 2,3,4
5261 <input xmlns="urn:opendaylight:params:xml:ns:yang:odl-bgp-app-peer-benchmark">
5262 <prefix>1.1.1.1/32</prefix>
5263 <count>100000</count>
5264 <batchsize>2000</batchsize>
5267 @line 2: A initial IPv4 prefix carried in route to be removed. Value is incremented for following routes.
5269 @line 3: An amount of routes to be removed from *Application Peer's* programmable RIB.
5271 @line 4: A size of the transaction batch.
5277 <output xmlns="urn:opendaylight:params:xml:ns:yang:odl-bgp-app-peer-benchmark">
5279 <duration>1837</duration>
5281 <count>100000</count>
5287 This section offers advices in a case OpenDaylight BGP plugin is not working as expected.
5289 .. contents:: Contents
5293 BGP is not working...
5294 ^^^^^^^^^^^^^^^^^^^^^
5295 * First of all, ensure that all required features are installed, local and remote BGP configuration is correct.
5297 * Check OpenDaylight Karaf logs:
5301 .. code-block:: console
5305 or open log file: ``data/log/karaf.log``
5307 Possibly, a reason/hint for a cause of the problem can be found there.
5309 * Try to minimise effect of other OpenDaylight features, when searching for a reason of the problem.
5311 * Try to set DEBUG severity level for BGP logger via Karaf console commands, in order to collect more information:
5313 .. code-block:: console
5315 log:set DEBUG org.opendaylight.protocol.bgp
5317 .. code-block:: console
5319 log:set DEBUG org.opendaylight.bgpcep.bgp
5323 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.
5325 Write an e-mail to bgpcep-users@lists.opendaylight.org and provide following information:
5327 #. State OpenDaylight version
5329 #. Describe your use-case and provide as much details related to BGP as possible
5331 #. Steps to reproduce
5333 #. Attach Karaf log files, optionally packet captures, REST input/output