netconfcentral logo

ietf-flexible-encapsulation

HTML

ietf-flexible-encapsulation@2019-11-04



  module ietf-flexible-encapsulation {

    yang-version 1.1;

    namespace
      "urn:ietf:params:xml:ns:yang:ietf-flexible-encapsulation";

    prefix flex;

    import ietf-interfaces {
      prefix if;
    }
    import iana-if-type {
      prefix ianaift;
    }
    import ietf-if-extensions {
      prefix if-ext;
    }
    import ieee802-dot1q-types {
      prefix dot1q-types;
    }

    organization
      "IETF NETMOD (NETCONF Data Modeling Language) Working Group";

    contact
      "WG Web:   <http://tools.ietf.org/wg/netmod/>
     WG List:  <mailto:netmod@ietf.org>

     Editor:   Robert Wilton
               <mailto:rwilton@cisco.com>";

    description
      "This YANG module describes interface configuration for flexible
     VLAN matches and rewrites.

     Copyright (c) 2019 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.";

    revision "2019-11-04" {
      description "Latest draft revision";
      reference
        "Internet-Draft draft-ietf-netmod-sub-intf-vlan-model-06";

    }


    feature flexible-rewrites {
      description
        "This feature indicates whether the network element supports
        specifying flexible rewrite operations";
    }

    feature asymmetric-rewrites {
      description
        "This feature indicates whether the network element supports
       specifying different rewrite operations for the ingress
       rewrite operation and egress rewrite operation.";
    }

    feature dot1q-tag-rewrites {
      description
        "This feature indicates whether the network element supports
       the flexible rewrite functionality specifying flexible 802.1Q
       tag rewrites";
    }

    grouping flexible-match {
      description "Flexible match";
      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 default

        case untagged {
          description
            "Match untagged Ethernet frames only";
          leaf untagged {
            type empty;
            description
              "Untagged match.  Matches all untagged traffic.";
          }
        }  // case untagged

        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";
            }
          }  // container dot1q-priority-tagged
        }  // case dot1q-priority-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 VLAN tag on the
               frame.";
            uses dot1q-types:dot1q-tag-ranges-or-any-classifier-grouping;
          }  // container outer-tag

          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 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 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;
          }  // container second-tag

          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.";
          }
        }  // container dot1q-vlan-tagged
      }  // choice match-type
    }  // grouping flexible-match

    grouping dot1q-tag-rewrite {
      description "Flexible rewrite";
      leaf pop-tags {
        type uint8 {
          range "1..2";
        }
        description
          "The number of tags to pop (or translate if used in
                   conjunction with push-tags)";
      }

      container push-tags {
        presence
          "802.1Q tags are pushed or translated";
        description
          "The 802.1Q tags to push (or translate if used 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 VLAN tag to push onto the frame.";
          uses dot1q-types:dot1q-tag-classifier-grouping;
        }  // container outer-tag

        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";
            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;
        }  // container second-tag
      }  // container push-tags
    }  // grouping dot1q-tag-rewrite

    grouping flexible-rewrite {
      description "Flexible rewrite";
      container dot1q-tag-rewrite {
        if-feature dot1q-tag-rewrites;
        description
          "Tag rewrite.  Translate operations are expressed
                   as a combination of tag push and pop operations.";
        uses dot1q-tag-rewrite;
      }  // container dot1q-tag-rewrite
    }  // grouping flexible-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
         derived-from-or-self(../if:type,
                              'if-ext:ethSubInterface')" {
        description
          "Applies only to Ethernet-like interfaces and
         sub-interfaces";
      }
      description
        "Add flexible match and rewrite for VLAN sub-interfaces";
      case flexible {
        description
          "Flexible encapsulation and rewrite";
        container flexible {
          description
            "Flexible encapsulation and rewrite";
          container match {
            description
              "The match used to classify frames to this interface";
            uses flexible-match;
          }  // container match

          container rewrite {
            if-feature flexible-rewrites;
            description
              "L2 frame rewrite operations";
            choice direction {
              description
                "Whether the rewrite policy is symmetrical or
               asymmetrical";
              container symmetrical {
                description
                  "Symmetrical rewrite.  Expressed in the ingress
                   direction, but the reverse operation is applied to
                   egress traffic";
                uses flexible-rewrite;
              }  // container symmetrical

              case asymmetrical {
                if-feature asymmetric-rewrites;
                description
                  "Asymmetrical rewrite";
                container ingress {
                  description
                    "Ingress rewrite";
                  uses flexible-rewrite;
                }  // container ingress

                container egress {
                  description
                    "Egress rewrite";
                  uses flexible-rewrite;
                }  // container egress
              }  // case asymmetrical
            }  // choice direction
          }  // container rewrite

          container local-traffic-default-encaps {
            presence
              "A local traffic default encapsulation has been
             specified";
            description
              "The 802.1Q VLAN tags to use by default for locally
             sourced traffic";
            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
                "The outermost VLAN tag for locally sourced traffic";
              uses dot1q-types:dot1q-tag-classifier-grouping;
            }  // container outer-tag

            container second-tag {
              must
                '../outer-tag/tag-type = "dot1q-types:s-vlan" and '
                  + 'tag-type = "dot1q-types:c-vlan"' {
                error-message
                  "When specifying 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";
                description
                  "For IEEE 802.1Q interoperability, when specifying 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
                "Indicates existence of a second outermost VLAN tag.";
              description
                "The second outermost VLAN tag for locally sourced
               traffic";
              uses dot1q-types:dot1q-tag-classifier-grouping;
            }  // container second-tag
          }  // container local-traffic-default-encaps
        }  // container flexible
      }  // case flexible
    }
  }  // module ietf-flexible-encapsulation

Summary

  
  
Organization IETF NETMOD (NETCONF Data Modeling Language) Working Group
  
Module ietf-flexible-encapsulation
Version 2019-11-04
File ietf-flexible-encapsulation@2019-11-04.yang
  
Prefix flex
Namespace urn:ietf:params:xml:ns:yang:ietf-flexible-encapsulation
  
Cooked /cookedmodules/ietf-flexible-encapsulation/2019-11-04
YANG /src/ietf-flexible-encapsulation@2019-11-04.yang
XSD /xsd/ietf-flexible-encapsulation@2019-11-04.xsd
  
Abstract This YANG module describes interface configuration for flexible VLAN matches and rewrites. Copyright (c) 2019 IETF Trust and th...
  
Contact
WG Web:   <http://tools.ietf.org/wg/netmod/>
WG List:  <mailto:netmod@ietf.org>

Editor:   Robert Wilton
	  <mailto:rwilton@cisco.com>

Description

 
This YANG module describes interface configuration for flexible
VLAN matches and rewrites.

Copyright (c) 2019 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.

Groupings

Grouping Objects Abstract
dot1q-tag-rewrite pop-tags push-tags Flexible rewrite
flexible-match match-type Flexible match
flexible-rewrite dot1q-tag-rewrite Flexible rewrite