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";
14 revision "2013-09-11" {
15 description "L3 VPN Service module";
18 grouping adjacency-list{
21 leaf-list next-hop-ip-list { type string; }
22 leaf ip_address {type string;}
24 description "The type of adjacency";
26 enum "primary-adjacency" {
29 "Primary adjacency type.";
34 "Learnt ip adjacency type.";
39 "Extra route adjacency type.";
42 default "extra-route";
44 leaf label { type uint32; config "false"; } /* optional */
45 leaf mac_address {type string;} /* optional */
46 leaf subnet_id {type yang:uuid;} /* optional */
47 leaf subnet_gateway_mac_address {type string; config "false";} /* optional */
48 leaf vrf-id { type string; config "false"; }
49 leaf phys-network-func {
52 description "Value of True indicates this is an adjacency of a device in a provider network";
57 grouping vpn-route-list{
58 leaf-list route-entry-id{
63 augment "/l3vpn:vpn-interfaces/l3vpn:vpn-interface" {
64 ext:augment-identifier "adjacencies";
68 augment "/l3vpn:vpn-interfaces/l3vpn:vpn-interface" {
69 ext:augment-identifier "opState";
70 leaf stateUp {type boolean; config false;}
73 /* Operational DS containers for reverse lookups*/
74 container prefix-to-interface {
78 leaf vpn-id {type uint32;}
81 leaf ip_address {type string;}
85 leaf vpn-interface-name {
99 container vpn-to-extraroutes {
105 description "VPN Instance name";
111 "The vrf-id configures unique route distinguisher (RD) for each ipv4
112 or ipv6 prefix when its nexthop-ip-list connected to same compute node";
117 leaf prefix {type string;}
118 leaf-list nexthop-ip-list {
126 /* Data models to adhere to restart requirements */
127 container vpn-instance-to-vpn-id {
129 key vpn-instance-name;
130 leaf vpn-instance-name {
138 "The vrf-id command configures a route distinguisher (RD)
139 for the IPv4 or IPv6 address family of a VPN instance or
140 vpn instance name for internal vpn case.";
146 container vpn-id-to-vpn-instance {
152 leaf vpn-instance-name {
157 "The vrf-id command configures a route distinguisher (RD)
158 for the IPv4 or IPv6 address family of a VPN instance or
159 vpn instance name for internal vpn case.";
164 description "The VPN is external?";
169 container evpn-rd-to-networks {
170 description "Holds the networks to which given evpn is attached";
171 list evpn-rd-to-network {
182 container vpn-instance-op-data {
184 list vpn-instance-op-data-entry {
186 leaf vpn-id { type uint32;}
189 "The vrf-id command configures a route distinguisher (RD)
190 for the IPv4 or IPv6 address family of a VPN instance or
191 vpn instance name for internal vpn case.";
195 leaf vpn-instance-name {
196 description "Typical the VPN Uuid";
200 leaf vpn-interface-count { type uint32; }
202 list vpn-to-dpn-list {
207 list vpn-interfaces {
209 leaf interface-name {
215 leaf ip-address { type string; }
216 leaf ip-address-source {
218 "This field indicates whether the IP address here is an External-Fixed-Ip(Owned by Router).
219 or Floating-Ip(Used by Ports).";
221 enum "ExternalFixedIP";
228 "This flag indicates the state of the DPN.
229 Active state indicates atleast one vpn interface present on that DPN for the vpn.
230 Inactive state indicates no vpn interface present on that DPN for this vpn.";
249 "The type of the VPN Instance.
250 L3 indicates it is an L3VPN.
251 L2 indicates it is an EVPN";
256 description “L3VPN";
268 container vpnTargets {
270 "The vpn-target command configures the export or import VPN target
271 extended community attribute for the VPN instance IPv4/IPv6 address
273 Format is ASN:nn or IP-address:nn.";
277 max-elements "unbounded";
280 "L3vpn vpntarget configure class";
284 "Vpn-target: adds VPN target extended community attribute to the
285 export or import VPN target extended community list. The
286 vpn-target can be expressed in either of the following formats:
287 (1)16-bit AS number:32-bit user-defined number
288 For example, 1:3. The AS number ranges from 0 to 65535. The
289 user-defined number ranges from 0 to 4294967295. The AS number
290 and the user-defined number cannot be 0s at the same time.
291 That is, a VPN target cannot be 0:0.
292 (2)32-bit IP address:16-bit user-defined number
293 For example, 192.168.122.15:1. The IP address ranges from
294 0.0.0.0 to 255.255.255.255. The user-defined number ranges from
296 (3)32-bit IP address:16-bit user-defined number
297 For example, 192.168.122.15:1. An IP address ranges from
298 0.0.0.0 to 255.255.255.255. A user-defined number ranges from 0
307 "Specifies the vpn target type, export-extcommunity:
308 specifies the extended community attributes carried in routing
309 information to be sent. import-extcommunity: receives routing
310 information carrying specified extended community attributes.";
313 enum export_extcommunity {
315 description "export-extcommunity:";
317 enum import_extcommunity {
319 description "import-extcommunity:";
323 description "export-extcommunity & import-extcommunity:";
331 "Represents a stage in this VpnInstance's lifecycle.";
336 "VPNInstance is successfully created";
338 enum pending_delete {
341 "VpnInstance marked for deletion.";
357 description "Task in idle state";
359 enum pending_advertise {
361 description "Task is pending advertisement state";
363 enum pending_withdraw {
365 description "Task is pending withdrawal state";
369 description "Task is in advertised state";
373 description "Task is in withdrawn state";
377 "This value the status of any task.
378 The possible values are IDLE, PENDING_ADVERTISE, PENDING_WITHDRAW, ADVERTISED, WITHDRAWN.";
382 container subnet-op-data {
384 list subnet-op-data-entry {
388 description "UUID representing the subnet ";
392 description "DpnId for the DPN used as nexthop for this subnet";
396 description "VPN Instance name";
403 description "Subnet in cidr notation";
405 leaf route-adv-state {
407 description "The status of the subnet route advertisement/withdrawal";
417 list vpn-interfaces {
419 leaf interface-name {
430 uses nvpn:network-attributes;
435 container port-op-data {
437 list port-op-data-entry {
441 description "UUID in string format representing the port ";
445 description "Back reference to obtain the subnet for a port ";
454 grouping dpn-in-vpn-event {
455 leaf dpn-id { type uint64; }
456 leaf vpn-name { type string; }
457 leaf rd { type string; }
460 notification add-dpn-event {
461 container add-event-data {
462 uses dpn-in-vpn-event;
466 notification remove-dpn-event {
467 container remove-event-data {
468 uses dpn-in-vpn-event;
472 notification add-interface-to-dpn-on-vpn-event {
473 container add-interface-event-data {
474 uses dpn-in-vpn-event;
475 leaf interface-name { type string; }
476 leaf vpn-id { type uint32; }
480 notification remove-interface-from-dpn-on-vpn-event {
481 container remove-interface-event-data {
482 uses dpn-in-vpn-event;
483 leaf interface-name { type string; }
484 leaf vpn-id { type uint32; }
489 * Configured Transport Type for l3vpn service.
491 container conf-transport-type-l3vpn {
492 leaf transport-type {
495 base odlif:tunnel-type-base;
498 "L3VPN service will use this config to setup
499 the transport type for tunnels between DPNs.";
503 /* container to maintain mapping between neutron router and DPN(s) on which vpn-interfaces for router are present */
504 container neutron-router-dpns {
506 list router-dpn-list {
508 leaf router-id { type string;}
509 list dpn-vpninterfaces-list {
511 leaf dpn-id { type uint64;}
512 list router-interfaces {
514 leaf interface { type string; }
520 /* container to maintain mapping between DPN(s) and the routers */
521 container dpn-routers {
523 list dpn-routers-list {
525 leaf dpn-id { type uint64;}
528 leaf router { type string;}
533 container router-interfaces {
534 list router-interface {
536 leaf interface-name { type string; }
537 leaf router-name { type string; }
541 container learnt-vpn-vip-to-port-data {
543 list learnt-vpn-vip-to-port {
544 key "vpn-name port-fixedip";
545 leaf vpn-name { type string; }
546 leaf port-fixedip { type string; }
547 leaf port-name { type string; }
548 leaf mac-address { type string; }
549 leaf creation-time { type string; }
553 container evpn-config {
555 leaf multi-homing-mode {
559 enum "single-active";
572 container l3vpn-lb-nexthops {
576 leaf nexthop-key { type string; }
577 leaf group-id { type string; }
578 leaf-list target-device-id { type string; } //dpId or ip-address
582 container dpid-l3vpn-lb-nexthops {
584 list dpn-lb-nexthops {
585 key "src-dp-id dst-device-id";
586 leaf src-dp-id { type uint64; }
587 leaf dst-device-id { type string; } //dpId or ip-address
588 leaf-list nexthop-key { type string; }