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 2013-09-19; }
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 2017-12-07; }
12 import bmp-monitor { prefix bmp-mon; revision-date 2017-12-07; }
13 import bgp-message { prefix bgp-msg; revision-date 2017-12-07; }
14 import bgp-multiprotocol { prefix bgp-mp; revision-date 2017-12-07; }
15 import pmsi-tunnel { prefix pmsi; revision-date 2016-08-12; }
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 route-distinguisher {
227 leaf route-distinguisher {
228 type bgp-t:route-distinguisher;
233 grouping ethernet-a-d-route {
234 container ethernet-a-d-route {
235 reference "https://tools.ietf.org/html/rfc7432#section-7.1";
236 description "Ethernet Auto-Discovery (A-D) route";
239 uses ethernet-tag-id;
241 type netc:mpls-label;
247 grouping mac-ip-adv-route {
248 container mac-ip-adv-route {
249 reference "https://tools.ietf.org/html/rfc7432#section-7.2";
250 description "MAC/IP Advertisement route";
253 uses ethernet-tag-id;
255 type yang:mac-address;
259 type inet:ip-address;
262 type netc:mpls-label;
266 type netc:mpls-label;
271 grouping inc-multi-ethernet-tag-res {
272 container inc-multi-ethernet-tag-res {
273 reference "https://tools.ietf.org/html/rfc7432#section-7.3";
274 description "Inclusive Multicast Ethernet Tag route";
276 uses ethernet-tag-id;
278 type inet:ip-address;
285 reference "https://tools.ietf.org/html/rfc7432#section-7.4";
286 description "Ethernet Segment route";
290 type inet:ip-address;
296 grouping esi-label-extended-community {
297 container esi-label-extended-community {
298 reference "https://tools.ietf.org/html/rfc7432#section-7.5";
299 description "The ESI Label Extended Community is a transitive Extended
300 Community that may be advertised along with Ethernet Auto-discovery
301 routes, and it enables split-horizon procedures for multihomed sites";
303 leaf single-active-mode {
308 type netc:mpls-label;
314 grouping es-import-route-extended-community {
315 container es-import-route-extended-community {
316 reference "https://tools.ietf.org/html/rfc7432#section-7.6";
318 "New transitive Route Target extended community carried with
319 the Ethernet Segment route. When used, it enables all the PEs
320 connected to the same multihomed site to import the Ethernet Segment
324 type yang:mac-address;
330 grouping mac-mobility-extended-community {
331 container mac-mobility-extended-community {
332 reference "https://tools.ietf.org/html/rfc7432#section-7.7";
334 "The MAC Mobility Extended Community is a transitive Extended Community
335 that may be advertised along with MAC/IP Advertisement routes.";
348 grouping default-gateway-extended-community {
349 container default-gateway-extended-community {
351 "The Default Gateway community is an Extended Community of an
354 reference "https://tools.ietf.org/html/rfc7432#section-7.8";
357 "The Default Gateway community is an Extended Community of an
362 typedef operational-mode {
364 enum vlan-aware-fxc {
367 enum vlan-unaware-fxc {
373 typedef normalization-type {
384 grouping layer-2-attributes-extended-community {
385 container layer-2-attributes-extended-community {
386 reference "https://tools.ietf.org/html/draft-ietf-bess-evpn-vpws-02#section-3.1";
388 "The EVPN Layer 2 attributes extended community is a extended community
389 to be included with Ethernet A-D per EVI route.
390 This attribute is mandatory if multihoming is enabled.";
404 leaf mode-of-operation {
405 reference "https://tools.ietf.org/html/draft-sajassi-bess-evpn-vpws-fxc-01#section-5";
406 type operational-mode;
409 reference "https://tools.ietf.org/html/draft-sajassi-bess-evpn-vpws-fxc-01#section-5";
410 type normalization-type;
419 grouping evpn-destination {
420 list evpn-destination {
425 grouping evpn-routes {
426 container evpn-routes {
431 key "route-key path-id";
433 uses bgp-msg:path-id-grouping;
435 augment "attributes" {
436 ext:augment-identifier pmsi-tunnel-augmentation;
437 uses pmsi:pmsi-tunnel;
439 augment "attributes/extended-communities/extended-community" {
440 case esi-label-extended-community-case {
441 uses esi-label-extended-community;
443 case es-import-route-extended-community-case {
444 uses es-import-route-extended-community;
446 case mac-mobility-extended-community-case {
447 uses mac-mobility-extended-community;
449 case default-gateway-extended-community-case {
450 uses default-gateway-extended-community;
452 case layer-2-attributes-extended-community-case {
453 uses layer-2-attributes-extended-community;
462 reference "https://tools.ietf.org/html/rfc7432#section-7";
463 description "The EVPN NLRI is carried in BGP [RFC4271] using BGP Multiprotocol
464 Extensions [RFC4760] with an Address Family Identifier (AFI) of 25 (L2VPN)
465 and a Subsequent Address Family Identifier (SAFI) of 70 (EVPN)";
468 case ethernet-a-d-route-case {
469 uses ethernet-a-d-route;
471 case mac-ip-adv-route-case {
472 uses mac-ip-adv-route;
474 case inc-multi-ethernet-tag-res-case {
475 uses inc-multi-ethernet-tag-res;
483 uses route-distinguisher;
486 augment "/bgp-msg:update/bgp-msg:attributes" {
487 uses pmsi:pmsi-tunnel;
490 augment "/bgp-msg:update/bgp-msg:attributes/bgp-mp:mp-reach-nlri/bgp-mp:advertized-routes/bgp-mp:destination-type" {
491 case destination-evpn-case {
492 container destination-evpn {
493 uses evpn-destination;
498 augment "/bgp-msg:update/bgp-msg:attributes/bgp-mp:mp-unreach-nlri/bgp-mp:withdrawn-routes/bgp-mp:destination-type" {
499 case destination-evpn-case {
500 container destination-evpn {
501 uses evpn-destination;
506 augment "/bgp-rib:application-rib/bgp-rib:tables/bgp-rib:routes" {
507 case evpn-routes-case {
512 augment "/bgp-rib:bgp-rib/bgp-rib:rib/bgp-rib:loc-rib/bgp-rib:tables/bgp-rib:routes" {
513 case evpn-routes-case {
518 augment "/bgp-rib:bgp-rib/bgp-rib:rib/bgp-rib:peer/bgp-rib:adj-rib-in/bgp-rib:tables/bgp-rib:routes" {
519 case evpn-routes-case {
524 augment "/bgp-rib:bgp-rib/bgp-rib:rib/bgp-rib:peer/bgp-rib:effective-rib-in/bgp-rib:tables/bgp-rib:routes" {
525 case evpn-routes-case {
530 augment "/bgp-rib:bgp-rib/bgp-rib:rib/bgp-rib:peer/bgp-rib:adj-rib-out/bgp-rib:tables/bgp-rib:routes" {
531 case evpn-routes-case {
536 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" {
537 case evpn-routes-case {
542 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" {
543 case evpn-routes-case {
548 augment "/bgp-msg:update/bgp-msg:attributes/bgp-msg:extended-communities/bgp-msg:extended-community" {
549 case esi-label-extended-community-case {
550 uses esi-label-extended-community;
552 case es-import-route-extended-community-case {
553 uses es-import-route-extended-community;
555 case mac-mobility-extended-community-case {
556 uses mac-mobility-extended-community;
558 case default-gateway-extended-community-case {
559 uses default-gateway-extended-community;
561 case layer-2-attributes-extended-community-case {
562 uses layer-2-attributes-extended-community;