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 odl-uint24 { prefix uint24; }
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 {
103 grouping ethernet-tag-id {
104 reference "https://tools.ietf.org/html/rfc7432#section-7.1";
105 description "An Ethernet Tag ID is a 32-bit field containing either
106 a 12-bit or 24-bit identifier that identifies a particular
107 broadcast domain (e.g., a VLAN) in an EVPN instance";
109 container ethernet-tag-id {
117 grouping local-discriminator {
118 leaf local-discriminator {
125 reference "https://tools.ietf.org/html/rfc7432#section-5";
126 description "Ethernet segment (ES) are identified by a unique non-zero identifier
127 called an Ethernet Segment Identifier (ESI). An ESI is encoded as a 10-octet
128 integer in line format with the most significant octet sent first";
132 case arbitrary-case {
133 container arbitrary {
134 description "Type 0 indicates an arbitrary 9-octet ESI
135 value, which is managed and configured by the operator";
145 case lacp-auto-generated-case {
146 container lacp-auto-generated {
147 description "When IEEE 802.1AX LACP is used between the PEs and CEs,
148 ESI type 1 indicates an auto-generated ESI value determined from LACP";
150 leaf ce-lacp-mac-address {
151 type yang:mac-address;
154 leaf ce-lacp-port-key {
160 case lan-auto-generated-case {
161 container lan-auto-generated {
162 description "Type 2 is used in the case of indirectly connected hosts via a bridged
163 LAN between the CEs and the PEs. The ESI Value is auto-generated and determined
164 based on the Layer 2 bridge protocol";
166 leaf root-bridge-mac-address {
167 type yang:mac-address;
170 leaf root-bridge-priority {
176 case mac-auto-generated-case {
177 container mac-auto-generated {
178 description "Type 3 indicates a MAC-based ESI Value that
179 can be auto-generated or configured by the operator.";
181 leaf system-mac-address {
182 type yang:mac-address;
185 leaf local-discriminator {
191 case router-id-generated-case {
192 container router-id-generated {
193 description "Type 4 indicates a router-ID ESI Value that
194 can be auto-generated or configured by the operator";
197 type inet:ipv4-address-no-zone;
200 uses local-discriminator;
203 case as-generated-case {
204 container as-generated {
205 description "Type 5 indicates an Autonomous System (AS)-based ESI
206 Value that can be auto-generated or configured by the operator";
212 uses local-discriminator;
218 grouping ethernet-a-d-route {
219 container ethernet-a-d-route {
220 reference "https://tools.ietf.org/html/rfc7432#section-7.1";
221 description "Ethernet Auto-Discovery (A-D) route";
224 uses ethernet-tag-id;
226 type netc:mpls-label;
232 grouping mac-ip-adv-route {
233 container mac-ip-adv-route {
234 reference "https://tools.ietf.org/html/rfc7432#section-7.2";
235 description "MAC/IP Advertisement route";
238 uses ethernet-tag-id;
240 type yang:mac-address;
244 type inet:ip-address-no-zone;
247 type netc:mpls-label;
251 type netc:mpls-label;
256 grouping inc-multi-ethernet-tag-res {
257 container inc-multi-ethernet-tag-res {
258 reference "https://tools.ietf.org/html/rfc7432#section-7.3";
259 description "Inclusive Multicast Ethernet Tag route";
261 uses ethernet-tag-id;
262 uses bgp-t:orig-route-ip-grouping;
268 reference "https://tools.ietf.org/html/rfc7432#section-7.4";
269 description "Ethernet Segment route";
272 uses bgp-t:orig-route-ip-grouping;
276 grouping esi-label-extended-community {
277 container esi-label-extended-community {
278 reference "https://tools.ietf.org/html/rfc7432#section-7.5";
279 description "The ESI Label Extended Community is a transitive Extended
280 Community that may be advertised along with Ethernet Auto-discovery
281 routes, and it enables split-horizon procedures for multihomed sites";
283 leaf single-active-mode {
288 type netc:mpls-label;
294 grouping es-import-route-extended-community {
295 container es-import-route-extended-community {
296 reference "https://tools.ietf.org/html/rfc7432#section-7.6";
298 "New transitive Route Target extended community carried with
299 the Ethernet Segment route. When used, it enables all the PEs
300 connected to the same multihomed site to import the Ethernet Segment
304 type yang:mac-address;
310 grouping mac-mobility-extended-community {
311 container mac-mobility-extended-community {
312 reference "https://tools.ietf.org/html/rfc7432#section-7.7";
314 "The MAC Mobility Extended Community is a transitive Extended Community
315 that may be advertised along with MAC/IP Advertisement routes.";
328 grouping default-gateway-extended-community {
329 container default-gateway-extended-community {
331 "The Default Gateway community is an Extended Community of an
334 reference "https://tools.ietf.org/html/rfc7432#section-7.8";
337 "The Default Gateway community is an Extended Community of an
342 typedef operational-mode {
344 enum vlan-aware-fxc {
347 enum vlan-unaware-fxc {
353 typedef normalization-type {
364 grouping layer-2-attributes-extended-community {
365 container layer-2-attributes-extended-community {
366 reference "https://tools.ietf.org/html/draft-ietf-bess-evpn-vpws-02#section-3.1";
368 "The EVPN Layer 2 attributes extended community is a extended community
369 to be included with Ethernet A-D per EVI route.
370 This attribute is mandatory if multihoming is enabled.";
384 leaf mode-of-operation {
385 reference "https://tools.ietf.org/html/draft-sajassi-bess-evpn-vpws-fxc-01#section-5";
386 type operational-mode;
389 reference "https://tools.ietf.org/html/draft-sajassi-bess-evpn-vpws-fxc-01#section-5";
390 type normalization-type;
399 grouping evpn-destination {
400 list evpn-destination {
402 uses bgp-msg:path-id-grouping;
406 grouping evpn-routes {
407 container evpn-routes {
409 key "route-key path-id";
411 uses pmsi:bgp-rib-route {
412 augment "attributes/extended-communities/extended-community" {
413 case esi-label-extended-community-case {
414 uses esi-label-extended-community;
416 case es-import-route-extended-community-case {
417 uses es-import-route-extended-community;
419 case mac-mobility-extended-community-case {
420 uses mac-mobility-extended-community;
422 case default-gateway-extended-community-case {
423 uses default-gateway-extended-community;
425 case layer-2-attributes-extended-community-case {
426 uses layer-2-attributes-extended-community;
435 reference "https://tools.ietf.org/html/rfc7432#section-7";
436 description "The EVPN NLRI is carried in BGP [RFC4271] using BGP Multiprotocol
437 Extensions [RFC4760] with an Address Family Identifier (AFI) of 25 (L2VPN)
438 and a Subsequent Address Family Identifier (SAFI) of 70 (EVPN)";
441 case ethernet-a-d-route-case {
442 uses ethernet-a-d-route;
444 case mac-ip-adv-route-case {
445 uses mac-ip-adv-route;
447 case inc-multi-ethernet-tag-res-case {
448 uses inc-multi-ethernet-tag-res;
456 uses bgp-t:route-distinguisher-grouping;
459 augment "/bgp-msg:update/bgp-msg:attributes/bgp-mp:mp-reach-nlri/bgp-mp:advertized-routes/bgp-mp:destination-type" {
460 case destination-evpn-case {
461 container destination-evpn {
462 uses evpn-destination;
467 augment "/bgp-msg:update/bgp-msg:attributes/bgp-mp:mp-unreach-nlri/bgp-mp:withdrawn-routes/bgp-mp:destination-type" {
468 case destination-evpn-case {
469 container destination-evpn {
470 uses evpn-destination;
475 augment "/bgp-rib:application-rib/bgp-rib:tables/bgp-rib:routes" {
476 case evpn-routes-case {
481 augment "/bgp-rib:bgp-rib/bgp-rib:rib/bgp-rib:loc-rib/bgp-rib:tables/bgp-rib:routes" {
482 case evpn-routes-case {
487 augment "/bgp-rib:bgp-rib/bgp-rib:rib/bgp-rib:peer/bgp-rib:adj-rib-in/bgp-rib:tables/bgp-rib:routes" {
488 case evpn-routes-case {
493 augment "/bgp-rib:bgp-rib/bgp-rib:rib/bgp-rib:peer/bgp-rib:effective-rib-in/bgp-rib:tables/bgp-rib:routes" {
494 case evpn-routes-case {
499 augment "/bgp-rib:bgp-rib/bgp-rib:rib/bgp-rib:peer/bgp-rib:adj-rib-out/bgp-rib:tables/bgp-rib:routes" {
500 case evpn-routes-case {
505 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" {
506 case evpn-routes-case {
511 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" {
512 case evpn-routes-case {
517 augment "/bgp-msg:update/bgp-msg:attributes/bgp-msg:extended-communities/bgp-msg:extended-community" {
518 case esi-label-extended-community-case {
519 uses esi-label-extended-community;
521 case es-import-route-extended-community-case {
522 uses es-import-route-extended-community;
524 case mac-mobility-extended-community-case {
525 uses mac-mobility-extended-community;
527 case default-gateway-extended-community-case {
528 uses default-gateway-extended-community;
530 case layer-2-attributes-extended-community-case {
531 uses layer-2-attributes-extended-community;