Tech-invite3GPPspaceIETFspace
96959493929190898887868584838281807978777675747372717069686766656463626160595857565554535251504948474645444342414039383736353433323130292827262524232221201918171615141312111009080706050403020100
in Index   Prev   Next

RFC 8519

YANG Data Model for Network Access Control Lists (ACLs)

Pages: 60
Proposed Standard
Errata
Part 1 of 3 – Pages 1 to 24
None   None   Next

Top   ToC   RFC8519 - Page 1
Internet Engineering Task Force (IETF)                   M. Jethanandani
Request for Comments: 8519                                        VMware
Category: Standards Track                                     S. Agarwal
ISSN: 2070-1721                                      Cisco Systems, Inc.
                                                                L. Huang
                                                                D. Blair
                                                              March 2019


        YANG Data Model for Network Access Control Lists (ACLs)

Abstract

This document defines a data model for Access Control Lists (ACLs). An ACL is a user-ordered set of rules used to configure the forwarding behavior in a device. Each rule is used to find a match on a packet and define actions that will be performed on the packet. Status of This Memo This is an Internet Standards Track document. This document is a product of the Internet Engineering Task Force (IETF). It represents the consensus of the IETF community. It has received public review and has been approved for publication by the Internet Engineering Steering Group (IESG). Further information on Internet Standards is available in Section 2 of RFC 7841. Information about the current status of this document, any errata, and how to provide feedback on it may be obtained at https://www.rfc-editor.org/info/rfc8519. Copyright Notice Copyright (c) 2019 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 Simplified BSD License text as described in Section 4.e of the Trust Legal Provisions and are provided without warranty as described in the Simplified BSD License.
Top   ToC   RFC8519 - Page 2

Table of Contents

1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 2 1.1. Definitions and Acronyms . . . . . . . . . . . . . . . . 3 1.2. Terminology . . . . . . . . . . . . . . . . . . . . . . . 4 1.3. Tree Diagram . . . . . . . . . . . . . . . . . . . . . . 4 2. Problem Statement . . . . . . . . . . . . . . . . . . . . . . 4 3. Understanding ACL's Filters and Actions . . . . . . . . . . . 4 3.1. ACL Modules . . . . . . . . . . . . . . . . . . . . . . . 5 4. ACL YANG Models . . . . . . . . . . . . . . . . . . . . . . . 9 4.1. IETF Access Control List Module . . . . . . . . . . . . . 9 4.2. IETF Packet Fields Module . . . . . . . . . . . . . . . . 24 4.3. ACL Examples . . . . . . . . . . . . . . . . . . . . . . 37 4.4. Port Range Usage and Other Examples . . . . . . . . . . . 39 5. Security Considerations . . . . . . . . . . . . . . . . . . . 42 6. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 43 6.1. URI Registration . . . . . . . . . . . . . . . . . . . . 43 6.2. YANG Module Name Registration . . . . . . . . . . . . . . 44 7. References . . . . . . . . . . . . . . . . . . . . . . . . . 44 7.1. Normative References . . . . . . . . . . . . . . . . . . 44 7.2. Informative References . . . . . . . . . . . . . . . . . 46 Appendix A. Extending ACL Model Examples . . . . . . . . . . . . 47 A.1. Example of a Company's Proprietary Module . . . . . . . . 47 A.2. Linux nftables . . . . . . . . . . . . . . . . . . . . . 50 A.3. Ethertypes . . . . . . . . . . . . . . . . . . . . . . . 51 Acknowledgements . . . . . . . . . . . . . . . . . . . . . . . . 60 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 60

1. Introduction

An Access Control List (ACL) is one of the basic elements used to configure device-forwarding behavior. It is used in many networking technologies such as Policy-Based Routing (PBR), firewalls, etc. An ACL is a user-ordered set of rules that is used to filter traffic on a networking device. Each rule is represented by an Access Control Entry (ACE). Each ACE has a group of match criteria and a group of actions. The match criteria allow for the definition of packet headers and metadata, the contents of which must match the definitions. o Packet header matches apply to fields visible in the packet such as address, Class of Service (CoS), or port number.
Top   ToC   RFC8519 - Page 3
   o  In case a vendor supports it, metadata matches apply to fields
      associated with the packet, that are not in the packet header,
      such as the input interface or length of the packet as received
      over the wire.

   The actions specify what to do with the packet when the matching
   criteria are met.  These actions are any operations that would apply
   to the packet, such as counting, policing, or simply forwarding.  The
   list of potential actions is unbounded depending on the capabilities
   of the networking devices.

   Access Control List is also widely known as ACL (pronounced as
   [ak-uh l]) or Access List.  In this document, Access Control List,
   ACL, and Access List are used interchangeably.

   The matching of filters and actions in an ACE/ACL is triggered only
   after the application/attachment of the ACL to an interface, a
   Virtual Routing and Forwarding (VRF) interface, a vty/tty session, a
   QoS policy, or routing protocols, amongst various other configuration
   attachment points.  Once attached, it is used for filtering traffic
   using the match criteria in the ACEs and taking appropriate action(s)
   that has been configured against that ACE.  In order to apply an ACL
   to any attachment point other than an interface, vendors would have
   to augment the ACL YANG model.

1.1. Definitions and Acronyms

ACE: Access Control Entry ACL: Access Control List CoS: Class of Service DSCP: Differentiated Services Code Point ICMP: Internet Control Message Protocol IP: Internet Protocol IPv4: Internet Protocol version 4 IPv6: Internet Protocol version 6 MAC: Media Access Control PBR: Policy-Based Routing
Top   ToC   RFC8519 - Page 4
   TCP: Transmission Control Protocol

   UDP: User Datagram Protocol

1.2. 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 [RFC2119] [RFC8174] when, and only when, they appear in all capitals, as shown here.

1.3. Tree Diagram

For a reference to the annotations used in the tree diagrams included in this document, please see "YANG Tree Diagrams" [RFC8340].

2. Problem Statement

This document defines a YANG 1.1 data model [RFC7950] for the configuration of ACLs. The model defines matching rules for commonly used protocols such as Ethernet, IPv4, IPv6, TCP, UDP, and ICMP. If more protocols need to be supported in the future, this base model can be augmented. An example of such an augmentation can be seen in Appendix A. ACL implementations in every device may vary greatly in terms of the filter constructs and actions that they support. Therefore, this document proposes a model that can be augmented by standard extensions and vendor proprietary models.

3. Understanding ACL's Filters and Actions

Although different vendors have different ACL data models, there is a common understanding of what an ACL is. A network system usually has a list of ACLs, and each ACL contains an ordered list of rules, also known as ACEs. Each ACE has a group of match criteria and a group of actions. The match criteria allows for definition of the contents of the packet headers or metadata, if supported by the vendor. Packet header matching applies to fields visible in the packet such as address, CoS, or port number. Metadata matching applies to fields associated with the packet, that are not in the packet header, such as the input interface, packet length, or source or destination prefix length. The actions can be any sort of operation from logging to rate-limiting or dropping to simply forwarding. Actions on the first matching ACE are applied with no processing of subsequent ACEs.
Top   ToC   RFC8519 - Page 5
   The model also includes a container to hold overall operational state
   for each ACL and for each ACE.  One ACL can be applied to multiple
   targets within the device, such as the interface of a networking
   device, applications or features running in the device, etc.  When
   applied to interfaces of a networked device, distinct ACLs are
   defined for the ingress (input) or egress (output) interface.

   This document tries to address the commonalities between all vendors
   and creates a common model, which can be augmented with proprietary
   models.  The base model is simple in design, and we hope to achieve
   enough flexibility for each vendor to extend the base model.

   The use of feature statements in the model allows vendors to
   advertise match rules they are capable and willing to support.  There
   are two sets of feature statements a device needs to advertise.  The
   first set of feature statements specifies the capability of the
   device.  These include features such as "Device can support matching
   on Ethernet headers" or "Device can support matching on IPv4
   headers".  The second set of feature statements specifies the
   combinations of headers the device is willing to support.  These
   include features such as "Plain IPv6 ACL supported" or "Ethernet,
   IPv4 and IPv6 ACL combinations supported".

3.1. ACL Modules

There are two YANG modules in the model. The first module, "ietf- access-control-list", defines generic ACL aspects that are common to all ACLs regardless of their type or vendor. In effect, the module can be viewed as providing a generic ACL "superclass". It imports the second module, "ietf-packet-fields". The match container in "ietf-access-control-list" uses groupings in "ietf-packet-fields" to specify match fields such as port numbers or protocols. The combination of 'if-feature' checks and 'must' statements allows for the selection of relevant match fields that a user can define rules for. If there is a need to define a new "matches" choice, such as IP Flow Information Export (IPFIX) [RFC7011], the container "matches" can be augmented.
Top   ToC   RFC8519 - Page 6
   module: ietf-access-control-list
     +--rw acls
        +--rw acl* [name]
        |  +--rw name    string
        |  +--rw type?   acl-type
        |  +--rw aces
        |     +--rw ace* [name]
        |        +--rw name          string
        |        +--rw matches
        |        |  +--rw (l2)?
        |        |  |  +--:(eth)
        |        |  |     +--rw eth {match-on-eth}?
        |        |  |        +--rw destination-mac-address?
        |        |  |        |       yang:mac-address
        |        |  |        +--rw destination-mac-address-mask?
        |        |  |        |       yang:mac-address
        |        |  |        +--rw source-mac-address?
        |        |  |        |       yang:mac-address
        |        |  |        +--rw source-mac-address-mask?
        |        |  |        |       yang:mac-address
        |        |  |        +--rw ethertype?
        |        |  |                eth:ethertype
        |        |  +--rw (l3)?
        |        |  |  +--:(ipv4)
        |        |  |  |  +--rw ipv4 {match-on-ipv4}?
        |        |  |  |     +--rw dscp?
        |        |  |  |     |       inet:dscp
        |        |  |  |     +--rw ecn?
        |        |  |  |     |       uint8
        |        |  |  |     +--rw length?
        |        |  |  |     |       uint16
        |        |  |  |     +--rw ttl?
        |        |  |  |     |       uint8
        |        |  |  |     +--rw protocol?
        |        |  |  |     |       uint8
        |        |  |  |     +--rw ihl?
        |        |  |  |     |       uint8
        |        |  |  |     +--rw flags?
        |        |  |  |     |       bits
        |        |  |  |     +--rw offset?
        |        |  |  |     |       uint16
        |        |  |  |     +--rw identification?
        |        |  |  |     |       uint16
        |        |  |  |     +--rw (destination-network)?
        |        |  |  |     |  +--:(destination-ipv4-network)
        |        |  |  |     |     +--rw destination-ipv4-network?
        |        |  |  |     |             inet:ipv4-prefix
Top   ToC   RFC8519 - Page 7
        |        |  |  |     +--rw (source-network)?
        |        |  |  |        +--:(source-ipv4-network)
        |        |  |  |           +--rw source-ipv4-network?
        |        |  |  |                   inet:ipv4-prefix
        |        |  |  +--:(ipv6)
        |        |  |     +--rw ipv6 {match-on-ipv6}?
        |        |  |        +--rw dscp?
        |        |  |        |       inet:dscp
        |        |  |        +--rw ecn?
        |        |  |        |       uint8
        |        |  |        +--rw length?
        |        |  |        |       uint16
        |        |  |        +--rw ttl?
        |        |  |        |       uint8
        |        |  |        +--rw protocol?
        |        |  |        |       uint8
        |        |  |        +--rw (destination-network)?
        |        |  |        |  +--:(destination-ipv6-network)
        |        |  |        |     +--rw destination-ipv6-network?
        |        |  |        |             inet:ipv6-prefix
        |        |  |        +--rw (source-network)?
        |        |  |        |  +--:(source-ipv6-network)
        |        |  |        |     +--rw source-ipv6-network?
        |        |  |        |             inet:ipv6-prefix
        |        |  |        +--rw flow-label?
        |        |  |                inet:ipv6-flow-label
        |        |  +--rw (l4)?
        |        |  |  +--:(tcp)
        |        |  |  |  +--rw tcp {match-on-tcp}?
        |        |  |  |     +--rw sequence-number?          uint32
        |        |  |  |     +--rw acknowledgement-number?   uint32
        |        |  |  |     +--rw data-offset?              uint8
        |        |  |  |     +--rw reserved?                 uint8
        |        |  |  |     +--rw flags?                    bits
        |        |  |  |     +--rw window-size?              uint16
        |        |  |  |     +--rw urgent-pointer?           uint16
        |        |  |  |     +--rw options?                  binary
        |        |  |  |     +--rw source-port
        |        |  |  |     |  +--rw (source-port)?
        |        |  |  |     |     +--:(range-or-operator)
        |        |  |  |     |        +--rw (port-range-or-operator)?
        |        |  |  |     |           +--:(range)
        |        |  |  |     |           |  +--rw lower-port
        |        |  |  |     |           |  |       inet:port-number
        |        |  |  |     |           |  +--rw upper-port
        |        |  |  |     |           |          inet:port-number
        |        |  |  |     |           +--:(operator)
Top   ToC   RFC8519 - Page 8
        |        |  |  |     |              +--rw operator?     operator
        |        |  |  |     |              +--rw port
        |        |  |  |     |                      inet:port-number
        |        |  |  |     +--rw destination-port
        |        |  |  |        +--rw (destination-port)?
        |        |  |  |           +--:(range-or-operator)
        |        |  |  |              +--rw (port-range-or-operator)?
        |        |  |  |                 +--:(range)
        |        |  |  |                 |  +--rw lower-port
        |        |  |  |                 |  |       inet:port-number
        |        |  |  |                 |  +--rw upper-port
        |        |  |  |                 |          inet:port-number
        |        |  |  |                 +--:(operator)
        |        |  |  |                    +--rw operator?     operator
        |        |  |  |                    +--rw port
        |        |  |  |                            inet:port-number
        |        |  |  +--:(udp)
        |        |  |  |  +--rw udp {match-on-udp}?
        |        |  |  |     +--rw length?             uint16
        |        |  |  |     +--rw source-port
        |        |  |  |     |  +--rw (source-port)?
        |        |  |  |     |     +--:(range-or-operator)
        |        |  |  |     |        +--rw (port-range-or-operator)?
        |        |  |  |     |           +--:(range)
        |        |  |  |     |           |  +--rw lower-port
        |        |  |  |     |           |  |       inet:port-number
        |        |  |  |     |           |  +--rw upper-port
        |        |  |  |     |           |          inet:port-number
        |        |  |  |     |           +--:(operator)
        |        |  |  |     |              +--rw operator?     operator
        |        |  |  |     |              +--rw port
        |        |  |  |     |                      inet:port-number
        |        |  |  |     +--rw destination-port
        |        |  |  |        +--rw (destination-port)?
        |        |  |  |           +--:(range-or-operator)
        |        |  |  |              +--rw (port-range-or-operator)?
        |        |  |  |                 +--:(range)
        |        |  |  |                 |  +--rw lower-port
        |        |  |  |                 |  |       inet:port-number
        |        |  |  |                 |  +--rw upper-port
        |        |  |  |                 |          inet:port-number
        |        |  |  |                 +--:(operator)
        |        |  |  |                    +--rw operator?     operator
        |        |  |  |                    +--rw port
        |        |  |  |                            inet:port-number
        |        |  |  +--:(icmp)
Top   ToC   RFC8519 - Page 9
        |        |  |     +--rw icmp {match-on-icmp}?
        |        |  |        +--rw type?             uint8
        |        |  |        +--rw code?             uint8
        |        |  |        +--rw rest-of-header?   binary
        |        |  +--rw egress-interface?    if:interface-ref
        |        |  +--rw ingress-interface?   if:interface-ref
        |        +--rw actions
        |        |  +--rw forwarding    identityref
        |        |  +--rw logging?      identityref
        |        +--ro statistics {acl-aggregate-stats}?
        |           +--ro matched-packets?   yang:counter64
        |           +--ro matched-octets?    yang:counter64
        +--rw attachment-points
           +--rw interface* [interface-id] {interface-attachment}?
              +--rw interface-id    if:interface-ref
              +--rw ingress
              |  +--rw acl-sets
              |     +--rw acl-set* [name]
              |        +--rw name              -> /acls/acl/name
              |        +--ro ace-statistics* [name] {interface-stats}?
              |           +--ro name
              |           |       -> /acls/acl/aces/ace/name
              |           +--ro matched-packets?   yang:counter64
              |           +--ro matched-octets?    yang:counter64
              +--rw egress
                 +--rw acl-sets
                    +--rw acl-set* [name]
                       +--rw name              -> /acls/acl/name
                       +--ro ace-statistics* [name] {interface-stats}?
                          +--ro name
                          |       -> /acls/acl/aces/ace/name
                          +--ro matched-packets?   yang:counter64
                          +--ro matched-octets?    yang:counter64

4. ACL YANG Models

4.1. IETF Access Control List Module

The "ietf-access-control-list" module defines the "acls" container that has a list of each "acl". Each "acl" has information identifying the access list by a name ("name") and a list ("aces") of rules associated with the "name". Each of the entries in the list ("aces"), indexed by the string "name", has containers defining "matches" and "actions".
Top   ToC   RFC8519 - Page 10
   The model defines several ACL types and actions in the form of
   identities and features.  Features are used by implementors to select
   the ACL types the system can support, and identities are used to
   validate the types that have been selected.  These types are
   implicitly inherited by the "ace", thus safeguarding against
   misconfiguration of "ace" types in an "acl".

   The "matches" define criteria used to identify patterns in "ietf-
   packet-fields".  The choice statements within the match container
   allow for the selection of one header within each of "l2", "l3", or
   "l4" headers.  The "actions" define the behavior to undertake once a
   "match" has been identified.  In addition to permit and deny actions,
   a logging option allows for a match to be logged that can later be
   used to determine which rule was matched upon.  The model also
   defines the ability for ACLs to be attached to a particular
   interface.

   Statistics in the ACL can be collected for an "ace" or for an
   "interface".  The feature statements defined for statistics can be
   used to determine whether statistics are being collected per "ace" or
   per "interface".

   This module imports definitions from "Common YANG Data Types"
   [RFC6991] and "A YANG Data Model for Interface Management" [RFC8343].

<CODE BEGINS> file "ietf-access-control-list@2019-03-04.yang"

module ietf-access-control-list {
  yang-version 1.1;
  namespace "urn:ietf:params:xml:ns:yang:ietf-access-control-list";
  prefix acl;

  import ietf-yang-types {
    prefix yang;
    reference
      "RFC 6991 - Common YANG Data Types.";
  }

  import ietf-packet-fields {
    prefix pf;
    reference
      "RFC 8519 - YANG Data Model for Network Access Control
                  Lists (ACLs).";
  }

  import ietf-interfaces {
    prefix if;
    reference
Top   ToC   RFC8519 - Page 11
      "RFC 8343 - A YANG Data Model for Interface Management.";
  }

  organization
    "IETF NETMOD (Network Modeling) Working Group.";

  contact
    "WG Web:  <https://datatracker.ietf.org/wg/netmod/>
     WG List: netmod@ietf.org

     Editor: Mahesh Jethanandani
             mjethanandani@gmail.com
     Editor: Lisa Huang
             huangyi_99@yahoo.com
     Editor: Sonal Agarwal
             sagarwal12@gmail.com
     Editor: Dana Blair
             dana@blairhome.com";

  description
    "This YANG module defines a component that describes the
     configuration and monitoring of Access Control Lists (ACLs).

     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.

     Copyright (c) 2019 IETF Trust and the persons identified as
     the document authors.  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).

     This version of this YANG module is part of RFC 8519; see
     the RFC itself for full legal notices.";

  revision 2019-03-04 {
    description
      "Initial version.";
    reference
      "RFC 8519: YANG Data Model for Network Access Control
Top   ToC   RFC8519 - Page 12
                 Lists (ACLs).";
  }

  /*
   * Identities
   */
  /*
   * Forwarding actions for a packet
   */

  identity forwarding-action {
    description
      "Base identity for actions in the forwarding category.";
  }

  identity accept {
    base forwarding-action;
    description
      "Accept the packet.";
  }

  identity drop {
    base forwarding-action;
    description
      "Drop packet without sending any ICMP error message.";
  }

  identity reject {
    base forwarding-action;
    description
      "Drop the packet and send an ICMP error message to the source.";
  }

  /*
   * Logging actions for a packet
   */

  identity log-action {
    description
      "Base identity for defining the destination for logging
       actions.";
  }

  identity log-syslog {
    base log-action;
    description
      "System log (syslog) the information for the packet.";
  }
Top   ToC   RFC8519 - Page 13
  identity log-none {
    base log-action;
    description
      "No logging for the packet.";
  }

  /*
   * ACL type identities
   */

  identity acl-base {
    description
      "Base Access Control List type for all Access Control List type
       identifiers.";
  }

  identity ipv4-acl-type {
    base acl:acl-base;
    if-feature "ipv4";
    description
      "An ACL that matches on fields from the IPv4 header
       (e.g., IPv4 destination address) and Layer 4 headers (e.g., TCP
       destination port).  An ACL of type ipv4 does not contain
       matches on fields in the Ethernet header or the IPv6 header.";
  }

  identity ipv6-acl-type {
    base acl:acl-base;
    if-feature "ipv6";
    description
      "An ACL that matches on fields from the IPv6 header
       (e.g., IPv6 destination address) and Layer 4 headers (e.g., TCP
       destination port).  An ACL of type ipv6 does not contain
       matches on fields in the Ethernet header or the IPv4 header.";
  }

  identity eth-acl-type {
    base acl:acl-base;
    if-feature "eth";
    description
      "An ACL that matches on fields in the Ethernet header,
       like 10/100/1000baseT or a Wi-Fi Access Control List.  An ACL
       of type ethernet does not contain matches on fields in the
       IPv4 header, the IPv6 header, or Layer 4 headers.";
  }

  identity mixed-eth-ipv4-acl-type {
    base acl:eth-acl-type;
Top   ToC   RFC8519 - Page 14
    base acl:ipv4-acl-type;
    if-feature "mixed-eth-ipv4";
    description
      "An ACL that contains a mix of entries that match
       on fields in Ethernet headers and in IPv4 headers.
       Matching on Layer 4 header fields may also exist in the
       list.";
  }

  identity mixed-eth-ipv6-acl-type {
    base acl:eth-acl-type;
    base acl:ipv6-acl-type;
    if-feature "mixed-eth-ipv6";
    description
      "An ACL that contains a mix of entries that match on fields
       in Ethernet headers and in IPv6 headers.  Matching
       on Layer 4 header fields may also exist in the list.";
  }

  identity mixed-eth-ipv4-ipv6-acl-type {
    base acl:eth-acl-type;
    base acl:ipv4-acl-type;
    base acl:ipv6-acl-type;
    if-feature "mixed-eth-ipv4-ipv6";
    description
      "An ACL that contains a mix of entries that
       match on fields in Ethernet headers, IPv4 headers, and IPv6
       headers.  Matching on Layer 4 header fields may also exist
       in the list.";
  }

  /*
   * Features
   */

  /*
   * Features supported by device
   */
  feature match-on-eth {
    description
      "The device can support matching on Ethernet headers.";
  }

  feature match-on-ipv4 {
    description
      "The device can support matching on IPv4 headers.";
  }
Top   ToC   RFC8519 - Page 15
  feature match-on-ipv6 {
    description
      "The device can support matching on IPv6 headers.";
  }

  feature match-on-tcp {
    description
      "The device can support matching on TCP headers.";
  }

  feature match-on-udp {
    description
      "The device can support matching on UDP headers.";
  }

  feature match-on-icmp {
    description
      "The device can support matching on ICMP (v4 and v6) headers.";
  }

  /*
   * Header classifications combinations supported by
   * device
   */

  feature eth {
    if-feature "match-on-eth";
    description
      "Plain Ethernet ACL supported.";
  }

  feature ipv4 {
    if-feature "match-on-ipv4";
    description
      "Plain IPv4 ACL supported.";
  }

  feature ipv6 {
    if-feature "match-on-ipv6";
    description
      "Plain IPv6 ACL supported.";
  }

  feature mixed-eth-ipv4 {
    if-feature "match-on-eth and match-on-ipv4";
    description
      "Ethernet and IPv4 ACL combinations supported.";
  }
Top   ToC   RFC8519 - Page 16
  feature mixed-eth-ipv6 {
    if-feature "match-on-eth and match-on-ipv6";
    description
      "Ethernet and IPv6 ACL combinations supported.";
  }

  feature mixed-eth-ipv4-ipv6 {
    if-feature
      "match-on-eth and match-on-ipv4
       and match-on-ipv6";
    description
      "Ethernet, IPv4, and IPv6 ACL combinations supported.";
  }

  /*
   * Stats Features
   */
  feature interface-stats {
    description
      "ACL counters are available and reported only per interface.";
  }

  feature acl-aggregate-stats {
    description
      "ACL counters are aggregated over all interfaces and reported
       only per ACL entry.";
  }

  /*
   * Attachment point features
   */
  feature interface-attachment {
    description
      "ACLs are set on interfaces.";
  }

  /*
   * Typedefs
   */
  typedef acl-type {
    type identityref {
      base acl-base;
    }
    description
      "This type is used to refer to an ACL type.";
  }

  /*
Top   ToC   RFC8519 - Page 17
   * Groupings
   */
  grouping acl-counters {
    description
      "Common grouping for ACL counters.";
    leaf matched-packets {
      type yang:counter64;
      config false;
      description
        "Count of the number of packets matching the current ACL
         entry.

         An implementation should provide this counter on a
         per-interface, per-ACL-entry basis if possible.

         If an implementation only supports ACL counters on a per-
         entry basis (i.e., not broken out per interface), then the
         value should be equal to the aggregate count across all
         interfaces.

         An implementation that provides counters on a per-entry, per-
         interface basis is not required to also provide an aggregate
         count, e.g., per entry -- the user is expected to be able to
         implement the required aggregation if such a count is
         needed.";
    }

    leaf matched-octets {
      type yang:counter64;
      config false;
      description
        "Count of the number of octets (bytes) matching the current
         ACL entry.

         An implementation should provide this counter on a
         per-interface, per-ACL-entry basis if possible.

         If an implementation only supports ACL counters per entry
         (i.e., not broken out per interface), then the value
         should be equal to the aggregate count across all interfaces.

         An implementation that provides counters per entry per
         interface is not required to also provide an aggregate count,
         e.g., per entry -- the user is expected to be able to
         implement the required aggregation if such a count is needed.";
    }
  }
Top   ToC   RFC8519 - Page 18
  /*
   * Configuration and monitoring data nodes
   */

  container acls {
    description
      "This is a top-level container for Access Control Lists.
       It can have one or more acl nodes.";
    list acl {
      key "name";
      description
        "An ACL is an ordered list of ACEs.  Each ACE has a
         list of match criteria and a list of actions.
         Since there are several kinds of ACLs implemented
         with different attributes for different vendors,
         this model accommodates customizing ACLs for
         each kind and for each vendor.";
      leaf name {
        type string {
          length "1..64";
        }
        description
          "The name of the access list.  A device MAY further
           restrict the length of this name; space and special
           characters are not allowed.";
      }
      leaf type {
        type acl-type;
        description
          "Type of ACL.  Indicates the primary intended
           type of match criteria (e.g., Ethernet, IPv4, IPv6, mixed,
           etc.) used in the list instance.";
      }
      container aces {
        description
          "The aces container contains one or more ACE nodes.";
        list ace {
          key "name";
          ordered-by user;
          description
            "List of ACEs.";
          leaf name {
            type string {
              length "1..64";
            }
            description
              "A unique name identifying this ACE.";
          }
Top   ToC   RFC8519 - Page 19
          container matches {
            description
              "The rules in this set determine what fields will be
               matched upon before any action is taken on them.
               The rules are selected based on the feature set
               defined by the server and the acl-type defined.
               If no matches are defined in a particular container,
               then any packet will match that container.  If no
               matches are specified at all in an ACE, then any
               packet will match the ACE.";

            choice l2 {
              container eth {
                when "derived-from-or-self(/acls/acl/type, "
                   + "'acl:eth-acl-type')";
                if-feature "match-on-eth";
                uses pf:acl-eth-header-fields;
                description
                  "Rule set that matches Ethernet headers.";
              }
              description
                "Match Layer 2 headers, for example, Ethernet
                 header fields.";
            }

            choice l3 {
              container ipv4 {
                when "derived-from-or-self(/acls/acl/type, "
                   + "'acl:ipv4-acl-type')";
                if-feature "match-on-ipv4";
                uses pf:acl-ip-header-fields;
                uses pf:acl-ipv4-header-fields;
                description
                  "Rule set that matches IPv4 headers.";
              }

              container ipv6 {
                when "derived-from-or-self(/acls/acl/type, "
                   + "'acl:ipv6-acl-type')";
                if-feature "match-on-ipv6";
                uses pf:acl-ip-header-fields;
                uses pf:acl-ipv6-header-fields;
                description
                  "Rule set that matches IPv6 headers.";
              }
              description
                "Choice of either IPv4 or IPv6 headers";
            }
Top   ToC   RFC8519 - Page 20
            choice l4 {
              container tcp {
                if-feature "match-on-tcp";
                uses pf:acl-tcp-header-fields;
                container source-port {
                  choice source-port {
                    case range-or-operator {
                      uses pf:port-range-or-operator;
                      description
                        "Source port definition from range or
                         operator.";
                    }
                    description
                      "Choice of source port definition using
                       range/operator or a choice to support future
                       'case' statements, such as one enabling a
                       group of source ports to be referenced.";
                  }
                  description
                    "Source port definition.";
                }
                container destination-port {
                  choice destination-port {
                    case range-or-operator {
                      uses pf:port-range-or-operator;
                      description
                        "Destination port definition from range or
                         operator.";
                    }
                    description
                      "Choice of destination port definition using
                       range/operator or a choice to support future
                       'case' statements, such as one enabling a
                       group of destination ports to be referenced.";
                  }
                  description
                    "Destination port definition.";
                }
                description
                  "Rule set that matches TCP headers.";
              }

              container udp {
                if-feature "match-on-udp";
                uses pf:acl-udp-header-fields;
                container source-port {
                  choice source-port {
                    case range-or-operator {
Top   ToC   RFC8519 - Page 21
                      uses pf:port-range-or-operator;
                      description
                        "Source port definition from range or
                         operator.";
                    }
                    description
                      "Choice of source port definition using
                       range/operator or a choice to support future
                       'case' statements, such as one enabling a
                       group of source ports to be referenced.";
                  }
                  description
                    "Source port definition.";
                }
                container destination-port {
                  choice destination-port {
                    case range-or-operator {
                      uses pf:port-range-or-operator;
                      description
                        "Destination port definition from range or
                         operator.";
                    }
                    description
                      "Choice of destination port definition using
                       range/operator or a choice to support future
                       'case' statements, such as one enabling a
                       group of destination ports to be referenced.";
                  }
                  description
                    "Destination port definition.";
                }
                description
                  "Rule set that matches UDP headers.";
              }

              container icmp {
                if-feature "match-on-icmp";
                uses pf:acl-icmp-header-fields;
                description
                  "Rule set that matches ICMP headers.";
              }
              description
                "Choice of TCP, UDP, or ICMP headers.";
            }

            leaf egress-interface {
              type if:interface-ref;
              description
Top   ToC   RFC8519 - Page 22
                "Egress interface.  This should not be used if this ACL
                 is attached as an egress ACL (or the value should
                 equal the interface to which the ACL is attached).";
            }

            leaf ingress-interface {
              type if:interface-ref;
              description
                "Ingress interface.  This should not be used if this ACL
                 is attached as an ingress ACL (or the value should
                 equal the interface to which the ACL is attached).";
            }
          }

          container actions {
            description
              "Definition of actions for this ace entry.";
            leaf forwarding {
              type identityref {
                base forwarding-action;
              }
              mandatory true;
              description
                "Specifies the forwarding action per ace entry.";
            }

            leaf logging {
              type identityref {
                base log-action;
              }
              default "log-none";
              description
                "Specifies the log action and destination for
                 matched packets.  Default value is not to log the
                 packet.";
            }
          }
          container statistics {
            if-feature "acl-aggregate-stats";
            config false;
            description
              "Statistics gathered across all attachment points for the
               given ACL.";
            uses acl-counters;
          }
        }
      }
    }
Top   ToC   RFC8519 - Page 23
    container attachment-points {
      description
        "Enclosing container for the list of
         attachment points on which ACLs are set.";
      /*
       * Groupings
       */
      grouping interface-acl {
        description
          "Grouping for per-interface ingress ACL data.";
        container acl-sets {
          description
            "Enclosing container for the list of ingress ACLs on the
             interface.";
          list acl-set {
            key "name";
            ordered-by user;
            description
              "List of ingress ACLs on the interface.";
            leaf name {
              type leafref {
                path "/acls/acl/name";
              }
              description
                "Reference to the ACL name applied on the ingress.";
            }
            list ace-statistics {
              if-feature "interface-stats";
              key "name";
              config false;
              description
                "List of ACEs.";
              leaf name {
                type leafref {
                  path "/acls/acl/aces/ace/name";
                }
                description
                  "Name of the ace entry.";
              }
              uses acl-counters;
            }
          }
        }
      }

      list interface {
        if-feature "interface-attachment";
        key "interface-id";
Top   ToC   RFC8519 - Page 24
        description
          "List of interfaces on which ACLs are set.";

        leaf interface-id {
          type if:interface-ref;
          description
            "Reference to the interface id list key.";
        }

        container ingress {
          uses interface-acl;
          description
            "The ACLs applied to the ingress interface.";
        }
        container egress {
          uses interface-acl;
          description
            "The ACLs applied to the egress interface.";
        }
      }
    }
  }
}

<CODE ENDS>



(page 24 continued on part 2)

Next Section