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 container vpn-instance-op-data {
201 list vpn-instance-op-data-entry {
203 leaf vpn-id { type uint32;}
206 "The vrf-id command configures a route distinguisher (RD)
207 for the IPv4 or IPv6 address family of a VPN instance or
208 vpn instance name for internal vpn case.";
212 leaf vpn-instance-name {
213 description "Typical the VPN Uuid";
217 leaf vpn-interface-count { type uint32; }
219 list vpn-to-dpn-list {
224 list vpn-interfaces {
226 leaf interface-name {
232 leaf ip-address { type string; }
233 leaf ip-address-source {
235 "This field indicates whether the IP address here is an External-Fixed-Ip(Owned by Router).
236 or Floating-Ip(Used by Ports).";
238 enum "ExternalFixedIP";
245 "This flag indicates the state of the DPN.
246 Active state indicates atleast one vpn interface present on that DPN for the vpn.
247 Inactive state indicates no vpn interface present on that DPN for this vpn.";
264 leaf ipv4-configured {
267 "This VPN Instance handles IPv4 traffic";
270 leaf ipv6-configured {
273 "This VPN Instance handles IPv6 traffic";
278 "The type of the VPN Instance.
279 L3 indicates it is an L3VPN.
280 L2 indicates it is an EVPN";
285 description “L3VPN";
297 container vpnTargets {
299 "The vpn-target command configures the export or import VPN target
300 extended community attribute for the VPN instance IPv4/IPv6 address
302 Format is ASN:nn or IP-address:nn.";
306 max-elements "unbounded";
309 "L3vpn vpntarget configure class";
313 "Vpn-target: adds VPN target extended community attribute to the
314 export or import VPN target extended community list. The
315 vpn-target can be expressed in either of the following formats:
316 (1)16-bit AS number:32-bit user-defined number
317 For example, 1:3. The AS number ranges from 0 to 65535. The
318 user-defined number ranges from 0 to 4294967295. The AS number
319 and the user-defined number cannot be 0s at the same time.
320 That is, a VPN target cannot be 0:0.
321 (2)32-bit IP address:16-bit user-defined number
322 For example, 192.168.122.15:1. The IP address ranges from
323 0.0.0.0 to 255.255.255.255. The user-defined number ranges from
325 (3)32-bit IP address:16-bit user-defined number
326 For example, 192.168.122.15:1. An IP address ranges from
327 0.0.0.0 to 255.255.255.255. A user-defined number ranges from 0
336 "Specifies the vpn target type, export-extcommunity:
337 specifies the extended community attributes carried in routing
338 information to be sent. import-extcommunity: receives routing
339 information carrying specified extended community attributes.";
342 enum export_extcommunity {
344 description "export-extcommunity:";
346 enum import_extcommunity {
348 description "import-extcommunity:";
352 description "export-extcommunity & import-extcommunity:";
360 "Represents a stage in this VpnInstance's lifecycle.";
365 "VPNInstance is successfully created";
367 enum pending_delete {
370 "VpnInstance marked for deletion.";
386 description "Task in idle state";
388 enum pending_advertise {
390 description "Task is pending advertisement state";
392 enum pending_withdraw {
394 description "Task is pending withdrawal state";
398 description "Task is in advertised state";
402 description "Task is in withdrawn state";
406 "This value the status of any task.
407 The possible values are IDLE, PENDING_ADVERTISE, PENDING_WITHDRAW, ADVERTISED, WITHDRAWN.";
411 container subnet-op-data {
413 list subnet-op-data-entry {
417 description "UUID representing the subnet ";
421 description "DpnId for the DPN used as nexthop for this subnet";
425 description "VPN Instance name";
432 description "Subnet in cidr notation";
434 leaf route-adv-state {
436 description "The status of the subnet route advertisement/withdrawal";
438 leaf last-adv-state {
440 description "The previous status of the subnet route advertisement/withdrawal.";
450 list vpn-interfaces {
452 leaf interface-name {
463 uses nvpn:network-attributes;
468 container port-op-data {
470 list port-op-data-entry {
474 description "UUID in string format representing the port ";
478 description "Back reference to obtain the subnet for a port ";
487 grouping dpn-in-vpn-event {
488 leaf dpn-id { type uint64; }
489 leaf vpn-name { type string; }
490 leaf rd { type string; }
493 notification add-dpn-event {
494 container add-event-data {
495 uses dpn-in-vpn-event;
499 notification remove-dpn-event {
500 container remove-event-data {
501 uses dpn-in-vpn-event;
505 notification add-interface-to-dpn-on-vpn-event {
506 container add-interface-event-data {
507 uses dpn-in-vpn-event;
508 leaf interface-name { type string; }
509 leaf vpn-id { type uint32; }
513 notification remove-interface-from-dpn-on-vpn-event {
514 container remove-interface-event-data {
515 uses dpn-in-vpn-event;
516 leaf interface-name { type string; }
517 leaf vpn-id { type uint32; }
522 * Configured Transport Type for l3vpn service.
524 container conf-transport-type-l3vpn {
525 leaf transport-type {
528 base odlif:tunnel-type-base;
531 "L3VPN service will use this config to setup
532 the transport type for tunnels between DPNs.";
536 /* container to maintain mapping between neutron router and DPN(s) on which vpn-interfaces for router are present */
537 container neutron-router-dpns {
539 list router-dpn-list {
541 leaf router-id { type string;}
542 list dpn-vpninterfaces-list {
544 leaf dpn-id { type uint64;}
545 list router-interfaces {
547 leaf interface { type string; }
553 /* container to maintain mapping between DPN(s) and the routers */
554 container dpn-routers {
556 list dpn-routers-list {
558 leaf dpn-id { type uint64;}
561 leaf router { type string;}
566 container router-interfaces {
567 list router-interface {
569 leaf interface-name { type string; }
570 leaf router-name { type string; }
574 container learnt-vpn-vip-to-port-data {
576 list learnt-vpn-vip-to-port {
577 key "vpn-name port-fixedip";
578 leaf vpn-name { type string; }
579 leaf port-fixedip { type string; }
580 leaf port-name { type string; }
581 leaf mac-address { type string; }
582 leaf creation-time { type string; }
586 container evpn-config {
588 leaf multi-homing-mode {
592 enum "single-active";
605 container l3vpn-lb-nexthops {
609 leaf nexthop-key { type string; }
610 leaf group-id { type string; }
611 leaf-list target-device-id { type string; } //dpId or ip-address
615 container dpid-l3vpn-lb-nexthops {
617 list dpn-lb-nexthops {
618 key "src-dp-id dst-device-id";
619 leaf src-dp-id { type uint64; }
620 leaf dst-device-id { type string; } //dpId or ip-address
621 leaf-list nexthop-key { type string; }