-
Notifications
You must be signed in to change notification settings - Fork 1
/
draft-ietf-netmod-sub-intf-vlan-model.txt
1960 lines (1374 loc) · 67.1 KB
/
draft-ietf-netmod-sub-intf-vlan-model.txt
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
Internet Engineering Task Force R.G. Wilton, Ed.
Internet-Draft Cisco Systems
Intended status: Standards Track S. Mansfield, Ed.
Expires: 29 July 2023 Ericsson
25 January 2023
Sub-interface VLAN YANG Data Models
draft-ietf-netmod-sub-intf-vlan-model-08
Abstract
This document defines YANG modules to add support for classifying
traffic received on interfaces as Ethernet/VLAN framed packets to
sub-interfaces based on the fields available in the Ethernet/VLAN
frame headers. These modules allow configuration of Layer 3 and
Layer 2 sub-interfaces (e.g. L2VPN attachment circuits) that can
interoperate with IETF based forwarding protocols; such as IP and
L3VPN services; or L2VPN services like VPWS, VPLS, and EVPN. The
sub-interfaces also interoperate with VLAN tagged traffic orignating
from an IEEE 802.1Q compliant bridge.
The model differs from an IEEE 802.1Q bridge model in that the
configuration is interface/sub-interface based as opposed to being
based on membership of an 802.1Q VLAN bridge.
The YANG data models in this document conforms to the Network
Management Datastore Architecture (NMDA) defined in RFC 8342.
Status of This Memo
This Internet-Draft is submitted in full conformance with the
provisions of BCP 78 and BCP 79.
Internet-Drafts are working documents of the Internet Engineering
Task Force (IETF). Note that other groups may also distribute
working documents as Internet-Drafts. The list of current Internet-
Drafts is at https://datatracker.ietf.org/drafts/current/.
Internet-Drafts are draft documents valid for a maximum of six months
and may be updated, replaced, or obsoleted by other documents at any
time. It is inappropriate to use Internet-Drafts as reference
material or to cite them other than as "work in progress."
This Internet-Draft will expire on 29 July 2023.
Wilton & Mansfield Expires 29 July 2023 [Page 1]
Internet-Draft Sub-interface VLAN YANG January 2023
Copyright Notice
Copyright (c) 2023 IETF Trust and the persons identified as the
document authors. All rights reserved.
This document is subject to BCP 78 and the IETF Trust's Legal
Provisions Relating to IETF Documents (https://trustee.ietf.org/
license-info) in effect on the date of publication of this document.
Please review these documents carefully, as they describe your rights
and restrictions with respect to this document. Code Components
extracted from this document must include Revised BSD License text as
described in Section 4.e of the Trust Legal Provisions and are
provided without warranty as described in the Revised BSD License.
Table of Contents
1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 3
1.1. Terminology . . . . . . . . . . . . . . . . . . . . . . . 4
1.2. Tree Diagrams . . . . . . . . . . . . . . . . . . . . . . 4
2. Objectives . . . . . . . . . . . . . . . . . . . . . . . . . 4
2.1. Interoperability with IEEE 802.1Q compliant bridges . . . 4
3. Interface VLAN Encapsulation Model . . . . . . . . . . . . . 4
4. Interface Flexible Encapsulation Model . . . . . . . . . . . 5
5. VLAN Encapsulation YANG Module . . . . . . . . . . . . . . . 7
6. Flexible Encapsulation YANG Module . . . . . . . . . . . . . 11
7. Examples . . . . . . . . . . . . . . . . . . . . . . . . . . 21
7.1. Layer 3 sub-interfaces with IPv6 . . . . . . . . . . . . 21
7.2. Layer 2 sub-interfaces with L2VPN . . . . . . . . . . . . 23
8. Acknowledgements . . . . . . . . . . . . . . . . . . . . . . 26
9. ChangeLog . . . . . . . . . . . . . . . . . . . . . . . . . . 26
9.1. WG version -08 . . . . . . . . . . . . . . . . . . . . . 26
9.2. WG version -07 and -06 . . . . . . . . . . . . . . . . . 26
9.3. WG version -05 . . . . . . . . . . . . . . . . . . . . . 26
9.4. WG version -04 . . . . . . . . . . . . . . . . . . . . . 26
9.5. WG version -03 . . . . . . . . . . . . . . . . . . . . . 26
9.6. WG version -02 . . . . . . . . . . . . . . . . . . . . . 26
9.7. WG version -01 . . . . . . . . . . . . . . . . . . . . . 27
9.8. Version -04 . . . . . . . . . . . . . . . . . . . . . . . 27
9.9. Version -03 . . . . . . . . . . . . . . . . . . . . . . . 27
10. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 27
10.1. YANG Module Registrations . . . . . . . . . . . . . . . 27
11. Security Considerations . . . . . . . . . . . . . . . . . . . 28
11.1. ietf-if-vlan-encapsulation.yang . . . . . . . . . . . . 29
11.2. ietf-if-flexible-encapsulation.yang . . . . . . . . . . 29
12. References . . . . . . . . . . . . . . . . . . . . . . . . . 31
12.1. Normative References . . . . . . . . . . . . . . . . . . 31
12.2. Informative References . . . . . . . . . . . . . . . . . 32
Wilton & Mansfield Expires 29 July 2023 [Page 2]
Internet-Draft Sub-interface VLAN YANG January 2023
Appendix A. Comparison with the IEEE 802.1Q Configuration
Model . . . . . . . . . . . . . . . . . . . . . . . . . . 33
A.1. Sub-interface based configuration model overview . . . . 33
A.2. IEEE 802.1Q Bridge Configuration Model Overview . . . . . 34
A.3. Possible Overlap Between the Two Models . . . . . . . . . 34
Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 35
1. Introduction
This document defines two YANG [RFC7950] modules that augment the
encapsulation choice YANG element defined in Interface Extensions
YANG [I-D.ietf-netmod-intf-ext-yang] and the generic interfaces data
model defined in [RFC8343]. The two modules provide configuration
nodes to support classification of Ethernet/VLAN traffic to sub-
interfaces, that can have interface based feature and service
configuration applied to them.
The purpose of these models is to allow IETF defined forwarding
protocols, for example, IPv6 [RFC2460], Ethernet Pseudo Wires
[RFC4448] and VPLS [RFC4761] [RFC4762], when configured via
appropriate YANG data models [RFC8344] [I-D.ietf-bess-l2vpn-yang], to
interoperate with VLAN tagged traffic received from an IEEE 802.1Q
compliant bridge.
In the case of layer 2 Ethernet services, the flexible encapsulation
module also supports flexible rewriting of the VLAN tags contained in
the frame header.
For reference, a comparison between the sub-interface based YANG
model documented in this draft and an IEEE 802.1Q bridge model is
described in Appendix A.
In summary, the YANG modules defined in this internet draft are:
ietf-if-vlan-encapsulation.yang - Defines the model for basic
classification of VLAN tagged traffic, normally to L3 packet
forwarding services
ietf-if-flexible-encapsulation.yang - Defines the model for
flexible classification of Ethernet/VLAN traffic, normally to L2
frame forwarding services
Wilton & Mansfield Expires 29 July 2023 [Page 3]
Internet-Draft Sub-interface VLAN YANG January 2023
1.1. Terminology
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 [RFC2119] RFC 8174 [RFC8174] when, and only when, they
appear in all capitals, as shown here.
The term 'sub-interface' is defined in section 2.6 of Interface
Extensions YANG [I-D.ietf-netmod-intf-ext-yang].
1.2. Tree Diagrams
Tree diagrams used in this document follow the notation defined in
[RFC8340].
2. Objectives
The primary aim of the YANG modules contained in this draft is to
provide the core model that is required to implement VLAN transport
services on router based devices that is fully compatible with IEEE
802.1Q compliant bridges.
A secondary aim is for the modules to be structured in such a way
that they can be cleanly extended in future.
2.1. Interoperability with IEEE 802.1Q compliant bridges
The modules defined in this document are designed to fully
interoperate with IEEE 802.1Q compliant bridges. In particular, the
models are restricted to only matching, adding, or rewriting the
802.1Q VLAN tags in frames in ways that are compatible with IEEE
802.1Q compliant bridges.
3. Interface VLAN Encapsulation Model
The Interface VLAN encapsulation model provides appropriate leaves
for termination of an 802.1Q VLAN tagged segment to a sub-interface
(or interface) based L3 service, such as IP. It allows for
termination of traffic with one or two 802.1Q VLAN tags.
The L3 service must be configured via a separate YANG data model,
e.g., [RFC8344]. A short example of configuring 802.1Q VLAN sub-
interfaces with IP using YANG is provided in Section 7.1.
The "ietf-if-vlan-encapsulation" YANG module has the following
structure:
Wilton & Mansfield Expires 29 July 2023 [Page 4]
Internet-Draft Sub-interface VLAN YANG January 2023
module: ietf-if-vlan-encapsulation
augment /if:interfaces/if:interface/if-ext:encapsulation
/if-ext:encaps-type:
+--:(dot1q-vlan)
+--rw dot1q-vlan
+--rw outer-tag
| +--rw tag-type dot1q-tag-type
| +--rw vlan-id vlanid
+--rw second-tag!
+--rw tag-type dot1q-tag-type
+--rw vlan-id vlanid
4. Interface Flexible Encapsulation Model
The Interface Flexible Encapsulation model is designed to allow for
the flexible provisioning of layer 2 services. It provides the
capability to classify and demultiplex Ethernet/VLAN frames received
on an Ethernet trunk interface to sub-interfaces based on the fields
available in the layer 2 headers. Once classified to sub-interfaces,
it provides the capability to selectively modify fields within the
layer 2 frame header before the frame is handed off to the
appropriate forwarding code for further handling. The forwarding
instance, e.g., L2VPN, VPLS, etc., is configured using a separate
YANG configuration model defined elsewhere, e.g.,
[I-D.ietf-bess-l2vpn-yang].
The model supports a common core set of layer 2 header matches based
on the 802.1Q tag type and VLAN Ids contained within the header up to
a tag stack depth of two tags.
The model supports flexible rewrites of the layer 2 frame header for
data frames as they are processed on the interface. It defines a set
of standard tag manipulations that allow for the insertion, removal,
or rewrite of one or two 802.1Q VLAN tags. The expectation is that
manipulations are generally implemented in a symmetrical fashion,
i.e. if a manipulation is performed on ingress traffic on an
interface then the reverse manipulation is always performed on egress
traffic out of the same interface. However, the model also allows
for asymmetrical rewrites, which may be required to implement some
forwarding models (such as E-Tree).
The model also allows a flexible encapsulation and rewrite to be
configured directly on an Ethernet or LAG interface without
configuring separate child sub-interfaces. Ingress frames that do
not match the encapsulation are dropped. Egress frames MUST conform
to the encapsulation.
Wilton & Mansfield Expires 29 July 2023 [Page 5]
Internet-Draft Sub-interface VLAN YANG January 2023
The final aim for the model design is for it to be cleanly extensible
to add in additional match and rewrite criteria of the layer 2
header, such as matching on the source or destination MAC address,
PCP or DEI fields in the 802.1Q tags, or the EtherType of the frame
payload. Rewrites can also be extended to allow for modification of
other fields within the layer 2 frame header.
A short example of configuring 802.1Q VLAN sub-interfaces with L2VPN
using YANG is provided in Section 7.2.
The "ietf-if-flexible-encapsulation" YANG module has the following
structure:
module: ietf-if-flexible-encapsulation
augment /if:interfaces/if:interface/if-ext:encapsulation
/if-ext:encaps-type:
+--:(flexible)
+--rw flexible
+--rw match
| +--rw (match-type)
| +--:(default)
| | +--rw default? empty
| +--:(untagged)
| | +--rw untagged? empty
| +--:(dot1q-priority-tagged)
| | +--rw dot1q-priority-tagged
| | +--rw tag-type dot1q-types:dot1q-tag-type
| +--:(dot1q-vlan-tagged)
| +--rw dot1q-vlan-tagged
| +--rw outer-tag
| | +--rw tag-type dot1q-tag-type
| | +--rw vlan-id union
| +--rw second-tag!
| | +--rw tag-type dot1q-tag-type
| | +--rw vlan-id union
| +--rw match-exact-tags? empty
+--rw rewrite {flexible-rewrites}?
| +--rw (direction)?
| +--:(symmetrical)
| | +--rw symmetrical
| | +--rw dot1q-tag-rewrite {dot1q-tag-rewrites}?
| | +--rw pop-tags? uint8
| | +--rw push-tags!
| | +--rw outer-tag
| | | +--rw tag-type dot1q-tag-type
| | | +--rw vlan-id vlanid
| | +--rw second-tag!
Wilton & Mansfield Expires 29 July 2023 [Page 6]
Internet-Draft Sub-interface VLAN YANG January 2023
| | +--rw tag-type dot1q-tag-type
| | +--rw vlan-id vlanid
| +--:(asymmetrical) {asymmetric-rewrites}?
| +--rw ingress
| | +--rw dot1q-tag-rewrite {dot1q-tag-rewrites}?
| | +--rw pop-tags? uint8
| | +--rw push-tags!
| | +--rw outer-tag
| | | +--rw tag-type dot1q-tag-type
| | | +--rw vlan-id vlanid
| | +--rw second-tag!
| | +--rw tag-type dot1q-tag-type
| | +--rw vlan-id vlanid
| +--rw egress
| +--rw dot1q-tag-rewrite {dot1q-tag-rewrites}?
| +--rw pop-tags? uint8
| +--rw push-tags!
| +--rw outer-tag
| | +--rw tag-type dot1q-tag-type
| | +--rw vlan-id vlanid
| +--rw second-tag!
| +--rw tag-type dot1q-tag-type
| +--rw vlan-id vlanid
+--rw local-traffic-default-encaps!
+--rw outer-tag
| +--rw tag-type dot1q-tag-type
| +--rw vlan-id vlanid
+--rw second-tag!
+--rw tag-type dot1q-tag-type
+--rw vlan-id vlanid
5. VLAN Encapsulation YANG Module
This YANG module augments the 'encapsulation' container defined in
ietf-if-extensions.yang [I-D.ietf-netmod-intf-ext-yang]. It also
contains references to [RFC8343], [RFC7224], and [IEEE802.1Qcp-2018].
<CODE BEGINS> file "[email protected]"
module ietf-if-vlan-encapsulation {
yang-version 1.1;
namespace "urn:ietf:params:xml:ns:yang:ietf-if-vlan-encapsulation";
prefix if-vlan;
import ietf-interfaces {
prefix if;
reference
"RFC 8343: A YANG Data Model For Interface Management";
Wilton & Mansfield Expires 29 July 2023 [Page 7]
Internet-Draft Sub-interface VLAN YANG January 2023
}
import iana-if-type {
prefix ianaift;
reference
"RFC 7224: IANA Interface Type YANG Module";
}
import ieee802-dot1q-types {
prefix dot1q-types;
reference
"IEEE Std 802.1Qcp-2018: IEEE Standard for Local and
metropolitan area networks -- Bridges and Bridged Networks --
Amendment 30: YANG Data Model";
}
import ietf-if-extensions {
prefix if-ext;
reference
"RFC XXXX: Common Interface Extension YANG Data Models";
}
organization
"IETF NETMOD (NETCONF Data Modeling Language) Working Group";
contact
"WG Web: <http://tools.ietf.org/wg/netmod/>
WG List: <mailto:[email protected]>
Editor: Robert Wilton
<mailto:[email protected]>";
description
"This YANG module models configuration to classify IEEE 802.1Q
VLAN tagged Ethernet traffic by exactly matching the tag type
and VLAN identifier of one or two 802.1Q VLAN tags in the frame.
Copyright (c) 2022 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
Wilton & Mansfield Expires 29 July 2023 [Page 8]
Internet-Draft Sub-interface VLAN YANG January 2023
(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.";
revision 2022-12-14 {
description
"Latest draft revision";
reference
"RFC XXXX: Sub-interface VLAN YANG Data Models";
}
augment "/if:interfaces/if:interface/if-ext:encapsulation/"
+ "if-ext:encaps-type" {
when "derived-from-or-self(../if:type,
'ianaift:ethernetCsmacd') or
derived-from-or-self(../if:type,
'ianaift:ieee8023adLag') or
derived-from-or-self(../if:type, 'ianaift:l2vlan') or
derived-from-or-self(../if:type,
'if-ext:ethSubInterface')" {
description
"Applies only to Ethernet-like interfaces and
sub-interfaces.";
}
description
"Augment the generic interface encapsulation with basic 802.1Q
VLAN tag classifications";
case dot1q-vlan {
container dot1q-vlan {
description
"Classifies 802.1Q VLAN tagged Ethernet frames to a
sub-interface (or interface) by exactly matching the
number of tags, tag type(s) and VLAN identifier(s).
Only frames matching the classification configured on a
sub-interface/interface are processed on that
sub-interface/interface.
Frames that do not match any sub-interface are processed
directly on the parent interface, if it is associated with
Wilton & Mansfield Expires 29 July 2023 [Page 9]
Internet-Draft Sub-interface VLAN YANG January 2023
a forwarding instance, otherwise they are dropped.";
container outer-tag {
must 'tag-type = "dot1q-types:s-vlan" or '
+ 'tag-type = "dot1q-types:c-vlan"' {
error-message
"Only C-VLAN and S-VLAN tags can be matched.";
description
"For IEEE 802.1Q interoperability, only C-VLAN and
S-VLAN tags are matched.";
}
description
"Specifies the VLAN tag values to match against the
outermost (first) 802.1Q VLAN tag in the frame.";
uses dot1q-types:dot1q-tag-classifier-grouping;
}
container second-tag {
must '../outer-tag/tag-type = "dot1q-types:s-vlan" and '
+ 'tag-type = "dot1q-types:c-vlan"' {
error-message
"When matching two 802.1Q VLAN tags, the outermost
(first) tag in the frame MUST be specified and be of
S-VLAN type and the second tag in the frame must be of
C-VLAN tag type.";
description
"For IEEE 802.1Q interoperability, when matching two
802.1Q VLAN tags, it is REQUIRED that the outermost
tag exists and is an S-VLAN, and the second tag is a
C-VLAN.";
}
presence "Classify frames that have two 802.1Q VLAN tags.";
description
"Specifies the VLAN tag values to match against the
second outermost 802.1Q VLAN tag in the frame.";
uses dot1q-types:dot1q-tag-classifier-grouping;
}
}
}
Wilton & Mansfield Expires 29 July 2023 [Page 10]
Internet-Draft Sub-interface VLAN YANG January 2023
}
}
<CODE ENDS>
6. Flexible Encapsulation YANG Module
This YANG module augments the 'encapsulation' container defined in
ietf-if-extensions.yang [I-D.ietf-netmod-intf-ext-yang]. This YANG
module also augments the 'interface' list entry defined in [RFC8343].
It also contains references to [RFC7224], and [IEEE802.1Qcp-2018].
<CODE BEGINS> file "[email protected]"
module ietf-if-flexible-encapsulation {
yang-version 1.1;
namespace
"urn:ietf:params:xml:ns:yang:ietf-if-flexible-encapsulation";
prefix if-flex;
import ietf-interfaces {
prefix if;
reference
"RFC 8343: A YANG Data Model For Interface Management";
}
import iana-if-type {
prefix ianaift;
reference
"RFC 7224: IANA Interface Type YANG Module";
}
import ieee802-dot1q-types {
prefix dot1q-types;
reference
"IEEE Std 802.1Qcp-2018: IEEE Standard for Local and
metropolitan area networks -- Bridges and Bridged Networks --
Amendment 30: YANG Data Model";
}
import ietf-if-extensions {
prefix if-ext;
reference
"RFC XXXX: Common Interface Extension YANG Data Models";
}
organization
"IETF NETMOD (NETCONF Data Modeling Language) Working Group";
contact
Wilton & Mansfield Expires 29 July 2023 [Page 11]
Internet-Draft Sub-interface VLAN YANG January 2023
"WG Web: <http://tools.ietf.org/wg/netmod/>
WG List: <mailto:[email protected]>
Editor: Robert Wilton
<mailto:[email protected]>";
description
"This YANG module describes interface configuration for flexible
classification and rewrites of IEEE 802.1Q VLAN tagged Ethernet
traffic.
Copyright (c) 2022 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.";
revision 2022-12-14 {
description
"Latest draft revision";
reference
"RFC XXXX: Sub-interface VLAN YANG Data Models";
}
feature flexible-rewrites {
description
"This feature indicates that the network element supports
specifying flexible rewrite operations.";
}
feature asymmetric-rewrites {
description
"This feature indicates that the network element supports
specifying different rewrite operations for the ingress
Wilton & Mansfield Expires 29 July 2023 [Page 12]
Internet-Draft Sub-interface VLAN YANG January 2023
rewrite operation and egress rewrite operation.";
}
feature dot1q-tag-rewrites {
description
"This feature indicates that the network element supports the
flexible rewrite functionality specifying 802.1Q tag
rewrites.";
}
grouping flexible-match {
description
"Represents a flexible frame classification:
The rules for a flexible match are:
1. Match-type: default, untagged, priority tag, or tag
stack.
2. Each tag in the stack of tags matches:
a. tag type (802.1Q or 802.1ad) +
b. tag value:
i. single tag
ii. set of tag ranges/values.
iii. 'any' keyword";
choice match-type {
mandatory true;
description
"Provides a choice of how the frames may be
matched";
case default {
description
"Default match";
leaf default {
type empty;
description
"Default match. Matches all traffic not matched to any
other peer sub-interface by a more specific
encapsulation.";
}
}
case untagged {
description
"Match untagged Ethernet frames only";
Wilton & Mansfield Expires 29 July 2023 [Page 13]
Internet-Draft Sub-interface VLAN YANG January 2023
leaf untagged {
type empty;
description
"Untagged match. Matches all untagged traffic.";
}
}
case dot1q-priority-tagged {
description
"Match 802.1Q priority tagged Ethernet frames only";
container dot1q-priority-tagged {
description
"802.1Q priority tag match";
leaf tag-type {
type dot1q-types:dot1q-tag-type;
mandatory true;
description
"The 802.1Q tag type of matched priority
tagged packets";
}
}
}
case dot1q-vlan-tagged {
container dot1q-vlan-tagged {
description
"Matches VLAN tagged frames";
container outer-tag {
must 'tag-type = "dot1q-types:s-vlan" or '
+ 'tag-type = "dot1q-types:c-vlan"' {
error-message
"Only C-VLAN and S-VLAN tags can be matched.";
description
"For IEEE 802.1Q interoperability, only C-VLAN and
S-VLAN tags can be matched.";
}
description
"Classifies traffic using the outermost (first) VLAN
tag on the frame.";
Wilton & Mansfield Expires 29 July 2023 [Page 14]
Internet-Draft Sub-interface VLAN YANG January 2023
uses "dot1q-types:"
+ "dot1q-tag-ranges-or-any-classifier-grouping";
}
container second-tag {
must
'../outer-tag/tag-type = "dot1q-types:s-vlan" and '
+ 'tag-type = "dot1q-types:c-vlan"' {
error-message
"When matching two tags, the outermost (first) tag
must be specified and of S-VLAN type and the second
outermost tag must be of C-VLAN tag type.";
description
"For IEEE 802.1Q interoperability, when matching two
tags, it is required that the outermost (first) tag
exists and is an S-VLAN, and the second outermost
tag is a C-VLAN.";
}
presence "Also classify on the second VLAN tag.";
description
"Classifies traffic using the second outermost VLAN tag
on the frame.";
uses "dot1q-types:"
+ "dot1q-tag-ranges-or-any-classifier-grouping";
}
leaf match-exact-tags {
type empty;
description
"If set, indicates that all 802.1Q VLAN tags in the
Ethernet frame header must be explicitly matched, i.e.
the EtherType following the matched tags must not be a
802.1Q tag EtherType. If unset then extra 802.1Q VLAN
tags are allowed.";
}
}
}
}
}
grouping dot1q-tag-rewrite {
description
"Flexible rewrite grouping. Can be either be expressed
Wilton & Mansfield Expires 29 July 2023 [Page 15]
Internet-Draft Sub-interface VLAN YANG January 2023
symmetrically, or independently in the ingress and/or egress
directions.";
leaf pop-tags {
type uint8 {
range "1..2";
}
description
"The number of 802.1Q VLAN tags to pop, or translate if used
in conjunction with push-tags.
Popped tags are the outermost tags on the frame.";
}
container push-tags {
presence "802.1Q tags are pushed or translated";
description
"The 802.1Q tags to push on the front of the frame, or
translate if configured in conjunction with pop-tags.";
container outer-tag {
must 'tag-type = "dot1q-types:s-vlan" or '
+ 'tag-type = "dot1q-types:c-vlan"' {
error-message "Only C-VLAN and S-VLAN tags can be pushed.";
description
"For IEEE 802.1Q interoperability, only C-VLAN and S-VLAN
tags can be pushed.";
}
description
"The outermost (first) VLAN tag to push onto the frame.";
uses dot1q-types:dot1q-tag-classifier-grouping;
}
container second-tag {
must '../outer-tag/tag-type = "dot1q-types:s-vlan" and '
+ 'tag-type = "dot1q-types:c-vlan"' {
error-message
"When pushing/rewriting two tags, the outermost tag must
be specified and of S-VLAN type and the second outermost
tag must be of C-VLAN tag type.";
Wilton & Mansfield Expires 29 July 2023 [Page 16]
Internet-Draft Sub-interface VLAN YANG January 2023
description
"For IEEE 802.1Q interoperability, when pushing two tags,
it is required that the outermost tag exists and is an
S-VLAN, and the second outermost tag is a C-VLAN.";
}
presence
"In addition to the first tag, also push/rewrite a second
VLAN tag.";
description
"The second outermost VLAN tag to push onto the frame.";
uses dot1q-types:dot1q-tag-classifier-grouping;
}
}
}
grouping flexible-rewrite {
description
"Grouping for flexible rewrites of fields in the L2 header.
Restricted to flexible 802.1Q VLAN tag rewrites, but could be
extended to cover rewrites of other fields in the L2 header in
future.";
container dot1q-tag-rewrite {
if-feature "dot1q-tag-rewrites";
description
"802.1Q VLAN tag rewrite.
Translate operations are expressed as a combination of tag
push and pop operations. E.g., translating the outer tag is
expressed as popping a single tag, and pushing a single tag.
802.1Q tags that are translated SHOULD preserve the PCP and
DEI fields unless if a different QoS behavior has been
specified.";
uses dot1q-tag-rewrite;
}
}
augment "/if:interfaces/if:interface/if-ext:encapsulation/"
+ "if-ext:encaps-type" {
when "derived-from-or-self(../if:type,
'ianaift:ethernetCsmacd') or
derived-from-or-self(../if:type,
'ianaift:ieee8023adLag') or
Wilton & Mansfield Expires 29 July 2023 [Page 17]
Internet-Draft Sub-interface VLAN YANG January 2023
derived-from-or-self(../if:type, 'ianaift:l2vlan') or
derived-from-or-self(../if:type,
'if-ext:ethSubInterface')" {
description
"Applies only to Ethernet-like interfaces and
sub-interfaces.";
}
description
"Augment the generic interface encapsulation with flexible
match and rewrite for VLAN sub-interfaces.";
case flexible {
description
"Flexible encapsulation and rewrite";
container flexible {
description
"Flexible encapsulation allows for the matching of ranges
and sets of 802.1Q VLAN Tags and performing rewrite
operations on the VLAN tags.
The structure is also designed to be extended to allow for
matching/rewriting other fields within the L2 frame header
if required.";
container match {
description
"Flexibly classifies Ethernet frames to a sub-interface
(or interface) based on the L2 header fields.
Only frames matching the classification configured on a
sub-interface/interface are processed on that
sub-interface/interface.
Frames that do not match any sub-interface are processed
directly on the parent interface, if it is associated
with a forwarding instance, otherwise they are dropped.
If a frame could be classified to multiple
sub-interfaces then they get classified to the
sub-interface with the most specific match. E.g.,
matching two VLAN tags in the frame is more specific