draft-ietf-netmod-acl-model-16.txt   draft-ietf-netmod-acl-model-17.txt 
NETMOD WG M. Jethanandani NETMOD WG M. Jethanandani
Internet-Draft Internet-Draft
Intended status: Standards Track L. Huang Intended status: Standards Track L. Huang
Expires: August 6, 2018 General Electric Expires: September 4, 2018 General Electric
S. Agarwal S. Agarwal
Cisco Systems, Inc.
D. Blair D. Blair
Cisco Systems, INc Cisco Systems, Inc.
February 2, 2018 March 3, 2018
Network Access Control List (ACL) YANG Data Model Network Access Control List (ACL) YANG Data Model
draft-ietf-netmod-acl-model-16 draft-ietf-netmod-acl-model-17
Abstract Abstract
This document describes a data model of Access Control List (ACL) This document defines a data model for Access Control List (ACL).
basic building blocks. ACL is a ordered-by-user set of rules, used to configure the
forwarding behavior in device. Each rule is used to find a match on
Editorial Note (To be removed by RFC Editor) a packet, and define actions that will be performed on the packet.
This draft contains many placeholder values that need to be replaced
with finalized values at the time of publication. This note
summarizes all of the substitutions that are needed. Please note
that no other RFC Editor instructions are specified anywhere else in
this document.
Artwork in this document contains shorthand references to drafts in
progress. Please apply the following replacements
o "XXXX" --> the assigned RFC value for this draft both in this
draft and in the YANG models under the revision statement.
o Revision date in model needs to get updated with the date the
draft gets approved. The date also needs to get reflected on the
line with <CODE BEGINS>.
Status of This Memo Status of This Memo
This Internet-Draft is submitted in full conformance with the This Internet-Draft is submitted in full conformance with the
provisions of BCP 78 and BCP 79. provisions of BCP 78 and BCP 79.
Internet-Drafts are working documents of the Internet Engineering Internet-Drafts are working documents of the Internet Engineering
Task Force (IETF). Note that other groups may also distribute Task Force (IETF). Note that other groups may also distribute
working documents as Internet-Drafts. The list of current Internet- working documents as Internet-Drafts. The list of current Internet-
Drafts is at https://datatracker.ietf.org/drafts/current/. Drafts is at https://datatracker.ietf.org/drafts/current/.
Internet-Drafts are draft documents valid for a maximum of six months Internet-Drafts are draft documents valid for a maximum of six months
and may be updated, replaced, or obsoleted by other documents at any and may be updated, replaced, or obsoleted by other documents at any
time. It is inappropriate to use Internet-Drafts as reference time. It is inappropriate to use Internet-Drafts as reference
material or to cite them other than as "work in progress." material or to cite them other than as "work in progress."
This Internet-Draft will expire on August 6, 2018. This Internet-Draft will expire on September 4, 2018.
Copyright Notice Copyright Notice
Copyright (c) 2018 IETF Trust and the persons identified as the Copyright (c) 2018 IETF Trust and the persons identified as the
document authors. All rights reserved. document authors. All rights reserved.
This document is subject to BCP 78 and the IETF Trust's Legal This document is subject to BCP 78 and the IETF Trust's Legal
Provisions Relating to IETF Documents Provisions Relating to IETF Documents
(https://trustee.ietf.org/license-info) in effect on the date of (https://trustee.ietf.org/license-info) in effect on the date of
publication of this document. Please review these documents publication of this document. Please review these documents
carefully, as they describe your rights and restrictions with respect carefully, as they describe your rights and restrictions with respect
to this document. Code Components extracted from this document must to this document. Code Components extracted from this document must
include Simplified BSD License text as described in Section 4.e of include Simplified BSD License text as described in Section 4.e of
the Trust Legal Provisions and are provided without warranty as the Trust Legal Provisions and are provided without warranty as
described in the Simplified BSD License. described in the Simplified BSD License.
Table of Contents Table of Contents
1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 3 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 2
1.1. Definitions and Acronyms . . . . . . . . . . . . . . . . 3 1.1. Definitions and Acronyms . . . . . . . . . . . . . . . . 4
1.2. Terminology . . . . . . . . . . . . . . . . . . . . . . . 4
2. Problem Statement . . . . . . . . . . . . . . . . . . . . . . 4 2. Problem Statement . . . . . . . . . . . . . . . . . . . . . . 4
3. Understanding ACL's Filters and Actions . . . . . . . . . . . 4 3. Understanding ACL's Filters and Actions . . . . . . . . . . . 4
3.1. ACL Modules . . . . . . . . . . . . . . . . . . . . . . . 5 3.1. ACL Modules . . . . . . . . . . . . . . . . . . . . . . . 5
4. ACL YANG Models . . . . . . . . . . . . . . . . . . . . . . . 9 4. ACL YANG Models . . . . . . . . . . . . . . . . . . . . . . . 9
4.1. IETF Access Control List module . . . . . . . . . . . . . 9 4.1. IETF Access Control List module . . . . . . . . . . . . . 9
4.2. IETF Packet Fields module . . . . . . . . . . . . . . . . 23 4.2. IETF Packet Fields module . . . . . . . . . . . . . . . . 24
4.3. An ACL Example . . . . . . . . . . . . . . . . . . . . . 35 4.3. An ACL Example . . . . . . . . . . . . . . . . . . . . . 36
4.4. Port Range Usage Example . . . . . . . . . . . . . . . . 36 4.4. Port Range Usage Example . . . . . . . . . . . . . . . . 37
5. Security Considerations . . . . . . . . . . . . . . . . . . . 38 5. Security Considerations . . . . . . . . . . . . . . . . . . . 40
6. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 38 6. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 41
7. Acknowledgements . . . . . . . . . . . . . . . . . . . . . . 39 6.1. URI Registration . . . . . . . . . . . . . . . . . . . . 41
8. References . . . . . . . . . . . . . . . . . . . . . . . . . 39 6.2. YANG Module Name Registration . . . . . . . . . . . . . . 41
8.1. Normative References . . . . . . . . . . . . . . . . . . 39 7. Acknowledgements . . . . . . . . . . . . . . . . . . . . . . 42
8.2. Informative References . . . . . . . . . . . . . . . . . 41 8. References . . . . . . . . . . . . . . . . . . . . . . . . . 42
Appendix A. Extending ACL model examples . . . . . . . . . . . . 42 8.1. Normative References . . . . . . . . . . . . . . . . . . 42
A.1. A company proprietary module example . . . . . . . . . . 42 8.2. Informative References . . . . . . . . . . . . . . . . . 44
A.2. Linux nftables . . . . . . . . . . . . . . . . . . . . . 45 Appendix A. Extending ACL model examples . . . . . . . . . . . . 44
A.3. Ethertypes . . . . . . . . . . . . . . . . . . . . . . . 46 A.1. A company proprietary module example . . . . . . . . . . 44
Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 54 A.2. Linux nftables . . . . . . . . . . . . . . . . . . . . . 48
A.3. Ethertypes . . . . . . . . . . . . . . . . . . . . . . . 49
Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 57
1. Introduction 1. Introduction
Access Control List (ACL) is one of the basic elements used to Access Control List (ACL) is one of the basic elements used to
configure device forwarding behavior. It is used in many networking configure device forwarding behavior. It is used in many networking
technologies such as Policy Based Routing, Firewalls etc. technologies such as Policy Based Routing, Firewalls etc.
An ACL is an ordered-by-user set of rules that is used to filter An ACL is an ordered-by-user set of rules that is used to filter
traffic on a networking device. Each rule is represented by an traffic on a networking device. Each rule is represented by an
Access Control Entry (ACE). Access Control Entry (ACE).
skipping to change at page 3, line 47 skipping to change at page 3, line 31
The matching of filters and actions in an ACE/ACL are triggered only The matching of filters and actions in an ACE/ACL are triggered only
after application/attachment of the ACL to an interface, VRF, vty/tty after application/attachment of the ACL to an interface, VRF, vty/tty
session, QoS policy, routing protocols amongst various other config session, QoS policy, routing protocols amongst various other config
attachment points. Once attached, it is used for filtering traffic attachment points. Once attached, it is used for filtering traffic
using the match criteria in the ACE's and taking appropriate using the match criteria in the ACE's and taking appropriate
action(s) that have been configured against that ACE. In order to action(s) that have been configured against that ACE. In order to
apply an ACL to any attachment point other than an interface, vendors apply an ACL to any attachment point other than an interface, vendors
would have to augment the ACL YANG model. would have to augment the ACL YANG model.
Editorial Note (To be removed by RFC Editor)
This draft contains many placeholder values that need to be replaced
with finalized values at the time of publication. This note
summarizes all of the substitutions that are needed. Please note
that no other RFC Editor instructions are specified anywhere else in
this document.
Artwork in this document contains shorthand references to drafts in
progress. Please apply the following replacements
o "XXXX" --> the assigned RFC value for this draft both in this
draft and in the YANG models under the revision statement.
o Revision date in model, in the format 2018-03-03 needs to get
updated with the date the draft gets approved. The date also
needs to get reflected on the line with <CODE BEGINS>.
o Replace "I-D.ietf-netmod-yang-tree-diagrams" with the assigned RFC
number.
1.1. Definitions and Acronyms 1.1. Definitions and Acronyms
ACE: Access Control Entry ACE: Access Control Entry
ACL: Access Control List ACL: Access Control List
DSCP: Differentiated Services Code Point DSCP: Differentiated Services Code Point
ICMP: Internet Control Message Protocol ICMP: Internet Control Message Protocol
IP: Internet Protocol IP: Internet Protocol
IPv4: Internet Protocol version 4 IPv4: Internet Protocol version 4
IPv6: Internet Protocol version 6 IPv6: Internet Protocol version 6
skipping to change at page 4, line 18 skipping to change at page 4, line 25
IP: Internet Protocol IP: Internet Protocol
IPv4: Internet Protocol version 4 IPv4: Internet Protocol version 4
IPv6: Internet Protocol version 6 IPv6: Internet Protocol version 6
MAC: Media Access Control MAC: Media Access Control
TCP: Transmission Control Protocol 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.
2. Problem Statement 2. Problem Statement
This document defines a YANG [RFC7950] data model for the This document defines a YANG [RFC7950] data model for the
configuration of ACLs. It is very important that model can be used configuration of ACLs. It is very important that model can be used
easily by applications/attachments. easily by applications/attachments.
ACL implementations in every device may vary greatly in terms of the ACL implementations in every device may vary greatly in terms of the
filter constructs and actions that they support. Therefore this filter constructs and actions that they support. Therefore this
draft proposes a model that can be augmented by standard extensions draft proposes a model that can be augmented by standard extensions
and vendor proprietary models. and vendor proprietary models.
skipping to change at page 5, line 36 skipping to change at page 6, line 6
access-control-list", defines generic ACL aspects which are common to access-control-list", defines generic ACL aspects which are common to
all ACLs regardless of their type or vendor. In effect, the module all ACLs regardless of their type or vendor. In effect, the module
can be viewed as providing a generic ACL "superclass". It imports can be viewed as providing a generic ACL "superclass". It imports
the second module, "ietf-packet-fields". The match container in the second module, "ietf-packet-fields". The match container in
"ietf-access-control-list" uses groupings in "ietf-packet-fields" to "ietf-access-control-list" uses groupings in "ietf-packet-fields" to
specify match fields such as port numbers or protocol. The specify match fields such as port numbers or protocol. The
combination of if-feature checks and must statements allow for the combination of if-feature checks and must statements allow for the
selection of relevant match fields that a user can define rules for. selection of relevant match fields that a user can define rules for.
If there is a need to define new "matches" choice, such as IPFIX If there is a need to define new "matches" choice, such as IPFIX
[RFC5101], the container "matches" can be augmented. [RFC7011], the container "matches" can be augmented.
For a reference to the annotations used in the diagram below, see For a reference to the annotations used in the diagram below, see
YANG Tree Diagrams [I-D.ietf-netmod-yang-tree-diagrams]. YANG Tree Diagrams [I-D.ietf-netmod-yang-tree-diagrams].
module: ietf-access-control-list module: ietf-access-control-list
+--rw access-lists +--rw access-lists
+--rw acl* [name] +--rw acl* [name]
| +--rw name string | +--rw name string
| +--rw type? acl-type | +--rw type? acl-type
| +--rw aces | +--rw aces
skipping to change at page 7, line 7 skipping to change at page 7, line 24
| | | | inet:ipv6-prefix | | | | inet:ipv6-prefix
| | | +--rw (source-network)? | | | +--rw (source-network)?
| | | | +--:(source-ipv6-network) | | | | +--:(source-ipv6-network)
| | | | +--rw source-ipv6-network? | | | | +--rw source-ipv6-network?
| | | | inet:ipv6-prefix | | | | inet:ipv6-prefix
| | | +--rw flow-label? | | | +--rw flow-label?
| | | inet:ipv6-flow-label | | | inet:ipv6-flow-label
| | +--rw (l4)? | | +--rw (l4)?
| | | +--:(tcp) | | | +--:(tcp)
| | | | +--rw tcp {match-on-tcp}? | | | | +--rw tcp {match-on-tcp}?
| | | | +--rw sequence-number? | | | | +--rw sequence-number? uint32
| | | | | uint32 | | | | +--rw acknowledgement-number? uint32
| | | | +--rw acknowledgement-number? | | | | +--rw data-offset? uint8
| | | | | uint32 | | | | +--rw reserved? uint8
| | | | +--rw data-offset? | | | | +--rw flags? bits
| | | | | uint8 | | | | +--rw window-size? uint16
| | | | +--rw reserved? | | | | +--rw urgent-pointer? uint16
| | | | | uint8 | | | | +--rw options? uint32
| | | | +--rw flags? | | | | +--rw source-port
| | | | | bits | | | | | +--rw (source-port)?
| | | | +--rw window-size? | | | | | +--:(range-or-operator)
| | | | | uint16
| | | | +--rw urgent-pointer?
| | | | | uint16
| | | | +--rw options?
| | | | | uint32
| | | | +--rw (source-port)?
| | | | | +--:(source-port-range-or-operator)
| | | | | +--rw source-port-range-or-operator
| | | | | +--rw (port-range-or-operator)? | | | | | +--rw (port-range-or-operator)?
| | | | | +--:(range) | | | | | +--:(range)
| | | | | | +--rw lower-port | | | | | | +--rw lower-port
| | | | | | | inet:port-number | | | | | | | inet:port-number
| | | | | | +--rw upper-port | | | | | | +--rw upper-port
| | | | | | inet:port-number | | | | | | inet:port-number
| | | | | +--:(operator) | | | | | +--:(operator)
| | | | | +--rw operator? operator | | | | | +--rw operator? operator
| | | | | +--rw port | | | | | +--rw port
| | | | | inet:port-number | | | | | inet:port-number
| | | | +--rw (destination-port)? | | | | +--rw destination-port
| | | | +--:(destination-port-range-or-operator) | | | | +--rw (destination-port)?
| | | | +--rw destination-port-range-or-opera | | | | +--:(range-or-operator)
tor
| | | | +--rw (port-range-or-operator)? | | | | +--rw (port-range-or-operator)?
| | | | +--:(range) | | | | +--:(range)
| | | | | +--rw lower-port | | | | | +--rw lower-port
| | | | | | inet:port-number | | | | | | inet:port-number
| | | | | +--rw upper-port | | | | | +--rw upper-port
| | | | | inet:port-number | | | | | inet:port-number
| | | | +--:(operator) | | | | +--:(operator)
| | | | +--rw operator? operator | | | | +--rw operator? operator
| | | | +--rw port | | | | +--rw port
| | | | inet:port-number | | | | inet:port-number
| | | +--:(udp) | | | +--:(udp)
| | | | +--rw udp {match-on-udp}? | | | | +--rw udp {match-on-udp}?
| | | | +--rw length? | | | | +--rw length? uint16
| | | | | uint16 | | | | +--rw source-port
| | | | +--rw (source-port)? | | | | | +--rw (source-port)?
| | | | | +--:(source-port-range-or-operator) | | | | | +--:(range-or-operator)
| | | | | +--rw source-port-range-or-operator
| | | | | +--rw (port-range-or-operator)? | | | | | +--rw (port-range-or-operator)?
| | | | | +--:(range) | | | | | +--:(range)
| | | | | | +--rw lower-port | | | | | | +--rw lower-port
| | | | | | | inet:port-number | | | | | | | inet:port-number
| | | | | | +--rw upper-port | | | | | | +--rw upper-port
| | | | | | inet:port-number | | | | | | inet:port-number
| | | | | +--:(operator) | | | | | +--:(operator)
| | | | | +--rw operator? operator | | | | | +--rw operator? operator
| | | | | +--rw port | | | | | +--rw port
| | | | | inet:port-number | | | | | inet:port-number
| | | | +--rw (destination-port)? | | | | +--rw destination-port
| | | | +--:(destination-port-range-or-operator) | | | | +--rw (destination-port)?
| | | | +--rw destination-port-range-or-opera | | | | +--:(range-or-operator)
tor
| | | | +--rw (port-range-or-operator)? | | | | +--rw (port-range-or-operator)?
| | | | +--:(range) | | | | +--:(range)
| | | | | +--rw lower-port | | | | | +--rw lower-port
| | | | | | inet:port-number | | | | | | inet:port-number
| | | | | +--rw upper-port | | | | | +--rw upper-port
| | | | | inet:port-number | | | | | inet:port-number
| | | | +--:(operator) | | | | +--:(operator)
| | | | +--rw operator? operator | | | | +--rw operator? operator
| | | | +--rw port | | | | +--rw port
| | | | inet:port-number | | | | inet:port-number
skipping to change at page 9, line 4 skipping to change at page 9, line 10
| | +--rw logging? identityref | | +--rw logging? identityref
| +--ro statistics {acl-aggregate-stats}? | +--ro statistics {acl-aggregate-stats}?
| +--ro matched-packets? yang:counter64 | +--ro matched-packets? yang:counter64
| +--ro matched-octets? yang:counter64 | +--ro matched-octets? yang:counter64
+--rw attachment-points +--rw attachment-points
+--rw interface* [interface-id] {interface-attachment}? +--rw interface* [interface-id] {interface-attachment}?
+--rw interface-id if:interface-ref +--rw interface-id if:interface-ref
+--rw ingress +--rw ingress
| +--rw acl-sets | +--rw acl-sets
| +--rw acl-set* [name] | +--rw acl-set* [name]
| +--rw name | +--rw name -> /access-lists/acl/name
| | -> ../../../../../../acl/name
| +--ro ace-statistics* [name] {interface-stats}? | +--ro ace-statistics* [name] {interface-stats}?
| +--ro name leafref | +--ro name
| | -> /access-lists/acl/aces/ace/name
| +--ro matched-packets? yang:counter64 | +--ro matched-packets? yang:counter64
| +--ro matched-octets? yang:counter64 | +--ro matched-octets? yang:counter64
+--rw egress +--rw egress
+--rw acl-sets +--rw acl-sets
+--rw acl-set* [name] +--rw acl-set* [name]
+--rw name +--rw name -> /access-lists/acl/name
| -> ../../../../../../acl/name
+--ro ace-statistics* [name] {interface-stats}? +--ro ace-statistics* [name] {interface-stats}?
+--ro name leafref +--ro name
| -> /access-lists/acl/aces/ace/name
+--ro matched-packets? yang:counter64 +--ro matched-packets? yang:counter64
+--ro matched-octets? yang:counter64 +--ro matched-octets? yang:counter64
4. ACL YANG Models 4. ACL YANG Models
4.1. IETF Access Control List module 4.1. IETF Access Control List module
"ietf-access-control-list" is the standard top level module for "ietf-access-control-list" is the standard top level module for
access lists. The "access-lists" container stores a list of "acl". access lists. The "access-lists" container stores a list of "acl".
Each "acl" has information identifying the access list by a name Each "acl" has information identifying the access list by a name
skipping to change at page 10, line 6 skipping to change at page 10, line 11
logging option allows for a match to be logged that can be used to logging option allows for a match to be logged that can be used to
determine which rule was matched upon. The model also defines the determine which rule was matched upon. The model also defines the
ability for ACL's to be attached to a particular interface. ability for ACL's to be attached to a particular interface.
Statistics in the ACL can be collected for an "ace" or for an Statistics in the ACL can be collected for an "ace" or for an
"interface". The feature statements defined for statistics can be "interface". The feature statements defined for statistics can be
used to determine whether statistics are being collected per "ace", used to determine whether statistics are being collected per "ace",
or per "interface". or per "interface".
This module imports definitions from Common YANG Data Types This module imports definitions from Common YANG Data Types
[RFC6991], and A YANG Data Model for Interface Management [RFC7223]. [RFC6991], and A YANG Data Model for Interface Management
[I-D.ietf-netmod-rfc7223bis].
<CODE BEGINS> file "ietf-access-control-list@2018-02-02.yang" <CODE BEGINS> file "ietf-access-control-list@2018-03-03.yang"
module ietf-access-control-list { module ietf-access-control-list {
yang-version 1.1; yang-version 1.1;
namespace "urn:ietf:params:xml:ns:yang:ietf-access-control-list"; namespace "urn:ietf:params:xml:ns:yang:ietf-access-control-list";
prefix acl; prefix acl;
import ietf-yang-types { import ietf-yang-types {
prefix yang; prefix yang;
} reference
"RFC 6991 - Common YANG Data Types.";
}
import ietf-packet-fields { import ietf-packet-fields {
prefix pf; prefix pf;
} reference
"RFC XXXX - Network ACL YANG Model.";
}
import ietf-interfaces { import ietf-interfaces {
prefix if; prefix if;
} reference
"I-D.draft-ietf-netmod-rfc7223bis - A YANG Data Model for
Interface Management.";
}
organization organization
"IETF NETMOD (NETCONF Data Modeling Language) "IETF NETMOD (NETCONF Data Modeling Language)
Working Group"; Working Group";
contact contact
"WG Web: http://tools.ietf.org/wg/netmod/ "WG Web: http://tools.ietf.org/wg/netmod/
WG List: netmod@ietf.org WG List: netmod@ietf.org
Editor: Mahesh Jethanandani Editor: Mahesh Jethanandani
mjethanandani@gmail.com mjethanandani@gmail.com
Editor: Lisa Huang Editor: Lisa Huang
lyihuang16@gmail.com lyihuang16@gmail.com
Editor: Sonal Agarwal Editor: Sonal Agarwal
sagarwal12@gmail.com sagarwal12@gmail.com
Editor: Dana Blair Editor: Dana Blair
dblair@cisco.com"; dblair@cisco.com";
description description
"This YANG module defines a component that describe the "This YANG module defines a component that describe the
configuration of Access Control Lists (ACLs). configuration of Access Control Lists (ACLs).
Copyright (c) 2018 IETF Trust and the persons identified as Copyright (c) 2018 IETF Trust and the persons identified as
the document authors. All rights reserved. the document authors. All rights reserved.
Redistribution and use in source and binary forms, with or Redistribution and use in source and binary forms, with or
without modification, is permitted pursuant to, and subject without modification, is permitted pursuant to, and subject
to the license terms contained in, the Simplified BSD to the license terms contained in, the Simplified BSD
License set forth in Section 4.c of the IETF Trust's Legal License set forth in Section 4.c of the IETF Trust's Legal
Provisions Relating to IETF Documents Provisions Relating to IETF Documents
(http://trustee.ietf.org/license-info). (http://trustee.ietf.org/license-info).
This version of this YANG module is part of RFC XXXX; see This version of this YANG module is part of RFC XXXX; see
the RFC itself for full legal notices."; the RFC itself for full legal notices.";
revision 2018-02-02 { revision 2018-03-03 {
description description
"Initial version."; "Initial version.";
reference reference
"RFC XXX: Network Access Control List (ACL) YANG Data Model."; "RFC XXX: Network Access Control List (ACL) YANG Data Model.";
} }
/* /*
* Identities * Identities
*/ */
/* /*
* Forwarding actions for a packet * Forwarding actions for a packet
*/ */
identity forwarding-action { identity forwarding-action {
description description
"Base identity for actions in the forwarding category"; "Base identity for actions in the forwarding category";
} }
identity accept { identity accept {
base forwarding-action; base forwarding-action;
description description
"Accept the packet"; "Accept the packet";
} }
identity drop { identity drop {
base forwarding-action; base forwarding-action;
description description
"Drop packet without sending any ICMP error message"; "Drop packet without sending any ICMP error message";
} }
identity reject { identity reject {
base forwarding-action; base forwarding-action;
description description
"Drop the packet and send an ICMP error message to the source"; "Drop the packet and send an ICMP error message to the source";
} }
/* /*
* Logging actions for a packet * Logging actions for a packet
*/ */
identity log-action { identity log-action {
description description
"Base identity for defining the destination for logging actions"; "Base identity for defining the destination for logging actions";
} }
identity log-syslog { identity log-syslog {
base log-action; base log-action;
description description
"System log (syslog) the information for the packet"; "System log (syslog) the information for the packet";
} }
identity log-none { identity log-none {
base log-action; base log-action;
description description
"No logging for the packet"; "No logging for the packet";
} }
/* /*
* ACL type identities * ACL type identities
*/ */
identity acl-base { identity acl-base {
description description
"Base Access Control List type for all Access Control List type "Base Access Control List type for all Access Control List type
identifiers."; identifiers.";
} }
identity ipv4-acl-type { identity ipv4-acl-type {
base acl:acl-base; base acl:acl-base;
if-feature "ipv4"; if-feature "ipv4";
description description
"ACL that primarily matches on fields from the IPv4 header "ACL that primarily matches on fields from the IPv4 header
(e.g. IPv4 destination address) and layer 4 headers (e.g. TCP (e.g. IPv4 destination address) and layer 4 headers (e.g. TCP
destination port). An acl of type ipv4 does not contain destination port). An acl of type ipv4 does not contain
matches on fields in the ethernet header or the IPv6 header."; matches on fields in the ethernet header or the IPv6 header.";
} }
identity ipv6-acl-type {
base acl:acl-base;
if-feature "ipv6";
description
"ACL that primarily 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 ipv6-acl-type { identity eth-acl-type {
base acl:acl-base; base acl:acl-base;
if-feature "ipv6"; if-feature "eth";
description description
"ACL that primarily matches on fields from the IPv6 header "ACL that primarily matches on fields in the ethernet header,
(e.g. IPv6 destination address) and layer 4 headers (e.g. TCP like 10/100/1000baseT or WiFi Access Control List. An acl of
destination port). An acl of type ipv6 does not contain type ethernet does not contain matches on fields in the IPv4
matches on fields in the ethernet header or the IPv4 header."; header, IPv6 header or layer 4 headers.";
} }
identity eth-acl-type { identity mixed-eth-ipv4-acl-type {
base acl:acl-base; base "acl:eth-acl-type";
if-feature "eth"; base "acl:ipv4-acl-type";
description if-feature "mixed-eth-ipv4";
"ACL that primarily matches on fields in the ethernet header, description
like 10/100/1000baseT or WiFi Access Control List. An acl of "ACL that contains a mix of entries that
type ethernet does not contain matches on fields in the IPv4 primarily match on fields in ethernet headers,
header, IPv6 header or layer 4 headers."; entries that primarily match on IPv4 headers.
} Matching on layer 4 header fields may also exist in the
list.";
}
identity mixed-eth-ipv4-acl-type { identity mixed-eth-ipv6-acl-type {
base "acl:eth-acl-type"; base "acl:eth-acl-type";
base "acl:ipv4-acl-type"; base "acl:ipv6-acl-type";
if-feature "mixed-eth-ipv4"; if-feature "mixed-eth-ipv6";
description description
"ACL that contains a mix of entries that "ACL that contains a mix of entries that
primarily match on fields in ethernet headers, primarily match on fields in ethernet headers, entries
entries that primarily match on IPv4 headers. that primarily match on fields in IPv6 headers. Matching on
Matching on layer 4 header fields may also exist in the layer 4 header fields may also exist in the list.";
list."; }
}
identity mixed-eth-ipv6-acl-type { identity mixed-eth-ipv4-ipv6-acl-type {
base "acl:eth-acl-type"; base "acl:eth-acl-type";
base "acl:ipv6-acl-type"; base "acl:ipv4-acl-type";
if-feature "mixed-eth-ipv6"; base "acl:ipv6-acl-type";
description if-feature "mixed-eth-ipv4-ipv6";
"ACL that contains a mix of entries that description
primarily match on fields in ethernet headers, entries "ACL that contains a mix of entries that
that primarily match on fields in IPv6 headers. Matching on primarily match on fields in ethernet headers, entries
layer 4 header fields may also exist in the list."; that primarily match on fields in IPv4 headers, and entries
} that primarily match on fields 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"; * Features
base "acl:ipv4-acl-type"; */
base "acl:ipv6-acl-type";
if-feature "mixed-eth-ipv4-ipv6";
description
"ACL that contains a mix of entries that
primarily match on fields in ethernet headers, entries
that primarily match on fields in IPv4 headers, and entries
that primarily match on fields in IPv6 headers. Matching on
layer 4 header fields may also exist in the list.";
}
/* /*
* Features * Features supported by device
*/ */
feature match-on-eth {
description
"Device can support matching on ethernet headers.";
}
/* feature match-on-ipv4 {
* Features supported by device description
*/ "Device can support matching on IPv4 headers.";
feature match-on-eth { }
description
"Device can support matching on ethernet headers.";
}
feature match-on-ipv4 { feature match-on-ipv6 {
description description
"Device can support matching on IPv4 headers."; "Device can support matching on IPv6 headers.";
} }
feature match-on-ipv6 { feature match-on-tcp {
description description
"Device can support matching on IPv6 headers."; "Device can support TCP headers.";
} }
feature match-on-tcp { feature match-on-udp {
description description
"Device can support TCP headers."; "Device can support UDP header.";
} }
feature match-on-udp { feature match-on-icmp {
description description
"Device can support UDP header."; "Device can support ICMP header.";
} }
feature match-on-icmp { /*
description * Header classifications combinations supported by
"Device can support ICMP header."; * device
} */
feature eth {
if-feature "match-on-eth";
description
"Plain Ethernet ACL supported";
}
/* feature ipv4 {
* Header classifications combinations supported by if-feature "match-on-ipv4";
* device description
*/ "Plain IPv4 ACL supported";
feature eth { }
if-feature "match-on-eth";
description
"Plain Ethernet ACL supported";
}
feature ipv4 { feature ipv6 {
if-feature "match-on-ipv4"; if-feature "match-on-ipv6";
description description
"Plain IPv4 ACL supported"; "Plain IPv6 ACL supported";
} }
feature ipv6 {
if-feature "match-on-ipv6";
description
"Plain IPv6 ACL supported";
}
feature mixed-eth-ipv4 { feature mixed-eth-ipv4 {
if-feature "match-on-eth and match-on-ipv4"; if-feature "match-on-eth and match-on-ipv4";
description description
"Ethernet and IPv4 ACL combinations supported"; "Ethernet and IPv4 ACL combinations supported";
} }
feature mixed-eth-ipv6 { feature mixed-eth-ipv6 {
if-feature "match-on-eth and match-on-ipv6"; if-feature "match-on-eth and match-on-ipv6";
description description
"Ethernet and IPv6 ACL combinations supported"; "Ethernet and IPv6 ACL combinations supported";
} }
feature mixed-eth-ipv4-ipv6 { feature mixed-eth-ipv4-ipv6 {
if-feature "match-on-eth and match-on-ipv4 if-feature "match-on-eth and match-on-ipv4
and match-on-ipv6"; and match-on-ipv6";
description description
"Ethernet, IPv4 and IPv6 ACL combinations supported."; "Ethernet, IPv4 and IPv6 ACL combinations supported.";
} }
/* /*
* Stats Features * Stats Features
*/ */
feature interface-stats { feature interface-stats {
description description
"ACL counters are available and reported only per interface"; "ACL counters are available and reported only per interface";
} }
feature acl-aggregate-stats { feature acl-aggregate-stats {
description description
"ACL counters are aggregated over all interfaces, and reported "ACL counters are aggregated over all interfaces, and reported
only per ACL entry"; only per ACL entry";
} }
/* /*
* Attachment point features * Attachment point features
*/ */
feature interface-attachment { feature interface-attachment {
description description
"ACLs are set on interfaces."; "ACLs are set on interfaces.";
} }
/* /*
* Typedefs * Typedefs
*/ */
typedef acl-type { typedef acl-type {
type identityref { type identityref {
base acl-base; base acl-base;
} }
description description
"This type is used to refer to an Access Control List "This type is used to refer to an Access Control List
(ACL) type"; (ACL) type";
} }
/* /*
* Groupings * Groupings
*/ */
grouping acl-counters { grouping acl-counters {
description description
"Common grouping for ACL counters"; "Common grouping for ACL counters";
leaf matched-packets { leaf matched-packets {
type yang:counter64; type yang:counter64;
config false; config false;
description description
"Count of the number of packets matching the current ACL "Count of the number of packets matching the current ACL
entry. entry.
An implementation should provide this counter on a An implementation should provide this counter on a
per-interface per-ACL-entry if possible. per-interface per-ACL-entry if possible.
If an implementation only supports ACL counters per entry If an implementation only supports ACL counters per entry
(i.e., not broken out per interface), then the value (i.e., not broken out per interface), then the value
should be equal to the aggregate count across all interfaces. should be equal to the aggregate count across all interfaces.
An implementation that provides counters per entry per An implementation that provides counters per entry per
interface is not required to also provide an aggregate count, interface is not required to also provide an aggregate count,
e.g., per entry -- the user is expected to be able implement e.g., per entry -- the user is expected to be able implement
the required aggregation if such a count is needed."; the required aggregation if such a count is needed.";
} }
leaf matched-octets { leaf matched-octets {
type yang:counter64; type yang:counter64;
config false; config false;
description description
"Count of the number of octets (bytes) matching the current "Count of the number of octets (bytes) matching the current
ACL entry. ACL entry.
An implementation should provide this counter on a An implementation should provide this counter on a
per-interface per-ACL-entry if possible. per-interface per-ACL-entry if possible.
If an implementation only supports ACL counters per entry If an implementation only supports ACL counters per entry
(i.e., not broken out per interface), then the value (i.e., not broken out per interface), then the value
should be equal to the aggregate count across all interfaces. should be equal to the aggregate count across all interfaces.
An implementation that provides counters per entry per An implementation that provides counters per entry per
interface is not required to also provide an aggregate count, interface is not required to also provide an aggregate count,
e.g., per entry -- the user is expected to be able implement e.g., per entry -- the user is expected to be able implement
the required aggregation if such a count is needed."; the required aggregation if such a count is needed.";
} }
} }
/* /*
* Configuration data nodes * Configuration data nodes
*/ */
container access-lists { container access-lists {
description description
"This is a top level container for Access Control Lists. "This is a top level container for Access Control Lists.
It can have one or more Access Control Lists."; It can have one or more Access Control Lists.";
list acl { list acl {
key "name"; key "name";
description description
"An Access Control List(ACL) is an ordered list of "An Access Control List(ACL) is an ordered list of
Access List Entries (ACE). Each Access Control Entry has a Access List Entries (ACE). Each Access Control Entry has a
list of match criteria and a list of actions. list of match criteria and a list of actions.
Since there are several kinds of Access Control Lists Since there are several kinds of Access Control Lists
implemented with different attributes for implemented with different attributes for
different vendors, this model accommodates customizing different vendors, this model accommodates customizing
Access Control Lists for each kind and for each vendor."; Access Control Lists for each kind and for each vendor.";
leaf name { leaf name {
type string { type string {
length "1..64"; length "1..64";
} }
description description
"The name of access-list. A device MAY restrict the length "The name of access-list. A device MAY restrict the length
and value of this name, possibly space and special and value of this name, possibly space and special
characters are not allowed."; characters are not allowed.";
} }
leaf type { leaf type {
type acl-type; type acl-type;
description description
"Type of access control list. Indicates the primary intended "Type of access control list. Indicates the primary intended
type of match criteria (e.g. ethernet, IPv4, IPv6, mixed, type of match criteria (e.g. ethernet, IPv4, IPv6, mixed,
etc) used in the list instance."; etc) used in the list instance.";
} }
container aces { container aces {
description description
"The access-list-entries container contains "The access-list-entries container contains
a list of access-list-entries(ACE)."; a list of access-list-entries(ACE).";
list ace {
key "name";
ordered-by user;
description
"List of access list entries(ACE)";
leaf name {
type string {
length "1..64";
}
description
"A unique name identifying this Access List
Entry(ACE).";
}
list ace { container matches {
key "name"; description
ordered-by user; "The rules in this set determine what fields will be
description matched upon before any action is taken on them.
"List of access list entries(ACE)"; The rules are selected based on the feature set
leaf name { defined by the server and the acl-type defined.
type string { If no matches are defined in a particular container,
length "1..64"; then any packet will match that container. If no
} matches are specified at all in an ACE, then any
description packet will match the ACE.";
"A unique name identifying this Access List
Entry(ACE).";
}
container matches { choice l2 {
description container eth {
"The rules in this set determine what fields will be when "derived-from-or-self(../../../../type, " +
matched upon before any action is taken on them. "'acl:eth-acl-type')";
The rules are selected based on the feature set if-feature match-on-eth;
defined by the server and the acl-type defined. uses pf:acl-eth-header-fields;
If no matches are defined in a particular container, description
then any packet will match that container. If no "Rule set that matches ethernet headers.";
matches are specified at all in an ACE, then any }
packet will match the ACE."; description
"Match layer 2 headers, for example ethernet
header fields.";
}
choice l2 { choice l3 {
container eth { container ipv4 {
when "derived-from(../../../../type, " + when "derived-from-or-self(../../../../type, " +
"'acl:eth-acl-type')"; "'acl:ipv4-acl-type')";
if-feature match-on-eth; if-feature match-on-ipv4;
uses pf:acl-eth-header-fields; uses pf:acl-ip-header-fields;
description uses pf:acl-ipv4-header-fields;
"Rule set that matches ethernet headers."; description
} "Rule set that matches IPv4 headers.";
description }
"Match layer 2 headers, for example ethernet
header fields.";
}
choice l3 { container ipv6 {
container ipv4 { when "derived-from-or-self(../../../../type, " +
when "derived-from(../../../../type, " + "'acl:ipv6-acl-type')";
"'acl:ipv4-acl-type')"; if-feature match-on-ipv6;
if-feature match-on-ipv4; uses pf:acl-ip-header-fields;
uses pf:acl-ip-header-fields; uses pf:acl-ipv6-header-fields;
uses pf:acl-ipv4-header-fields; description
description "Rule set that matches IPv6 headers.";
"Rule set that matches IPv4 headers."; }
description
"Choice of either ipv4 or ipv6 headers";
}
} 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 referring to a group of
source ports";
}
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 referring to a group of
destination ports.";
}
description
"Destination port definition.";
}
description
"Rule set that matches TCP headers.";
}
container ipv6 { container udp {
when "derived-from(../../../../type, " + if-feature match-on-udp;
"'acl:ipv6-acl-type')"; uses pf:acl-udp-header-fields;
if-feature match-on-ipv6; container source-port {
uses pf:acl-ip-header-fields; choice source-port {
uses pf:acl-ipv6-header-fields; case range-or-operator {
description uses pf:port-range-or-operator;
"Rule set that matches IPv6 headers."; description
} "Source port definition from range or
description operator.";
"Choice of either ipv4 or ipv6 headers"; }
} description
"Choice of source port definition using
range/operator or referring to a group of
source ports.";
}
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 referring to a group of
destination ports.";
}
description
"Destination port definition.";
}
description
"Rule set that matches UDP headers.";
}
choice l4 { container icmp {
container tcp { if-feature match-on-icmp;
if-feature match-on-tcp; uses pf:acl-icmp-header-fields;
uses pf:acl-tcp-header-fields; description
choice source-port { "Rule set that matches ICMP headers.";
container source-port-range-or-operator { }
uses pf:port-range-or-operator; description
description "Choice of TCP, UDP or ICMP headers.";
"Source port definition."; }
}
description
"Choice of specifying the source port or referring to
a group of source ports.";
}
choice destination-port {
container destination-port-range-or-operator {
uses pf:port-range-or-operator;
description
"Destination port definition.";
}
description
"Choice of specifying a destination port or referring
to a group of destination ports.";
}
description
"Rule set that matches TCP headers.";
}
container udp { leaf egress-interface {
if-feature match-on-udp; type if:interface-ref;
uses pf:acl-udp-header-fields; description
choice source-port { "Egress interface. This should not be used if this ACL
container source-port-range-or-operator { is attached as an egress ACL (or the value should
uses pf:port-range-or-operator; equal the interface to which the ACL is attached).";
description }
"Source port definition.";
}
description
"Choice of specifying the source port or referring to
a group of source ports.";
}
choice destination-port {
container destination-port-range-or-operator {
uses pf:port-range-or-operator;
description
"Destination port definition.";
}
description
"Choice of specifying a destination port or referring
to a group of destination ports.";
}
description
"Rule set that matches UDP headers.";
}
container icmp { leaf ingress-interface {
if-feature match-on-icmp; type if:interface-ref;
uses pf:acl-icmp-header-fields; description
description "Ingress interface. This should not be used if this ACL
"Rule set that matches ICMP headers."; is attached as an ingress ACL (or the value should
} equal the interface to which the ACL is attached)";
description }
"Choice of TCP, UDP or ICMP headers."; }
}
leaf egress-interface { container actions {
type if:interface-ref; description
description "Definitions of action for this ace entry";
"Egress interface. This should not be used if this ACL leaf forwarding {
is attached as an egress ACL (or the value should equal type identityref {
the interface to which the ACL is attached)."; base forwarding-action;
} }
mandatory true;
description
"Specifies the forwarding action per ace entry";
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
"Definitions of action for this ace entry";
leaf forwarding {
type identityref {
base forwarding-action;
}
mandatory true;
description
"Specifies the forwarding action per ace entry";
}
leaf logging { leaf logging {
type identityref { type identityref {
base log-action; base log-action;
} }
default log-none; default log-none;
description description
"Specifies the log action and destination for "Specifies the log action and destination for
matched packets. Default value is not to log the matched packets. Default value is not to log the
packet."; packet.";
} }
} }
container statistics { container statistics {
if-feature "acl-aggregate-stats"; if-feature "acl-aggregate-stats";
config false; config false;
description description
"Statistics gathered across all attachment points for the "Statistics gathered across all attachment points for the
given ACL."; given ACL.";
uses acl-counters; uses acl-counters;
} }
} }
} }
} }
container attachment-points { container attachment-points {
description description
"Enclosing container for the list of "Enclosing container for the list of
attachment-points on which ACLs are set"; attachment-points on which ACLs are set";
/* /*
* Groupings * Groupings
*/ */
grouping interface-acl { grouping interface-acl {
description description
"Grouping for per-interface ingress ACL data"; "Grouping for per-interface ingress ACL data";
container acl-sets { container acl-sets {
description description
"Enclosing container the list of ingress ACLs on the "Enclosing container the list of ingress ACLs on the
interface"; interface";
list acl-set { list acl-set {
key "name"; key "name";
ordered-by user; ordered-by user;
description description
"List of ingress ACLs on the interface"; "List of ingress ACLs on the interface";
leaf name { leaf name {
type leafref { type leafref {
path "../../../../../../acl/name"; path "/access-lists/acl/name";
} }
description description
"Reference to the ACL name applied on ingress"; "Reference to the ACL name applied on ingress";
} }
list ace-statistics { list ace-statistics {
if-feature "interface-stats"; if-feature "interface-stats";
key "name"; key "name";
config false; config false;
description description
"List of access list entries(ACE)"; "List of access list entries(ACE)";
leaf name { leaf name {
type leafref { type leafref {
path "../../../../../../../acl/aces/ace/name"; path "/access-lists/acl/aces/ace/name";
} }
description description
"The ace name"; "The ace name";
} }
uses acl-counters; uses acl-counters;
} }
} }
} }
} }
list interface { list interface {
if-feature interface-attachment; if-feature interface-attachment;
key "interface-id"; key "interface-id";
description description
"List of interfaces on which ACLs are set"; "List of interfaces on which ACLs are set";
leaf interface-id { leaf interface-id {
type if:interface-ref; type if:interface-ref;
description description
"Reference to the interface id list key"; "Reference to the interface id list key";
} }
container ingress {
uses interface-acl;
description
"The ACL's applied to ingress interface";
}
container egress {
uses interface-acl;
description
"The ACL's applied to egress interface";
}
}
}
}
}
<CODE ENDS> container ingress {
uses interface-acl;
description
"The ACL's applied to ingress interface";
}
container egress {
uses interface-acl;
description
"The ACL's applied to egress interface";
}
}
}
}
}
<CODE ENDS>
4.2. IETF Packet Fields module 4.2. IETF Packet Fields module
The packet fields module defines the necessary groups for matching on The packet fields module defines the necessary groups for matching on
fields in the packet including ethernet, ipv4, ipv6, and transport fields in the packet including ethernet, ipv4, ipv6, and transport
layer fields. The "type" node determines which of these fields get layer fields. The "type" node determines which of these fields get
included for any given ACL with the exception of TCP, UDP and ICMP included for any given ACL with the exception of TCP, UDP and ICMP
header fields. Those fields can be used in conjunction with any of header fields. Those fields can be used in conjunction with any of
the above layer 2 or layer 3 fields. the above layer 2 or layer 3 fields.
Since the number of match criteria is very large, the base draft does Since the number of match criteria is very large, the base draft does
not include these directly but references them by "uses" to keep the not include these directly but references them by "uses" to keep the
base module simple. In case more match conditions are needed, those base module simple. In case more match conditions are needed, those
can be added by augmenting choices within container "matches" in can be added by augmenting choices within container "matches" in
ietf-access-control-list.yang model. ietf-access-control-list.yang model.
This module imports definitions from Common YANG Data Types [RFC6991] This module imports definitions from Common YANG Data Types [RFC6991]
and references IP [RFC0791], ICMP [RFC0792], IPv6 [RFC2460], and references IP [RFC0791], ICMP [RFC0792], Definition of the
Definition of the Differentiated Services Field in the IPv4 and IPv6 Differentiated Services Field in the IPv4 and IPv6 Headers [RFC2474],
Headers [RFC2474], The Addition of Explicit Congestion Notification The Addition of Explicit Congestion Notification (ECN) to IP
(ECN) to IP [RFC3168], Robust Explicit Congestion Notification [RFC3168], , IPv6 Scoped Address Architecture [RFC4007], IPv6
Signaling with Nonces [RFC3540], IPv6 Scoped Address Architecture Addressing Architecture [RFC4291], A Recommendation for IPv6 Address
[RFC4007], IPv6 Addressing Architecture [RFC4291], A Recommendation Text Representation [RFC5952], IPv6 [RFC8200].
for IPv6 Address Text Representation [RFC5952].
<CODE BEGINS> file "ietf-packet-fields@2018-02-02.yang" <CODE BEGINS> file "ietf-packet-fields@2018-03-03.yang"
module ietf-packet-fields { module ietf-packet-fields {
yang-version 1.1; yang-version 1.1;
namespace "urn:ietf:params:xml:ns:yang:ietf-packet-fields"; namespace "urn:ietf:params:xml:ns:yang:ietf-packet-fields";
prefix packet-fields; prefix packet-fields;
import ietf-inet-types { import ietf-inet-types {
prefix inet; prefix inet;
reference
"RFC 6991 - Common YANG Data Types.";
} }
import ietf-yang-types { import ietf-yang-types {
prefix yang; prefix yang;
reference
"RFC 6991 - Common YANG Data Types.";
} }
import ietf-ethertypes { import ietf-ethertypes {
prefix eth; prefix eth;
reference
"RFC XXXX - Network ACL YANG Model.";
} }
organization organization
"IETF NETMOD (NETCONF Data Modeling Language) Working "IETF NETMOD (NETCONF Data Modeling Language) Working
Group"; Group";
contact contact
"WG Web: http://tools.ietf.org/wg/netmod/ "WG Web: http://tools.ietf.org/wg/netmod/
WG List: netmod@ietf.org WG List: netmod@ietf.org
skipping to change at page 24, line 51 skipping to change at page 25, line 45
Redistribution and use in source and binary forms, with or Redistribution and use in source and binary forms, with or
without modification, is permitted pursuant to, and subject without modification, is permitted pursuant to, and subject
to the license terms contained in, the Simplified BSD to the license terms contained in, the Simplified BSD
License set forth in Section 4.c of the IETF Trust's Legal License set forth in Section 4.c of the IETF Trust's Legal
Provisions Relating to IETF Documents Provisions Relating to IETF Documents
(http://trustee.ietf.org/license-info). (http://trustee.ietf.org/license-info).
This version of this YANG module is part of RFC XXXX; see This version of this YANG module is part of RFC XXXX; see
the RFC itself for full legal notices."; the RFC itself for full legal notices.";
revision 2018-02-02 { revision 2018-03-03 {
description description
"Initial version."; "Initial version.";
reference reference
"RFC XXX: Network Access Control List (ACL) YANG Data Model."; "RFC XXX: Network Access Control List (ACL) YANG Data Model.";
} }
/* /*
* Typedefs * Typedefs
*/ */
typedef operator { typedef operator {
type enumeration { type enumeration {
enum lte { enum lte {
description description
"Less than or equal."; "Less than or equal.";
} }
enum gte { enum gte {
skipping to change at page 27, line 28 skipping to change at page 28, line 23
type uint16; type uint16;
description description
"In IPv4 header field, this field is known as the Total Length. "In IPv4 header field, this field is known as the Total Length.
Total Length is the length of the datagram, measured in octets, Total Length is the length of the datagram, measured in octets,
including internet header and data. including internet header and data.
In IPv6 header field, this field is known as the Payload In IPv6 header field, this field is known as the Payload
Length, the length of the IPv6 payload, i.e. the rest of Length, the length of the IPv6 payload, i.e. the rest of
the packet following the IPv6 header, in octets."; the packet following the IPv6 header, in octets.";
reference reference
"RFC 719, RFC 2460"; "RFC 791, RFC 2460";
} }
leaf ttl { leaf ttl {
type uint8; type uint8;
description description
"This field indicates the maximum time the datagram is allowed "This field indicates the maximum time the datagram is allowed
to remain in the internet system. If this field contains the to remain in the internet system. If this field contains the
value zero, then the datagram must be destroyed. value zero, then the datagram must be destroyed.
In IPv6, this field is known as the Hop Limit."; In IPv6, this field is known as the Hop Limit.";
reference "RFC 719, RFC 2460"; reference "RFC 791, RFC 2460";
} }
leaf protocol { leaf protocol {
type uint8; type uint8;
description description
"Internet Protocol number. Refers to the protocol of the "Internet Protocol number. Refers to the protocol of the
payload. In IPv6, this field is known as 'next-header."; payload. In IPv6, this field is known as 'next-header.";
reference "RFC 719, RFC 2460."; reference "RFC 791, RFC 2460.";
} }
} }
grouping acl-ipv4-header-fields { grouping acl-ipv4-header-fields {
description description
"Fields in IPv4 header."; "Fields in IPv4 header.";
leaf ihl { leaf ihl {
type uint8 { type uint8 {
range "5..60"; range "5..60";
skipping to change at page 32, line 4 skipping to change at page 32, line 45
type uint8 { type uint8 {
range "5..15"; range "5..15";
} }
description description
"Specifies the size of the TCP header in 32-bit "Specifies the size of the TCP header in 32-bit
words. The minimum size header is 5 words and words. The minimum size header is 5 words and
the maximum is 15 words thus giving the minimum the maximum is 15 words thus giving the minimum
size of 20 bytes and maximum of 60 bytes, size of 20 bytes and maximum of 60 bytes,
allowing for up to 40 bytes of options in the allowing for up to 40 bytes of options in the
header."; header.";
} }
leaf reserved { leaf reserved {
type uint8; type uint8;
description description
"Reserved for future use."; "Reserved for future use.";
} }
leaf flags { leaf flags {
type bits { type bits {
bit ns {
position 0;
description
"ECN-nonce concealment protection";
reference "RFC 3540";
}
bit cwr { bit cwr {
position 1; position 1;
description description
"Congestion Window Reduced (CWR) flag is set by "Congestion Window Reduced (CWR) flag is set by
the sending host to indicate that it received the sending host to indicate that it received
a TCP segment with the ECE flag set and had a TCP segment with the ECE flag set and had
responded in congestion control mechanism."; responded in congestion control mechanism.";
reference "RFC 3168"; reference "RFC 3168";
} }
bit ece { bit ece {
skipping to change at page 35, line 33 skipping to change at page 36, line 20
"Four-bytes field, contents vary based on the "Four-bytes field, contents vary based on the
ICMP type and code."; ICMP type and code.";
} }
} }
} }
<CODE ENDS> <CODE ENDS>
4.3. An ACL Example 4.3. An ACL Example
Requirement: Deny tcp traffic from 10.10.10.1/24, destined to Requirement: Deny tcp traffic from 192.0.2.0/24, destined to
11.11.11.1/24. 198.51.100.0/24.
Here is the acl configuration xml for this Access Control List: Here is the acl configuration xml for this Access Control List:
<?xml version='1.0' encoding='UTF-8'?> <?xml version="1.0" encoding="UTF-8"?>
<data xmlns="urn:ietf:params:xml:ns:netconf:base:1.0"> <config xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
<access-lists xmlns="urn:ietf:params:xml:ns:yang:ietf-access-control-list"> <access-lists xmlns="urn:ietf:params:xml:ns:yang:ietf-access-control-list">
<acl> <acl>
<name>sample-ipv4-acl</name> <name>sample-ipv4-acl</name>
<type>ipv4-acl-type</type> <type>ipv4-acl-type</type>
<aces> <aces>
<ace> <ace>
<name>rule1</name> <name>rule1</name>
<matches> <matches>
<l3> <ipv4>
<ipv4> <protocol>6</protocol>
<protocol>tcp</protocol> <destination-ipv4-network>192.0.2.0/24</destination-ipv4-network>
<destination-ipv4-network> <source-ipv4-network>198.51.100.0/24</source-ipv4-network>
11.11.11.1/24 </ipv4>
</destination-ipv4-network>
<source-ipv4-network>
10.10.10.1/24
</source-ipv4-network>
</ipv4>
</l3>
</matches> </matches>
<actions> <actions>
<forwarding>drop</forwarding> <forwarding>drop</forwarding>
</actions> </actions>
</ace> </ace>
</aces> </aces>
</acl> </acl>
</access-lists> </access-lists>
</data> </config>
The acl and aces can be described in CLI as the following: The acl and aces can be described in CLI as the following:
access-list ipv4 sample-ipv4-acl access-list ipv4 sample-ipv4-acl
deny tcp 10.10.10.1/24 11.11.11.1/24 deny tcp 192.0.2.0/24 198.51.100.0/24
4.4. Port Range Usage Example 4.4. Port Range Usage Example
When a lower-port and an upper-port are both present, it represents a When a lower-port and an upper-port are both present, it represents a
range between lower-port and upper-port with both the lower-port and range between lower-port and upper-port with both the lower-port and
upper-port are included. When only a lower-port presents, it upper-port are included. When only a lower-port presents, it
represents a single port. represents a single port.
With the follow XML snippet: With the follow XML example:
<source-port-range-or-operator> <?xml version="1.0" encoding="UTF-8"?>
<port-range-or-operator> <config xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
<range> <access-lists xmlns="urn:ietf:params:xml:ns:yang:ietf-access-control-list">
<lower-port>16384</lower-port> <acl>
<upper-port>16387</upper-port> <name>sample-ipv4-acl</name>
</range> <type>ipv4-acl-type</type>
</port-range-or-operator> <aces>
<source-port-range-or-operator> <ace>
<name>rule1</name>
<matches>
<tcp>
<source-port>
<lower-port>16384</lower-port>
<upper-port>16387</upper-port>
</source-port>
</tcp>
</matches>
<actions>
<forwarding>drop</forwarding>
</actions>
</ace>
</aces>
</acl>
</access-lists>
</config>
This represents source ports 16384, 16385, 16386, and 16387. This represents source ports 16384, 16385, 16386, and 16387.
With the follow XML snippet: With the follow XML example:
<source-port-range-or-operator> <?xml version="1.0" encoding="UTF-8"?>
<port-range-or-operator> <config xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
<range> <access-lists xmlns="urn:ietf:params:xml:ns:yang:ietf-access-control-list">
<lower-port>16384</lower-port> <acl>
<upper-port>65535</upper-port> <name>sample-ipv4-acl</name>
</range> <type>ipv4-acl-type</type>
</port-range-or-operator> <aces>
</source-port-range-or-operator> <ace>
<name>rule1</name>
<matches>
<tcp>
<source-port>
<lower-port>16384</lower-port>
<upper-port>65535</upper-port>
</source-port>
</tcp>
</matches>
<actions>
<forwarding>drop</forwarding>
</actions>
</ace>
</aces>
</acl>
</access-lists>
</config>
This represents source ports greater than or equal to 16384 and less This represents source ports greater than or equal to 16384 and less
than equal to 65535. than equal to 65535.
With the follow XML snippet: With the follow XML example:
<source-port-range-or-operator> <?xml version="1.0" encoding="UTF-8"?>
<port-range-or-operator> <config xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
<operator> <access-lists xmlns="urn:ietf:params:xml:ns:yang:ietf-access-control-list">
<operator>eq</operator> <acl>
<port>21</port> <name>sample-ipv4-acl</name>
</operator> <type>ipv4-acl-type</type>
</port-range-or-operator> <aces>
</source-port-range-or-operator> <ace>
<name>rule1</name>
<matches>
<tcp>
<source-port>
<operator>eq</operator>
<port>21</port>
</source-port>
</tcp>
</matches>
<actions>
<forwarding>drop</forwarding>
</actions>
</ace>
</aces>
</acl>
</access-lists>
</config>
This represents port 21. This represents port 21.
With the following XML snippet, the configuration is specifying all With the following XML example, the configuration is specifying all
ports that are not equal to 21. ports that are not equal to 21.
<source-port-range-or-operator> <?xml version="1.0" encoding="UTF-8"?>
<port-range-or-operator> <config xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
<operator> <access-lists xmlns="urn:ietf:params:xml:ns:yang:ietf-access-control-list">
<operator>neq</operator> <acl>
<port>21</port> <name>sample-ipv4-acl</name>
</operator> <type>ipv4-acl-type</type>
</port-range-or-operator> <aces>
</source-port-range-or-operator> <ace>
<name>rule1</name>
<matches>
<tcp>
<source-port>
<operator>neq</operator>
<port>21</port>
</source-port>
</tcp>
</matches>
<actions>
<forwarding>drop</forwarding>
</actions>
</ace>
</aces>
</acl>
</access-lists>
</config>
5. Security Considerations 5. Security Considerations
The YANG module specified in this document is defines a schema for The YANG module specified in this document defines a schema for data
data that is designed to be accessed via network management protocol that is designed to be accessed via network management protocol such
such as NETCONF [RFC6241] or RESTCONF [RFC8040]. The lowest NETCONF as NETCONF [RFC6241] or RESTCONF [RFC8040]. The lowest NETCONF layer
layer is the secure transport layer and the mandatory-to-implement is the secure transport layer and the mandatory-to-implement secure
secure transport is SSH [RFC6242]. The lowest RESTCONF layer is transport is SSH [RFC6242]. The lowest RESTCONF layer is HTTPS, and
HTTPS, and the mandatory-to-implement secure transport is TLS the mandatory-to-implement secure transport is TLS [RFC5246].
[RFC5246].
The NETCONF Access Control Model (NACM [RFC6536]) provides the means The NETCONF Access Control Model (NACM [RFC6536]) provides the means
to restrict access for particular NETCONF users to a pre-configured to restrict access for particular NETCONF users to a pre-configured
subset of all available NETCONF protocol operations and content. subset of all available NETCONF protocol operations and content.
There are a number of data nodes defined in the YANG module which are There are a number of data nodes defined in the YANG module which are
writable/creatable/deletable (i.e., config true, which is the writable/creatable/deletable (i.e., config true, which is the
default). These data nodes may be considered sensitive or vulnerable default). These data nodes may be considered sensitive or vulnerable
in some network environments. Write operations (e.g., <edit-config>) in some network environments. Write operations (e.g., <edit-config>)
to these data nodes without proper protection can have a negative to these data nodes without proper protection can have a negative
effect on network operations. effect on network operations.
These are the subtrees and data nodes and their sensitivity/ These are the subtrees and data nodes and their sensitivity/
vulnerability: vulnerability:
/access-lists/acl/aces: This list specifies all the configured access /access-lists/acl/aces: This list specifies all the configured
control entries on the device. Unauthorized write access to this access control entries on the device. Unauthorized write access
list can allow intruders to access and control the system. to this list can allow intruders to access and control the system.
Unauthorized read access to this list can allow intruders to spoof Unauthorized read access to this list can allow intruders to spoof
packets with authorized addresses thereby compromising the system. packets with authorized addresses thereby compromising the system.
6. IANA Considerations 6. IANA Considerations
This document registers a URI in the IETF XML registry [RFC3688]. This document registers three URIs and three YANG module.
6.1. URI Registration
This document registers three URI in the IETF XML registry [RFC3688].
Following the format in RFC 3688, the following registration is Following the format in RFC 3688, the following registration is
requested to be made: requested to be made:
URI: urn:ietf:params:xml:ns:yang:ietf-access-control-list URI: urn:ietf:params:xml:ns:yang:ietf-access-control-list
URI: urn:ietf:params:xml:ns:yang:ietf-packet-fields URI: urn:ietf:params:xml:ns:yang:ietf-packet-fields
URI: urn:ietf:params:xml:ns:yang:ietf-ethertypes
Registrant Contact: The IESG. Registrant Contact: The IESG.
XML: N/A, the requested URI is an XML namespace. XML: N/A, the requested URI is an XML namespace.
This document registers a YANG module in the YANG Module Names 6.2. YANG Module Name Registration
This document registers three YANG module in the YANG Module Names
registry YANG [RFC6020]. registry YANG [RFC6020].
name: ietf-access-control-list namespace: name: ietf-access-control-list
urn:ietf:params:xml:ns:yang:ietf-access-control-list prefix: ietf-acl namespace: urn:ietf:params:xml:ns:yang:ietf-access-control-list
prefix: acl
reference: RFC XXXX reference: RFC XXXX
name: ietf-packet-fields namespace: urn:ietf:params:xml:ns:yang:ietf- name: ietf-packet-fields
packet-fields prefix: ietf-packet-fields reference: RFC XXXX namespace: urn:ietf:params:xml:ns:yang:ietf-packet-fields
prefix: packet-fields
reference: RFC XXXX
name: ietf-ethertypes
namespace: urn:ietf:params:xml:ns:yang:ietf-ethertypes
prefix: ethertypes
reference: RFC XXXX
7. Acknowledgements 7. Acknowledgements
Alex Clemm, Andy Bierman and Lisa Huang started it by sketching out Alex Clemm, Andy Bierman and Lisa Huang started it by sketching out
an initial IETF draft in several past IETF meetings. That draft an initial IETF draft in several past IETF meetings. That draft
included an ACL YANG model structure and a rich set of match filters, included an ACL YANG model structure and a rich set of match filters,
and acknowledged contributions by Louis Fourie, Dana Blair, Tula and acknowledged contributions by Louis Fourie, Dana Blair, Tula
Kraiser, Patrick Gili, George Serpa, Martin Bjorklund, Kent Watsen, Kraiser, Patrick Gili, George Serpa, Martin Bjorklund, Kent Watsen,
and Phil Shafer. Many people have reviewed the various earlier and Phil Shafer. Many people have reviewed the various earlier
drafts that made the draft went into IETF charter. drafts that made the draft went into IETF charter.
skipping to change at page 39, line 46 skipping to change at page 42, line 31
received more participation from many vendors. received more participation from many vendors.
Authors would like to thank Jason Sterne, Lada Lhotka, Juergen Authors would like to thank Jason Sterne, Lada Lhotka, Juergen
Schoenwalder, David Bannister, Jeff Haas, Kristian Larsson and Einar Schoenwalder, David Bannister, Jeff Haas, Kristian Larsson and Einar
Nilsen-Nygaard for their review of and suggestions to the draft. Nilsen-Nygaard for their review of and suggestions to the draft.
8. References 8. References
8.1. Normative References 8.1. Normative References
[I-D.ietf-netmod-rfc7223bis]
Bjorklund, M., "A YANG Data Model for Interface
Management", draft-ietf-netmod-rfc7223bis-03 (work in
progress), January 2018.
[RFC0791] Postel, J., "Internet Protocol", STD 5, RFC 791, [RFC0791] Postel, J., "Internet Protocol", STD 5, RFC 791,
DOI 10.17487/RFC0791, September 1981, DOI 10.17487/RFC0791, September 1981,
<https://www.rfc-editor.org/info/rfc791>. <https://www.rfc-editor.org/info/rfc791>.
[RFC0792] Postel, J., "Internet Control Message Protocol", STD 5, [RFC0792] Postel, J., "Internet Control Message Protocol", STD 5,
RFC 792, DOI 10.17487/RFC0792, September 1981, RFC 792, DOI 10.17487/RFC0792, September 1981,
<https://www.rfc-editor.org/info/rfc792>. <https://www.rfc-editor.org/info/rfc792>.
[RFC2460] Deering, S. and R. Hinden, "Internet Protocol, Version 6 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate
(IPv6) Specification", RFC 2460, DOI 10.17487/RFC2460, Requirement Levels", BCP 14, RFC 2119,
December 1998, <https://www.rfc-editor.org/info/rfc2460>. DOI 10.17487/RFC2119, March 1997,
<https://www.rfc-editor.org/info/rfc2119>.
[RFC2474] Nichols, K., Blake, S., Baker, F., and D. Black, [RFC2474] Nichols, K., Blake, S., Baker, F., and D. Black,
"Definition of the Differentiated Services Field (DS "Definition of the Differentiated Services Field (DS
Field) in the IPv4 and IPv6 Headers", RFC 2474, Field) in the IPv4 and IPv6 Headers", RFC 2474,
DOI 10.17487/RFC2474, December 1998, DOI 10.17487/RFC2474, December 1998,
<https://www.rfc-editor.org/info/rfc2474>. <https://www.rfc-editor.org/info/rfc2474>.
[RFC3168] Ramakrishnan, K., Floyd, S., and D. Black, "The Addition [RFC3168] Ramakrishnan, K., Floyd, S., and D. Black, "The Addition
of Explicit Congestion Notification (ECN) to IP", of Explicit Congestion Notification (ECN) to IP",
RFC 3168, DOI 10.17487/RFC3168, September 2001, RFC 3168, DOI 10.17487/RFC3168, September 2001,
<https://www.rfc-editor.org/info/rfc3168>. <https://www.rfc-editor.org/info/rfc3168>.
[RFC3540] Spring, N., Wetherall, D., and D. Ely, "Robust Explicit
Congestion Notification (ECN) Signaling with Nonces",
RFC 3540, DOI 10.17487/RFC3540, June 2003,
<https://www.rfc-editor.org/info/rfc3540>.
[RFC3688] Mealling, M., "The IETF XML Registry", BCP 81, RFC 3688, [RFC3688] Mealling, M., "The IETF XML Registry", BCP 81, RFC 3688,
DOI 10.17487/RFC3688, January 2004, DOI 10.17487/RFC3688, January 2004,
<https://www.rfc-editor.org/info/rfc3688>. <https://www.rfc-editor.org/info/rfc3688>.
[RFC4007] Deering, S., Haberman, B., Jinmei, T., Nordmark, E., and [RFC4007] Deering, S., Haberman, B., Jinmei, T., Nordmark, E., and
B. Zill, "IPv6 Scoped Address Architecture", RFC 4007, B. Zill, "IPv6 Scoped Address Architecture", RFC 4007,
DOI 10.17487/RFC4007, March 2005, DOI 10.17487/RFC4007, March 2005,
<https://www.rfc-editor.org/info/rfc4007>. <https://www.rfc-editor.org/info/rfc4007>.
[RFC4291] Hinden, R. and S. Deering, "IP Version 6 Addressing [RFC4291] Hinden, R. and S. Deering, "IP Version 6 Addressing
skipping to change at page 41, line 28 skipping to change at page 44, line 14
[RFC6536] Bierman, A. and M. Bjorklund, "Network Configuration [RFC6536] Bierman, A. and M. Bjorklund, "Network Configuration
Protocol (NETCONF) Access Control Model", RFC 6536, Protocol (NETCONF) Access Control Model", RFC 6536,
DOI 10.17487/RFC6536, March 2012, DOI 10.17487/RFC6536, March 2012,
<https://www.rfc-editor.org/info/rfc6536>. <https://www.rfc-editor.org/info/rfc6536>.
[RFC6991] Schoenwaelder, J., Ed., "Common YANG Data Types", [RFC6991] Schoenwaelder, J., Ed., "Common YANG Data Types",
RFC 6991, DOI 10.17487/RFC6991, July 2013, RFC 6991, DOI 10.17487/RFC6991, July 2013,
<https://www.rfc-editor.org/info/rfc6991>. <https://www.rfc-editor.org/info/rfc6991>.
[RFC7223] Bjorklund, M., "A YANG Data Model for Interface
Management", RFC 7223, DOI 10.17487/RFC7223, May 2014,
<https://www.rfc-editor.org/info/rfc7223>.
[RFC7950] Bjorklund, M., Ed., "The YANG 1.1 Data Modeling Language", [RFC7950] Bjorklund, M., Ed., "The YANG 1.1 Data Modeling Language",
RFC 7950, DOI 10.17487/RFC7950, August 2016, RFC 7950, DOI 10.17487/RFC7950, August 2016,
<https://www.rfc-editor.org/info/rfc7950>. <https://www.rfc-editor.org/info/rfc7950>.
[RFC8040] Bierman, A., Bjorklund, M., and K. Watsen, "RESTCONF [RFC8040] Bierman, A., Bjorklund, M., and K. Watsen, "RESTCONF
Protocol", RFC 8040, DOI 10.17487/RFC8040, January 2017, Protocol", RFC 8040, DOI 10.17487/RFC8040, January 2017,
<https://www.rfc-editor.org/info/rfc8040>. <https://www.rfc-editor.org/info/rfc8040>.
[RFC8174] Leiba, B., "Ambiguity of Uppercase vs Lowercase in RFC
2119 Key Words", BCP 14, RFC 8174, DOI 10.17487/RFC8174,
May 2017, <https://www.rfc-editor.org/info/rfc8174>.
[RFC8200] Deering, S. and R. Hinden, "Internet Protocol, Version 6
(IPv6) Specification", STD 86, RFC 8200,
DOI 10.17487/RFC8200, July 2017,
<https://www.rfc-editor.org/info/rfc8200>.
8.2. Informative References 8.2. Informative References
[I-D.ietf-netmod-yang-tree-diagrams] [I-D.ietf-netmod-yang-tree-diagrams]
Bjorklund, M. and L. Berger, "YANG Tree Diagrams", draft- Bjorklund, M. and L. Berger, "YANG Tree Diagrams", draft-
ietf-netmod-yang-tree-diagrams-04 (work in progress), ietf-netmod-yang-tree-diagrams-06 (work in progress),
December 2017. February 2018.
[RFC5101] Claise, B., Ed., "Specification of the IP Flow Information [RFC7011] Claise, B., Ed., Trammell, B., Ed., and P. Aitken,
Export (IPFIX) Protocol for the Exchange of IP Traffic "Specification of the IP Flow Information Export (IPFIX)
Flow Information", RFC 5101, DOI 10.17487/RFC5101, January Protocol for the Exchange of Flow Information", STD 77,
2008, <https://www.rfc-editor.org/info/rfc5101>. RFC 7011, DOI 10.17487/RFC7011, September 2013,
<https://www.rfc-editor.org/info/rfc7011>.
Appendix A. Extending ACL model examples Appendix A. Extending ACL model examples
A.1. A company proprietary module example A.1. A company proprietary module example
Module "example-newco-acl" is an example of company proprietary model Module "example-newco-acl" is an example of company proprietary model
that augments "ietf-acl" module. It shows how to use 'augment' with that augments "ietf-acl" module. It shows how to use 'augment' with
an XPath expression to add additional match criteria, action an XPath expression to add additional match criteria, action
criteria, and default actions when no ACE matches found. All these criteria, and default actions when no ACE matches are found. All
are company proprietary extensions or system feature extensions. these are company proprietary extensions or system feature
"example-newco-acl" is just an example and it is expected from extensions. "example-newco-acl" is just an example and it is
vendors to create their own proprietary models. expected that vendors will create their own proprietary models.
The following figure is the tree structure of example-newco-acl. In
this example, /ietf-acl:access-lists/ietf-acl:acl/ietf-acl:aces/ietf-
acl:ace/ietf-acl:matches are augmented with two new choices,
protocol-payload-choice and metadata. The protocol-payload-choice
uses a grouping with an enumeration of all supported protocol values.
Metadata matches apply to fields associated with the packet but not
in the packet header such as overall packet length. In other
example, /ietf-acl:access-lists/ietf-acl:acl/ietf-acl:aces/ietf-
acl:ace/ietf-acl:actions are augmented with new choice of actions.
module: example-newco-acl
augment /ietf-acl:access-lists/ietf-acl:acl/ietf-acl:aces/ietf-acl:ac
e/ietf-acl:matches:
+--rw (protocol-payload-choice)?
| +--:(protocol-payload)
| +--rw protocol-payload* [value-keyword]
| +--rw value-keyword enumeration
+--rw (metadata)?
+--:(packet-length)
+--rw packet-length? uint16
augment /ietf-acl:access-lists/ietf-acl:acl/ietf-acl:aces/ietf-acl:ac
e/ietf-acl:actions:
+--rw (action)?
+--:(count)
| +--rw count? uint32
+--:(policer)
| +--rw policer? string
+--:(hiearchical-policer)
+--rw hierarchitacl-policer? string
augment /ietf-acl:access-lists/ietf-acl:acl/ietf-acl:aces/ietf-acl:ac
e/ietf-acl:actions:
+--rw default-action? identityref
module example-newco-acl { module example-newco-acl {
yang-version 1.1; yang-version 1.1;
namespace "urn:newco:params:xml:ns:yang:example-newco-acl";
namespace "http://example.com/ns/example-newco-acl";
prefix example-newco-acl; prefix example-newco-acl;
import ietf-access-control-list { import ietf-access-control-list {
prefix "ietf-acl"; prefix "acl";
} }
organization organization
"Newco model group."; "Newco model group.";
contact contact
"abc@newco.com"; "abc@newco.com";
description description
"This YANG module augments IETF ACL Yang."; "This YANG module augments IETF ACL Yang.";
revision 2018-02-02 { revision 2018-03-03 {
description description
"Creating NewCo proprietary extensions to ietf-acl model"; "Creating NewCo proprietary extensions to ietf-acl model";
reference reference
"RFC XXXX: Network Access Control List (ACL) "RFC XXXX: Network Access Control List (ACL)
YANG Data Model"; YANG Data Model";
} }
augment "/ietf-acl:access-lists/ietf-acl:acl/" + augment "/acl:access-lists/acl:acl/" +
"ietf-acl:aces/ietf-acl:ace/" + "acl:aces/acl:ace/" +
"ietf-acl:matches" { "acl:matches" {
description "Newco proprietary simple filter matches"; description "Newco proprietary simple filter matches";
choice protocol-payload-choice { choice protocol-payload-choice {
description "Newco proprietary payload match condition"; description "Newco proprietary payload match condition";
list protocol-payload { list protocol-payload {
key value-keyword; key value-keyword;
ordered-by user; ordered-by user;
description "Match protocol payload"; description "Match protocol payload";
uses match-simple-payload-protocol-value; uses match-simple-payload-protocol-value;
} }
} }
choice metadata { choice metadata {
description "Newco proprietary interface match condition"; description "Newco proprietary interface match condition";
leaf packet-length { leaf packet-length {
type uint16; type uint16;
description "Match on packet length"; description "Match on packet length";
} }
} }
} }
augment "/ietf-acl:access-lists/ietf-acl:acl/" +
"ietf-acl:aces/ietf-acl:ace/" + augment "/acl:access-lists/acl:acl/" +
"ietf-acl:actions" { "acl:aces/acl:ace/" +
"acl:actions" {
description "Newco proprietary simple filter actions"; description "Newco proprietary simple filter actions";
choice action { choice action {
description ""; description "";
case count { case count {
description "Count the packet in the named counter"; description "Count the packet in the named counter";
leaf count { leaf count {
type uint32; type uint32;
description "Count"; description "Count";
} }
} }
case policer { case policer {
description "Name of policer to use to rate-limit traffic"; description "Name of policer to use to rate-limit traffic";
leaf policer { leaf policer {
type string; type string;
description "Name of the policer"; description "Name of the policer";
} }
} }
case hiearchical-policer { case hiearchical-policer {
description "Name of hierarchical policer to use to
rate-limit traffic";
leaf hierarchitacl-policer { leaf hierarchitacl-policer {
type string; type string;
description "Name of the hierarchical policer."; description
"Name of the hierarchical policer.";
} }
description
"Name of hierarchical policer to use to
rate-limit traffic";
} }
} }
} }
augment "/ietf-acl:access-lists/ietf-acl:acl" + augment "/acl:access-lists/acl:acl" +
"/ietf-acl:aces/ietf-acl:ace/" + "/acl:aces/acl:ace/" +
"ietf-acl:actions" { "acl:actions" {
description "Newco proprietary default action";
leaf default-action { leaf default-action {
description
"Actions that occur if no ace is matched.";
type identityref { type identityref {
base ietf-acl:forwarding-action; base acl:forwarding-action;
} }
default ietf-acl:drop; default acl:drop;
description
"Actions that occur if no ace is matched.";
} }
description
"Newco proprietary default action";
} }
grouping match-simple-payload-protocol-value { grouping match-simple-payload-protocol-value {
description "Newco proprietary payload"; description "Newco proprietary payload";
leaf value-keyword { leaf value-keyword {
type enumeration { type enumeration {
enum icmp { enum icmp {
description "Internet Control Message Protocol"; description "Internet Control Message Protocol";
} }
enum icmp6 { enum icmp6 {
skipping to change at page 45, line 20 skipping to change at page 47, line 30
} }
enum range { enum range {
description "Range of values"; description "Range of values";
} }
} }
description "(null)"; description "(null)";
} }
} }
} }
Draft authors expect that different vendors will provide their own The following figure is the tree structure of example-newco-acl. In
yang models as in the example above, which is the augmentation of the this example, /ietf-acl:access-lists/ietf-acl:acl/ietf-acl:aces/ietf-
base model acl:ace/ietf-acl:matches are augmented with two new choices,
protocol-payload-choice and metadata. The protocol-payload-choice
uses a grouping with an enumeration of all supported protocol values.
Metadata matches apply to fields associated with the packet but not
in the packet header such as overall packet length. In other
example, /ietf-acl:access-lists/ietf-acl:acl/ietf-acl:aces/ietf-
acl:ace/ietf-acl:actions are augmented with new choice of actions.
module: example-newco-acl
augment /acl:access-lists/acl:acl/acl:aces/acl:ace/acl:matches:
+--rw (protocol-payload-choice)?
| +--:(protocol-payload)
| +--rw protocol-payload* [value-keyword]
| +--rw value-keyword enumeration
+--rw (metadata)?
+--:(packet-length)
+--rw packet-length? uint16
augment /acl:access-lists/acl:acl/acl:aces/acl:ace/acl:actions:
+--rw (action)?
+--:(count)
| +--rw count? uint32
+--:(policer)
| +--rw policer? string
+--:(hiearchical-policer)
+--rw hierarchitacl-policer? string
augment /acl:access-lists/acl:acl/acl:aces/acl:ace/acl:actions:
+--rw default-action? identityref
A.2. Linux nftables A.2. Linux nftables
As Linux platform is becoming more popular as networking platform, As Linux platform is becoming more popular as networking platform,
the Linux data model is changing. Previously ACLs in Linux were the Linux data model is changing. Previously ACLs in Linux were
highly protocol specific and different utilities were used (iptables, highly protocol specific and different utilities were used (iptables,
ip6tables, arptables, ebtables), so each one had separate data model. ip6tables, arptables, ebtables), so each one had separate data model.
Recently, this has changed and a single utility, nftables, has been Recently, this has changed and a single utility, nftables, has been
developed. With a single application, it has a single data model for developed. With a single application, it has a single data model for
filewall filters and it follows very similarly to the ietf-access- filewall filters and it follows very similarly to the ietf-access-
control list module proposed in this draft. The nftables support control list module proposed in this draft. The nftables support
input and output ACEs and each ACE can be defined with match and input and output ACEs and each ACE can be defined with match and
action. action.
The example in Section 4.3 can be configured using nftable tool as The example in Section 4.3 can be configured using nftable tool as
below. below.
nft add table ip filter nft add table ip filter
nft add chain filter input nft add chain filter input
nft add rule ip filter input ip protocol tcp ip saddr \ nft add rule ip filter input ip protocol tcp ip saddr \
10.10.10.1/24 drop 192.0.2.1/24 drop
The configuration entries added in nftable would be. The configuration entries added in nftable would be.
table ip filter { table ip filter {
chain input { chain input {
ip protocol tcp ip saddr 10.10.10.1/24 drop ip protocol tcp ip saddr 192.0.2.1/24 drop
} }
} }
We can see that there are many similarities between Linux nftables We can see that there are many similarities between Linux nftables
and IETF ACL YANG data models and its extension models. It should be and IETF ACL YANG data models and its extension models. It should be
fairly easy to do translation between ACL YANG model described in fairly easy to do translation between ACL YANG model described in
this draft and Linux nftables. this draft and Linux nftables.
A.3. Ethertypes A.3. Ethertypes
The ACL module is dependent on the definition of ethertypes. IEEE The ACL module is dependent on the definition of ethertypes. IEEE
owns the allocation of those ethertypes. This model is being owns the allocation of those ethertypes. This model is being
included here to enable definition of those types till such time that included here to enable definition of those types till such time that
IEEE takes up the task of publication of the model that defines those IEEE takes up the task of publication of the model that defines those
ethertypes. At that time, this model can be deprecated. ethertypes. At that time, this model can be deprecated.
<CODE BEGINS> file "ietf-ethertypes@2018-02-02.yang" <CODE BEGINS> file "ietf-ethertypes@2018-03-03.yang"
module ietf-ethertypes { module ietf-ethertypes {
namespace "urn:ietf:params:xml:ns:yang:ietf-ethertypes"; namespace "urn:ietf:params:xml:ns:yang:ietf-ethertypes";
prefix ie; prefix ethertypes;
organization organization
"IETF NETMOD (NETCONF Data Modeling Language)"; "IETF NETMOD (NETCONF Data Modeling Language)";
contact contact
"WG Web: <http://tools.ietf.org/wg/netmod/> "WG Web: <http://tools.ietf.org/wg/netmod/>
WG List: <mailto:netmod@ietf.org> WG List: <mailto:netmod@ietf.org>
Editor: Mahesh Jethanandani Editor: Mahesh Jethanandani
<mjethanandani@gmail.com>"; <mjethanandani@gmail.com>";
description description
"This module contains the common definitions for the "This module contains the common definitions for the
Ethertype used by different modules. It is a Ethertype used by different modules. It is a
placeholder module, till such time that IEEE placeholder module, till such time that IEEE
starts a project to define these Ethertypes starts a project to define these Ethertypes
and publishes a standard. and publishes a standard.
At that time this module can be deprecated."; At that time this module can be deprecated.";
revision 2018-02-02 { revision 2018-03-03 {
description description
"Initial revision."; "Initial revision.";
reference reference
"RFC XXXX: IETF Ethertype YANG Data Module."; "RFC XXXX: IETF Ethertype YANG Data Module.";
} }
typedef ethertype { typedef ethertype {
type union { type union {
type uint16; type uint16;
skipping to change at page 54, line 22 skipping to change at page 57, line 22
General Electric General Electric
Email: lyihuang16@gmail.com Email: lyihuang16@gmail.com
Sonal Agarwal Sonal Agarwal
Cisco Systems, Inc. Cisco Systems, Inc.
Email: sagarwal12@gmail.com Email: sagarwal12@gmail.com
Dana Blair Dana Blair
Cisco Systems, INc Cisco Systems, Inc.
Email: dblair@cisco.com Email: dblair@cisco.com
 End of changes. 157 change blocks. 
824 lines changed or deleted 942 lines changed or added

This html diff was produced by rfcdiff 1.46. The latest version is available from http://tools.ietf.org/tools/rfcdiff/