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
|
module hc2vpp-ietf-srv6-static {
namespace "urn:ietf:params:xml:ns:yang:ietf-srv6-static";
prefix srv6-static;
import ietf-interfaces {
prefix "if";
}
import ietf-inet-types {
prefix inet;
}
// TODO: hc2vpp-298 - Renamed imports, because hc2vpp uses modified versions of these models.
import hc2vpp-ietf-routing {
prefix "rt";
}
import ietf-srv6-types {
prefix srv6-types;
}
// TODO: hc2vpp-332 - Renamed imports, because hc2vpp uses modified versions of these models.
import hc2vpp-ietf-srv6-base {
prefix srv6;
}
organization
"IETF SPRING Working Group";
contact
"WG Web: <http://tools.ietf.org/wg/spring/>
WG List: <mailto:spring@ietf.org>
Editor: Kamran Raza
<mailto:skraza@cisco.com>
Editor: Jaganbabu Rajamanickam
<maito:jrajaman@cisco.com>
Editor: Xufeng Liu
<mailto:Xufeng_Liu@jabil.com>
Editor: Zhibo Hu
<mailto:huzhibo@huawei.com>
Editor: Iftekhar Hussain
<mailto:IHussain@infinera.com>
Editor: Himanshu Shah
<mailto:hshah@ciena.com>
Editor: Daniel Voyer
<mailto:daniel.voyer@bell.ca>
Editor: Hani Elmalky
<mailto:hani.elmalky@ericsson.com>
Editor: Satoru Matsushima
<mailto:satoru.matsushima@gmail.com>
Editor: Katsuhiro Horiba
<mailto:katsuhiro.horiba@g.softbank.co.jp>
Editor: Ahmed AbdelSalam
<mailto:ahmed.abdelsalam@gssi.it>
";
description
"This YANG module defines the essential elements for the
management of Static application for Segment-Routing with
IPv6 dataplane (SRv6).
Copyright (c) 2017 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
(http://trustee.ietf.org/license-info).";
reference "RFC XXXX";
revision 2018-03-01 {
description
"Updated to align with SRv6 network programming draft rev 04";
reference
"RFC XXXX: YANG Data Model for SRv6";
}
revision 2017-11-12 {
description
"Initial revision.";
reference
"RFC XXXX: YANG Data Model for SRv6";
}
/*
* Config and State
*/
grouping path-attrs-v6 {
description
"IPv6 Path properties";
leaf interface {
type if:interface-ref;
description "The outgoing interface";
}
leaf next-hop {
type inet:ipv6-address;
description "The IP address of the next-hop";
}
uses srv6:path-attrs-cmn;
}
grouping path-attrs-v4 {
description
"IPv4 Path properties";
leaf interface {
type if:interface-ref;
description "The outgoing interface";
}
leaf next-hop {
type inet:ipv4-address;
description "The IP address of the next-hop";
}
uses srv6:path-attrs-cmn;
}
grouping path-attrs-mpls {
description
"MPLS Path properties";
leaf interface {
type if:interface-ref;
description "The outgoing interface";
}
leaf next-hop {
type inet:ip-address;
description "The IP address of the next-hop";
}
uses srv6:path-attrs-cmn;
}
grouping multi-paths-v6 {
description "Multipath grouping";
container paths {
description "List of outgoing paths";
list path {
key path-index;
description "The list of paths associated with the SID";
leaf path-index {
type uint8;
description "Index of the path";
}
uses path-attrs-v6;
container encap {
description "Encapsulation on path";
uses srv6:path-out-sids;
}
}
}
}
grouping multi-paths-v4 {
description "Multipath grouping";
container paths {
description "List of outgoing paths";
list path {
key path-index;
description "The list of paths associated with the SID";
leaf path-index {
type uint8;
description "Index of the path";
}
uses path-attrs-v4;
container encap {
description "Encapsulation on path";
uses srv6:path-out-sids;
}
}
}
}
grouping multi-paths-mpls {
description "Multipath grouping";
container paths {
description "List of outgoing paths";
list path {
key path-index;
description "The list of paths associated with the SID";
leaf path-index {
type uint8;
description "Index of the path";
}
uses path-attrs-mpls;
container encap {
description "Encapsulation on path";
uses srv6:path-out-labels;
}
}
}
}
grouping srv6-sid-config {
description
"Configuration parameters relating to SRv6 sid.";
leaf opcode {
type srv6-types:srv6-func-opcode-unreserved;
description
"SRv6 function opcode.";
}
leaf end-behavior-type {
type identityref {
base srv6-types:srv6-endpoint-type;
}
mandatory true;
description
"Type of SRv6 end behavior.";
}
container end {
when "../end-behavior-type = 'End'" {
description
"This container is valid only when the user chooses End
behavior (variant: no PSP, no USP).";
}
description
"The Endpoint function is the most basic function.
FIB lookup on updated DA and forward accordingly
to the matched entry.
This is the SRv6 instantiation of a Prefix SID
(variant: no PSP, no USP)";
}
container end_psp {
when "../end-behavior-type = 'End_PSP'" {
description
"This container is valid only when the user chooses End
behavior (variant: PSP only).";
}
description
"The Endpoint function is the most basic function.
FIB lookup on updated DA and forward accordingly
to the matched entry.
This is the SRv6 instantiation of a Prefix SID
(variant: PSP only)";
}
container end_usp {
when "../end-behavior-type = 'End_USP'" {
description
"This container is valid only when the user chooses End
behavior (variant: USP only).";
}
description
"The Endpoint function is the most basic function.
FIB lookup on updated DA and forward accordingly
to the matched entry.
This is the SRv6 instantiation of a Prefix SID
(variant: USP only)";
}
container end_psp_usp {
when "../end-behavior-type = 'End_PSP_USP'" {
description
"This container is valid only when the user chooses End
behavior (variant: PSP/USP).";
}
description
"The Endpoint function is the most basic function.
FIB lookup on updated DA and forward accordingly
to the matched entry.
This is the SRv6 instantiation of a Prefix SID
(variant: PSP/USP)";
}
container end-t {
when "../end-behavior-type = 'End.T'" {
description
"This container is valid only when the user chooses
End.T behavior (variant: no PSP, no USP).";
}
description
"Endpoint with specific IPv6 table lookup (variant: no PSP, no USP).
Lookup the next segment in IPv6 table T
associated with the SID and forward via
the matched table entry.
The End.T is used for multi-table operation
in the core.";
// TODO: HC2VPP-332 - Uncommented presence in container so mandatory child is enforced
// only when container is present. Caused by Yangtools not enforcing when statement (YANGTOOLS-688).
presence "Mandatory child only if container is present";
leaf lookup-table-ipv6 {
type srv6-types:table-id;
mandatory true;
description
"Table Id for lookup on updated DA (next segment)";
}
}
container end-t_psp {
when "../end-behavior-type = 'End.T_PSP'" {
description
"This container is valid only when the user chooses
End.T behavior (variant: PSP only).";
}
description
"Endpoint with specific IPv6 table lookup (variant: PSP only).
Lookup the next segment in IPv6 table T
associated with the SID and forward via
the matched table entry.
The End.T is used for multi-table operation
in the core.";
// TODO: HC2VPP-332 - Uncommented presence in container so mandatory child is enforced
// only when container is present. Caused by Yangtools not enforcing when statement (YANGTOOLS-688).
presence "Mandatory child only if container is present";
leaf lookup-table-ipv6 {
type srv6-types:table-id;
mandatory true;
description
"Table Id for lookup on updated DA (next segment)";
}
}
container end-t_usp {
when "../end-behavior-type = 'End.T_USP'" {
description
"This container is valid only when the user chooses
End.T behavior (variant: USP only).";
}
description
"Endpoint with specific IPv6 table lookup (variant: USP only).
Lookup the next segment in IPv6 table T
associated with the SID and forward via
the matched table entry.
The End.T is used for multi-table operation
in the core.";
// TODO: HC2VPP-332 - Uncommented presence in container so mandatory child is enforced
// only when container is present. Caused by Yangtools not enforcing when statement (YANGTOOLS-688).
presence "Mandatory child only if container is present";
leaf lookup-table-ipv6 {
type srv6-types:table-id;
mandatory true;
description
"Table Id for lookup on updated DA (next segment)";
}
}
container end-t_psp_usp {
when "../end-behavior-type = 'End.T_PSP_USP'" {
description
"This container is valid only when the user chooses
End.T behavior (variant: USP/PSP).";
}
description
"Endpoint with specific IPv6 table lookup (variant: USP/PSP).
Lookup the next segment in IPv6 table T
associated with the SID and forward via
the matched table entry.
The End.T is used for multi-table operation
in the core.";
// TODO: HC2VPP-332 - Uncommented presence in container so mandatory child is enforced
// only when container is present. Caused by Yangtools not enforcing when statement (YANGTOOLS-688).
presence "Mandatory child only if container is present";
leaf lookup-table-ipv6 {
type srv6-types:table-id;
mandatory true;
description
"Table Id for lookup on updated DA (next segment)";
}
}
container end-x {
when "../end-behavior-type = 'End.X'" {
description
"This container is valid only when the user chooses
End.X behavior (variant: no USP/PSP)";
}
description
"Endpoint with cross-connect to an array of
layer-3 adjacencies (variant: no USP/PSP).
Forward to layer-3 adjacency bound to the SID S.
The End.X function is required to express any
traffic-engineering policy.";
leaf protected {
type boolean;
default false;
description "Is Adj-SID protected?";
}
uses multi-paths-v6;
}
container end-x_psp {
when "../end-behavior-type = 'End.X_PSP'" {
description
"This container is valid only when the user chooses
End.X behavior (variant: PSP only)";
}
description
"Endpoint with cross-connect to an array of
layer-3 adjacencies (variant: PSP only).
Forward to layer-3 adjacency bound to the SID S.
The End.X function is required to express any
traffic-engineering policy.";
leaf protected {
type boolean;
default false;
description "Is Adj-SID protected?";
}
uses multi-paths-v6;
}
container end-x_usp {
when "../end-behavior-type = 'End.X_USP'" {
description
"This container is valid only when the user chooses
End.X behavior (variant: USP only)";
}
description
"Endpoint with cross-connect to an array of
layer-3 adjacencies (variant: USP only).
Forward to layer-3 adjacency bound to the SID S.
The End.X function is required to express any
traffic-engineering policy.";
leaf protected {
type boolean;
default false;
description "Is Adj-SID protected?";
}
uses multi-paths-v6;
}
container end-x_psp_usp {
when "../end-behavior-type = 'End.X_PSP_USP'" {
description
"This container is valid only when the user chooses
End.X behavior (variant: PSP/USP)";
}
description
"Endpoint with cross-connect to an array of
layer-3 adjacencies (variant: PSP/USP).
Forward to layer-3 adjacency bound to the SID S.
The End.X function is required to express any
traffic-engineering policy.";
leaf protected {
type boolean;
default false;
description "Is Adj-SID protected?";
}
uses multi-paths-v6;
}
container end-b6 {
when "../end-behavior-type = 'End.B6'" {
description
"This container is valid only when the user chooses
End.B6 behavior.";
}
description
"Endpoint bound to an SRv6 Policy.
Insert SRH based on the policy and forward the
packet toward the first hop configured in the policy.
This is the SRv6 instantiation of a Binding SID.";
// TODO: HC2VPP-332 - Uncommented presence in container so mandatory child is enforced
// only when container is present. Caused by Yangtools not enforcing when statement (YANGTOOLS-688).
presence "Mandatory child only if container is present";
leaf policy-name {
type string;
mandatory true;
description "SRv6 policy name.";
}
uses multi-paths-v6;
}
container end-b6-encaps {
when "../end-behavior-type = 'End.B6.Encaps'" {
description
"This container is valid only when the user chooses
End_B6_Encaps behavior.";
}
description
"This is a variation of the End.B6 behavior where
the SRv6 Policy also includes an IPv6 Source
Address.
Insert SRH based on the policy and update the
source IP and forward the packet toward the
first hop configured in the policy.
Instead of simply inserting an SRH with the
policy (End.B6), this behavior also adds an
outer IPv6 header.";
// TODO: HC2VPP-332 - Uncommented presence in container so mandatory child is enforced
// only when container is present. Caused by Yangtools not enforcing when statement (YANGTOOLS-688).
presence "Mandatory child only if container is present";
leaf policy-name {
type string;
mandatory true;
description "SRv6 policy name.";
}
leaf source-address {
type inet:ipv6-address;
mandatory true;
description
"IPv6 source address for Encap.";
}
uses multi-paths-v6;
}
container end-bm {
when "../end-behavior-type = 'End.BM'" {
description
"This container is valid only when the user chooses
End.BM behavior.";
}
description
"Endpoint bound to an SR-MPLS Policy.
push an MPLS label stack <L1, L2, L3> on the
received packet and forward the according to
Lable L1.
This is an SRv6 instantiation of an SR-MPLS Binding SID.";
// TODO: HC2VPP-332 - Uncommented presence in container so mandatory child is enforced
// only when container is present. Caused by Yangtools not enforcing when statement (YANGTOOLS-688).
presence "Mandatory child only if container is present";
leaf policy-name {
type string;
mandatory true;
description "SRv6 policy name";
}
uses multi-paths-mpls;
}
container end-dx6 {
when "../end-behavior-type = 'End.DX6'" {
description
"This container is valid only when the user chooses
End.DX6 behavior.";
}
description
"Endpoint with decapsulation and cross-connect to
an array of IPv6 adjacencies. Pop the (outer)
IPv6 header and its extension headers and forward
to layer-3 adjacency bound to the SID S.
The End.DX6 used in the L3VPN use-case.";
uses multi-paths-v6;
}
container end-dx4 {
when "../end-behavior-type = 'End.DX4'" {
description
"This container is valid only when the user chooses
End.DX4 behavior.";
}
description
"Endpoint with decapsulation and cross-connect to
an array of IPv4 adjacencies.
Pop the (outer) IPv6 header and its extension
header and forward to layer-3 adjacency bound
to the SID S.
This would be equivalent to the per-CE VPN
label in MPLS.";
uses multi-paths-v4;
}
container end-dt6 {
when "../end-behavior-type = 'End.DT6'" {
description
"This container is valid only when the user chooses
End.DT6 behavior.";
}
description
"Endpoint with decapsulation and specific IPv6 table
lookup.
Pop the (outer) IPv6 header and its extension
headers.
Lookup the exposed inner IPv6 DA in IPv6
table T and forward via the matched table entry.
End.DT6 function is used in L3VPN use-case.";
// TODO: HC2VPP-332 - Uncommented presence in container so mandatory child is enforced
// only when container is present. Caused by Yangtools not enforcing when statement (YANGTOOLS-688).
presence "Mandatory child only if container is present";
leaf lookup-table-ipv6 {
type srv6-types:table-id;
mandatory true;
description "IPv6 table";
}
}
container end-dt4 {
when "../end-behavior-type = 'End.DT4'" {
description
"This container is valid only when the user chooses
End.DT4 behavior.";
}
description
"Endpoint with decapsulation and specific
IPv4 table lookup.
Pop the (outer) IPv6 header and its extension
headers.
Lookup the exposed inner IPv4 DA in IPv4
table T and forward via the matched table entry.
This would be equivalent to the per-VRF VPN label
in MPLS.";
// TODO: HC2VPP-332 - Uncommented presence in container so mandatory child is enforced
// only when container is present. Caused by Yangtools not enforcing when statement (YANGTOOLS-688).
presence "Mandatory child only if container is present";
leaf lookup-table-ipv4 {
type srv6-types:table-id;
mandatory true;
description "IPv4 table";
}
}
container end-dt46 {
when "../end-behavior-type = 'End.DT46'" {
description
"This container is valid only when the user chooses
End.DT46 behavior.";
}
description
"Endpoint with decapsulation and specific
IP table lookup.
Depending on the protocol type (IPv4 or IPv6)
of the inner ip packet and the specific VRF name
forward the packet.
This would be equivalent to the per-VRF VPN
label in MPLS.";
// TODO: HC2VPP-332 - Uncommented presence in container so mandatory child is enforced
// only when container is present. Caused by Yangtools not enforcing when statement (YANGTOOLS-688).
presence "Mandatory child only if container is present";
leaf lookup-table-ipv4 {
type srv6-types:table-id;
mandatory true;
description "IPv4 table";
}
leaf lookup-table-ipv6 {
type srv6-types:table-id;
mandatory true;
description "IPv6 table";
}
}
container end-dx2 {
when "../end-behavior-type = 'End.DX2'" {
description
"This container is valid only when the user chooses
End.DX2 behavior.";
}
description
"This is an Endpoint with decapsulation and Layer-2
cross-connect to OIF.
Pop the (outer) IPv6 header and its extension headers.
Forward the resulting frame via OIF associated to the SID.
The End.DX2 function is the L2VPN use-case";
// TODO: HC2VPP-332 - Added presence in container so mandatory child is enforced
// only when container is present. Caused by Yangtools not enforcing when statement (YANGTOOLS-688).
presence "Mandatory child only if container is present";
container paths {
description "List of outgoing paths";
leaf interface {
type if:interface-ref;
mandatory true;
description "Layer-2 cross-connect to Out interface.";
}
}
}
/* TODO
container end-dx2v {
when "../end-behavior-type = 'End.DX2V'" {
description
"This container is valid only when the user chooses
End.DX2V behavior.";
}
description
"Endpoint with decapsulation and specific VLAN
L2 table lookup.
Pop the (outer) IPv6 header
and its extension headers lookup the exposed
inner VLANs in L2 table T forward via the
matched table entry.
The End.DX2V is used for EVPN Flexible cross-connect
use-cases";
leaf end-dx2v {
type empty;
description
"End_DX2V behavior";
}
}
container end-dt2u {
when "../end-behavior-type = 'End.DT2U'" {
description
"This container is valid only when the user chooses
End.DT2U behavior.";
}
description
"Endpoint with decapsulation and specific
unicast MAC L2 table lookup.
Pop the (outer) IPv6 header and its extension headers.
Learn the exposed inner MAC SA in L2 table T.
Lookup the exposed inner MAC DA in L2 table T.
Forward via the matched T entry else to all L2OIF in T.
The End.DT2U is used for EVPN Bridging unicast use cases";
leaf end-dt2u {
type empty;
description
"End_DT2U behavior";
}
}
container end-dt2m {
when "../end-behavior-type = 'End.DT2M'" {
description
"This container is valid only when the user chooses
End.DT2M behavior.";
}
description
"Endpoint with decapsulation and specific L2 table flooding.
Pop the (outer) IPv6 header and its extension headers.
Learn the exposed inner MAC SA in L2 table T.
Forward on all L2OIF excluding the one specified in Arg.FE2.
The End.DT2M is used for EVPN Bridging BUM use case with
ESI filtering capability.";
leaf end-dt2m {
type empty;
description
"End_DT2M behavior";
}
}
*/
container end-otp {
when "../end-behavior-type = 'End.OTP'" {
description
"This container is valid only when the user chooses
End.OTP behavior.";
}
description
"Endpoint for OAM with timestamp and punt behavior";
}
}
grouping srv6-static-cfg {
description
"Grouping configuration and operation for SRv6 sid.";
list sid {
key "opcode";
description "Local SID list";
uses srv6-sid-config;
}
}
augment "/rt:routing/srv6:srv6/srv6:locators/srv6:locator" {
description
"This augments locator leaf withing SRv6.";
container static {
description "Static SRv6";
/* Local SIDs */
container local-sids {
description
"SRv6-static local-SIDs";
uses srv6-static-cfg;
/* no state for now; SID state accessible through base model */
}
}
}
} // module
|