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 {
95 description "Nothing special";
99 description "NAT prefix";
103 description "Physical Network Function(PNF) prefix";
107 description "Subnet Route prefix";
116 container vpn-to-extraroutes {
122 description "VPN Instance name";
128 "The vrf-id configures unique route distinguisher (RD) for each ipv4
129 or ipv6 prefix when its nexthop-ip-list connected to same compute node";
134 leaf prefix {type string;}
135 leaf-list nexthop-ip-list {
143 /* Data models to adhere to restart requirements */
144 container vpn-instance-to-vpn-id {
146 key vpn-instance-name;
147 leaf vpn-instance-name {
155 "The vrf-id command configures a route distinguisher (RD)
156 for the IPv4 or IPv6 address family of a VPN instance or
157 vpn instance name for internal vpn case.";
163 container vpn-id-to-vpn-instance {
169 leaf vpn-instance-name {
174 "The vrf-id command configures a route distinguisher (RD)
175 for the IPv4 or IPv6 address family of a VPN instance or
176 vpn instance name for internal vpn case.";
181 description "The VPN is external?";
186 container evpn-rd-to-networks {
187 description "Holds the networks to which given evpn is attached";
188 list evpn-rd-to-network {
199 /* Binding Interfaces to a VPN Instance. */
200 container vpn-interface-op-data {
202 list vpn-interface-op-data-entry {
203 key "name vpn-instance-name";
207 leaf vpn-instance-name {
212 max-elements "unbounded";
217 leaf scheduled-for-remove {
220 leaf router-interface {
223 leaf vpn-interface-state {
225 "This flag indicates the state of this interface in the VPN identified by vpn-name.
226 ACTIVE state indicates that this vpn-interface is currently associated to vpn-name
227 available as one of the keys.
228 INACTIVE state indicates that this vpn-interface has already been dis-associated
229 from vpn-name available as one of the keys.";
248 augment "/odl-l3vpn:vpn-interface-op-data/odl-l3vpn:vpn-interface-op-data-entry" {
249 ext:augment-identifier "adjacencies-op";
253 container vpn-instance-op-data {
255 list vpn-instance-op-data-entry {
257 leaf vpn-id { type uint32;}
260 "The vrf-id command configures a route distinguisher (RD)
261 for the IPv4 or IPv6 address family of a VPN instance or
262 vpn instance name for internal vpn case.";
266 leaf vpn-instance-name {
267 description "Typical the VPN Uuid";
271 leaf vpn-interface-count { type uint32; }
273 list vpn-to-dpn-list {
278 list vpn-interfaces {
280 leaf interface-name {
286 leaf ip-address { type string; }
287 leaf ip-address-source {
289 "This field indicates whether the IP address here is an External-Fixed-Ip(Owned by Router).
290 or Floating-Ip(Used by Ports).";
292 enum "ExternalFixedIP";
299 "This flag indicates the state of the DPN.
300 Active state indicates atleast one vpn interface present on that DPN for the vpn.
301 Inactive state indicates no vpn interface present on that DPN for this vpn.";
318 leaf ipv4-configured {
321 "This VPN Instance handles IPv4 traffic";
324 leaf ipv6-configured {
327 "This VPN Instance handles IPv6 traffic";
332 enum BGPVPNInternet {
334 description "BGPVPN Internet";
336 enum BGPVPNExternal {
338 description "BGPVPN External";
342 description "Default VPN";
348 "The type of the VPN Instance.
349 L3 indicates it is an L3VPN.
350 L2 indicates it is an EVPN";
355 description “L3VPN";
367 container vpnTargets {
369 "The vpn-target command configures the export or import VPN target
370 extended community attribute for the VPN instance IPv4/IPv6 address
372 Format is ASN:nn or IP-address:nn.";
376 max-elements "unbounded";
379 "L3vpn vpntarget configure class";
383 "Vpn-target: adds VPN target extended community attribute to the
384 export or import VPN target extended community list. The
385 vpn-target can be expressed in either of the following formats:
386 (1)16-bit AS number:32-bit user-defined number
387 For example, 1:3. The AS number ranges from 0 to 65535. The
388 user-defined number ranges from 0 to 4294967295. The AS number
389 and the user-defined number cannot be 0s at the same time.
390 That is, a VPN target cannot be 0:0.
391 (2)32-bit IP address:16-bit user-defined number
392 For example, 192.168.122.15:1. The IP address ranges from
393 0.0.0.0 to 255.255.255.255. The user-defined number ranges from
395 (3)32-bit IP address:16-bit user-defined number
396 For example, 192.168.122.15:1. An IP address ranges from
397 0.0.0.0 to 255.255.255.255. A user-defined number ranges from 0
406 "Specifies the vpn target type, export-extcommunity:
407 specifies the extended community attributes carried in routing
408 information to be sent. import-extcommunity: receives routing
409 information carrying specified extended community attributes.";
412 enum export_extcommunity {
414 description "export-extcommunity:";
416 enum import_extcommunity {
418 description "import-extcommunity:";
422 description "export-extcommunity & import-extcommunity:";
430 "Represents a stage in this VpnInstance's lifecycle.";
435 "VPNInstance is successfully created";
437 enum pending_delete {
440 "VpnInstance marked for deletion.";
456 description "Task in idle state";
458 enum pending_advertise {
460 description "Task is pending advertisement state";
462 enum pending_withdraw {
464 description "Task is pending withdrawal state";
468 description "Task is in advertised state";
472 description "Task is in withdrawn state";
476 "This value the status of any task.
477 The possible values are IDLE, PENDING_ADVERTISE, PENDING_WITHDRAW, ADVERTISED, WITHDRAWN.";
481 container subnet-op-data {
483 list subnet-op-data-entry {
487 description "UUID representing the subnet ";
491 description "DpnId for the DPN used as nexthop for this subnet";
495 description "VPN Instance name";
502 description "Subnet in cidr notation";
504 leaf route-adv-state {
506 description "The status of the subnet route advertisement/withdrawal";
508 leaf last-adv-state {
510 description "The previous status of the subnet route advertisement/withdrawal.";
520 list vpn-interfaces {
522 leaf interface-name {
533 uses nvpn:network-attributes;
538 container port-op-data {
540 list port-op-data-entry {
544 description "UUID in string format representing the port ";
546 leaf-list subnet-ids {
548 description "Back reference to obtain the subnet for a port ";
557 grouping dpn-in-vpn-event {
558 leaf dpn-id { type uint64; }
559 leaf vpn-name { type string; }
560 leaf rd { type string; }
563 notification add-dpn-event {
564 container add-event-data {
565 uses dpn-in-vpn-event;
569 notification remove-dpn-event {
570 container remove-event-data {
571 uses dpn-in-vpn-event;
575 notification add-interface-to-dpn-on-vpn-event {
576 container add-interface-event-data {
577 uses dpn-in-vpn-event;
578 leaf interface-name { type string; }
579 leaf vpn-id { type uint32; }
583 notification remove-interface-from-dpn-on-vpn-event {
584 container remove-interface-event-data {
585 uses dpn-in-vpn-event;
586 leaf interface-name { type string; }
587 leaf vpn-id { type uint32; }
592 * Configured Transport Type for l3vpn service.
594 container conf-transport-type-l3vpn {
595 leaf transport-type {
598 base odlif:tunnel-type-base;
601 "L3VPN service will use this config to setup
602 the transport type for tunnels between DPNs.";
606 /* container to maintain mapping between neutron router and DPN(s) on which vpn-interfaces for router are present */
607 container neutron-router-dpns {
609 list router-dpn-list {
611 leaf router-id { type string;}
612 list dpn-vpninterfaces-list {
614 leaf dpn-id { type uint64;}
615 list router-interfaces {
617 leaf interface { type string; }
623 /* container to maintain mapping between DPN(s) and the routers */
624 container dpn-routers {
626 list dpn-routers-list {
628 leaf dpn-id { type uint64;}
631 leaf router { type string;}
636 container router-interfaces {
637 list router-interface {
639 leaf interface-name { type string; }
640 leaf router-name { type string; }
644 container learnt-vpn-vip-to-port-data {
646 list learnt-vpn-vip-to-port {
647 key "vpn-name port-fixedip";
648 leaf vpn-name { type string; }
649 leaf port-fixedip { type string; }
650 leaf port-name { type string; }
651 leaf mac-address { type string; }
652 leaf creation-time { type string; }
656 container evpn-config {
658 leaf multi-homing-mode {
662 enum "single-active";
675 container l3vpn-lb-nexthops {
679 leaf nexthop-key { type string; }
680 leaf group-id { type string; }
681 leaf-list target-device-id { type string; } //dpId or ip-address
685 container dpid-l3vpn-lb-nexthops {
687 list dpn-lb-nexthops {
688 key "src-dp-id dst-device-id";
689 leaf src-dp-id { type uint64; }
690 leaf dst-device-id { type string; } //dpId or ip-address
691 leaf-list nexthop-key { type string; }