blob: 85bf697a28e3c28ad58dbbb59fb615ebcedcb027 [file] [log] [blame]
Elia Battistona1333642022-07-27 12:17:24 +00001module bbf-l2-access-attributes {
2 yang-version 1.1;
3 namespace "urn:bbf:yang:bbf-l2-access-attributes";
4 prefix bbf-l2access-attr;
5
6 import bbf-dot1q-types {
7 prefix bbf-dot1qt;
8 }
9 import ietf-network {
10 prefix nw;
11 }
12 import ietf-network-topology {
13 prefix nt;
14 }
15
16 organization
17 "Broadband Forum <https://www.broadband-forum.org>
18 Common YANG Work Area";
19 contact
20 "Comments or questions about this Broadband Forum YANG module
21 should be directed to <mailto:help@broadband-forum.org>.
22
23 Editor: TBD
24
25 PS Leader: TBD
26
27 WA Director: TBD";
28 description
29 "This module contains a collection of YANG definitions for
30 simplifying the Access Device Model as exposed over NBI of BAA.
31
32 Copyright (c) 2022, Broadband Forum
33
34 Redistribution and use in source and binary forms, with or
35 without modification, are permitted provided that the following
36 conditions are met:
37
38 1. Redistributions of source code must retain the above copyright
39 notice, this list of conditions and the following disclaimer.
40
41 2. Redistributions in binary form must reproduce the above
42 copyright notice, this list of conditions and the following
43 disclaimer in the documentation and/or other materials
44 provided with the distribution.
45
46 3. Neither the name of the copyright holder nor the names of its
47 contributors may be used to endorse or promote products
48 derived from this software without specific prior written
49 permission.
50
51 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
52 CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES,
53 INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
54 MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
55 DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
56 CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
57 SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
58 NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
59 LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
60 CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
61 STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
62 ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
63 ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
64
65 The above license is used as a license under copyright only.
66 Please reference the Forum IPR Policy for patent licensing terms
67 <https://www.broadband-forum.org/ipr-policy>.
68
69 Any moral rights which are necessary to exercise under the above
70 license grant are also deemed granted under this license.
71
72 This version of this YANG module is part of TR-383a4; see
73 the TR itself for full legal notices.";
74
75 revision 2021-09-30 {
76 description
77 "Initial revision.";
78 reference
79 "RFC 8944: A YANG Data Model for Layer 2 Network Topologies";
80 }
81
82 grouping access-tag {
83 leaf tag-type {
84 type union {
85 type bbf-dot1qt:dot1q-tag-type;
86 type uint16;
87 type enumeration {
88 enum any {
89 description
90 "Matches any tag type.";
91 }
92 }
93 }
94 default "any";
95 description
96 "VLAN tag type.";
97 }
98 leaf vlan-id {
99 type union {
100 type bbf-dot1qt:vlan-id-range;
101 type enumeration {
102 enum any {
103 description
104 "Matches any VLAN-ID in the range 1 to 4094, or
105 matches priority tagged frames.";
106 }
107 enum priority-tagged {
108 description
109 "Priority-tagged frames are frames with a VLAN tag
110 present and that match VLAN-ID 0.";
111 }
112 enum vlan-id-is-a-parameter {
113 description
114 "The VLAN ID is not
115 specified inside this profile but has to be
116 specified at the place where this profile
117 is referenced.";
118 }
119 }
120 }
121 mandatory true;
122 description
123 "Allowed VLAN-IDs.";
124 }
125 leaf pbit {
126 type union {
127 type bbf-dot1qt:pbit-list;
128 type enumeration {
129 enum any {
130 description
131 "Matches any pbit value in the range of 0 to 7.";
132 }
133 }
134 }
135 description
136 "Allowed PBIT values.";
137 }
138 }
139
140 grouping access-vlan-tag-match {
141 description
142 "Flexible match on the VLAN tags of Ethernet frames.";
143 choice vlan-tag-match-type {
144 description
145 "Provides a choice of how the frames may be matched.";
146 case untagged {
147 leaf untagged {
148 type empty;
149 description
150 "Untagged match. Matches all untagged traffic.";
151 }
152 }
153 case vlan-tagged {
154 container outer-tag {
155 description
156 "Classifies traffic using the outermost VLAN tag on the
157 frame.";
158 uses access-tag;
159 }
160 container second-tag {
161 description
162 "Classifies traffic using the second outermost VLAN tag
163 on the frame.";
164 uses access-tag;
165 }
166 }
167 }
168 }
169
170 grouping access-vlan-tag-rewrite {
171 description
172 "Flexible match on the VLAN tags of Ethernet frames.";
173 leaf pop-tags {
174 type uint8 {
175 range "0..2";
176 }
177 description
178 "The number of tags to pop.";
179 }
180 container push-outer-tag {
181 description
182 "The outermost VLAN tag to push onto the frame.";
183 uses access-tag;
184 }
185 container push-second-tag {
186 description
187 "The second outermost VLAN tag to push onto the frame.";
188 uses access-tag;
189 }
190 }
191
192 grouping vlan-match-and-rewrite {
193 description
194 "Configuration of frame vlan tag processing, include frame classification and vlan tag rewrite";
195 container match-criteria {
196 description
197 "This container collects match criteria for various frame fields.";
198 uses access-vlan-tag-match;
199 }
200 container ingress-rewrite {
201 description
202 "Ingress rewrite refers to the supported tag manipulations
203 before the frame is offered to a higher layer interface or
204 to a forwarder or to a destination termination-point.";
205 uses access-vlan-tag-rewrite;
206 }
207 }
208
209 grouping l2-access-attributes {
210 description
211 "Flexible match on the VLAN tags of Ethernet frames.";
212 container vlan-translation {
213 leaf translation-profile {
214 type leafref {
215 path
216 "/bbf-l2access-attr:vlan-translation-profiles/bbf-l2access-attr:"
217 + "vlan-translation-profile/bbf-l2access-attr:name";
218 }
219 description
220 "A reference to a vlan translation profile that contains
221 frame vlan classification and vlan tag rewrite.";
222 }
223 leaf outer-vlan-id {
224 when
225 '/bbf-l2access-attr:vlan-translation-profiles/'
226 + 'bbf-l2access-attr:vlan-translation-profile[bbf-l2access-attr:'
227 + 'name = current()/../../vlan-translation-profile]/'
228 + 'match-criteria/outer-tag/vlan-id = '
229 + '"vlan-id-is-a-parameter" ' {
230 description
231 "Match criteria for the outer VLAN tag of a frame that
232 overrules the match criteria provided through the
233 referenced vlan translaton profile.";
234 }
235 type bbf-dot1qt:vlan-id;
236 }
237 leaf second-vlan-id {
238 when
239 '/bbf-l2access-attr:vlan-translation-profiles/'
240 + 'bbf-l2access-attr:vlan-translation-profile[bbf-l2access-attr:'
241 + 'name = current()/../../vlan-translation-profile]/'
242 + 'match-criteria/second-tag/vlan-id = '
243 + '"vlan-id-is-a-parameter" ' {
244 description
245 "Match criteria for the second VLAN tag of a frame that
246 overrules the match criteria provided through the
247 referenced vlan translaton profile.";
248 }
249 type bbf-dot1qt:vlan-id;
250 }
251 leaf push-outer-vlan-id {
252 when
253 '/bbf-l2access-attr:vlan-translation-profiles/'
254 + 'bbf-l2access-attr:vlan-translation-profile[bbf-l2access-attr:'
255 + 'name = current()/../../vlan-translation-profile]/'
256 + 'ingress-rewrite/push-outer-tag/vlan-id = '
257 + '"vlan-id-is-a-parameter" ' {
258 description
259 "Indicates the VLAN ID of the pushed outer VLAN tag,
260 which overwrites the outer VLAN tag rewritten
261 by the referenced VLAN translation profile.";
262 }
263 type bbf-dot1qt:vlan-id;
264 }
265 leaf push-second-vlan-id {
266 when
267 '/bbf-l2access-attr:vlan-translation-profiles/'
268 + 'bbf-l2access-attr:vlan-translation-profile[bbf-l2access-attr:'
269 + 'name = current()/../../vlan-translation-profile]/'
270 + 'ingress-rewrite/push-second-tag/vlan-id = '
271 + '"vlan-id-is-a-parameter" ' {
272 description
273 "Indicates the VLAN ID of the pushed seconed VLAN tag,
274 which overwrites the seconed VLAN tag rewritten
275 by the referenced VLAN translation profile.";
276 }
277 type bbf-dot1qt:vlan-id;
278 }
279 }
280 }
281
282 container vlan-translation-profiles {
283 description
284 "Configuration of VLAN translation profiles.";
285 list vlan-translation-profile {
286 key "name";
287 description
288 "A translation profile defines the vlan match criteria and
289 vlan tag rewrite.";
290 leaf name {
291 type string;
292 description
293 "vlan translaton profile name.";
294 }
295 uses vlan-match-and-rewrite;
296 }
297 }
298 container vlan-forwarding-profiles {
299 description
300 "Configuration of VLAN forwarding profiles.";
301 list vlan-forwarding-profile {
302 key "name";
303 description
304 "A forwarding profile defines the network-side
305 forwarding of traffic in a forwarding VLAN.";
306 leaf name {
307 type string;
308 description
309 "vlan forwrding profile name.";
310 }
311 container forwarding-ports {
312 description
313 "Network-side forwarding ports in the forwarding profile.";
314 list port {
315 key "name";
316 leaf name {
317 type string;
318 description
319 "forwarding port name.";
320 }
321 leaf node-ref {
322 type leafref {
323 path "/nw:networks/nw:network/nw:node/nw:node-id";
324 require-instance false;
325 }
326 description
327 "This leaf references a network side node.";
328 }
329 leaf tp-ref {
330 type leafref {
331 path "/nw:networks/nw:network/"
332 + "nw:node/nt:termination-point/nt:tp-id";
333 require-instance false;
334 }
335 description
336 "This leaf references a network side termination point types.";
337 }
338 }
339 }
340 }
341 }
342}