This module contains a collection of YANG definitions for supporting the Broadband Forum requirements on the management of sub-i...
Version: 2022-03-01
module bbf-sub-interface-tagging { yang-version 1.1; namespace "urn:bbf:yang:bbf-sub-interface-tagging"; prefix bbf-subif-tag; import ietf-interfaces { prefix if; } import bbf-dot1q-types { prefix bbf-dot1qt; } import bbf-if-type { prefix bbfift; } import bbf-sub-interfaces { prefix bbf-subif; } import bbf-frame-classification { prefix bbf-classif; } organization "Broadband Forum <https://www.broadband-forum.org> Common YANG Work Area"; contact "Comments or questions about this Broadband Forum YANG module should be directed to <mailto:help@broadband-forum.org>. Editor: Nick Hancock, ADTRAN Editor: Ludwig Pauwels, Nokia PS Leader: Joey Boyd, ADTRAN WA Director: Joey Boyd, ADTRAN WA Director: Sven Ooghe, Nokia"; description "This module contains a collection of YANG definitions for supporting the Broadband Forum requirements on the management of sub-interfaces as applicable to access network equipment. As such, this module is specific to access network equipment (e.g., BBF-specified Access Nodes and FTTdp DPUs). Specifically, this module augments the frame processing configuration of a (sub-)interface with additional criteria and adds VLAN-specific ingress and egress rewrite actions. Copyright (c) 2017-2022, Broadband Forum Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. The above license is used as a license under copyright only. Please reference the Forum IPR Policy for patent licensing terms <https://www.broadband-forum.org/ipr-policy>. Any moral rights which are necessary to exercise under the above license grant are also deemed granted under this license. This version of this YANG module is part of TR-383a5; see the TR itself for full legal notices."; revision "2022-03-01" { description "Amendment 5. * Approval Date: 2022-03-01. * Publication Date: 2022-03-01."; reference "TR-383a5: Common YANG Modules <https://www.broadband-forum.org/technical/download/ TR-383_Amendment-5.pdf>"; } revision "2021-06-02" { description "Amendment 4. * Approval Date: 2021-06-02. * Publication Date: 2021-06-02."; reference "TR-383a4: Common YANG Modules <https://www.broadband-forum.org/technical/download/ TR-383_Amendment-4.pdf>"; } revision "2020-10-13" { description "Amendment 3. * Approval Date: 2020-10-13. * Publication Date: 2020-10-13."; reference "TR-383a3: Common YANG Modules <https://www.broadband-forum.org/technical/download/ TR-383_Amendment-3.pdf>"; } revision "2018-07-13" { description "Amendment 1. * Approval Date: 2018-06-04. * Publication Date: see revision date above."; reference "TR-383: Common YANG Modules <https://www.broadband-forum.org/technical/download/ TR-383_Amendment-1.pdf>"; } revision "2017-05-08" { description "Initial revision. * Approval Date: see revision date above. * Publication Date: 2017-06-02."; reference "TR-383: Common YANG Modules <https://www.broadband-forum.org/technical/download/ TR-383.pdf>"; } feature copy-vlan-id-from-tag-index { description "Indicates support for copying the VLAN ID from a specified tag index."; } feature write-pbit-value-in-vlan-tag { description "Indicates support for writing a configurable p-bits value into a VLAN tag."; } feature exclude-criteria { description "This feature indicates whether the network element supports the exclude criteria for matching frames into a sub-interface."; } feature dscp-match-criteria { description "Indicates support for the use of DSCP values as match criteria."; } grouping pbit-marking { description "The Priority bits (3 bits) of a VLAN tag (p-bits). These p-bits are in the VLAN tag next to the Drop Eligible Inidicator (DEI) bit (1 bit) and the VLAN ID (12 bits)."; choice pbit { mandatory true; description "Defines how to write the p-bits."; case write-pbit-0 { description "Tagged and priority-tagged frames contain p-bits. Untagged frames do not contain p-bits. Write-pbit-0 provides a simple method to identify what p-bits MUST be inserted in the output frame that can be applied to all frame types. More advanced methods can be provided via other pbit-action cases."; leaf write-pbit-0 { type empty; description "Push p-bits=000 in the tag."; } } // case write-pbit-0 case copy-pbit-from-input-or-0 { description "Copy from the specified input tag, or write p-bits=000 if the input tag does not exist."; leaf pbit-from-tag-index { type bbf-classif:tag-index; description "Specifies from which tag the p-bits MUST be copied."; } } // case copy-pbit-from-input-or-0 case write-pbit-value { if-feature bbf-subif-tag:write-pbit-value-in-vlan-tag; description "Write a p-bits value into the tag."; leaf write-pbit { type bbf-dot1qt:pbit; description "Specified p-bits value to write into the tag."; } } // case write-pbit-value } // choice pbit } // grouping pbit-marking grouping dei-marking { description "The DEI bit (1 bit) of a VLAN tag. This bit is in the VLAN tag next to the p-bits (3 bits) and the VLAN ID (12 bits)."; choice dei { mandatory true; description "Defines how to write the DEI bit."; case write-dei-0 { description "Tagged and priority-tagged frames contain a DEI bit. Untagged frames do not contain a DEI bit. Write-dei-0 provides a simple method to identify what DEI MUST be inserted in the output frame that can be applied to all frame types. More advanced methods can be provided via other dei-action cases."; leaf write-dei-0 { type empty; description "Push DEI=0 in the tag."; } } // case write-dei-0 case copy-dei-from-input-or-0 { description "Copy DEI from the specified input tag, or write DEI=0 if the input tag does not exist."; leaf dei-from-tag-index { type bbf-classif:tag-index; description "Specifies from which tag the DEI bit MUST be copied."; } } // case copy-dei-from-input-or-0 case write-dei-1 { description "Tagged and priority-tagged frames contain a DEI bit. Untagged frames do not contain a DEI bit. Write-dei-1 provides a simple method to identify what DEI MUST be inserted in the output frame that can be applied to all frame types. More advanced methods can be provided via other dei-action cases."; leaf write-dei-1 { type empty; description "Push DEI=1 in the tag."; } } // case write-dei-1 } // choice dei } // grouping dei-marking grouping dot1q-tag { description "Grouping to allow configuration to identify a single 802.1Q VLAN tag."; container dot1q-tag { description "Identifies an 802.1Q VLAN tag with an explicit tag-type and a single VLAN ID."; leaf tag-type { type union { type bbf-dot1qt:dot1q-tag-type; type bbf-dot1qt:ether-type; type bbf-dot1qt:ether-type-hex; } mandatory true; description "VLAN tag type."; } leaf vlan-id { type union { type bbf-dot1qt:vlan-id-or-0; type enumeration { enum "vlan-id-from-tag-index" { value 0; description "The VLAN ID is derived from one of the ingress tags as specified by 'vlan-id-from-tag-index'."; } } } mandatory true; description "The VLAN ID, the value 0 (priority-tagged) or configure to derive from an existing tag."; } leaf vlan-id-from-tag-index-or-discard { when "../vlan-id = 'vlan-id-from-tag-index'" { description "Only applicable when the 'vlan-id' is configured to be derived from a tag index."; } if-feature bbf-subif-tag:copy-vlan-id-from-tag-index; type bbf-classif:tag-index; mandatory true; description "Specifies from which tag the VLAN ID is be copied. If the specified input tag does not exist, the frame is discarded."; } uses pbit-marking; uses dei-marking; } // container dot1q-tag } // grouping dot1q-tag grouping flexible-rewrite { description "Tag manipulation actions."; leaf pop-tags { type uint8 { range "0..2"; } default "0"; description "The number of tags to pop (or translate if used in conjunction with push-tags)."; } list push-tag { key "index"; max-elements 2; description "The number of tags to push (or translate if used in conjunction with pop-tags)."; leaf index { type bbf-classif:tag-index; must '(count(../../push-tag[index = 0]) > 0)' { error-message "An inner tag can only be pushed if an outer tag is also " + "specified."; description "Only allow a push of an inner tag if an outer tag is also being pushed."; } description "The index into the tag stack."; } uses dot1q-tag; } // list push-tag } // grouping flexible-rewrite augment /if:interfaces/if:interface/bbf-subif:frame-processing/bbf-subif:inline-frame-processing/bbf-subif:inline-frame-processing/bbf-subif:ingress-rule/bbf-subif:rule/bbf-subif:flexible-match { when "derived-from-or-self(../../../../if:type," + "'bbfift:vlan-sub-interface')" { description "Augments the general flexible-match container with specific VLAN match criteria."; } description "Augments the general flexible-match container with specific VLAN match criteria."; container match-criteria { description "This container collects match criteria for various frame fields. The match criteria are unambiguously in case a frame field is unique. This is not the case for the match criteria defined via leaf ethernet-frame-type included via the uses ethertype-match. The value provided by the leaf inside this grouping is to be compared with the first Ethertype of an untagged Ethernet frame; or for frames that contain one or more VLAN tags it is the value to be compared with the Ethertype that is the first after the VLAN tags for which a matching criteria is specified via the leafs of the grouping multiple-vlan-tag-match. For example, if matching criteria are specified for one outer VLAN tag, and a received IPoE frame is single tagged, then the ethernet-frame-type refers to the Ethertype 0x0800 being the Ethertype that identifies the frame as IPoE. While the same YANG configuration applied to a received IPoE frame that is double tagged, then the ethernet-frame-type refers to the Ethertype 0x8100 being the Ethertype that identifies the frame contains an inner VLAN tag."; uses bbf-classif:frame-destination-match; uses bbf-classif:multiple-vlan-tag-match; uses bbf-classif:ethertype-match; uses bbf-classif:protocol-match; uses bbf-classif:dscp-match; } // container match-criteria container exclude-criteria { if-feature exclude-criteria; description "Exclude criteria extend the match criteria defined within the container 'flexible-match'. I.e. a frame matches in the sub-interface if it matches the criteria defined in 'flexible-match' container AND if it does not match the criteria defined in the 'exclude-criteria' container. A non-existing exclude-criteria container means it does not provide additional criteria and all frames match that part of the classification."; uses bbf-classif:frame-destination-match-specific; uses bbf-classif:ethertype-match-no-default; uses bbf-classif:protocol-match-specific; uses bbf-classif:dscp-match-specific; } // container exclude-criteria } augment /if:interfaces/if:interface/bbf-subif:frame-processing/bbf-subif:inline-frame-processing/bbf-subif:inline-frame-processing/bbf-subif:ingress-rule/bbf-subif:rule/bbf-subif:flexible-match/match-criteria/vlan-tag-match-type/vlan-tagged/tag { when "derived-from-or-self(../../../../../../if:type," + "'bbfift:vlan-sub-interface')" { description "Defines match criteria for all the fields of VLAN tags, being the TPID, the VLAN ID, the p-bits, and the DEI bit."; } description "Defines match criteria for all the fields of VLAN tags, being the TPID, the VLAN ID, the p-bits, and the DEI bit."; uses bbf-classif:dot1q-tag-ranges-or-any; } augment /if:interfaces/if:interface/bbf-subif:frame-processing/bbf-subif:inline-frame-processing/bbf-subif:inline-frame-processing/bbf-subif:ingress-rule/bbf-subif:rule/bbf-subif:ingress-rewrite { when "derived-from-or-self(../../../../if:type," + "'bbfift:vlan-sub-interface')" { description "Augments the general ingress-rewrite container with specific VLAN rewrite actions."; } description "Augments the general ingress-rewrite container with specific VLAN rewrite actions."; uses flexible-rewrite; } augment /if:interfaces/if:interface/bbf-subif:frame-processing/bbf-subif:inline-frame-processing/bbf-subif:inline-frame-processing/bbf-subif:egress-rewrite { when "derived-from-or-self(../../if:type," + "'bbfift:vlan-sub-interface')" { description "Augments the general egress-rewrite container with specific VLAN rewrite actions."; } description "Augments the general egress-rewrite container with specific VLAN rewrite actions."; uses flexible-rewrite; } } // module bbf-sub-interface-tagging
© 2023 YumaWorks, Inc. All rights reserved.