2 namespace "urn:opendaylight:netvirt:l3vpn";
5 import yang-ext {prefix ext; revision-date "2013-07-09";}
6 import l3vpn { prefix l3vpn; revision-date "2014-08-15"; }
7 import ietf-yang-types { prefix "yang"; revision-date "2013-07-15"; }
8 import odl-interface { prefix odlif; revision-date "2016-04-06"; }
11 revision-date "2015-06-02";
13 import l3vpn-instances-interfaces {
15 revision-date "2020-02-04";
17 revision "2013-09-11" {
18 description "L3 VPN Service module";
21 grouping vpn-route-list{
22 leaf-list route-entry-id{
27 /* Operational DS containers for reverse lookups*/
28 container prefix-to-interface {
32 leaf vpn-id {type uint32;}
35 leaf ip_address {type string;}
39 leaf vpn-interface-name {
42 uses nvpn:network-attributes;
47 description "Nothing special";
51 description "NAT prefix";
55 description "Physical Network Function(PNF) prefix";
59 description "Subnet Route prefix";
68 container vpn-to-extraroutes {
74 description "VPN Instance name";
80 "The vrf-id configures unique route distinguisher (RD) for each ipv4
81 or ipv6 prefix when its nexthop-ip-list connected to same compute node";
86 leaf prefix {type string;}
87 leaf-list nexthop-ip-list {
95 /* Data models to adhere to restart requirements */
96 container vpn-instance-to-vpn-id {
98 key vpn-instance-name;
99 leaf vpn-instance-name {
107 "The vrf-id command configures a route distinguisher (RD)
108 for the IPv4 or IPv6 address family of a VPN instance or
109 vpn instance name for internal vpn case.";
115 container vpn-id-to-vpn-instance {
121 leaf vpn-instance-name {
126 "The vrf-id command configures a route distinguisher (RD)
127 for the IPv4 or IPv6 address family of a VPN instance or
128 vpn instance name for internal vpn case.";
133 description "The VPN is external?";
138 container evpn-rd-to-networks {
139 description "Holds the networks to which given evpn is attached";
140 list evpn-rd-to-network {
151 /* Binding Interfaces to a VPN Instance. */
152 container vpn-interface-op-data {
154 list vpn-interface-op-data-entry {
155 key "name vpn-instance-name";
159 leaf vpn-instance-name {
164 max-elements "unbounded";
169 leaf router-interface {
172 leaf gateway-mac-address {
175 leaf gateway-ip-address {
181 leaf vpn-interface-state {
183 "This flag indicates the state of this interface in the VPN identified by vpn-name.
184 ACTIVE state indicates that this vpn-interface is currently associated to vpn-name
185 available as one of the keys.
186 INACTIVE state indicates that this vpn-interface has already been dis-associated
187 from vpn-name available as one of the keys.";
206 augment "/odl-l3vpn:vpn-interface-op-data/odl-l3vpn:vpn-interface-op-data-entry" {
207 ext:augment-identifier "adjacencies-op";
208 uses nvpn-l3vpn:adjacency-list;
211 container vpn-instance-op-data {
213 list vpn-instance-op-data-entry {
215 leaf vpn-id { type uint32;}
218 "The vrf-id command configures a route distinguisher (RD)
219 for the IPv4 or IPv6 address family of a VPN instance or
220 vpn instance name for internal vpn case.";
224 leaf vpn-instance-name {
225 description "Typical the VPN Uuid";
229 leaf vpn-interface-count { type uint32; }
231 list vpn-to-dpn-list {
236 list vpn-interfaces {
238 leaf interface-name {
244 leaf ip-address { type string; }
245 leaf ip-address-source {
247 "This field indicates whether the IP address here is an External-Fixed-Ip(Owned by Router).
248 or Floating-Ip(Used by Ports).";
250 enum "ExternalFixedIP";
257 "This flag indicates the state of the DPN.
258 Active state indicates atleast one vpn interface present on that DPN for the vpn.
259 Inactive state indicates no vpn interface present on that DPN for this vpn.";
276 leaf ip-address-family-configured {
287 enum "ipv4-and-ipv6" {
295 enum BGPVPNInternet {
297 description "BGPVPN Internet";
299 enum BGPVPNExternal {
301 description "BGPVPN External";
305 description "Default VPN";
311 "The type of the VPN Instance.
312 L3 indicates it is an L3VPN.
313 L2 indicates it is an EVPN";
330 container vpnTargets {
332 "The vpn-target command configures the export or import VPN target
333 extended community attribute for the VPN instance IPv4/IPv6 address
335 Format is ASN:nn or IP-address:nn.";
339 max-elements "unbounded";
342 "L3vpn vpntarget configure class";
346 "Vpn-target: adds VPN target extended community attribute to the
347 export or import VPN target extended community list. The
348 vpn-target can be expressed in either of the following formats:
349 (1)16-bit AS number:32-bit user-defined number
350 For example, 1:3. The AS number ranges from 0 to 65535. The
351 user-defined number ranges from 0 to 4294967295. The AS number
352 and the user-defined number cannot be 0s at the same time.
353 That is, a VPN target cannot be 0:0.
354 (2)32-bit IP address:16-bit user-defined number
355 For example, 192.168.122.15:1. The IP address ranges from
356 0.0.0.0 to 255.255.255.255. The user-defined number ranges from
358 (3)32-bit IP address:16-bit user-defined number
359 For example, 192.168.122.15:1. An IP address ranges from
360 0.0.0.0 to 255.255.255.255. A user-defined number ranges from 0
369 "Specifies the vpn target type, export-extcommunity:
370 specifies the extended community attributes carried in routing
371 information to be sent. import-extcommunity: receives routing
372 information carrying specified extended community attributes.";
375 enum export_extcommunity {
377 description "export-extcommunity:";
379 enum import_extcommunity {
381 description "import-extcommunity:";
385 description "export-extcommunity & import-extcommunity:";
393 "Represents a stage in this VpnInstance's lifecycle.";
398 "VPNInstance is successfully created";
400 enum pending_delete {
403 "VpnInstance marked for deletion.";
419 description "Task in idle state";
421 enum pending_advertise {
423 description "Task is pending advertisement state";
425 enum pending_withdraw {
427 description "Task is pending withdrawal state";
431 description "Task is in advertised state";
435 description "Task is in withdrawn state";
439 "This value the status of any task.
440 The possible values are IDLE, PENDING_ADVERTISE, PENDING_WITHDRAW, ADVERTISED, WITHDRAWN.";
444 container subnet-op-data {
446 list subnet-op-data-entry {
450 description "UUID representing the subnet ";
454 description "DpnId for the DPN used as nexthop for this subnet";
458 description "VPN Instance name";
465 description "Subnet in cidr notation";
467 leaf route-adv-state {
469 description "The status of the subnet route advertisement/withdrawal";
471 leaf last-adv-state {
473 description "The previous status of the subnet route advertisement/withdrawal.";
483 list vpn-interfaces {
485 leaf interface-name {
496 uses nvpn:network-attributes;
501 container port-op-data {
503 list port-op-data-entry {
507 description "UUID in string format representing the port ";
509 leaf-list subnet-ids {
511 description "Back reference to obtain the subnet for a port ";
520 grouping dpn-in-vpn-event {
521 leaf dpn-id { type uint64; }
522 leaf vpn-name { type string; }
523 leaf rd { type string; }
526 notification add-dpn-event {
527 container add-event-data {
528 uses dpn-in-vpn-event;
532 notification remove-dpn-event {
533 container remove-event-data {
534 uses dpn-in-vpn-event;
538 notification add-interface-to-dpn-on-vpn-event {
539 container add-interface-event-data {
540 uses dpn-in-vpn-event;
541 leaf interface-name { type string; }
542 leaf vpn-id { type uint32; }
546 notification remove-interface-from-dpn-on-vpn-event {
547 container remove-interface-event-data {
548 uses dpn-in-vpn-event;
549 leaf interface-name { type string; }
550 leaf vpn-id { type uint32; }
555 * Configured Transport Type for l3vpn service.
557 container conf-transport-type-l3vpn {
558 leaf transport-type {
561 base odlif:tunnel-type-base;
564 "L3VPN service will use this config to setup
565 the transport type for tunnels between DPNs.";
569 /* container to maintain mapping between neutron router and DPN(s) on which vpn-interfaces for router are present */
570 container neutron-router-dpns {
572 list router-dpn-list {
574 leaf router-id { type string;}
575 list dpn-vpninterfaces-list {
577 leaf dpn-id { type uint64;}
578 list router-interfaces {
580 leaf interface { type string; }
586 /* container to maintain mapping between DPN(s) and the routers */
587 container dpn-routers {
589 list dpn-routers-list {
591 leaf dpn-id { type uint64;}
594 leaf router { type string;}
599 container router-interfaces {
600 list router-interface {
602 leaf interface-name { type string; }
603 leaf router-name { type string; }
607 container learnt-vpn-vip-to-port-data {
609 list learnt-vpn-vip-to-port {
610 key "vpn-name port-fixedip";
611 leaf vpn-name { type string; }
612 leaf port-fixedip { type string; }
613 leaf port-name { type string; }
614 leaf mac-address { type string; }
615 leaf creation-time { type string; }
619 container evpn-config {
621 leaf multi-homing-mode {
625 enum "single-active";
638 container l3vpn-lb-nexthops {
642 leaf nexthop-key { type string; }
643 leaf group-id { type string; }
644 leaf-list target-device-id { type string; } //dpId or ip-address
648 container l3vpn-dc-gws {
658 typedef learnt-vpn-vip-to-port-event-action {
663 "Event to add a learnt vip to CSC FIB";
668 "Event to remove a learnt vip from CSC FIB";
672 "This value represents the action of an event on learnt-vpn-vip-to-port.
673 The possible actions supported are only ADD, DELETE";
676 container learnt-vpn-vip-to-port-event-data {
678 list learnt-vpn-vip-to-port-event {
679 key "learnt-vpn-vip-event-id";
680 leaf vpn-name { type string; }
681 leaf src-fixedip { type string; }
682 leaf dest-fixedip { type string; }
683 leaf port-name { type string; }
684 leaf mac-address { type string; }
685 leaf event-action { type learnt-vpn-vip-to-port-event-action; }
686 leaf learnt-vpn-vip-event-id { type string; }
690 /* rt to subnets map */
691 container subnets-associated-to-route-targets {
695 leaf rt { type string; }
706 list associated-subnet {
708 leaf cidr { type string; }
709 list associated-vpn {
711 leaf name { type string; }