blob: 276a59fc728645df253af850ae791c13d3d70f34 [file] [log] [blame]
janani b2d54a362017-03-20 16:10:25 +05301module ietf-bgp-l3vpn {
2 namespace "urn:ietf:params:xml:ns:yang:ietf-bgp-l3vpn";
3 // replace with IANA namespace when assigned
4 prefix l3vpn ;
5
6 import ietf-network-instance {
7 prefix ni;
8 revision-date 2016-06-23;
9 }
10
11 import ietf-interfaces {
12 prefix if;
13 }
14
15// TODO: TBD for bgp-info
16// import ietf-bgp {
17// prefix bgp;
18// revision-date 2016-06-21;
19// }
20
21 organization
22 "IETF BGP Enabled Services WG";
23
24 contact
25 "BESS working group - bess@ietf.org";
26 description
27 "This YANG module defines a YANG data model to configure and
28 manage BGP Layer3 VPNs. It augments the IETF bgp yang model
29 and IETF network instance model to add L3VPN specific
30 configuration and operational knobs.
31
32
33 Terms and Acronyms
34
35 AF : Address Family
36
37 AS : Autonomous System
38
39 ASBR : Autonomous Systems Border Router
40
41 BGP (bgp) : Border Gateway Protocol
42
43 CE : Customer Edge
44
45 IP (ip) : Internet Protocol
46
47 IPv4 (ipv4):Internet Protocol Version 4
48
49 IPv6 (ipv6): Internet Protocol Version 6
50
51 L3VPN: Layer 3 VPN
52
53 PE : Provider Edge
54
55 RT : Route Target
56
57 RD : Route Distinguisher
58
59 VPN : Virtual Private Network
60
61 VRF : Virtual Routing and Forwarding
62
63 ";
64
65 revision 2016-09-09 {
66 description
67 "Initial revision.";
68 reference
69 "RFC XXXX: A YANG Data Model for BGP L3VPN config management";
70 }
71
72 //RD
73 grouping route-distinguisher-params {
74 description "BGP route distinguisher";
75 container route-distinguisher {
76 description "Route distinguisher value as per RFC4364";
77 container config {
78 description
79 "Configuration parameters for route distinguisher";
80 leaf rd {
81 type string;
82 description "Route distinguisher value as per RFC4364";
83 }
84 }
85 container state {
86 config "false" ;
87 description
88 "State information for route distinguisher";
89 leaf rd {
90 type string;
91 description "Route distinguisher value";
92 }
93 }
94 }
95 }
96
97 //Label mode
98 typedef bgp-label-mode {
99 type enumeration {
100 enum per-ce {
101 description "Allocate labels per CE";
102 }
103 enum per-route {
104 description "Allocate labels per prefix";
105 }
106 enum per-vpn {
107 description "Allocate labels per VRF";
108 }
109 }
110 description "BGP label allocation mode";
111 }
112
113 //Fwding mode
114 typedef fwd-mode-type {
115 type enumeration {
116 enum mpls {
117 description "Forwarding mode mpls";
118 }
119 }
120 description
121 "Enable forwarding mode under ASBR facing interface";
122 }
123
124 grouping forwarding-mode {
125 description "Forwarding mode of interface for ASBR scenario";
126 container forwarding-mode {
127 description "Forwarding mode of interface for ASBR scenario";
128 container config {
129 description "Configuration of Forwarding mode";
130 leaf forwarding-mode {
131 type fwd-mode-type;
132 description "Forwarding mode for this interface";
133 }
134 }
135 container state {
136 config "false";
137 description "State information of Forwarding mode";
138 leaf forwarding-mode {
139 type fwd-mode-type;
140 description "Forwarding mode for this interface";
141 }
142 }
143 }
144 }
145
146 grouping label-security {
147 description "Mpls label security for ASBR option B scenario";
148 container mpls-label-security {
149 description "MPLS label secruity";
150 container config {
151 description "Configuration parameters";
152 leaf rpf {
153 type boolean;
154 description "Enable MPLS label security rpf on interface";
155 }
156 }
157 container state {
158 config "false";
159 description "State information";
160 leaf rpf {
161 type boolean;
162 description "MPLS label security rpf on interface";
163 }
164 }
165 }
166 }
167
168
169 //per VPN instance table limit under BGP
170 grouping prefix-limit {
171 description
172 "The prefix limit command sets a limit on the maximum
173 number of prefixes supported in the existing VPN
174 instance, preventing the PE from importing excessive
175 VPN route prefixes.
176 ";
177
178 leaf prefix-limit-number {
179 type uint32 {
180 range "1..4294967295";
181 }
182 description
183 "Specifies the maximum number of prefixes supported in the
184 VPN instance IPv4 or IPv6 address family.";
185 }
186
187 choice prefix-limit-action {
188 description ".";
189 case enable-alert-percent {
190 leaf alert-percent-value {
191 type uint8 {
192 range "1..100";
193 }
194 description
195 "Specifies the proportion of the alarm threshold to the
196 maximum number of prefixes.";
197 }
198 leaf route-unchanged {
199 type boolean;
200 default "false";
201 description
202 "Indicates that the routing table remains unchanged.
203 By default, route-unchanged is not configured. When
204 the number of prefixes in the routing table is
205 greater than the value of the parameter number,
206 routes are processed as follows:
207 (1)If route-unchanged is configured, routes in the
208 routing table remain unchanged.
209 (2)If route-unchanged is not configured, all routes
210 in the routing table are deleted and then
211 re-added.";
212 }
213 }
214 case enable-simple-alert {
215 leaf simple-alert {
216 type boolean;
217 default "false";
218 description
219 "Indicates that when the number of VPN route prefixes
220 exceeds number, prefixes can still join the VPN
221 routing table and alarms are displayed.";
222 }
223 }
224 }
225 }
226
227 grouping vpn-pfx-limit {
228 description "Per VPN instance table limit under BGP";
229 container vpn-prefix-limit {
230 description "Prefix limit for this table";
231 container config {
232 description "Config parameters";
233 uses prefix-limit;
234 }
235 container state {
236 config "false";
237 description "State parameters";
238 uses prefix-limit;
239 }
240 }
241 }
242
243 grouping route-target-set {
244 description
245 "Extended community route-target set ";
246 list rts {
247 key "rt" ;
248 description
249 "List of route-targets" ;
250 leaf rt {
251 type string {
252 pattern '([0-9]+:[0-9]+)';
253 }
254 description "Route target extended community as per RFC4360";
255 }
256 leaf rt-type {
257 type enumeration {
258 enum import {
259 description "Route target is for import routes";
260 }
261 enum export {
262 description "Route target is for export routes";
263 }
264 enum both {
265 description
266 "Route target is for both import and export routes";
267 }
268 }
269 description "Route target type";
270 }
271 }
272 leaf route-policy {
273 type string;
274 description
275 "Reference to the policy containing set of routes.
276 TBD: leafref to policy entry in IETF policy model";
277 }
278 }
279
280 grouping import-from-gbl {
281 description "Import from global routing table";
282 leaf enable {
283 type boolean;
284 description "Enable";
285 }
286 leaf advertise-as-vpn {
287 type boolean;
288 description
289 "Advertise routes imported from global table as VPN routes";
290 }
291 leaf route-policy {
292 type string;
293 description "Route policy as filter for importing routes";
294 }
295
296 leaf bgp-valid-route {
297 type boolean;
298 description
299 "Enable all valid routes (including non-best paths) to be
300 candidate for import";
301 }
302
303 leaf protocol {
304 type enumeration {
305 enum ALL {
306 value "0";
307 description "ALL:";
308 }
309 enum Direct {
310 value "1";
311 description "Direct:";
312 }
313 enum OSPF {
314 value "2";
315 description "OSPF:";
316 }
317 enum ISIS {
318 value "3";
319 description "ISIS:";
320 }
321 enum Static {
322 value "4";
323 description "Static:";
324 }
325 enum RIP {
326 value "5";
327 description "RIP:";
328 }
329 enum BGP {
330 value "6";
331 description "BGP:";
332 }
333 enum OSPFV3 {
334 value "7";
335 description "OSPFV3:";
336 }
337 enum RIPNG {
338 value "8";
339 description "RIPNG:";
340 }
341 }
342 description
343 "Specifies the protocol from which routes are imported.
344 At present, In the IPv4 unicast address family view,
345 the protocol can be IS-IS,static, direct and BGP.";
346 }
347
348 leaf instance {
349 type string;
350 description
351 "Specifies the instance id of the protocol";
352 }
353 }
354 grouping global-imports {
355 description "Grouping for imports from global routing table";
356 container import-from-global {
357 description "Import from global routing table";
358 container config {
359 description "Configuration";
360 uses import-from-gbl;
361 }
362 container state {
363 config "false";
364 description "State";
365 uses import-from-gbl;
366 }
367 }
368 }
369
370
371 grouping export-to-gbl {
372 description "Export routes to default VRF";
373 leaf enable {
374 type boolean;
375 description "Enable";
376 }
377 }
378
379 grouping global-exports {
380 description "Grouping for exports routes to global table";
381 container export-to-global {
382 description "Export to global routing table";
383 container config {
384 description "Configuration";
385 uses export-to-gbl;
386 }
387 container state {
388 config "false";
389 description "State";
390 uses export-to-gbl;
391 }
392 }
393 }
394
395 grouping route-target-params {
396 description "Grouping to specify rules for route import and export";
397 container route-targets {
398 description
399 "Set of route-targets to match for import and export routes
400 to/from VRF";
401 container config {
402 description
403 "Configuration of route targets";
404 uses route-target-set ;
405 }
406 container state {
407 config "false" ;
408 description
409 "State information for route targets";
410 uses route-target-set ;
411 }
412 }
413 }
414
415 grouping route-tbl-limit-params {
416 description "Grouping for VPN table prefix limit config";
417 leaf routing-table-limit-number {
418 type uint32 {
419 range "1..4294967295";
420 }
421 description
422 "Specifies the maximum number of routes supported by a
423 VPN instance. ";
424 }
425
426 choice routing-table-limit-action {
427 description ".";
428 case enable-alert-percent {
429 leaf alert-percent-value {
430 type uint8 {
431 range "1..100";
432 }
433 description
434 "Specifies the percentage of the maximum number of
435 routes. When the maximum number of routes that join
436 the VPN instance is up to the value
437 (number*alert-percent)/100, the system prompts
438 alarms. The VPN routes can be still added to the
439 routing table, but after the number of routes
440 reaches number, the subsequent routes are
441 dropped.";
442 }
443 }
444 case enable-simple-alert {
445 leaf simple-alert {
446 type boolean;
447 description
448 "Indicates that when VPN routes exceed number, routes
449 can still be added into the routing table, but the
450 system prompts alarms.
451 However, after the total number of VPN routes and
452 network public routes reaches the unicast route limit
453 specified in the License, the subsequent VPN routes
454 are dropped.";
455 }
456 }
457 }
458 }
459
460 grouping routing-tbl-limit {
461 description ".";
462 container routing-table-limit {
463 description
464 "The routing-table limit command sets a limit on the maximum
465 number of routes that the IPv4 or IPv6 address family of a
466 VPN instance can support.
467 By default, there is no limit on the maximum number of
468 routes that the IPv4 or IPv6 address family of a VPN
469 instance can support, but the total number of private
470 network and public network routes on a device cannot
471 exceed the allowed maximum number of unicast routes.";
472 container config {
473 description "Config parameters";
474 uses route-tbl-limit-params;
475 }
476 container state {
477 config "false";
478 description "State parameters";
479 uses route-tbl-limit-params;
480 }
481 }
482 }
483
484 // Tunnel policy parameters
485 grouping tunnel-params {
486 description "Tunnel parameters";
487 container tunnel-params {
488 description "Tunnel config parameters";
489 container config {
490 description "configuration parameters";
491 leaf tunnel-policy {
492 type string;
493 description
494 "Tunnel policy name.";
495 }
496 }
497 container state {
498 config "false";
499 description "state parameters";
500 leaf tunnel-policy {
501 type string;
502 description
503 "Tunnel policy name.";
504 }
505 }
506 }
507 }
508
509 // Grouping for the L3vpn specific parameters under VRF
510 // (network-instance)
511 grouping l3vpn-vrf-params {
512 description "Specify route filtering rules for import/export";
513 container ipv4 {
514 description
515 "Specify route filtering rules for import/export";
516 container unicast {
517 description
518 "Specify route filtering rules for import/export";
519 uses route-target-params;
520 uses global-imports;
521 uses global-exports;
522 uses routing-tbl-limit;
523 uses tunnel-params;
524 }
525 }
526 container ipv6 {
527 description
528 "Ipv6 address family specific rules for import/export";
529 container unicast {
530 description "Ipv6 unicast address family";
531 uses route-target-params;
532 uses global-imports;
533 uses global-exports;
534 uses routing-tbl-limit;
535 uses tunnel-params;
536 }
537 }
538 }
539
540 grouping bgp-label-mode {
541 description "MPLS/VPN label allocation mode";
542 container config {
543 description
544 "Configuration parameters for label allocation mode";
545 leaf label-mode {
546 type bgp-label-mode;
547 description "Label allocation mode";
548 }
549 }
550 container state {
551 config "false" ;
552 description "State information for label allocation mode";
553 leaf label-mode {
554 type bgp-label-mode;
555 description "Label allocation mode";
556 }
557 }
558 }
559
560 grouping retain-route-targets {
561 description "Grouping for route target accept";
562 container retain-route-targets {
563 description "Control route target acceptance behavior for ASBRs";
564 container config {
565 description
566 "Configuration parameters for retaining route targets";
567 leaf all {
568 type empty;
569 description "Disable filtering of all route-targets";
570 }
571 leaf route-policy {
572 type string;
573 description "Filter routes as per filter policy name
574 TBD: leafref to IETF routing policy model";
575 }
576 }
577 container state {
578 config "false" ;
579 description "State information for retaining route targets";
580 leaf all {
581 type empty;
582 description "Disable filtering of all route-targets";
583 }
584 leaf route-policy {
585 type string;
586 description "Filter routes as per filter policy name";
587 }
588 }
589 }
590 }
591
592 grouping nexthop-opts {
593 description "Next hop control options for inter-as route exchange";
594 leaf next-hop-self {
595 type boolean;
596 description
597 "Set nexthop of the route to self when advertising routes";
598 }
599 leaf next-hop-unchanged {
600 type boolean;
601 description "Enforce no nexthop change when advertising routes";
602 }
603 }
604
605 grouping asbr-nexthop-options {
606 description "Nexthop parameters for inter-as VPN options ";
607 container nexthop-options {
608 description "Nexthop related options for inter-as options";
609 container config {
610 description "Configuration parameters for nexthop options";
611 uses nexthop-opts;
612 }
613 container state {
614 config "false";
615 description "State information for nexthop options" ;
616 uses nexthop-opts;
617 }
618 }
619 }
620
621 //
622 // VRF specific parameters.
623 // RD and RTs and route import-export rules are added under
624 // network instance container in network instance model, hence
625 // per VRF scoped
626 augment "/ni:devices/ni:device/ni:network-instances/ni:network-instance" {
627 description
628 "Augment network instance for per VRF L3vpn parameters";
629 container l3vpn {
630 //Enable this check once network instance model has
631 //identify defined for VRF type
632 //when "../type='rt:vrf-network-instance'" {
633 // description
634 // "This container is only valid for vrf routing instance.";
635 //}
636 description "Configuration of L3VPN specific parameters";
637
638 uses route-distinguisher-params;
639 uses l3vpn-vrf-params ;
640 }
641 }
642
643 // bgp mpls forwarding enable required for inter-as option AB.
644 augment "/if:devices/if:device/if:interfaces/if:interface" {
645 description
646 "BGP mpls forwarding mode configuration on interface for
647 ASBR scenario";
648 uses forwarding-mode ;
649 uses label-security;
650 }
651
652 //
653 // BGP Specific Paramters
654 //
655
656 //
657 // Retain route-target for inter-as option ASBR knob.
658 // vpn prefix limits
659 // vpnv4/vpnv6 address-family only.
660 //augment "/bgp:bgp/bgp:global/bgp:afi-safis/" +
661 // "bgp:afi-safi/bgp:l3vpn-ipv4-unicast" {
662 // description "Retain route targets for ASBR scenario";
663 // uses retain-route-targets;
664 // uses vpn-pfx-limit;
665 // }
666
667 // augment "/bgp:bgp/bgp:global/bgp:afi-safis/" +
668 // "bgp:afi-safi/bgp:l3vpn-ipv6-unicast" {
669 // description "Retain route targets for ASBR scenario";
670 // uses retain-route-targets;
671 // uses vpn-pfx-limit;
672 // }
673
674 // Label allocation mode configuration. Certain AFs only.
675 // augment "/bgp:bgp/bgp:global/bgp:afi-safis/" +
676 // "bgp:afi-safi/bgp:ipv4-unicast" {
677 // description
678 // "Augment BGP global AF mode for label allocation mode
679 // configuration";
680 // uses bgp-label-mode ;
681 // uses routing-tbl-limit;
682 // }
683
684 // augment "/bgp:bgp/bgp:global/bgp:afi-safis/" +
685 // "bgp:afi-safi/bgp:ipv6-unicast" {
686 // description
687 // "Augment BGP global AF mode for label allocation mode
688 // configuration";
689 // uses bgp-label-mode ;
690 // uses routing-tbl-limit;
691 // }
692
693
694 // Nexthop options for the inter-as ASBR peering.
695 // augment "/bgp:bgp/bgp:neighbors/bgp:neighbor" {
696 // description
697 // "Augment BGP NBR mode with nexthop options for inter-as ASBRs";
698 // uses asbr-nexthop-options;
699 // }
700
701 // augment "/bgp:bgp/bgp:peer-groups/bgp:peer-group" {
702 // description
703 // "Augment BGP peer-group mode with nexthop options for inter-as
704 // ASBRs";
705 // uses asbr-nexthop-options;
706 // }
707
708 // augment "/bgp:bgp/bgp:neighbors/bgp:neighbor/" +
709 // "bgp:afi-safis/bgp:afi-safi" {
710 // description
711 // "Augment BGP NBR AF mode with nexthop options for inter-as
712 // ASBRs";
713 // uses asbr-nexthop-options;
714 // }
715
716 // augment "/bgp:bgp/bgp:peer-groups/bgp:peer-group/" +
717 // "bgp:afi-safis/bgp:afi-safi" {
718 // description
719 // "Augment BGP peer-group AF mode with nexthop options for inter-as
720 // ASBRs";
721 // uses asbr-nexthop-options;
722 // }
723}