-
Notifications
You must be signed in to change notification settings - Fork 1
/
draft-ietf-rtgwg-policy-model-13.xml
1876 lines (1664 loc) · 65.5 KB
/
draft-ietf-rtgwg-policy-model-13.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<?xml version="1.0"?>
<!DOCTYPE rfc SYSTEM "rfc2629.dtd" [
<!ENTITY RFC2119 PUBLIC ''
'http://xml.resource.org/public/rfc/bibxml/reference.RFC.2119.xml'>
<!ENTITY RFC3688 PUBLIC ''
'http://xml.resource.org/public/rfc/bibxml/reference.RFC.3688.xml'>
<!ENTITY RFC4271 PUBLIC ''
'http://xml.resource.org/public/rfc/bibxml/reference.RFC.4271.xml'>
<!ENTITY RFC5246 PUBLIC ''
'http://xml.resource.org/public/rfc/bibxml/reference.RFC.5246.xml'>
<!ENTITY RFC6020 PUBLIC ''
'http://xml.resource.org/public/rfc/bibxml/reference.RFC.6020.xml'>
<!ENTITY RFC6241 PUBLIC ''
'http://xml.resource.org/public/rfc/bibxml/reference.RFC.6241.xml'>
<!ENTITY RFC6242 PUBLIC ''
'http://xml.resource.org/public/rfc/bibxml/reference.RFC.6242.xml'>
<!ENTITY RFC6991 PUBLIC ''
'http://xml.resource.org/public/rfc/bibxml/reference.RFC.6991.xml'>
<!ENTITY RFC7950 PUBLIC ''
'http://xml.resource.org/public/rfc/bibxml/reference.RFC.7950.xml'>
<!ENTITY RFC8040 PUBLIC ''
'http://xml.resource.org/public/rfc/bibxml/reference.RFC.8040.xml'>
<!ENTITY RFC8174 PUBLIC ''
'http://xml.resource.org/public/rfc/bibxml/reference.RFC.8174.xml'>
<!ENTITY RFC8340 PUBLIC ''
'http://xml.resource.org/public/rfc/bibxml/reference.RFC.8340.xml'>
<!ENTITY RFC8341 PUBLIC ''
'http://xml.resource.org/public/rfc/bibxml/reference.RFC.8341.xml'>
<!ENTITY RFC8342 PUBLIC ''
'http://xml.resource.org/public/rfc/bibxml/reference.RFC.8342.xml'>
<!ENTITY RFC8343 PUBLIC ''
'http://xml.resource.org/public/rfc/bibxml/reference.RFC.8343.xml'>
<!ENTITY RFC8349 PUBLIC ''
'http://xml.resource.org/public/rfc/bibxml/reference.RFC.8349.xml'>
<!ENTITY RFC8446 PUBLIC ''
'http://xml.resource.org/public/rfc/bibxml/reference.RFC.8446.xml'>
<!ENTITY I-D.ietf-netmod-intf-ext-yang PUBLIC ''
'http://xml.resource.org/public/rfc/bibxml-ids/reference.I-D.draft-ietf-netmod-intf-ext-yang-08.xml'>
<!ENTITY I-D.ietf-netmod-sub-intf-vlan-model PUBLIC ''
'http://xml.resource.org/public/rfc/bibxml-ids/reference.I-D.draft-ietf-netmod-sub-intf-vlan-model-06.xml'>
]>
<?xml-stylesheet type='text/xsl' href='rfc2629.xslt' ?>
<rfc docName="draft-ietf-rtgwg-policy-model-13" ipr="trust200902" category="std">
<?rfc toc="yes"?>
<front>
<title abbrev="Routing Policy Model">A YANG Data Model for Routing Policy Management</title>
<author fullname="Yingzhen Qu" initials="Y" surname="Qu">
<organization>Futurewei</organization>
<address>
<postal>
<street>2330 Central Expressway</street>
<city>Santa Clara</city>
<code>CA 95050</code>
<country>USA</country>
</postal>
<email>[email protected]</email>
</address>
</author>
<author fullname="Jeff Tantsura" initials="J" surname="Tantsura">
<organization>Apstra</organization>
<address>
<email>[email protected]</email>
</address>
</author>
<author fullname="Acee Lindem" initials="A" surname="Lindem">
<organization>Cisco</organization>
<address>
<postal>
<street>301 Midenhall Way</street>
<city>Cary</city>
<region>NC</region>
<code>27513</code>
<country>US</country>
</postal>
<email>[email protected]</email>
</address>
</author>
<author fullname="Xufeng Liu" initials="X" surname="Liu">
<organization>Volta Networks</organization>
<address>
<email>[email protected]</email>
</address>
</author>
<date/>
<area>Routing</area>
<workgroup>RTGWG</workgroup>
<abstract>
<t>This document defines a YANG data model for configuring and
managing routing policies in a vendor-neutral way and based on
actual operational practice. The model provides a generic policy
framework which can be augmented with protocol-specific policy
configuration.
</t>
</abstract>
</front>
<middle>
<section title="Introduction" anchor="intro">
<t>This document describes a YANG <xref target="RFC7950"/> data model for routing policy configuration based on operational usage and best practices in a variety of service provider networks. The model is intended to be vendor-neutral, in order to allow operators to manage policy configuration in a consistent, intuitive way in heterogeneous environments with routers supplied by multiple vendors.
</t>
<t> The YANG modules in this document conform to the Network Management
Datastore Architecture (NMDA) [RFC8342].</t>
<section title = "Goals and approach" anchor="goals">
<t>
This model does not aim to be feature complete -- it is a
subset of the policy configuration parameters available
in a variety of vendor implementations, but supports widely
used constructs for managing how routes are imported,
exported, and modified across different routing protocols.
The model development approach has been to examine actual
policy configurations in use across a number of operator
networks. Hence the focus is on enabling policy configuration
capabilities and structure that are in wide use.
</t>
<t>
Despite the differences in details of policy expressions and
conventions in various vendor implementations, the model
reflects the observation that a relatively simple condition-action
approach can be readily mapped to several existing vendor
implementations, and also gives operators an intuitive and
straightforward way to express policy without sacrificing
flexibility. A side effect of this design decision is that
legacy methods for expressing policies are not considered. Such
methods could be added as an augmentation to the model if
needed.
</t>
<t>
Consistent with the goal to produce a data model that is vendor
neutral, only policy expressions that are deemed to be widely
available in existing major implementations are included in the
model. Those configuration items that are only available from
a single implementation are omitted from the model with the
expectation they will be available in separate vendor-provided
modules that augment the current model.
</t>
</section>
</section>
<section title="Terminology and Notation">
<t>
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL
NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED",
"MAY", and "OPTIONAL" in this document are to be interpreted as
described in BCP 14 <xref target="RFC2119"/> <xref target="RFC8174"/>
when, and only when, they appear in all capitals, as shown here.</t>
<t>Routing Policy: A routing policy defines how routes are
imported, exported, modified, and advertised between routing
protocols instances or within a single routing protocol instance.</t>
<t>The following terms are defined in <xref target="RFC8342"/>:
<list style="symbols">
<t>client</t>
<t>server</t>
<t>configuration</t>
<t>system state</t>
<t>operational state</t>
<t>intended configuration</t>
</list>
</t>
<t>The following terms are defined in <xref target="RFC7950"/>:
<list style="symbols">
<t>action</t>
<t>augment</t>
<t>container</t>
<t>container with presence</t>
<t>data model</t>
<t>data node</t>
<t>feature</t>
<t>leaf</t>
<t>list</t>
<t>mandatory node</t>
<t>module</t>
<t>schema tree</t>
<t>RPC (Remote Procedure Call) operation</t>
</list>
</t>
<section title="Tree Diagrams">
<t>Tree diagrams used in this document follow the notation
defined in <xref target="RFC8340"/>.</t>
</section>
<section anchor="sec.prefixes" title="Prefixes in Data Node Names">
<t>
In this document, names of data nodes, actions, and other
data model objects are often used without a prefix, as long as
it is clear from the context in which YANG module each name is
defined. Otherwise, names are prefixed using the standard prefix
associated with the corresponding YANG module, as shown in
<xref target="tab.prefixes"/>.
</t>
<texttable anchor="tab.prefixes" title="Prefixes and Corresponding YANG Modules">
<ttcol>Prefix</ttcol>
<ttcol>YANG module</ttcol>
<ttcol>Reference</ttcol>
<c>if</c><c>ietf-interfaces</c><c><xref target="RFC8343"/></c>
<c>rt</c><c>ietf-routing</c><c><xref target="RFC8349"/></c>
<c>yang</c><c>ietf-yang-types</c><c><xref target="RFC6991"/></c>
<c>inet</c><c>ietf-inet-types</c><c><xref target="RFC6991"/></c>
<c>if-ext</c><c>ietf-if-extensions</c><c><xref target="INTF-EXT-YANG"/></c>
<c>if-l3-vlan</c><c>ietf-if-l3-vlan</c><c><xref target="SUB-INTF-VLAN-YANG"/></c>
</texttable>
</section>
</section>
<section title="Model overview" anchor="overview">
<t>
The routing policy module has three main parts:
</t>
<t>
<list style="symbols">
<t>
A generic framework to express policies as sets of related
conditions and actions. This includes match sets and actions
that are useful across many routing protocols.
</t>
<t>
A structure that allows routing protocol models to add
protocol-specific policy conditions and actions though
YANG augmentations. There is a complete example of this
for <xref target="RFC4271">BGP</xref> policies in the proposed vendor-neutral
<xref target="I-D.ietf-idr-bgp-model">BGP data model</xref>.
</t>
<t>
A reusable grouping for attaching import and export rules in
the context of routing configuration for different
protocols, VRFs, etc. This also enables creation of policy
chains and expressing default policy behavior.
</t>
</list>
</t>
<t>
The module makes use of the standard Internet types,
such as IP addresses, autonomous system numbers, etc.,
defined in <xref target="RFC6991">RFC 6991</xref>.
</t>
</section>
<section title="Route policy expression" anchor="expression">
<t>
Policies are expressed as a sequence of top-level policy
definitions each of which consists of a sequence of policy statements.
Policy statements in turn consist of simple condition-action
tuples. Conditions may include multiple match or comparison
operations, and similarly, actions may effect multiple changes to
route attributes, or indicate a final disposition of accepting
or rejecting the route. This structure is shown below.
</t>
<figure>
<artwork>
+--rw routing-policy
+--rw policy-definitions
+--rw policy-definition* [name]
+--rw name string
+--rw statements
+--rw statement* [name]
+--rw name string
+--rw conditions
| ...
+--rw actions
...
</artwork>
</figure>
<section title="Defined sets for policy matching" anchor="sets">
<t>
The models provides a set of generic sets that can be used for
matching in policy conditions. These sets are applicable for
route selection across multiple routing protocols. They may be
further augmented by protocol-specific models which have their
own defined sets. The supported defined sets include:
</t>
<t>
<list style="symbols">
<t>
prefix sets - define a set of IP prefixes, each with an
associated CIDR netmask range (or exact length)
</t>
<t>
neighbor sets - define a set of neighboring nodes by their
IP addresses. These sets are used for selecting routes based on the
neighbors advertising the routes.
</t>
<t>
tag set - define a set of generic tag values that can be used
in matches for filtering routes
</t>
</list>
</t>
<t>
The model structure for defined sets is shown below.
</t>
<figure>
<artwork>
+--rw routing-policy
+--rw defined-sets
| +--rw prefix-sets
| | +--rw prefix-set* [name]
| | +--rw name string
| | +--rw mode? enumeration
| | +--rw prefixes
| | +--rw prefix-list* [ip-prefix mask-length-lower
| | mask-length-upper]
| | +--rw ip-prefix inet:ip-prefix
| | +--rw mask-length-lower uint8
| | +--rw mask-length-upper uint8
| +--rw neighbor-sets
| | +--rw neighbor-set* [name]
| | +--rw name string
| | +--rw address* inet:ip-address
| +--rw tag-sets
| +--rw tag-set* [name]
| +--rw name string
| +--rw tag-value* tag-type
</artwork>
</figure>
</section>
<section title="Policy conditions" anchor="conditions">
<t>
Policy statements consist of a set of conditions and actions
(either of which may be empty). Conditions are used to
match route attributes against a defined set (e.g., a prefix
set), or to compare attributes against a specific value.
</t>
<t>
Match conditions may be further modified using the
match-set-options configuration which allows operators to
change the behavior of a match. Three options are supported:
</t>
<t>
<list style="symbols">
<t>ALL - match is true only if the given value matches
all members of the set.
</t>
<t>ANY - match is true if the given value matches any
member of the set.
</t>
<t>INVERT - match is true if the given value does not
match any member of the given set.
</t>
</list>
</t>
<t>
Not all options are appropriate for matching against all
defined sets (e.g., match ALL in a prefix set does not make sense).
In the model, a restricted set of match options is used where
applicable.
</t>
<t>
Comparison conditions may similarly use options to change how
route attributes should be tested, e.g., for equality or
inequality, against a given value.
</t>
<t>
While most policy conditions will be added by individual
routing protocol models via augmentation, this routing policy
model includes several generic match conditions and also the
ability to test which protocol or mechanism installed a route
(e.g., BGP, IGP, static, etc.). The conditions included in
the model are shown below.
</t>
<figure>
<artwork>
+--rw routing-policy
+--rw policy-definitions
+--rw policy-definition* [name]
+--rw name string
+--rw statements
+--rw statement* [name]
+--rw conditions
| +--rw call-policy?
| +--rw source-protocol?
| +--rw match-interface
| | +--rw interface?
| | +--rw subinterface?
| +--rw match-prefix-set
| | +--rw prefix-set?
| | +--rw match-set-options?
| +--rw match-neighbor-set
| | +--rw neighbor-set?
| +--rw match-tag-set
| | +--rw tag-set?
| | +--rw match-set-options?
| +--rw match-proto-route-type* identityref
</artwork>
</figure>
</section>
<section title="Policy actions" anchor="actions">
<t>
When policy conditions are satisfied, policy actions are used
to set various attributes of the route being processed, or to
indicate the final disposition of the route, i.e., accept or
reject.</t>
<t>
Similar to policy conditions, the routing policy model includes
generic actions in addition to the basic route disposition
actions. These are shown below.
</t>
<figure>
<artwork>
+--rw routing-policy
+--rw policy-definitions
+--rw policy-definition* [name]
+--rw statements
+--rw statement* [name]
+--rw actions
+--rw policy-result? policy-result-type
+--rw set-metric
| +--rw metric-modification?
| | metric-modification-type
| +--rw metric? uint32
+--rw set-metric-type
| +--rw metric-type? identityref
+--rw set-import-level
| +--rw import-level? identityref
+--rw set-preference? uint16
+--rw set-tag? tag-type
+--rw set-application-tag? tag-type
</artwork>
</figure>
</section>
<section title="Policy subroutines" anchor="subroutines">
<t>
Policy 'subroutines' (or nested policies) are
supported by allowing policy statement conditions to reference
other policy definitions using the call-policy configuration.
Called policies apply their conditions and
actions before returning to the calling policy statement and
resuming evaluation. The outcome of the called policy affects
the evaluation of the calling policy. If the called policy
results in an accept-route,
then the subroutine returns an effective boolean true value to
the calling policy. For the calling policy, this is equivalent
to a condition statement evaluating to a true value and
evaluation of the policy continues
(see <xref target="evaluation"></xref>). Note that
the called policy may also modify attributes of the route in
its action statements. Similarly, a reject-route action
returns false and the calling policy evaluation will be
affected accordingly. When the end of the subroutine policy chain
is reached, the default route disposition action is returned (i.e.,
boolean false for reject-route unless an alternate default action
is specified for the chain). Consequently, a subroutine cannot
explicitly accept or reject a route. Rather it merely provides
an indication that 'call-policy' condition returns boolean true
or false indicating whether or not the condition matches. Route
acceptance or rejection is solely determined by the top-level
policy.
</t>
<t>
Note that the called policy may itself call other policies (subject
to implementation limitations). The model does not prescribe a
nesting depth because this varies among implementations. For example,
some major implementation may only support a single level of
subroutine recursion. As with any routing policy construction, care
must be taken with nested policies to ensure that the effective
return value results in the intended behavior. Nested policies
are a convenience in many routing policy constructions but
creating policies nested beyond a small number of levels (e.g., 2-3)
should be discouraged.
</t>
</section>
</section>
<section title="Policy evaluation" anchor="evaluation">
<t>
Evaluation of each policy definition proceeds by evaluating its
corresponding individual policy statements in order. When all
the condition statements in a policy statement are satisfied, the
corresponding action statements are executed. If the actions
include either accept-route or reject-route actions,
evaluation of the current policy definition stops, and no further
policy definitions in the chain are evaluated.
</t>
<t>
If the conditions are not satisfied, then evaluation proceeds to
the next policy statement. If none of the policy statement
conditions are satisfied, then evaluation of the current policy
definition stops, and the next policy definition in the chain is
evaluated. When the end of the policy chain is reached, the
default route disposition action is performed (i.e., reject-route
unless an alternate default action is specified for the
chain).
</t>
<t>
Note that the route's pre-policy attributes are always used for
testing policy statement conditions. In other words, if actions modify
the policy application specific attributes, those modifications are
not used for policy statement conditions.
</t>
</section>
<section title="Applying routing policy" anchor="usage">
<t>
Routing policy is applied by defining and attaching policy chains
in various routing contexts. Policy chains are sequences of
policy definitions (described in <xref target="expression">
</xref>) that have an associated direction (import or export)
with respect to the routing context in which they are defined.
The routing policy model defines an apply-policy grouping that
can be imported and used by other models. As shown below, it
allows definition of import and export policy chains, as well as
specifying the default route disposition to be used when no
policy definition in the chain results in a final decision.
</t>
<figure>
<artwork>
+--rw apply-policy
| +--rw import-policy*
| +--rw default-import-policy? default-policy-type
| +--rw export-policy*
| +--rw default-export-policy? default-policy-type
</artwork>
</figure>
<t>
The default policy defined by the model is to reject the route for
both import and export policies.
</t>
</section>
<section title="Routing protocol-specific policies" anchor="augment">
<t>
Routing models that require the ability to apply routing policy
may augment the routing policy model with protocol or other
specific policy configuration. The routing policy model
assumes that additional defined sets, conditions, and actions
may all be added by other models.
</t>
<t>
An example of this is shown below, in which the BGP configuration
model in <xref target="I-D.ietf-idr-bgp-model"></xref>
adds new defined sets to match on community values or AS paths.
The model similarly augments BGP-specific conditions and actions
in the corresponding sections of the routing policy model.
</t>
<figure>
<artwork>
module: ietf-routing-policy
+--rw routing-policy
+--rw defined-sets
| +--rw prefix-sets
| | +--rw prefix-set* [name]
| | +--rw name string
| | +--rw mode? enumeration
| | +--rw prefixes
| | +--rw prefix-list* [ip-prefix mask-length-lower
| | mask-length-upper]
| | +--rw ip-prefix inet:ip-prefix
| | +--rw mask-length-lower uint8
| | +--rw mask-length-upper uint8
| +--rw neighbor-sets
| | +--rw neighbor-set* [name]
| | +--rw name string
| | +--rw address* inet:ip-address
| +--rw tag-sets
| | +--rw tag-set* [name]
| | +--rw name string
| | +--rw tag-value* tag-type
| +--rw bp:bgp-defined-sets
| +--rw bp:community-sets
| | +--rw bp:community-set* [name]
| | +--rw bp:name string
| | +--rw bp:member* union
| +--rw bp:ext-community-sets
| | +--rw bp:ext-community-set* [name]
| | +--rw bp:name string
| | +--rw bp:member* union
| +--rw bp:as-path-sets
| +--rw bp:as-path-set* [name]
| +--rw bp:name string
| +--rw bp:member* string
+--rw policy-definitions
+--rw policy-definition* [name]
+--rw name string
+--rw statements
+--rw statement* [name]
+--rw name string
+--rw conditions
| +--rw call-policy?
| +--rw source-protocol? identityref
| +--rw match-interface
| | +--rw interface?
| | +--rw subinterface?
| +--rw match-prefix-set
| | +--rw prefix-set? prefix-set/name
| | +--rw match-set-options? match-set-options-type
| +--rw match-neighbor-set
| | +--rw neighbor-set?
| +--rw match-tag-set
| | +--rw tag-set?
| | +--rw match-set-options? match-set-options-type
| +--rw match-proto-route-type* identityref
| +--rw bp:bgp-conditions
| +--rw bp:med-eq? uint32
| +--rw bp:origin-eq? bt:bgp-origin-attr-type
| +--rw bp:next-hop-in* inet:ip-address-no-zone
| +--rw bp:afi-safi-in* identityref
| +--rw bp:local-pref-eq? uint32
| +--rw bp:route-type? enumeration
| +--rw bp:community-count
| +--rw bp:as-path-length
| +--rw bp:match-community-set
| | +--rw bp:community-set?
| | +--rw bp:match-set-options?
| +--rw bp:match-ext-community-set
| | +--rw bp:ext-community-set?
| | +--rw bp:match-set-options?
| +--rw bp:match-as-path-set
| +--rw bp:as-path-set?
| +--rw bp:match-set-options?
+--rw actions
+--rw policy-result? policy-result-type
+--rw set-metric
| +--rw metric-modification?
| +--rw metric? uint32
+--rw set-metric-type
| +--rw metric-type? identityref
+--rw set-import-level
| +--rw import-level? identityref
+--rw set-preference? uint16
+--rw set-tag? tag-type
+--rw set-application-tag? tag-type
+--rw bp:bgp-actions
+--rw bp:set-route-origin?bt:bgp-origin-attr-type
+--rw bp:set-local-pref? uint32
+--rw bp:set-next-hop? bgp-next-hop-type
+--rw bp:set-med? bgp-set-med-type
+--rw bp:set-as-path-prepend
| +--rw bp:repeat-n? uint8
+--rw bp:set-community
| +--rw bp:method? enumeration
| +--rw bp:options?
| +--rw bp:inline
| | +--rw bp:communities* union
| +--rw bp:reference
| +--rw bp:community-set-ref?
+--rw bp:set-ext-community
+--rw bp:method? enumeration
+--rw bp:options?
+--rw bp:inline
| +--rw bp:communities* union
+--rw bp:reference
+--rw bp:ext-community-set-ref?
</artwork>
</figure>
</section>
<section title="Security Considerations">
<t>The YANG modules specified in this document define a schema for data
that is designed to be accessed via network management protocols such
as NETCONF <xref target="RFC6241"/> or RESTCONF <xref target="RFC8040"/>.
The lowest NETCONF layer is the secure transport layer, and the
mandatory-to-implement secure transport is Secure Shell (SSH) <xref target="RFC6242"/>.
The lowest RESTCONF layer is HTTPS, and the mandatory-to-implement
secure transport is TLS <xref target="RFC8446"/>.</t>
<t>The NETCONF Access Control Model (NACM) <xref target="RFC8341"/> provides
the means to restrict access for particular NETCONF or RESTCONF users
to a pre-configured subset of all available NETCONF or RESTCONF protocol
operations and content.</t>
<t>There are a number of data nodes defined in this YANG module that are
writable/creatable/deletable (i.e., config true, which is the
default). These data nodes may be considered sensitive or vulnerable
in some network environments. Write operations (e.g., edit-config)
to these data nodes without proper protection can have a negative
effect on network operations. These are the subtrees and data nodes
and their sensitivity/vulnerability:
<list style="empty">
<t>/routing-policy</t>
<t>/routing-policy/defined-sets/prefix-sets</t>
<t>/routing-policy/defined-sets/neighbor-sets</t>
<t>/routing-policy/defined-sets/tag-sets</t>
<t>/routing-policy/policy-definitions</t>
</list></t>
<t>Unauthorized access to any data node of these subtrees can disclose
the operational state information of routing policies on this device.</t>
<t>Routing policy configuration has a significant impact on network operations,
and, as such, any related model carries potential security risks. Unauthorized
access or invalid data could cause major disruption.</t>
</section>
<section title="IANA Considerations">
<t>This document registers a URI in the IETF XML registry
<xref target="RFC3688"/>. Following the format in <xref target="RFC3688"/>,
the following registration is requested to be made:
<figure>
<artwork>
URI: urn:ietf:params:xml:ns:yang:ietf-routing-policy
Registrant Contact: The IESG.
XML: N/A, the requested URI is an XML namespace.
</artwork>
</figure></t>
<t>This document registers a YANG module in the YANG Module Names
registry <xref target="RFC6020"/>.
<figure>
<artwork>
name: ietf-routing-policy
namespace: urn:ietf:params:xml:ns:yang:ietf-routing-policy
prefix: rt-pol
reference: RFC XXXX
</artwork>
</figure></t>
</section>
<section title="YANG modules" anchor="models">
<t>The routing policy model is described by the YANG modules in the
sections below.
</t>
<section title="Routing policy model">
<figure>
<artwork><![CDATA[
<CODE BEGINS> file "[email protected]"
module ietf-routing-policy {
yang-version "1.1";
namespace "urn:ietf:params:xml:ns:yang:ietf-routing-policy";
prefix rt-pol;
import ietf-inet-types {
prefix "inet";
reference "RFC 6991: Common YANG Data Types";
}
import ietf-yang-types {
prefix "yang";
reference "RFC 6991: Common YANG Data Types";
}
import ietf-interfaces {
prefix "if";
reference "RFC 8343: A YANG Data Model for Interface
Management (NMDA Version)";
}
import ietf-routing {
prefix "rt";
reference "RFC 8349: A YANG Data Model for Routing
Management (NMDA Version)";
}
import ietf-if-extensions {
prefix "if-ext";
reference "RFC YYYY: Common Interface Extension YANG
Data Models. Please replace YYYY with
published RFC number for
draft-ietf-netmod-intf-ext-yang.";
}
import ietf-if-l3-vlan {
prefix "if-l3-vlan";
reference "RFC XXXX: Sub-interface VLAN YANG Data Models.
Please replace XXXX with published RFC number
for draft-ietf-netmod-sub-intf-vlan-model.";
}
organization
"IETF RTGWG - Routing Area Working Group";
contact
"WG Web: <http://tools.ietf.org/wg/rtgwg/>
WG List: <Email: [email protected]>
Editor: Yingzhen Qu
<Email: [email protected]>
Jeff Tantsura
<Email: [email protected]>
Acee Lindem
<Email: [email protected]>
Xufeng Liu
<Email: [email protected]>";
description
"This module describes a YANG model for routing policy
configuration. It is a limited subset of all of the policy
configuration parameters available in the variety of vendor
implementations, but supports widely used constructs for
managing how routes are imported, exported, modified and
advertised across different routing protocol instances or
within a single routing protocol instance. This module is
intended to be used in conjunction with routing protocol
configuration modules (e.g., BGP) defined in other models.
Route policy expression:
Policies are expressed as a set of top-level policy
definitions, each of which consists of a sequence of policy
statements. Policy statements consist of simple
condition-action tuples. Conditions may include multiple match
or comparison operations, and similarly actions may be
multitude of changes to route attributes or a final
disposition of accepting or rejecting the route.
Route policy evaluation:
Policy definitions are referenced in routing protocol
configurations using import and export configuration
statements. The arguments are members of an ordered list of
named policy definitions which comprise a policy chain, and
optionally, an explicit default policy action (i.e., reject
or accept).
Evaluation of each policy definition proceeds by evaluating
its corresponding individual policy statements in order. When
a condition statement in a policy statement is satisfied, the
corresponding action statement is executed. If the action
statement has either accept-route or reject-route actions,
policy evaluation of the current policy definition stops, and
no further policy definitions in the chain are evaluated.
If the condition is not satisfied, then evaluation proceeds to
the next policy statement. If none of the policy statement
conditions are satisfied, then evaluation of the current
policy definition stops, and the next policy definition in the
chain is evaluated. When the end of the policy chain is
reached, the default route disposition action is performed
(i.e., reject-route unless an alternate default action is
specified for the chain).
Policy 'subroutines' (or nested policies) are supported by
allowing policy statement conditions to reference another
policy definition which applies conditions and actions from
the referenced policy before returning to the calling policy
statement and resuming evaluation. If the called policy
results in an accept-route (either explicit or by default),
then the subroutine returns an effective true value to the
calling policy. Similarly, a reject-route action returns
false. If the subroutine returns true, the calling policy
continues to evaluate the remaining conditions (using a
modified route if the subroutine performed any changes to the
route).
Copyright (c) 2020 IETF Trust and the persons identified as
authors of the code. All rights reserved.
Redistribution and use in source and binary forms, with or
without modification, is permitted pursuant to, and subject to
the license terms contained in, the Simplified BSD License set
forth in Section 4.c of the IETF Trust's Legal Provisions
Relating to IETF Documents
(https://trustee.ietf.org/license-info).
This version of this YANG module is part of RFC XXXX
(https://www.rfc-editor.org/info/rfcXXXX); see the RFC itself
for full legal notices.
The key words 'MUST', 'MUST NOT', 'REQUIRED', 'SHALL', 'SHALL
NOT', 'SHOULD', 'SHOULD NOT', 'RECOMMENDED', 'NOT
RECOMMENDED', 'MAY', and 'OPTIONAL' in this document are to be
interpreted as described in BCP 14 (RFC 2119) (RFC 8174) when,
and only when, they appear in all capitals, as shown here.
This version of this YANG module is part of RFC XXXX;
see the RFC itself for full legal notices.";
revision "2020-05-26" {
description
"Initial revision.";
reference
"RFC XXXX: Routing Policy Configuration Model for Service
Provider Networks";
}
/* Identities */
identity metric-type {
description
"Base identity for route metric types.";
}
identity ospf-type-1-metric {
base metric-type;
description
"Identity for the OSPF type 1 external metric types. It
is only applicable to OSPF routes.";
}
identity ospf-type-2-metric {
base metric-type;
description
"Identity for the OSPF type 2 external metric types. It
is only applicable to OSPF routes.";
}
identity isis-internal-metric {
base metric-type;
description
"Identity for the IS-IS internal metric types. It is only
applicable to IS-IS routes.";
}
identity isis-external-metric {
base metric-type;
description
"Identity for the IS-IS external metric types. It is only
applicable to IS-IS routes.";
}
identity import-level {
description
"Base identity for route import level.";
}
identity ospf-normal {
base import-level;
description
"Identity for OSPF importation into normal areas
It is only applicable to routes imported
into the OSPF protocol.";
}
identity ospf-nssa-only {
base import-level;
description
"Identity for the OSPF NSSA area importation. It is only
applicable to routes imported into the OSPF protocol.";
}
identity ospf-normal-nssa {
base import-level;
description
"Identity for OSPF importation into both normal and NSSA
areas, it is only applicable to routes imported into
the OSPF protocol.";
}
identity isis-level-1 {
base import-level;
description
"Identity for IS-IS Level 1 area importation. It is only
applicable to routes imported into the IS-IS protocol.";
}
identity isis-level-2 {
base import-level;
description
"Identity for IS-IS Level 2 area importation. It is only
applicable to routes imported into the IS-IS protocol.";
}
identity isis-level-1-2 {
base import-level;
description
"Identity for IS-IS Level 1 and Level 2 area importation. It
is only applicable to routes imported into the IS-IS
protocol.";
}
identity proto-route-type {
description
"Base identity for route type within a protocol.";
}
identity isis-level-1-type {