1 // vi: set smarttab et sw=4 tabstop=4:
4 namespace "urn:opendaylight:params:xml:ns:yang:bgp-evpn";
7 import bgp-types { prefix bgp-t; revision-date 2018-03-29; }
8 import ietf-inet-types { prefix inet; revision-date 2013-07-15; }
9 import ietf-yang-types {prefix yang; revision-date 2013-07-15;}
10 import network-concepts { prefix netc; revision-date 2013-11-25; }
11 import bgp-rib { prefix bgp-rib; revision-date 2018-03-29; }
12 import bmp-monitor { prefix bmp-mon; revision-date 2018-03-29; }
13 import bgp-message { prefix bgp-msg; revision-date 2018-03-29; }
14 import bgp-multiprotocol { prefix bgp-mp; revision-date 2018-03-29; }
15 import pmsi-tunnel { prefix pmsi; revision-date 2018-03-29; }
16 import yang-ext { prefix ext; revision-date 2013-07-09; }
18 organization "Cisco Systems, Inc.";
20 contact "Claudio D. Gasparini <cgaspari@cisco.com>";
23 "This module contains the base data model of a BGP flow specification.
24 It rolls up the definitions contained in RFC7432.
26 Copyright (c)2016 Cisco Systems, Inc. All rights reserved.
28 This program and the accompanying materials are made available
29 under the terms of the Eclipse Public License v1.0 which
30 accompanies this distribution, and is available at
31 http://www.eclipse.org/legal/epl-v10.html";
33 revision "2018-03-29" {
34 description "Add support for add-path for all afi/safi.";
37 revision "2017-12-13" {
38 description "Support draft https://tools.ietf.org/html/draft-sajassi-bess-evpn-vpws-fxc-01";
41 revision "2017-12-07" {
42 description "Add support for add-path in base BGP NLRI.";
45 revision "2016-03-21" {
48 reference "https://tools.ietf.org/html/rfc7432";
51 identity l2vpn-address-family {
52 reference "https://tools.ietf.org/html/rfc7432#section-20";
53 base bgp-t:address-family;
56 identity evpn-subsequent-address-family {
57 reference "https://tools.ietf.org/html/rfc7432#section-20";
58 base bgp-t:subsequent-address-family;
62 reference "https://tools.ietf.org/html/rfc7432#section-7";
70 enum inc-mult-eth-tag {
80 reference "https://tools.ietf.org/html/rfc7432#section-5";
85 enum lacp-auto-generated {
88 enum lan-auto-generated {
91 enum mac-auto-generated {
94 enum router-id-generated {
105 range "0 .. 16777215";
108 "24-bit unsigned integer.";
111 grouping ethernet-tag-id {
112 reference "https://tools.ietf.org/html/rfc7432#section-7.1";
113 description "An Ethernet Tag ID is a 32-bit field containing either
114 a 12-bit or 24-bit identifier that identifies a particular
115 broadcast domain (e.g., a VLAN) in an EVPN instance";
117 container ethernet-tag-id {
125 grouping local-discriminator {
126 leaf local-discriminator {
133 reference "https://tools.ietf.org/html/rfc7432#section-5";
134 description "Ethernet segment (ES) are identified by a unique non-zero identifier
135 called an Ethernet Segment Identifier (ESI). An ESI is encoded as a 10-octet
136 integer in line format with the most significant octet sent first";
140 case arbitrary-case {
141 container arbitrary {
142 description "Type 0 indicates an arbitrary 9-octet ESI
143 value, which is managed and configured by the operator";
153 case lacp-auto-generated-case {
154 container lacp-auto-generated {
155 description "When IEEE 802.1AX LACP is used between the PEs and CEs,
156 ESI type 1 indicates an auto-generated ESI value determined from LACP";
158 leaf ce-lacp-mac-address {
159 type yang:mac-address;
162 leaf ce-lacp-port-key {
168 case lan-auto-generated-case {
169 container lan-auto-generated {
170 description "Type 2 is used in the case of indirectly connected hosts via a bridged
171 LAN between the CEs and the PEs. The ESI Value is auto-generated and determined
172 based on the Layer 2 bridge protocol";
174 leaf root-bridge-mac-address {
175 type yang:mac-address;
178 leaf root-bridge-priority {
184 case mac-auto-generated-case {
185 container mac-auto-generated {
186 description "Type 3 indicates a MAC-based ESI Value that
187 can be auto-generated or configured by the operator.";
189 leaf system-mac-address {
190 type yang:mac-address;
193 leaf local-discriminator {
199 case router-id-generated-case {
200 container router-id-generated {
201 description "Type 4 indicates a router-ID ESI Value that
202 can be auto-generated or configured by the operator";
205 type inet:ipv4-address;
208 uses local-discriminator;
211 case as-generated-case {
212 container as-generated {
213 description "Type 5 indicates an Autonomous System (AS)-based ESI
214 Value that can be auto-generated or configured by the operator";
220 uses local-discriminator;
226 grouping ethernet-a-d-route {
227 container ethernet-a-d-route {
228 reference "https://tools.ietf.org/html/rfc7432#section-7.1";
229 description "Ethernet Auto-Discovery (A-D) route";
232 uses ethernet-tag-id;
234 type netc:mpls-label;
240 grouping mac-ip-adv-route {
241 container mac-ip-adv-route {
242 reference "https://tools.ietf.org/html/rfc7432#section-7.2";
243 description "MAC/IP Advertisement route";
246 uses ethernet-tag-id;
248 type yang:mac-address;
252 type inet:ip-address;
255 type netc:mpls-label;
259 type netc:mpls-label;
264 grouping inc-multi-ethernet-tag-res {
265 container inc-multi-ethernet-tag-res {
266 reference "https://tools.ietf.org/html/rfc7432#section-7.3";
267 description "Inclusive Multicast Ethernet Tag route";
269 uses ethernet-tag-id;
270 uses bgp-t:orig-route-ip-grouping;
276 reference "https://tools.ietf.org/html/rfc7432#section-7.4";
277 description "Ethernet Segment route";
280 uses bgp-t:orig-route-ip-grouping;
284 grouping esi-label-extended-community {
285 container esi-label-extended-community {
286 reference "https://tools.ietf.org/html/rfc7432#section-7.5";
287 description "The ESI Label Extended Community is a transitive Extended
288 Community that may be advertised along with Ethernet Auto-discovery
289 routes, and it enables split-horizon procedures for multihomed sites";
291 leaf single-active-mode {
296 type netc:mpls-label;
302 grouping es-import-route-extended-community {
303 container es-import-route-extended-community {
304 reference "https://tools.ietf.org/html/rfc7432#section-7.6";
306 "New transitive Route Target extended community carried with
307 the Ethernet Segment route. When used, it enables all the PEs
308 connected to the same multihomed site to import the Ethernet Segment
312 type yang:mac-address;
318 grouping mac-mobility-extended-community {
319 container mac-mobility-extended-community {
320 reference "https://tools.ietf.org/html/rfc7432#section-7.7";
322 "The MAC Mobility Extended Community is a transitive Extended Community
323 that may be advertised along with MAC/IP Advertisement routes.";
336 grouping default-gateway-extended-community {
337 container default-gateway-extended-community {
339 "The Default Gateway community is an Extended Community of an
342 reference "https://tools.ietf.org/html/rfc7432#section-7.8";
345 "The Default Gateway community is an Extended Community of an
350 typedef operational-mode {
352 enum vlan-aware-fxc {
355 enum vlan-unaware-fxc {
361 typedef normalization-type {
372 grouping layer-2-attributes-extended-community {
373 container layer-2-attributes-extended-community {
374 reference "https://tools.ietf.org/html/draft-ietf-bess-evpn-vpws-02#section-3.1";
376 "The EVPN Layer 2 attributes extended community is a extended community
377 to be included with Ethernet A-D per EVI route.
378 This attribute is mandatory if multihoming is enabled.";
392 leaf mode-of-operation {
393 reference "https://tools.ietf.org/html/draft-sajassi-bess-evpn-vpws-fxc-01#section-5";
394 type operational-mode;
397 reference "https://tools.ietf.org/html/draft-sajassi-bess-evpn-vpws-fxc-01#section-5";
398 type normalization-type;
407 grouping evpn-destination {
408 list evpn-destination {
410 uses bgp-msg:path-id-grouping;
414 grouping evpn-routes {
415 container evpn-routes {
417 key "route-key path-id";
419 uses pmsi:bgp-rib-route {
420 augment "attributes/extended-communities/extended-community" {
421 case esi-label-extended-community-case {
422 uses esi-label-extended-community;
424 case es-import-route-extended-community-case {
425 uses es-import-route-extended-community;
427 case mac-mobility-extended-community-case {
428 uses mac-mobility-extended-community;
430 case default-gateway-extended-community-case {
431 uses default-gateway-extended-community;
433 case layer-2-attributes-extended-community-case {
434 uses layer-2-attributes-extended-community;
443 reference "https://tools.ietf.org/html/rfc7432#section-7";
444 description "The EVPN NLRI is carried in BGP [RFC4271] using BGP Multiprotocol
445 Extensions [RFC4760] with an Address Family Identifier (AFI) of 25 (L2VPN)
446 and a Subsequent Address Family Identifier (SAFI) of 70 (EVPN)";
449 case ethernet-a-d-route-case {
450 uses ethernet-a-d-route;
452 case mac-ip-adv-route-case {
453 uses mac-ip-adv-route;
455 case inc-multi-ethernet-tag-res-case {
456 uses inc-multi-ethernet-tag-res;
464 uses bgp-t:route-distinguisher-grouping;
467 augment "/bgp-msg:update/bgp-msg:attributes/bgp-mp:mp-reach-nlri/bgp-mp:advertized-routes/bgp-mp:destination-type" {
468 case destination-evpn-case {
469 container destination-evpn {
470 uses evpn-destination;
475 augment "/bgp-msg:update/bgp-msg:attributes/bgp-mp:mp-unreach-nlri/bgp-mp:withdrawn-routes/bgp-mp:destination-type" {
476 case destination-evpn-case {
477 container destination-evpn {
478 uses evpn-destination;
483 augment "/bgp-rib:application-rib/bgp-rib:tables/bgp-rib:routes" {
484 case evpn-routes-case {
489 augment "/bgp-rib:bgp-rib/bgp-rib:rib/bgp-rib:loc-rib/bgp-rib:tables/bgp-rib:routes" {
490 case evpn-routes-case {
495 augment "/bgp-rib:bgp-rib/bgp-rib:rib/bgp-rib:peer/bgp-rib:adj-rib-in/bgp-rib:tables/bgp-rib:routes" {
496 case evpn-routes-case {
501 augment "/bgp-rib:bgp-rib/bgp-rib:rib/bgp-rib:peer/bgp-rib:effective-rib-in/bgp-rib:tables/bgp-rib:routes" {
502 case evpn-routes-case {
507 augment "/bgp-rib:bgp-rib/bgp-rib:rib/bgp-rib:peer/bgp-rib:adj-rib-out/bgp-rib:tables/bgp-rib:routes" {
508 case evpn-routes-case {
513 augment "/bmp-mon:bmp-monitor/bmp-mon:monitor/bmp-mon:router/bmp-mon:peer/bmp-mon:pre-policy-rib/bmp-mon:tables/bmp-mon:routes" {
514 case evpn-routes-case {
519 augment "/bmp-mon:bmp-monitor/bmp-mon:monitor/bmp-mon:router/bmp-mon:peer/bmp-mon:post-policy-rib/bmp-mon:tables/bmp-mon:routes" {
520 case evpn-routes-case {
525 augment "/bgp-msg:update/bgp-msg:attributes/bgp-msg:extended-communities/bgp-msg:extended-community" {
526 case esi-label-extended-community-case {
527 uses esi-label-extended-community;
529 case es-import-route-extended-community-case {
530 uses es-import-route-extended-community;
532 case mac-mobility-extended-community-case {
533 uses mac-mobility-extended-community;
535 case default-gateway-extended-community-case {
536 uses default-gateway-extended-community;
538 case layer-2-attributes-extended-community-case {
539 uses layer-2-attributes-extended-community;