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 scheduled-for-remove {
231 leaf router-interface {
234 leaf gateway-mac-address {
240 leaf vpn-interface-state {
242 "This flag indicates the state of this interface in the VPN identified by vpn-name.
243 ACTIVE state indicates that this vpn-interface is currently associated to vpn-name
244 available as one of the keys.
245 INACTIVE state indicates that this vpn-interface has already been dis-associated
246 from vpn-name available as one of the keys.";
265 augment "/odl-l3vpn:vpn-interface-op-data/odl-l3vpn:vpn-interface-op-data-entry" {
266 ext:augment-identifier "adjacencies-op";
270 container vpn-instance-op-data {
272 list vpn-instance-op-data-entry {
274 leaf vpn-id { type uint32;}
277 "The vrf-id command configures a route distinguisher (RD)
278 for the IPv4 or IPv6 address family of a VPN instance or
279 vpn instance name for internal vpn case.";
283 leaf vpn-instance-name {
284 description "Typical the VPN Uuid";
288 leaf vpn-interface-count { type uint32; }
290 list vpn-to-dpn-list {
295 list vpn-interfaces {
297 leaf interface-name {
303 leaf ip-address { type string; }
304 leaf ip-address-source {
306 "This field indicates whether the IP address here is an External-Fixed-Ip(Owned by Router).
307 or Floating-Ip(Used by Ports).";
309 enum "ExternalFixedIP";
316 "This flag indicates the state of the DPN.
317 Active state indicates atleast one vpn interface present on that DPN for the vpn.
318 Inactive state indicates no vpn interface present on that DPN for this vpn.";
335 leaf ipv4-configured {
338 "This VPN Instance handles IPv4 traffic";
341 leaf ipv6-configured {
344 "This VPN Instance handles IPv6 traffic";
349 enum BGPVPNInternet {
351 description "BGPVPN Internet";
353 enum BGPVPNExternal {
355 description "BGPVPN External";
359 description "Default VPN";
365 "The type of the VPN Instance.
366 L3 indicates it is an L3VPN.
367 L2 indicates it is an EVPN";
384 container vpnTargets {
386 "The vpn-target command configures the export or import VPN target
387 extended community attribute for the VPN instance IPv4/IPv6 address
389 Format is ASN:nn or IP-address:nn.";
393 max-elements "unbounded";
396 "L3vpn vpntarget configure class";
400 "Vpn-target: adds VPN target extended community attribute to the
401 export or import VPN target extended community list. The
402 vpn-target can be expressed in either of the following formats:
403 (1)16-bit AS number:32-bit user-defined number
404 For example, 1:3. The AS number ranges from 0 to 65535. The
405 user-defined number ranges from 0 to 4294967295. The AS number
406 and the user-defined number cannot be 0s at the same time.
407 That is, a VPN target cannot be 0:0.
408 (2)32-bit IP address:16-bit user-defined number
409 For example, 192.168.122.15:1. The IP address ranges from
410 0.0.0.0 to 255.255.255.255. The user-defined number ranges from
412 (3)32-bit IP address:16-bit user-defined number
413 For example, 192.168.122.15:1. An IP address ranges from
414 0.0.0.0 to 255.255.255.255. A user-defined number ranges from 0
423 "Specifies the vpn target type, export-extcommunity:
424 specifies the extended community attributes carried in routing
425 information to be sent. import-extcommunity: receives routing
426 information carrying specified extended community attributes.";
429 enum export_extcommunity {
431 description "export-extcommunity:";
433 enum import_extcommunity {
435 description "import-extcommunity:";
439 description "export-extcommunity & import-extcommunity:";
447 "Represents a stage in this VpnInstance's lifecycle.";
452 "VPNInstance is successfully created";
454 enum pending_delete {
457 "VpnInstance marked for deletion.";
473 description "Task in idle state";
475 enum pending_advertise {
477 description "Task is pending advertisement state";
479 enum pending_withdraw {
481 description "Task is pending withdrawal state";
485 description "Task is in advertised state";
489 description "Task is in withdrawn state";
493 "This value the status of any task.
494 The possible values are IDLE, PENDING_ADVERTISE, PENDING_WITHDRAW, ADVERTISED, WITHDRAWN.";
498 container subnet-op-data {
500 list subnet-op-data-entry {
504 description "UUID representing the subnet ";
508 description "DpnId for the DPN used as nexthop for this subnet";
512 description "VPN Instance name";
519 description "Subnet in cidr notation";
521 leaf route-adv-state {
523 description "The status of the subnet route advertisement/withdrawal";
525 leaf last-adv-state {
527 description "The previous status of the subnet route advertisement/withdrawal.";
537 list vpn-interfaces {
539 leaf interface-name {
550 uses nvpn:network-attributes;
555 container port-op-data {
557 list port-op-data-entry {
561 description "UUID in string format representing the port ";
563 leaf-list subnet-ids {
565 description "Back reference to obtain the subnet for a port ";
574 grouping dpn-in-vpn-event {
575 leaf dpn-id { type uint64; }
576 leaf vpn-name { type string; }
577 leaf rd { type string; }
580 notification add-dpn-event {
581 container add-event-data {
582 uses dpn-in-vpn-event;
586 notification remove-dpn-event {
587 container remove-event-data {
588 uses dpn-in-vpn-event;
592 notification add-interface-to-dpn-on-vpn-event {
593 container add-interface-event-data {
594 uses dpn-in-vpn-event;
595 leaf interface-name { type string; }
596 leaf vpn-id { type uint32; }
600 notification remove-interface-from-dpn-on-vpn-event {
601 container remove-interface-event-data {
602 uses dpn-in-vpn-event;
603 leaf interface-name { type string; }
604 leaf vpn-id { type uint32; }
609 * Configured Transport Type for l3vpn service.
611 container conf-transport-type-l3vpn {
612 leaf transport-type {
615 base odlif:tunnel-type-base;
618 "L3VPN service will use this config to setup
619 the transport type for tunnels between DPNs.";
623 /* container to maintain mapping between neutron router and DPN(s) on which vpn-interfaces for router are present */
624 container neutron-router-dpns {
626 list router-dpn-list {
628 leaf router-id { type string;}
629 list dpn-vpninterfaces-list {
631 leaf dpn-id { type uint64;}
632 list router-interfaces {
634 leaf interface { type string; }
640 /* container to maintain mapping between DPN(s) and the routers */
641 container dpn-routers {
643 list dpn-routers-list {
645 leaf dpn-id { type uint64;}
648 leaf router { type string;}
653 container router-interfaces {
654 list router-interface {
656 leaf interface-name { type string; }
657 leaf router-name { type string; }
661 container learnt-vpn-vip-to-port-data {
663 list learnt-vpn-vip-to-port {
664 key "vpn-name port-fixedip";
665 leaf vpn-name { type string; }
666 leaf port-fixedip { type string; }
667 leaf port-name { type string; }
668 leaf mac-address { type string; }
669 leaf creation-time { type string; }
673 container evpn-config {
675 leaf multi-homing-mode {
679 enum "single-active";
692 container l3vpn-lb-nexthops {
696 leaf nexthop-key { type string; }
697 leaf group-id { type string; }
698 leaf-list target-device-id { type string; } //dpId or ip-address
702 container dpid-l3vpn-lb-nexthops {
704 list dpn-lb-nexthops {
705 key "src-dp-id dst-device-id";
706 leaf src-dp-id { type uint64; }
707 leaf dst-device-id { type string; } //dpId or ip-address
708 leaf-list nexthop-key { type string; }
712 typedef learnt-vpn-vip-to-port-event-action {
717 "Event to add a learnt vip to CSC FIB";
722 "Event to remove a learnt vip from CSC FIB";
726 "This value represents the action of an event on learnt-vpn-vip-to-port.
727 The possible actions supported are only ADD, DELETE";
730 container learnt-vpn-vip-to-port-event-data {
732 list learnt-vpn-vip-to-port-event {
733 key "learnt-vpn-vip-event-id";
734 leaf vpn-name { type string; }
735 leaf src-fixedip { type string; }
736 leaf dest-fixedip { type string; }
737 leaf port-name { type string; }
738 leaf mac-address { type string; }
739 leaf event-action { type learnt-vpn-vip-to-port-event-action; }
740 leaf learnt-vpn-vip-event-id { type string; }
744 /* rt to subnets map */
745 container subnets-associated-to-route-targets {
749 leaf rt { type string; }
760 list associated-subnet {
762 leaf cidr { type string; }
763 list associated-vpn {
765 leaf name { type string; }