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 mac_address {type string;} /* optional */
45 leaf subnet_id {type yang:uuid;} /* optional */
46 leaf subnet_gateway_ip {type string;} /* optional */
47 leaf phys-network-func {
50 description "Value of True indicates this is an adjacency of a device in a provider network";
52 uses adjacency-op-data;
56 grouping adjacency-op-data{
57 leaf label { type uint32; config "false"; } /* optional */
58 leaf subnet_gateway_mac_address {type string; config "false";} /* optional */
59 leaf vrf-id { type string; config "false"; }
60 leaf marked_for_deletion {
63 description "This flag if true suggest this adjancency has been marked for deletion";
67 grouping vpn-route-list{
68 leaf-list route-entry-id{
73 augment "/l3vpn:vpn-interfaces/l3vpn:vpn-interface" {
74 ext:augment-identifier "adjacencies";
78 /* Operational DS containers for reverse lookups*/
79 container prefix-to-interface {
83 leaf vpn-id {type uint32;}
86 leaf ip_address {type string;}
90 leaf vpn-interface-name {
93 uses nvpn:network-attributes;
98 description "Nothing special";
102 description "NAT prefix";
106 description "Physical Network Function(PNF) prefix";
110 description "Subnet Route prefix";
119 container vpn-to-extraroutes {
125 description "VPN Instance name";
131 "The vrf-id configures unique route distinguisher (RD) for each ipv4
132 or ipv6 prefix when its nexthop-ip-list connected to same compute node";
137 leaf prefix {type string;}
138 leaf-list nexthop-ip-list {
146 /* Data models to adhere to restart requirements */
147 container vpn-instance-to-vpn-id {
149 key vpn-instance-name;
150 leaf vpn-instance-name {
158 "The vrf-id command configures a route distinguisher (RD)
159 for the IPv4 or IPv6 address family of a VPN instance or
160 vpn instance name for internal vpn case.";
166 container vpn-id-to-vpn-instance {
172 leaf vpn-instance-name {
177 "The vrf-id command configures a route distinguisher (RD)
178 for the IPv4 or IPv6 address family of a VPN instance or
179 vpn instance name for internal vpn case.";
184 description "The VPN is external?";
189 container evpn-rd-to-networks {
190 description "Holds the networks to which given evpn is attached";
191 list evpn-rd-to-network {
202 /* Binding Interfaces to a VPN Instance. */
203 container vpn-interface-op-data {
205 list vpn-interface-op-data-entry {
206 key "name vpn-instance-name";
210 leaf vpn-instance-name {
215 max-elements "unbounded";
220 leaf router-interface {
223 leaf gateway-mac-address {
229 leaf vpn-interface-state {
231 "This flag indicates the state of this interface in the VPN identified by vpn-name.
232 ACTIVE state indicates that this vpn-interface is currently associated to vpn-name
233 available as one of the keys.
234 INACTIVE state indicates that this vpn-interface has already been dis-associated
235 from vpn-name available as one of the keys.";
254 augment "/odl-l3vpn:vpn-interface-op-data/odl-l3vpn:vpn-interface-op-data-entry" {
255 ext:augment-identifier "adjacencies-op";
259 container vpn-instance-op-data {
261 list vpn-instance-op-data-entry {
263 leaf vpn-id { type uint32;}
266 "The vrf-id command configures a route distinguisher (RD)
267 for the IPv4 or IPv6 address family of a VPN instance or
268 vpn instance name for internal vpn case.";
272 leaf vpn-instance-name {
273 description "Typical the VPN Uuid";
277 leaf vpn-interface-count { type uint32; }
279 list vpn-to-dpn-list {
284 list vpn-interfaces {
286 leaf interface-name {
292 leaf ip-address { type string; }
293 leaf ip-address-source {
295 "This field indicates whether the IP address here is an External-Fixed-Ip(Owned by Router).
296 or Floating-Ip(Used by Ports).";
298 enum "ExternalFixedIP";
305 "This flag indicates the state of the DPN.
306 Active state indicates atleast one vpn interface present on that DPN for the vpn.
307 Inactive state indicates no vpn interface present on that DPN for this vpn.";
324 leaf ipv4-configured {
327 "This VPN Instance handles IPv4 traffic";
330 leaf ipv6-configured {
333 "This VPN Instance handles IPv6 traffic";
338 enum BGPVPNInternet {
340 description "BGPVPN Internet";
342 enum BGPVPNExternal {
344 description "BGPVPN External";
348 description "Default VPN";
354 "The type of the VPN Instance.
355 L3 indicates it is an L3VPN.
356 L2 indicates it is an EVPN";
373 container vpnTargets {
375 "The vpn-target command configures the export or import VPN target
376 extended community attribute for the VPN instance IPv4/IPv6 address
378 Format is ASN:nn or IP-address:nn.";
382 max-elements "unbounded";
385 "L3vpn vpntarget configure class";
389 "Vpn-target: adds VPN target extended community attribute to the
390 export or import VPN target extended community list. The
391 vpn-target can be expressed in either of the following formats:
392 (1)16-bit AS number:32-bit user-defined number
393 For example, 1:3. The AS number ranges from 0 to 65535. The
394 user-defined number ranges from 0 to 4294967295. The AS number
395 and the user-defined number cannot be 0s at the same time.
396 That is, a VPN target cannot be 0:0.
397 (2)32-bit IP address:16-bit user-defined number
398 For example, 192.168.122.15:1. The IP address ranges from
399 0.0.0.0 to 255.255.255.255. The user-defined number ranges from
401 (3)32-bit IP address:16-bit user-defined number
402 For example, 192.168.122.15:1. An IP address ranges from
403 0.0.0.0 to 255.255.255.255. A user-defined number ranges from 0
412 "Specifies the vpn target type, export-extcommunity:
413 specifies the extended community attributes carried in routing
414 information to be sent. import-extcommunity: receives routing
415 information carrying specified extended community attributes.";
418 enum export_extcommunity {
420 description "export-extcommunity:";
422 enum import_extcommunity {
424 description "import-extcommunity:";
428 description "export-extcommunity & import-extcommunity:";
436 "Represents a stage in this VpnInstance's lifecycle.";
441 "VPNInstance is successfully created";
443 enum pending_delete {
446 "VpnInstance marked for deletion.";
462 description "Task in idle state";
464 enum pending_advertise {
466 description "Task is pending advertisement state";
468 enum pending_withdraw {
470 description "Task is pending withdrawal state";
474 description "Task is in advertised state";
478 description "Task is in withdrawn state";
482 "This value the status of any task.
483 The possible values are IDLE, PENDING_ADVERTISE, PENDING_WITHDRAW, ADVERTISED, WITHDRAWN.";
487 container subnet-op-data {
489 list subnet-op-data-entry {
493 description "UUID representing the subnet ";
497 description "DpnId for the DPN used as nexthop for this subnet";
501 description "VPN Instance name";
508 description "Subnet in cidr notation";
510 leaf route-adv-state {
512 description "The status of the subnet route advertisement/withdrawal";
514 leaf last-adv-state {
516 description "The previous status of the subnet route advertisement/withdrawal.";
526 list vpn-interfaces {
528 leaf interface-name {
539 uses nvpn:network-attributes;
544 container port-op-data {
546 list port-op-data-entry {
550 description "UUID in string format representing the port ";
552 leaf-list subnet-ids {
554 description "Back reference to obtain the subnet for a port ";
563 grouping dpn-in-vpn-event {
564 leaf dpn-id { type uint64; }
565 leaf vpn-name { type string; }
566 leaf rd { type string; }
569 notification add-dpn-event {
570 container add-event-data {
571 uses dpn-in-vpn-event;
575 notification remove-dpn-event {
576 container remove-event-data {
577 uses dpn-in-vpn-event;
581 notification add-interface-to-dpn-on-vpn-event {
582 container add-interface-event-data {
583 uses dpn-in-vpn-event;
584 leaf interface-name { type string; }
585 leaf vpn-id { type uint32; }
589 notification remove-interface-from-dpn-on-vpn-event {
590 container remove-interface-event-data {
591 uses dpn-in-vpn-event;
592 leaf interface-name { type string; }
593 leaf vpn-id { type uint32; }
598 * Configured Transport Type for l3vpn service.
600 container conf-transport-type-l3vpn {
601 leaf transport-type {
604 base odlif:tunnel-type-base;
607 "L3VPN service will use this config to setup
608 the transport type for tunnels between DPNs.";
612 /* container to maintain mapping between neutron router and DPN(s) on which vpn-interfaces for router are present */
613 container neutron-router-dpns {
615 list router-dpn-list {
617 leaf router-id { type string;}
618 list dpn-vpninterfaces-list {
620 leaf dpn-id { type uint64;}
621 list router-interfaces {
623 leaf interface { type string; }
629 /* container to maintain mapping between DPN(s) and the routers */
630 container dpn-routers {
632 list dpn-routers-list {
634 leaf dpn-id { type uint64;}
637 leaf router { type string;}
642 container router-interfaces {
643 list router-interface {
645 leaf interface-name { type string; }
646 leaf router-name { type string; }
650 container learnt-vpn-vip-to-port-data {
652 list learnt-vpn-vip-to-port {
653 key "vpn-name port-fixedip";
654 leaf vpn-name { type string; }
655 leaf port-fixedip { type string; }
656 leaf port-name { type string; }
657 leaf mac-address { type string; }
658 leaf creation-time { type string; }
662 container evpn-config {
664 leaf multi-homing-mode {
668 enum "single-active";
681 container l3vpn-lb-nexthops {
685 leaf nexthop-key { type string; }
686 leaf group-id { type string; }
687 leaf-list target-device-id { type string; } //dpId or ip-address
691 container l3vpn-dc-gws {
701 typedef learnt-vpn-vip-to-port-event-action {
706 "Event to add a learnt vip to CSC FIB";
711 "Event to remove a learnt vip from CSC FIB";
715 "This value represents the action of an event on learnt-vpn-vip-to-port.
716 The possible actions supported are only ADD, DELETE";
719 container learnt-vpn-vip-to-port-event-data {
721 list learnt-vpn-vip-to-port-event {
722 key "learnt-vpn-vip-event-id";
723 leaf vpn-name { type string; }
724 leaf src-fixedip { type string; }
725 leaf dest-fixedip { type string; }
726 leaf port-name { type string; }
727 leaf mac-address { type string; }
728 leaf event-action { type learnt-vpn-vip-to-port-event-action; }
729 leaf learnt-vpn-vip-event-id { type string; }
733 /* rt to subnets map */
734 container subnets-associated-to-route-targets {
738 leaf rt { type string; }
749 list associated-subnet {
751 leaf cidr { type string; }
752 list associated-vpn {
754 leaf name { type string; }