3 namespace "urn:opendaylight:params:xml:ns:yang:bgp-flowspec";
6 import ietf-inet-types { prefix inet; revision-date 2013-07-15; }
7 import bgp-message { prefix bgp-msg; revision-date 2018-03-29; }
8 import bgp-multiprotocol { prefix bgp-mp; revision-date 2018-03-29; }
9 import bgp-rib { prefix bgp-rib; revision-date 2018-03-29; }
10 import bgp-types { prefix bgp-t; revision-date 2018-03-29; }
11 import network-concepts { prefix netc; revision-date 2013-11-25; }
12 import bmp-monitor { prefix bmp-mon; revision-date 2018-03-29; }
14 organization "Cisco Systems, Inc.";
15 contact "Dana Kutenicsova <dkutenic@cisco.com>";
18 "This module contains the base data model of a BGP flow specification.
19 It rolls up the definitions contained in RFC5575.
21 Copyright (c)2015 Cisco Systems, Inc. All rights reserved.
23 This program and the accompanying materials are made available
24 under the terms of the Eclipse Public License v1.0 which
25 accompanies this distribution, and is available at
26 http://www.eclipse.org/legal/epl-v10.html";
28 revision "2018-03-29" {
29 description "Add support for add-path for all afi/safi.";
32 revision "2017-12-07" {
33 description "Add support for add-path in base BGP NLRI.";
36 revision "2015-08-07" {
39 reference "https://tools.ietf.org/html/draft-ietf-idr-flow-spec-v6-06";
42 revision "2015-01-14" {
45 reference "http://tools.ietf.org/html/rfc5575";
48 identity flowspec-subsequent-address-family {
49 description "SAFI 133 for dissemination of unicast flow specification rules.";
50 reference "http://tools.ietf.org/html/rfc5575#section-11";
52 base bgp-t:subsequent-address-family;
55 identity flowspec-l3vpn-subsequent-address-family {
56 description "SAFI 134 for dissemination of L3VPN flow specification rules";
57 reference "http://tools.ietf.org/html/rfc5575#section-11";
59 base bgp-t:subsequent-address-family;
63 reference "http://tools.ietf.org/html/rfc5575#section-4";
81 reference "https://tools.ietf.org/html/rfc2474#section-3";
87 typedef numeric-operand {
88 reference "http://tools.ietf.org/html/rfc5575#section-4";
108 typedef bitmask-operand {
109 reference "http://tools.ietf.org/html/rfc5575#section-4";
126 grouping numeric-two-byte-value {
127 reference "http://tools.ietf.org/html/rfc5575#section-4";
129 type numeric-operand;
136 grouping numeric-one-byte-value {
137 reference "http://tools.ietf.org/html/rfc5575#section-4";
139 type numeric-operand;
146 grouping bitmask-two-byte-value {
147 reference "http://tools.ietf.org/html/rfc5575#section-4";
149 type bitmask-operand;
156 grouping dscp-value {
157 reference "http://tools.ietf.org/html/rfc5575#section-4";
159 type numeric-operand;
166 grouping fragment-value {
167 reference "http://tools.ietf.org/html/rfc5575#section-4";
169 type bitmask-operand;
176 grouping flowspec-destination {
177 reference "http://tools.ietf.org/html/rfc5575#section-4";
179 choice flowspec-type {
182 uses numeric-two-byte-value;
185 case destination-port-case {
186 list destination-ports {
187 uses numeric-two-byte-value;
190 case source-port-case {
192 uses numeric-two-byte-value;
195 case icmp-type-case {
197 uses numeric-one-byte-value;
200 case icmp-code-case {
202 uses numeric-one-byte-value;
205 case tcp-flags-case {
207 uses bitmask-two-byte-value;
210 case packet-length-case {
211 list packet-lengths {
212 uses numeric-two-byte-value;
229 grouping flowspec-destination-group-ipv4 {
230 reference "http://tools.ietf.org/html/rfc5575#section-4";
231 uses flowspec-destination {
232 augment "flowspec/flowspec-type" {
233 case destination-prefix-case {
234 leaf destination-prefix {
235 type inet:ipv4-prefix;
238 case source-prefix-case {
240 type inet:ipv4-prefix;
243 case protocol-ip-case {
245 uses numeric-one-byte-value;
252 grouping flow-label-value {
253 reference "https://tools.ietf.org/html/draft-ietf-idr-flow-spec-v6-06#section-3";
255 type numeric-operand;
262 grouping flowspec-destination-group-ipv6 {
263 reference "https://tools.ietf.org/html/draft-ietf-idr-flow-spec-v6-06#section-3.1";
264 uses flowspec-destination {
265 augment "flowspec/flowspec-type" {
266 case destination-ipv6-prefix-case {
267 leaf destination-prefix {
268 type inet:ipv6-prefix;
271 case source-ipv6-prefix-case {
273 type inet:ipv6-prefix;
276 case next-header-case {
278 uses numeric-one-byte-value;
281 case flow-label-case {
283 uses flow-label-value;
290 grouping flowspec-destination-ipv4 {
291 container destination-flowspec-ipv4 {
292 uses flowspec-destination-group-ipv4;
293 uses bgp-msg:path-id-grouping;
297 grouping flowspec-destination-ipv6 {
298 container destination-flowspec-ipv6 {
299 uses flowspec-destination-group-ipv6;
300 uses bgp-msg:path-id-grouping;
304 grouping flowspec-l3vpn-destination-ipv4 {
305 container destination-flowspec-l3vpn-ipv4 {
306 uses bgp-t:route-distinguisher-grouping;
307 uses flowspec-destination-group-ipv4;
308 uses bgp-msg:path-id-grouping;
312 grouping flowspec-l3vpn-destination-ipv6 {
313 container destination-flowspec-l3vpn-ipv6 {
314 uses bgp-t:route-distinguisher-grouping;
315 uses flowspec-destination-group-ipv6;
316 uses bgp-msg:path-id-grouping;
320 augment "/bgp-msg:update/bgp-msg:attributes/bgp-mp:mp-reach-nlri/bgp-mp:advertized-routes/bgp-mp:destination-type" {
321 case destination-flowspec-case {
322 uses flowspec-destination-ipv4;
324 case destination-flowspec-ipv6-case {
325 uses flowspec-destination-ipv6;
327 case destination-flowspec-l3vpn-ipv4-case {
328 uses flowspec-l3vpn-destination-ipv4;
330 case destination-flowspec-l3vpn-ipv6-case {
331 uses flowspec-l3vpn-destination-ipv6;
335 augment "/bgp-msg:update/bgp-msg:attributes/bgp-mp:mp-unreach-nlri/bgp-mp:withdrawn-routes/bgp-mp:destination-type" {
336 case destination-flowspec-case {
337 uses flowspec-destination-ipv4;
339 case destination-flowspec-ipv6-case {
340 uses flowspec-destination-ipv6;
342 case destination-flowspec-l3vpn-ipv4-case {
343 uses flowspec-l3vpn-destination-ipv4;
345 case destination-flowspec-l3vpn-ipv6-case {
346 uses flowspec-l3vpn-destination-ipv6;
350 grouping traffic-rate-extended-community {
351 container traffic-rate-extended-community {
352 leaf informative-as {
353 type bgp-t:short-as-number;
355 leaf local-administrator {
361 grouping traffic-action-extended-community {
362 container traffic-action-extended-community {
367 leaf terminal-action {
374 grouping redirect-extended-community {
375 container redirect-extended-community {
376 leaf global-administrator {
377 type bgp-t:short-as-number;
379 leaf local-administrator {
387 grouping redirect-ipv4-extended-community {
388 reference "http://tools.ietf.org/html/rfc7674";
389 container redirect-ipv4 {
390 uses bgp-t:route-ipv4-extended-community;
394 grouping redirect-ipv6-extended-community {
395 container redirect-ipv6 {
396 leaf global-administrator {
397 type inet:ipv6-address;
399 leaf local-administrator {
405 grouping redirect-as4-extended-community {
406 reference "http://tools.ietf.org/html/rfc7674";
407 container redirect-as4 {
408 leaf global-administrator {
411 leaf local-administrator {
417 grouping traffic-marking-extended-community {
418 container traffic-marking-extended-community {
419 leaf global-administrator {
425 grouping redirect-ip-nh-extended-community {
426 reference "https://tools.ietf.org/html/draft-ietf-idr-flowspec-redirect-ip-02";
427 container redirect-ip-nh-extended-community {
428 leaf next-hop-address {
429 type inet:ip-address;
437 grouping bgp-rib-route {
439 augment "attributes/extended-communities/extended-community" {
440 case traffic-rate-extended-community-case {
441 uses traffic-rate-extended-community;
443 case traffic-action-extended-community-case {
444 uses traffic-action-extended-community;
446 case redirect-extended-community-case {
447 uses redirect-extended-community;
449 case traffic-marking-extended-community-case {
450 uses traffic-marking-extended-community;
452 case redirect-ipv4-extended-community-case {
453 uses redirect-ipv4-extended-community;
455 case redirect-ipv6-extended-community-case {
456 uses redirect-ipv6-extended-community;
458 case redirect-as4-extended-community-case {
459 uses redirect-as4-extended-community;
461 case redirect-ip-nh-extended-community-case {
462 uses redirect-ip-nh-extended-community;
468 grouping flowspec-ipv4-route-list {
469 uses flowspec-destination-group-ipv4;
473 grouping flowspec-ipv4-route {
474 list flowspec-route {
475 key "route-key path-id";
476 uses flowspec-ipv4-route-list;
480 grouping flowspec-l3vpn-ipv4-route {
481 list flowspec-l3vpn-route {
482 key "route-key path-id";
483 uses flowspec-ipv4-route-list;
484 uses bgp-t:route-distinguisher-grouping;
488 grouping flowspec-ipv6-route-list {
489 uses flowspec-destination-group-ipv6;
493 grouping flowspec-ipv6-route {
494 list flowspec-route {
495 key "route-key path-id";
496 uses flowspec-ipv6-route-list;
500 grouping flowspec-l3vpn-ipv6-route {
501 list flowspec-l3vpn-route {
502 key "route-key path-id";
503 uses flowspec-ipv6-route-list;
504 uses bgp-t:route-distinguisher-grouping;
508 grouping flowspec-routes {
509 container flowspec-routes {
510 uses flowspec-ipv4-route;
514 grouping flowspec-ipv6-routes {
515 container flowspec-ipv6-routes {
516 uses flowspec-ipv6-route;
520 grouping flowspec-l3vpn-ipv4-routes {
521 container flowspec-l3vpn-ipv4-routes {
522 uses flowspec-l3vpn-ipv4-route;
526 grouping flowspec-l3vpn-ipv6-routes {
527 container flowspec-l3vpn-ipv6-routes {
528 uses flowspec-l3vpn-ipv6-route;
532 augment "/bgp-msg:update/bgp-msg:attributes/bgp-msg:extended-communities/bgp-msg:extended-community" {
533 reference "https://tools.ietf.org/html/rfc5575#section-7";
534 case traffic-rate-extended-community-case {
535 uses traffic-rate-extended-community;
537 case traffic-action-extended-community-case {
538 uses traffic-action-extended-community;
540 case redirect-extended-community-case {
541 uses redirect-extended-community;
543 case traffic-marking-extended-community-case {
544 uses traffic-marking-extended-community;
546 case redirect-ipv4-extended-community-case {
547 uses redirect-ipv4-extended-community;
549 case redirect-ipv6-extended-community-case {
550 uses redirect-ipv6-extended-community;
552 case redirect-as4-extended-community-case {
553 uses redirect-as4-extended-community;
555 case redirect-ip-nh-extended-community-case {
556 uses redirect-ip-nh-extended-community;
560 augment "/bgp-rib:application-rib/bgp-rib:tables/bgp-rib:routes" {
561 case flowspec-routes-case {
562 uses flowspec-routes;
564 case flowspec-ipv6-routes-case {
565 uses flowspec-ipv6-routes;
567 case flowspec-l3vpn-ipv4-routes-case {
568 uses flowspec-l3vpn-ipv4-routes;
570 case flowspec-l3vpn-ipv6-routes-case {
571 uses flowspec-l3vpn-ipv6-routes;
575 augment "/bgp-rib:bgp-rib/bgp-rib:rib/bgp-rib:loc-rib/bgp-rib:tables/bgp-rib:routes" {
576 case flowspec-routes-case {
577 uses flowspec-routes;
579 case flowspec-ipv6-routes-case {
580 uses flowspec-ipv6-routes;
582 case flowspec-l3vpn-ipv4-routes-case {
583 uses flowspec-l3vpn-ipv4-routes;
585 case flowspec-l3vpn-ipv6-routes-case {
586 uses flowspec-l3vpn-ipv6-routes;
590 augment "/bgp-rib:bgp-rib/bgp-rib:rib/bgp-rib:peer/bgp-rib:adj-rib-in/bgp-rib:tables/bgp-rib:routes" {
591 case flowspec-routes-case {
592 uses flowspec-routes;
594 case flowspec-ipv6-routes-case {
595 uses flowspec-ipv6-routes;
597 case flowspec-l3vpn-ipv4-routes-case {
598 uses flowspec-l3vpn-ipv4-routes;
600 case flowspec-l3vpn-ipv6-routes-case {
601 uses flowspec-l3vpn-ipv6-routes;
605 augment "/bgp-rib:bgp-rib/bgp-rib:rib/bgp-rib:peer/bgp-rib:effective-rib-in/bgp-rib:tables/bgp-rib:routes" {
606 case flowspec-routes-case {
607 uses flowspec-routes;
609 case flowspec-ipv6-routes-case {
610 uses flowspec-ipv6-routes;
612 case flowspec-l3vpn-ipv4-routes-case {
613 uses flowspec-l3vpn-ipv4-routes;
615 case flowspec-l3vpn-ipv6-routes-case {
616 uses flowspec-l3vpn-ipv6-routes;
620 augment "/bgp-rib:bgp-rib/bgp-rib:rib/bgp-rib:peer/bgp-rib:adj-rib-out/bgp-rib:tables/bgp-rib:routes" {
621 case flowspec-routes-case {
622 uses flowspec-routes;
624 case flowspec-ipv6-routes-case {
625 uses flowspec-ipv6-routes;
627 case flowspec-l3vpn-ipv4-routes-case {
628 uses flowspec-l3vpn-ipv4-routes;
630 case flowspec-l3vpn-ipv6-routes-case {
631 uses flowspec-l3vpn-ipv6-routes;
635 augment "/bmp-mon:bmp-monitor/bmp-mon:monitor/bmp-mon:router/bmp-mon:peer/bmp-mon:pre-policy-rib/bmp-mon:tables/bmp-mon:routes" {
636 case flowspec-routes-case {
637 uses flowspec-routes;
639 case flowspec-ipv6-routes-case {
640 uses flowspec-ipv6-routes;
642 case flowspec-l3vpn-ipv4-routes-case {
643 uses flowspec-l3vpn-ipv4-routes;
645 case flowspec-l3vpn-ipv6-routes-case {
646 uses flowspec-l3vpn-ipv6-routes;
650 augment "/bmp-mon:bmp-monitor/bmp-mon:monitor/bmp-mon:router/bmp-mon:peer/bmp-mon:post-policy-rib/bmp-mon:tables/bmp-mon:routes" {
651 case flowspec-routes-case {
652 uses flowspec-routes;
654 case flowspec-ipv6-routes-case {
655 uses flowspec-ipv6-routes;
657 case flowspec-l3vpn-ipv4-routes-case {
658 uses flowspec-l3vpn-ipv4-routes;
660 case flowspec-l3vpn-ipv6-routes-case {
661 uses flowspec-l3vpn-ipv6-routes;