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 augment "/l3vpn:vpn-interfaces/l3vpn:vpn-interface" {
79 ext:augment-identifier "opState";
80 leaf stateUp {type boolean; config false;}
83 /* Operational DS containers for reverse lookups*/
84 container prefix-to-interface {
88 leaf vpn-id {type uint32;}
91 leaf ip_address {type string;}
95 leaf vpn-interface-name {
105 description "Nothing special";
109 description "NAT prefix";
113 description "Physical Network Function(PNF) prefix";
117 description "Subnet Route prefix";
126 container vpn-to-extraroutes {
132 description "VPN Instance name";
138 "The vrf-id configures unique route distinguisher (RD) for each ipv4
139 or ipv6 prefix when its nexthop-ip-list connected to same compute node";
144 leaf prefix {type string;}
145 leaf-list nexthop-ip-list {
153 /* Data models to adhere to restart requirements */
154 container vpn-instance-to-vpn-id {
156 key vpn-instance-name;
157 leaf vpn-instance-name {
165 "The vrf-id command configures a route distinguisher (RD)
166 for the IPv4 or IPv6 address family of a VPN instance or
167 vpn instance name for internal vpn case.";
173 container vpn-id-to-vpn-instance {
179 leaf vpn-instance-name {
184 "The vrf-id command configures a route distinguisher (RD)
185 for the IPv4 or IPv6 address family of a VPN instance or
186 vpn instance name for internal vpn case.";
191 description "The VPN is external?";
196 container evpn-rd-to-networks {
197 description "Holds the networks to which given evpn is attached";
198 list evpn-rd-to-network {
209 /* Binding Interfaces to a VPN Instance. */
210 container vpn-interface-op-data {
212 list vpn-interface-op-data-entry {
213 key "name vpn-instance-name";
217 leaf vpn-instance-name {
222 max-elements "unbounded";
227 leaf router-interface {
230 leaf gateway-mac-address {
236 leaf vpn-interface-state {
238 "This flag indicates the state of this interface in the VPN identified by vpn-name.
239 ACTIVE state indicates that this vpn-interface is currently associated to vpn-name
240 available as one of the keys.
241 INACTIVE state indicates that this vpn-interface has already been dis-associated
242 from vpn-name available as one of the keys.";
261 augment "/odl-l3vpn:vpn-interface-op-data/odl-l3vpn:vpn-interface-op-data-entry" {
262 ext:augment-identifier "adjacencies-op";
266 container vpn-instance-op-data {
268 list vpn-instance-op-data-entry {
270 leaf vpn-id { type uint32;}
273 "The vrf-id command configures a route distinguisher (RD)
274 for the IPv4 or IPv6 address family of a VPN instance or
275 vpn instance name for internal vpn case.";
279 leaf vpn-instance-name {
280 description "Typical the VPN Uuid";
284 leaf vpn-interface-count { type uint32; }
286 list vpn-to-dpn-list {
291 list vpn-interfaces {
293 leaf interface-name {
299 leaf ip-address { type string; }
300 leaf ip-address-source {
302 "This field indicates whether the IP address here is an External-Fixed-Ip(Owned by Router).
303 or Floating-Ip(Used by Ports).";
305 enum "ExternalFixedIP";
312 "This flag indicates the state of the DPN.
313 Active state indicates atleast one vpn interface present on that DPN for the vpn.
314 Inactive state indicates no vpn interface present on that DPN for this vpn.";
331 leaf ipv4-configured {
334 "This VPN Instance handles IPv4 traffic";
337 leaf ipv6-configured {
340 "This VPN Instance handles IPv6 traffic";
345 enum BGPVPNInternet {
347 description "BGPVPN Internet";
349 enum BGPVPNExternal {
351 description "BGPVPN External";
355 description "Default VPN";
361 "The type of the VPN Instance.
362 L3 indicates it is an L3VPN.
363 L2 indicates it is an EVPN";
380 container vpnTargets {
382 "The vpn-target command configures the export or import VPN target
383 extended community attribute for the VPN instance IPv4/IPv6 address
385 Format is ASN:nn or IP-address:nn.";
389 max-elements "unbounded";
392 "L3vpn vpntarget configure class";
396 "Vpn-target: adds VPN target extended community attribute to the
397 export or import VPN target extended community list. The
398 vpn-target can be expressed in either of the following formats:
399 (1)16-bit AS number:32-bit user-defined number
400 For example, 1:3. The AS number ranges from 0 to 65535. The
401 user-defined number ranges from 0 to 4294967295. The AS number
402 and the user-defined number cannot be 0s at the same time.
403 That is, a VPN target cannot be 0:0.
404 (2)32-bit IP address:16-bit user-defined number
405 For example, 192.168.122.15:1. The IP address ranges from
406 0.0.0.0 to 255.255.255.255. The user-defined number ranges from
408 (3)32-bit IP address:16-bit user-defined number
409 For example, 192.168.122.15:1. An IP address ranges from
410 0.0.0.0 to 255.255.255.255. A user-defined number ranges from 0
419 "Specifies the vpn target type, export-extcommunity:
420 specifies the extended community attributes carried in routing
421 information to be sent. import-extcommunity: receives routing
422 information carrying specified extended community attributes.";
425 enum export_extcommunity {
427 description "export-extcommunity:";
429 enum import_extcommunity {
431 description "import-extcommunity:";
435 description "export-extcommunity & import-extcommunity:";
443 "Represents a stage in this VpnInstance's lifecycle.";
448 "VPNInstance is successfully created";
450 enum pending_delete {
453 "VpnInstance marked for deletion.";
469 description "Task in idle state";
471 enum pending_advertise {
473 description "Task is pending advertisement state";
475 enum pending_withdraw {
477 description "Task is pending withdrawal state";
481 description "Task is in advertised state";
485 description "Task is in withdrawn state";
489 "This value the status of any task.
490 The possible values are IDLE, PENDING_ADVERTISE, PENDING_WITHDRAW, ADVERTISED, WITHDRAWN.";
494 container subnet-op-data {
496 list subnet-op-data-entry {
500 description "UUID representing the subnet ";
504 description "DpnId for the DPN used as nexthop for this subnet";
508 description "VPN Instance name";
515 description "Subnet in cidr notation";
517 leaf route-adv-state {
519 description "The status of the subnet route advertisement/withdrawal";
521 leaf last-adv-state {
523 description "The previous status of the subnet route advertisement/withdrawal.";
533 list vpn-interfaces {
535 leaf interface-name {
546 uses nvpn:network-attributes;
551 container port-op-data {
553 list port-op-data-entry {
557 description "UUID in string format representing the port ";
559 leaf-list subnet-ids {
561 description "Back reference to obtain the subnet for a port ";
570 grouping dpn-in-vpn-event {
571 leaf dpn-id { type uint64; }
572 leaf vpn-name { type string; }
573 leaf rd { type string; }
576 notification add-dpn-event {
577 container add-event-data {
578 uses dpn-in-vpn-event;
582 notification remove-dpn-event {
583 container remove-event-data {
584 uses dpn-in-vpn-event;
588 notification add-interface-to-dpn-on-vpn-event {
589 container add-interface-event-data {
590 uses dpn-in-vpn-event;
591 leaf interface-name { type string; }
592 leaf vpn-id { type uint32; }
596 notification remove-interface-from-dpn-on-vpn-event {
597 container remove-interface-event-data {
598 uses dpn-in-vpn-event;
599 leaf interface-name { type string; }
600 leaf vpn-id { type uint32; }
605 * Configured Transport Type for l3vpn service.
607 container conf-transport-type-l3vpn {
608 leaf transport-type {
611 base odlif:tunnel-type-base;
614 "L3VPN service will use this config to setup
615 the transport type for tunnels between DPNs.";
619 /* container to maintain mapping between neutron router and DPN(s) on which vpn-interfaces for router are present */
620 container neutron-router-dpns {
622 list router-dpn-list {
624 leaf router-id { type string;}
625 list dpn-vpninterfaces-list {
627 leaf dpn-id { type uint64;}
628 list router-interfaces {
630 leaf interface { type string; }
636 /* container to maintain mapping between DPN(s) and the routers */
637 container dpn-routers {
639 list dpn-routers-list {
641 leaf dpn-id { type uint64;}
644 leaf router { type string;}
649 container router-interfaces {
650 list router-interface {
652 leaf interface-name { type string; }
653 leaf router-name { type string; }
657 container learnt-vpn-vip-to-port-data {
659 list learnt-vpn-vip-to-port {
660 key "vpn-name port-fixedip";
661 leaf vpn-name { type string; }
662 leaf port-fixedip { type string; }
663 leaf port-name { type string; }
664 leaf mac-address { type string; }
665 leaf creation-time { type string; }
669 container evpn-config {
671 leaf multi-homing-mode {
675 enum "single-active";
688 container l3vpn-lb-nexthops {
692 leaf nexthop-key { type string; }
693 leaf group-id { type string; }
694 leaf-list target-device-id { type string; } //dpId or ip-address
698 container dpid-l3vpn-lb-nexthops {
700 list dpn-lb-nexthops {
701 key "src-dp-id dst-device-id";
702 leaf src-dp-id { type uint64; }
703 leaf dst-device-id { type string; } //dpId or ip-address
704 leaf-list nexthop-key { type string; }
708 typedef learnt-vpn-vip-to-port-event-action {
713 "Event to add a learnt vip to CSC FIB";
718 "Event to remove a learnt vip from CSC FIB";
722 "This value represents the action of an event on learnt-vpn-vip-to-port.
723 The possible actions supported are only ADD, DELETE";
726 container learnt-vpn-vip-to-port-event-data {
728 list learnt-vpn-vip-to-port-event {
729 key "learnt-vpn-vip-event-id";
730 leaf vpn-name { type string; }
731 leaf src-fixedip { type string; }
732 leaf dest-fixedip { type string; }
733 leaf port-name { type string; }
734 leaf mac-address { type string; }
735 leaf event-action { type learnt-vpn-vip-to-port-event-action; }
736 leaf learnt-vpn-vip-event-id { type string; }
740 /* rt to subnets map */
741 container subnets-associated-to-route-targets {
745 leaf rt { type string; }
756 list associated-subnet {
758 leaf cidr { type string; }
759 list associated-vpn {
761 leaf name { type string; }