draft-ietf-netmod-acl-model-14.txt   draft-ietf-netmod-acl-model-15.txt 
NETMOD WG M. Jethanandani NETMOD WG M. Jethanandani
Internet-Draft Cisco Systems, Inc Internet-Draft
Intended status: Standards Track L. Huang Intended status: Standards Track L. Huang
Expires: April 6, 2018 General Electric Expires: July 20, 2018 General Electric
S. Agarwal S. Agarwal
Cisco Systems, Inc. Cisco Systems, Inc.
D. Blair D. Blair
Cisco Systems, INc Cisco Systems, INc
October 03, 2017 January 16, 2018
Network Access Control List (ACL) YANG Data Model Network Access Control List (ACL) YANG Data Model
draft-ietf-netmod-acl-model-14 draft-ietf-netmod-acl-model-15
Abstract Abstract
This document describes a data model of Access Control List (ACL) This document describes a data model of Access Control List (ACL)
basic building blocks. basic building blocks.
Editorial Note (To be removed by RFC Editor) Editorial Note (To be removed by RFC Editor)
This draft contains many placeholder values that need to be replaced This draft contains many placeholder values that need to be replaced
with finalized values at the time of publication. This note with finalized values at the time of publication. This note
skipping to change at page 2, line 10 skipping to change at page 2, line 10
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 April 6, 2018. This Internet-Draft will expire on July 20, 2018.
Copyright Notice Copyright Notice
Copyright (c) 2017 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 . . . . . . . . . . . . . . . . . . . . . . . . 3
1.1. Definitions and Acronyms . . . . . . . . . . . . . . . . 3 1.1. Definitions and Acronyms . . . . . . . . . . . . . . . . 3
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 . . . . . . . . . . . . . . . . . . . . . . . 10 4. ACL YANG Models . . . . . . . . . . . . . . . . . . . . . . . 9
4.1. IETF Access Control List module . . . . . . . . . . . . . 10 4.1. IETF Access Control List module . . . . . . . . . . . . . 9
4.2. IETF Packet Fields module . . . . . . . . . . . . . . . . 23 4.2. IETF Packet Fields module . . . . . . . . . . . . . . . . 22
4.3. An ACL Example . . . . . . . . . . . . . . . . . . . . . 35 4.3. An ACL Example . . . . . . . . . . . . . . . . . . . . . 33
4.4. Port Range Usage Example . . . . . . . . . . . . . . . . 36 4.4. Port Range Usage Example . . . . . . . . . . . . . . . . 34
5. Security Considerations . . . . . . . . . . . . . . . . . . . 37 5. Security Considerations . . . . . . . . . . . . . . . . . . . 36
6. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 38 6. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 36
7. Acknowledgements . . . . . . . . . . . . . . . . . . . . . . 38 7. Acknowledgements . . . . . . . . . . . . . . . . . . . . . . 37
8. Open Issues . . . . . . . . . . . . . . . . . . . . . . . . . 39 8. Open Issues . . . . . . . . . . . . . . . . . . . . . . . . . 37
9. References . . . . . . . . . . . . . . . . . . . . . . . . . 39 9. References . . . . . . . . . . . . . . . . . . . . . . . . . 37
9.1. Normative References . . . . . . . . . . . . . . . . . . 39 9.1. Normative References . . . . . . . . . . . . . . . . . . 37
9.2. Informative References . . . . . . . . . . . . . . . . . 40 9.2. Informative References . . . . . . . . . . . . . . . . . 38
Appendix A. Extending ACL model examples . . . . . . . . . . . . 40 Appendix A. Extending ACL model examples . . . . . . . . . . . . 38
A.1. Example of extending existing model for route filtering . 40 A.1. A company proprietary module example . . . . . . . . . . 38
A.2. A company proprietary module example . . . . . . . . . . 42 A.2. Linux nftables . . . . . . . . . . . . . . . . . . . . . 42
A.3. Linux nftables . . . . . . . . . . . . . . . . . . . . . 46 A.3. Ethertypes . . . . . . . . . . . . . . . . . . . . . . . 42
A.4. Ethertypes . . . . . . . . . . . . . . . . . . . . . . . 46 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 50
Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 54
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 set of rules that is used to filter traffic on a An ACL is an ordered-by-user set of rules that is used to filter
networking device. Each rule is represented by an Access Control traffic on a networking device. Each rule is represented by an
Entry (ACE). Access Control Entry (ACE).
Each ACE has a group of match criteria and a group of action Each ACE has a group of match criteria and a group of action
criteria. criteria.
The match criteria consist of a tuple of packet header match criteria The match criteria consist of a tuple of packet header match criteria
and can have metadata match criteria as well. and can have metadata match criteria as well.
o Packet header matches apply to fields visible in the packet such o Packet header matches apply to fields visible in the packet such
as address or class of service or port numbers. as address or class of service or port numbers.
skipping to change at page 3, line 44 skipping to change at page 3, line 44
Access Control List is also widely knowns as ACL (pronounce as [ak-uh Access Control List is also widely knowns as ACL (pronounce as [ak-uh
l]) or Access List. In this document, Access Control List, ACL and l]) or Access List. In this document, Access Control List, ACL and
Access List are used interchangeably. Access List are used interchangeably.
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, vendors would have to augment apply an ACL to any attachment point other than an interface, vendors
the ACL YANG model. would have to augment the ACL YANG model.
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
skipping to change at page 4, line 21 skipping to change at page 4, line 21
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
2. Problem Statement 2. Problem Statement
This document defines a YANG [RFC6020] data model for the This document defines a YANG [RFC6020] data model for the
configuration of ACLs. It is very important that model can be easily configuration of ACLs. It is very important that model can be used
used 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.
3. Understanding ACL's Filters and Actions 3. Understanding ACL's Filters and Actions
Although different vendors have different ACL data models, there is a Although different vendors have different ACL data models, there is a
common understanding of what access control list (ACL) is. A network common understanding of what Access Control List (ACL) is. A network
system usually have a list of ACLs, and each ACL contains an ordered system usually have a list of ACLs, and each ACL contains an ordered
list of rules, also known as access list entries - ACEs. Each ACE list of rules, also known as Access Control Entries (ACE). Each ACE
has a group of match criteria and a group of action criteria. The has a group of match criteria and a group of action criteria. The
match criteria consist of packet header matching. It as also match criteria consist of packet header matching. It as also
possible for ACE to match on metadata, if supported by the vendor. possible for ACE to match on metadata, if supported by the vendor.
Packet header matching applies to fields visible in the packet such Packet header matching applies to fields visible in the packet such
as address or class of service or port numbers. Metadata matching as address or class of service or port numbers. Metadata matching
applies to fields associated with the packet, but not in the packet applies to fields associated with the packet, but not in the packet
header such as input interface, packet length, or source or header such as input interface, packet length, or source or
destination prefix length. The actions can be any sort of operation destination prefix length. The actions can be any sort of operation
from logging to rate limiting or dropping to simply forwarding. from logging to rate limiting or dropping to simply forwarding.
Actions on the first matching ACE are applied with no processing of Actions on the first matching ACE are applied with no processing of
skipping to change at page 5, line 12 skipping to change at page 5, line 12
a networked device, applications or features running in the device, a networked device, applications or features running in the device,
etc. When applied to interfaces of a networked device, the ACL is etc. When applied to interfaces of a networked device, the ACL is
applied in a direction which indicates if it should be applied to applied in a direction which indicates if it should be applied to
packet entering (input) or leaving the device (output). An example packet entering (input) or leaving the device (output). An example
in the appendix shows how to express it in YANG model. in the appendix shows how to express it in YANG model.
This draft tries to address the commonalities between all vendors and This draft tries to address the commonalities between all vendors and
create a common model, which can be augmented with proprietary create a common model, which can be augmented with proprietary
models. The base model is simple and with this design we hope to models. The base model is simple and with this design we hope to
achieve enough flexibility for each vendor to extend the base model. achieve enough flexibility for each vendor to extend the base model.
The use of feature statements in the document allows vendors to
advertise match rules they support. The use of feature statements in the model allows vendors to
advertise match rules they are capable and willing support. There
are two sets of feature statements a device needs to advertise. The
first set of feature statements specify the capability of the device.
These include features such as "Device can support ethernet headers"
or "Device can support of IPv4 headers". The second set of feature
statements specify 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 3.1. ACL Modules
There are two YANG modules in the model. The first module, "ietf- There are two YANG modules in the model. The first module, "ietf-
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". "ietf-access-control-list" uses groupings in "ietf-packet-fields" to
The combination of if-feature checks and must statements allow for specify match fields such as port numbers or protocol. The
the selection of relevant match fields that a user can define rules combination of if-feature checks and must statements allow for the
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. [RFC5101], 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* [acl-type acl-name] +--rw acl* [name]
| +--rw acl-name string | +--rw name string
| +--rw acl-type acl-type | +--rw type? acl-type
| +--rw aces | +--rw aces
| +--rw ace* [rule-name] | +--rw ace* [name]
| +--rw rule-name string | +--rw name string
| +--rw matches | +--rw matches
| | +--rw l2-acl {l2-acl}? | | +--rw (l2)?
| | | +--rw destination-mac-address? yang:mac-ad | | | +--:(eth)
dress | | | +--rw eth {match-on-eth}?
| | | +--rw destination-mac-address-mask? yang:mac-ad | | | +--rw destination-mac-address?
dress | | | | yang:mac-address
| | | +--rw source-mac-address? yang:mac-ad | | | +--rw destination-mac-address-mask?
dress | | | | yang:mac-address
| | | +--rw source-mac-address-mask? yang:mac-ad | | | +--rw source-mac-address?
dress | | | | yang:mac-address
| | | +--rw ethertype? eth:etherty | | | +--rw source-mac-address-mask?
| | | | yang:mac-address
pe | | | +--rw ethertype?
| | +--rw ipv4-acl {ipv4-acl}? | | | eth:ethertype
| | | +--rw dscp? inet:dscp | | +--rw (l3)?
| | | +--rw ecn? uint8 | | | +--:(ipv4)
| | | +--rw length? uint16 | | | | +--rw ipv4 {match-on-ipv4}?
| | | +--rw ttl? uint8 | | | | +--rw dscp?
| | | +--rw protocol? uint8 | | | | | inet:dscp
| | | +--rw source-port-range! | | | | +--rw ecn?
| | | | +--rw lower-port inet:port-number | | | | | uint8
| | | | +--rw upper-port? inet:port-number | | | | +--rw length?
| | | | +--rw operation? operator | | | | | uint16
| | | +--rw destination-port-range! | | | | +--rw ttl?
| | | | +--rw lower-port inet:port-number | | | | | uint8
| | | | +--rw upper-port? inet:port-number | | | | +--rw protocol?
| | | | +--rw operations? operator | | | | | uint8
| | | +--rw ihl? uint8 | | | | +--rw source-port-range-or-operator
| | | +--rw flags? bits | | | | | +--rw (port-range-or-operator)?
| | | +--rw offset? uint16 | | | | | +--:(range)
| | | +--rw identification? uint16 | | | | | | +--rw lower-port inet:port-numb
| | | +--rw destination-ipv4-network? inet:ipv4-prefi er
x | | | | | | +--rw upper-port inet:port-numb
| | | +--rw source-ipv4-network? inet:ipv4-prefi er
x | | | | | +--:(operator)
| | +--rw ipv6-acl {ipv6-acl}? | | | | | +--rw operator? operator
| | | +--rw dscp? inet:dscp | | | | | +--rw port inet:port-numb
| | | +--rw ecn? uint8 er
| | | +--rw length? uint16 | | | | +--rw destination-port-range-or-operator
| | | +--rw ttl? uint8 | | | | | +--rw (port-range-or-operator)?
| | | +--rw protocol? uint8 | | | | | +--:(range)
| | | +--rw source-port-range! | | | | | | +--rw lower-port inet:port-numb
| | | | +--rw lower-port inet:port-number er
| | | | +--rw upper-port? inet:port-number | | | | | | +--rw upper-port inet:port-numb
| | | | +--rw operation? operator er
| | | +--rw destination-port-range! | | | | | +--:(operator)
| | | | +--rw lower-port inet:port-number | | | | | +--rw operator? operator
| | | | +--rw upper-port? inet:port-number | | | | | +--rw port inet:port-numb
| | | | +--rw operations? operator er
| | | +--rw next-header? uint8 | | | | +--rw ihl?
| | | +--rw destination-ipv6-network? inet:ipv6-prefi | | | | | uint8
x | | | | +--rw flags?
| | | +--rw source-ipv6-network? inet:ipv6-prefi | | | | | bits
x | | | | +--rw offset?
| | | +--rw flow-label? inet:ipv6-flow- | | | | | uint16
label | | | | +--rw identification?
| | +--rw l2-l3-ipv4-acl {mixed-ipv4-acl}? | | | | | uint16
| | | +--rw destination-mac-address? yang:mac-ad | | | | +--rw destination-ipv4-network?
dress | | | | | inet:ipv4-prefix
| | | +--rw destination-mac-address-mask? yang:mac-ad | | | | +--rw source-ipv4-network?
| | | | inet:ipv4-prefix
dress | | | +--:(ipv6)
| | | +--rw source-mac-address? yang:mac-ad | | | +--rw ipv6 {match-on-ipv6}?
dress | | | +--rw dscp?
| | | +--rw source-mac-address-mask? yang:mac-ad | | | | inet:dscp
dress | | | +--rw ecn?
| | | +--rw ethertype? eth:etherty | | | | uint8
pe | | | +--rw length?
| | | +--rw dscp? inet:dscp | | | | uint16
| | | +--rw ecn? uint8 | | | +--rw ttl?
| | | +--rw length? uint16 | | | | uint8
| | | +--rw ttl? uint8 | | | +--rw protocol?
| | | +--rw protocol? uint8 | | | | uint8
| | | +--rw source-port-range! | | | +--rw source-port-range-or-operator
| | | | +--rw lower-port inet:port-number | | | | +--rw (port-range-or-operator)?
| | | | +--rw upper-port? inet:port-number | | | | +--:(range)
| | | | +--rw operation? operator | | | | | +--rw lower-port inet:port-numb
| | | +--rw destination-port-range! er
| | | | +--rw lower-port inet:port-number | | | | | +--rw upper-port inet:port-numb
| | | | +--rw upper-port? inet:port-number er
| | | | +--rw operations? operator | | | | +--:(operator)
| | | +--rw ihl? uint8 | | | | +--rw operator? operator
| | | +--rw flags? bits | | | | +--rw port inet:port-numb
| | | +--rw offset? uint16 er
| | | +--rw identification? uint16 | | | +--rw destination-port-range-or-operator
| | | +--rw destination-ipv4-network? inet:ipv4-p | | | | +--rw (port-range-or-operator)?
refix | | | | +--:(range)
| | | +--rw source-ipv4-network? inet:ipv4-p | | | | | +--rw lower-port inet:port-numb
refix er
| | +--rw l2-l3-ipv6-acl {mixed-ipv6-acl}? | | | | | +--rw upper-port inet:port-numb
| | | +--rw destination-mac-address? yang:mac-ad er
dress | | | | +--:(operator)
| | | +--rw destination-mac-address-mask? yang:mac-ad | | | | +--rw operator? operator
dress | | | | +--rw port inet:port-numb
| | | +--rw source-mac-address? yang:mac-ad er
dress | | | +--rw destination-ipv6-network?
| | | +--rw source-mac-address-mask? yang:mac-ad | | | | inet:ipv6-prefix
dress | | | +--rw source-ipv6-network?
| | | +--rw ethertype? eth:etherty | | | | inet:ipv6-prefix
pe | | | +--rw flow-label?
| | | +--rw dscp? inet:dscp | | | inet:ipv6-flow-label
| | | +--rw ecn? uint8 | | +--rw (l4)?
| | | +--rw length? uint16 | | | +--:(tcp)
| | | +--rw ttl? uint8 | | | | +--rw tcp {match-on-tcp}?
| | | +--rw protocol? uint8 | | | | +--rw sequence-number? uint32
| | | +--rw source-port-range! | | | | +--rw acknowledgement-number? uint32
| | | | +--rw lower-port inet:port-number | | | | +--rw data-offset? uint8
| | | | +--rw upper-port? inet:port-number | | | | +--rw reserved? uint8
| | | | +--rw operation? operator | | | | +--rw flags? bits
| | | +--rw destination-port-range! | | | | +--rw window-size? uint16
| | | | +--rw lower-port inet:port-number | | | | +--rw urgent-pointer? uint16
| | | | +--rw upper-port? inet:port-number | | | | +--rw options? uint32
| | | | +--rw operations? operator | | | +--:(udp)
| | | +--rw next-header? uint8 | | | | +--rw udp {match-on-udp}?
| | | +--rw destination-ipv6-network? inet:ipv6-p | | | | +--rw length? uint16
refix | | | +--:(icmp)
| | | +--rw source-ipv6-network? inet:ipv6-p | | | +--rw icmp {match-on-icmp}?
refix | | | +--rw type? uint8
| | | +--rw flow-label? | | | +--rw code? uint8
| | | inet:ipv6-flow-label | | | +--rw rest-of-header? uint32
| | +--rw l2-l3-ipv4-ipv6-acl {l2-l3-ipv4-ipv6-acl}? | | +--rw egress-interface? if:interface-ref
| | | +--rw destination-mac-address? yang:mac-ad | | +--rw ingress-interface? if:interface-ref
dress
| | | +--rw destination-mac-address-mask? yang:mac-ad
dress
| | | +--rw source-mac-address? yang:mac-ad
dress
| | | +--rw source-mac-address-mask? yang:mac-ad
dress
| | | +--rw ethertype? eth:etherty
pe
| | | +--rw dscp? inet:dscp
| | | +--rw ecn? uint8
| | | +--rw length? uint16
| | | +--rw ttl? uint8
| | | +--rw protocol? uint8
| | | +--rw source-port-range!
| | | | +--rw lower-port inet:port-number
| | | | +--rw upper-port? inet:port-number
| | | | +--rw operation? operator
| | | +--rw destination-port-range!
| | | | +--rw lower-port inet:port-number
| | | | +--rw upper-port? inet:port-number
| | | | +--rw operations? operator
| | | +--rw ihl? uint8
| | | +--rw flags? bits
| | | +--rw offset? uint16
| | | +--rw identification? uint16
| | | +--rw destination-ipv4-network? inet:ipv4-p
refix
| | | +--rw source-ipv4-network? inet:ipv4-p
refix
| | | +--rw next-header? uint8
| | | +--rw destination-ipv6-network? inet:ipv6-p
refix
| | | +--rw source-ipv6-network? inet:ipv6-p
refix
| | | +--rw flow-label?
| | | inet:ipv6-flow-label
| | +--rw tcp-acl {tcp-acl}?
| | | +--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? uint32
| | +--rw udp-acl {udp-acl}?
| | | +--rw length? uint16
| | +--rw icmp-acl {icmp-acl}?
| | | +--rw type? uint8
| | | +--rw code? uint8
| | | +--rw rest-of-header? uint32
| | +--rw any-acl! {any-acl}?
| | +--rw interface? if:interface-ref
| +--rw actions | +--rw actions
| | {acl-aggregate-stats or interface-acl-aggregate
}?
| | +--rw forwarding identityref | | +--rw forwarding identityref
| | +--rw logging? identityref | | +--rw logging? identityref
| | +--rw icmp-off? boolean | +--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 interfaces +--rw attachment-points
+--rw interface* [interface-id] +--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* [set-name type] | +--rw acl-set* [name]
| +--rw set-name -> ../../../../../../acl/acl-na | +--rw name
me | | -> ../../../../../../acl/name
| +--rw type -> ../../../../../../acl/acl-ty | +--ro ace-statistics* [name] {interface-stats}?
pe | +--ro name leafref
| +--rw ace* [rule-name]
| {interface-stats or interface-acl-aggrega
te}?
| +--rw rule-name leafref
| +--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* [set-name type] +--rw acl-set* [name]
+--rw set-name -> ../../../../../../acl/acl-na +--rw name
me | -> ../../../../../../acl/name
+--rw type -> ../../../../../../acl/acl-ty +--ro ace-statistics* [name] {interface-stats}?
pe +--ro name leafref
+--rw ace* [rule-name]
{interface-stats or interface-acl-aggrega
te}?
+--rw rule-name leafref
+--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 Each "acl" has information identifying the access list by a name
name("acl-name") and a list("access-list-entries") of rules ("name") and a list ("aces") of rules associated with the "name".
associated with the "acl-name". Each of the entries in the Each of the entries in the list ("aces"), indexed by the string
list("access-list-entries"), indexed by the string "rule-name", has "name", has containers defining "matches" and "actions".
containers defining "matches" and "actions".
The model uses defines several ACL types in the form of identities The model defines several ACL types and actions in the form of
and features. Features are used by implementors to select the ACL identities and features. Features are used by implementors to select
types the system can support. These types are implicitly inherited the ACL types the system can support and identities are used to
by the "ace", thus safeguarding against misconfiguration of "ace" validate the types that have been selected. These types are
types in an "acl". 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- The "matches" define criteria used to identify patterns in "ietf-
packet-fields". The "actions" define behavior to undertake once a packet-fields". The choice statements within the match container
"match" has been identified. In addition to permit and deny for allow for selection of one header within each of "l2", "l3", or "l4"
actions, a logging option allows for a match to be logged that can be headers. The "actions" define behavior to undertake once a "match"
used to determine which rule was matched upon. The model also has been identified. In addition to permit and deny for actions, a
defines the ability for ACL's to be attached to a particular logging option allows for a match to be logged that can be used to
interface. determine which rule was matched upon. The model also defines the
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",
per "interface" or both. or per "interface".
<CODE BEGINS> file "ietf-access-control-list@2017-10-03.yang" <CODE BEGINS> file "ietf-access-control-list@2018-01-16.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;
} }
skipping to change at page 11, line 28 skipping to change at page 10, line 24
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@cisco.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) 2017 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 2017-10-03 { revision 2018-01-16 {
description description
"Added feature and identity statements for different types "Initial version.";
of rule matches. Split the matching rules based on the
feature statement and added a must statement within
each container.";
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
skipping to change at page 13, line 4 skipping to change at page 11, line 44
*/ */
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
*/
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 { identity ipv4-acl-type {
base acl:acl-base; base acl:acl-base;
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-acl 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 { identity ipv6-acl-type {
base acl:acl-base; base acl:acl-base;
if-feature "ipv6";
description description
"ACL that primarily matches on fields from the IPv6 header "ACL that primarily matches on fields from the IPv6 header
(e.g. IPv6 destination address) and layer 4 headers (e.g. TCP (e.g. IPv6 destination address) and layer 4 headers (e.g. TCP
destination port). An acl of type ipv6-acl does not contain destination port). An acl of type ipv6 does not contain
matches on fields in the ethernet header or the IPv4 header."; matches on fields in the ethernet header or the IPv4 header.";
} }
identity eth-acl { identity eth-acl-type {
base acl:acl-base; base acl:acl-base;
if-feature "eth";
description description
"ACL that primarily matches on fields in the ethernet header, "ACL that primarily matches on fields in the ethernet header,
like 10/100/1000baseT or WiFi Access Control List. An acl of like 10/100/1000baseT or WiFi Access Control List. An acl of
type eth-acl does not contain matches on fields in the IPv4 type ethernet does not contain matches on fields in the IPv4
header, IPv6 header or layer 4 headers."; header, IPv6 header or layer 4 headers.";
} }
identity mixed-l2-l3-ipv4-acl { identity mixed-eth-ipv4-acl-type {
base "acl:acl-base"; base "acl:eth-acl-type";
base "acl:ipv4-acl-type";
if-feature "mixed-eth-ipv4";
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 that primarily match on IPv4 headers. entries that primarily match on IPv4 headers.
Matching on layer 4 header fields may also exist in the Matching on layer 4 header fields may also exist in the
list."; list.";
} }
identity mixed-l2-l3-ipv6-acl { identity mixed-eth-ipv6-acl-type {
base "acl:acl-base"; base "acl:eth-acl-type";
base "acl:ipv6-acl-type";
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, entries primarily match on fields in ethernet headers, entries
that primarily match on fields in IPv6 headers. Matching on that primarily match on fields in IPv6 headers. Matching on
layer 4 header fields may also exist in the list."; layer 4 header fields may also exist in the list.";
} }
identity mixed-l2-l3-ipv4-ipv6-acl { identity mixed-eth-ipv4-ipv6-acl-type {
base "acl:acl-base"; base "acl:eth-acl-type";
base "acl:ipv4-acl-type";
base "acl:ipv6-acl-type";
if-feature "mixed-eth-ipv4-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, entries primarily match on fields in ethernet headers, entries
that primarily match on fields in IPv4 headers, and entries that primarily match on fields in IPv4 headers, and entries
that primarily match on fields in IPv6 headers. Matching on that primarily match on fields in IPv6 headers. Matching on
layer 4 header fields may also exist in the list."; layer 4 header fields may also exist in the list.";
} }
identity any-acl {
base "acl:acl-base";
description
"ACL that can contain any pattern to match upon";
}
/* /*
* Features * Features
*/ */
feature l2-acl {
/*
* Features supported by device
*/
feature match-on-eth {
description description
"Layer 2 ACL supported"; "Device can support matching on ethernet headers.";
} }
feature ipv4-acl { feature match-on-ipv4 {
description description
"Layer 3 IPv4 ACL supported"; "Device can support matching on IPv4 headers.";
} }
feature ipv6-acl { feature match-on-ipv6 {
description description
"Layer 3 IPv6 ACL supported"; "Device can support matching on IPv6 headers.";
}
feature match-on-tcp {
description
"Device can support TCP headers.";
} }
feature mixed-ipv4-acl { feature match-on-udp {
description description
"Layer 2 and Layer 3 IPv4 ACL supported"; "Device can support UDP header.";
} }
feature mixed-ipv6-acl { feature match-on-icmp {
description description
"Layer 2 and Layer 3 IPv6 ACL supported"; "Device can support ICMP header.";
} }
feature l2-l3-ipv4-ipv6-acl { /*
* Header classifications combinations supported by
* device
*/
feature eth {
if-feature "match-on-eth";
description description
"Layer 2 and any Layer 3 ACL supported."; "Plain Ethernet ACL supported";
} }
feature tcp-acl { feature ipv4 {
if-feature "match-on-ipv4";
description description
"TCP header ACL supported."; "Plain IPv4 ACL supported";
} }
feature udp-acl { feature ipv6 {
if-feature "match-on-ipv6";
description description
"UDP header ACL supported."; "Plain IPv6 ACL supported";
} }
feature icmp-acl { feature mixed-eth-ipv4 {
if-feature "match-on-eth and match-on-ipv4";
description description
"ICMP header ACL supported."; "Ethernet and IPv4 ACL combinations supported";
} }
feature any-acl { feature mixed-eth-ipv6 {
if-feature "match-on-eth and match-on-ipv6";
description description
"ACL for any pattern."; "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 * 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";
} }
feature interface-acl-aggregate { /*
* Attachment point features
*/
feature interface-attachment {
description description
"ACL counters are reported per interface, and also aggregated "ACLs are set on interfaces.";
and reported per ACL entry";
} }
/* /*
* 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";
} }
typedef acl-ref { /*
type leafref { * Groupings
path "/access-lists/acl/acl-name"; */
}
description
"This type is used by data models that need to reference an
Access Control List";
}
grouping interface-acl {
description
"Grouping for per-interface ingress ACL data";
container acl-sets {
description
"Enclosing container the list of ingress ACLs on the
interface";
list acl-set {
key "set-name type";
ordered-by user;
description
"List of ingress ACLs on the interface";
leaf set-name {
type leafref {
path "../../../../../../acl/acl-name";
}
description
"Reference to the ACL set name applied on ingress";
}
leaf type {
type leafref {
path "../../../../../../acl/acl-type";
}
description
"Reference to the ACL set type applied on ingress";
}
list ace {
if-feature "interface-stats or interface-acl-aggregate";
key "rule-name";
description
"List of access list entries(ACE)";
leaf rule-name {
type leafref {
path "../../../../../../../acl/aces/ace/rule-name";
}
description
"The ace rule-name";
}
uses acl-counters;
}
}
}
}
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.
skipping to change at page 18, line 39 skipping to change at page 17, line 4
} }
} }
/* /*
* 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 "acl-type acl-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 different vendors, this model accommodates customizing
model accommodates customizing Access Control Lists for Access Control Lists for each kind and for each vendor.";
each kind and for each vendor."; leaf name {
leaf acl-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 acl-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 { list ace {
key "rule-name"; key "name";
ordered-by user; ordered-by user;
description description
"List of access list entries(ACE)"; "List of access list entries(ACE)";
leaf rule-name { leaf name {
type string { type string {
length "1..64"; length "1..64";
} }
description description
"A unique name identifying this Access List "A unique name identifying this Access List
Entry(ACE)."; Entry(ACE).";
} }
container matches { container matches {
description description
"The rules in this set determine what fields will be "The rules in this set determine what fields will be
matched upon before any action is taken on them. 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.";
container l2-acl { The rules are selected based on the feature set
if-feature l2-acl; defined by the server and the acl-type defined.
must "derived-from(../../../../acl-type, 'acl:eth-acl')"; If no matches are defined in a particular container,
uses packet-fields:acl-eth-header-fields; then any packet will match that container. If no
description matches are specified at all in an ACE, then any
"Rule set for L2 ACL."; packet will match the ACE.";
}
container ipv4-acl { choice l2 {
if-feature ipv4-acl; container eth {
must "derived-from(../../../../acl-type, " + when "derived-from(../../../../type, " +
"'acl:ipv4-acl')"; "'acl:eth-acl-type')";
uses packet-fields:acl-ip-header-fields; if-feature match-on-eth;
uses packet-fields:acl-ipv4-header-fields; uses packet-fields:acl-eth-header-fields;
description
"Rule set that matches ethernet headers.";
}
description description
"Rule set that supports IPv4 headers."; "Match layer 2 headers, for example ethernet
header fields.";
} }
container ipv6-acl { choice l3 {
if-feature ipv6-acl; container ipv4 {
must "derived-from(../../../../acl-type, " + when "derived-from(../../../../type, " +
"'acl:ipv6-acl')"; "'acl:ipv4-acl-type')";
uses packet-fields:acl-ip-header-fields; if-feature match-on-ipv4;
uses packet-fields:acl-ipv6-header-fields; uses packet-fields:acl-ip-header-fields;
description uses packet-fields:acl-ipv4-header-fields;
"Rule set that supports IPv6 headers."; description
} "Rule set that matches IPv4 headers.";
}
container l2-l3-ipv4-acl { container ipv6 {
if-feature mixed-ipv4-acl; when "derived-from(../../../../type, " +
must "derived-from(../../../../acl-type, " + "'acl:ipv6-acl-type')";
"'acl:mixed-l2-l3-ipv4-acl')"; if-feature match-on-ipv6;
uses packet-fields:acl-eth-header-fields; uses packet-fields:acl-ip-header-fields;
uses packet-fields:acl-ip-header-fields; uses packet-fields:acl-ipv6-header-fields;
uses packet-fields:acl-ipv4-header-fields; description
"Rule set that matches IPv6 headers.";
}
description description
"Rule set that is a logical AND (&&) of l2 "Choice of either ipv4 or ipv6 headers";
and ipv4 headers.";
} }
container l2-l3-ipv6-acl { choice l4 {
if-feature mixed-ipv6-acl; container tcp {
must "derived-from(../../../../acl-type, " + if-feature match-on-tcp;
"'acl:mixed-l2-l3-ipv6-acl')"; uses packet-fields:acl-tcp-header-fields;
uses packet-fields:acl-eth-header-fields; description
uses packet-fields:acl-ip-header-fields; "Rule set that matches TCP headers.";
uses packet-fields:acl-ipv6-header-fields; }
description
"Rule set that is a logical AND (&&) of L2
&& IPv6 headers.";
}
container l2-l3-ipv4-ipv6-acl { container udp {
if-feature l2-l3-ipv4-ipv6-acl; if-feature match-on-udp;
must "derived-from(../../../../acl-type, " + uses packet-fields:acl-udp-header-fields;
"'acl:mixed-l2-l3-ipv4-ipv6-acl')"; description
uses packet-fields:acl-eth-header-fields; "Rule set that matches UDP headers.";
uses packet-fields:acl-ip-header-fields; }
uses packet-fields:acl-ipv4-header-fields;
uses packet-fields:acl-ipv6-header-fields;
description
"Rule set that is a logical AND (&&) of L2
&& IPv4 && IPv6 headers.";
}
container tcp-acl { container icmp {
if-feature tcp-acl; if-feature match-on-icmp;
uses packet-fields:acl-tcp-header-fields; uses packet-fields:acl-icmp-header-fields;
description
"Rule set that matches ICMP headers.";
}
description description
"Rule set that defines TCP headers."; "Choice of TCP, UDP or ICMP headers.";
} }
container udp-acl { leaf egress-interface {
if-feature udp-acl; type if:interface-ref;
uses packet-fields:acl-udp-header-fields;
description description
"Rule set that defines UDP headers."; "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).";
} }
container icmp-acl { leaf ingress-interface {
if-feature icmp-acl; type if:interface-ref;
uses packet-fields:acl-icmp-header-fields;
description description
"Rule set that defines ICMP headers."; "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 any-acl { container actions {
if-feature any-acl; description
must "derived-from(../../../../acl-type, 'acl:any-acl')"; "Definitions of action for this ace entry";
presence "Matches any"; leaf forwarding {
type identityref {
base forwarding-action;
}
mandatory true;
description description
"Rule set that allows for a any ACL."; "Specifies the forwarding action per ace entry";
} }
leaf interface { leaf logging {
type if:interface-ref; type identityref {
base log-action;
}
default log-none;
description description
"Interface name that is specified to "Specifies the log action and destination for
match upon."; 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;
}
}
}
}
container attachment-points {
description
"Enclosing container for the list of
attachment-points on which ACLs are set";
container actions { /*
if-feature "acl-aggregate-stats or interface-acl-aggregate"; * Groupings
*/
grouping interface-acl {
description
"Grouping for per-interface ingress ACL data";
container acl-sets {
description
"Enclosing container the list of ingress ACLs on the
interface";
list acl-set {
key "name";
ordered-by user;
description description
"Definitions of action criteria for this ace entry"; "List of ingress ACLs on the interface";
leaf forwarding {
type identityref {
base forwarding-action;
}
mandatory true;
description
"Specifies the forwarding action per ace entry";
}
leaf logging { leaf name {
type identityref { type leafref {
base log-action; path "../../../../../../acl/name";
} }
default log-none; description
description "Reference to the ACL name applied on ingress";
"Specifies the log action and destination for }
matched packets. Default value is not to log the
packet.";
}
leaf icmp-off { list ace-statistics {
type boolean; if-feature "interface-stats";
default "false"; key "name";
description config false;
"true indicates ICMP errors will never be generated description
in response to an ICMP error message. false indicates "List of access list entries(ACE)";
ICMP error will be generated."; leaf name {
type leafref {
path "../../../../../../../acl/aces/ace/name";
} }
description
"The ace name";
}
uses acl-counters;
}
} }
uses acl-counters;
} }
} }
}
container interfaces {
description
"Enclosing container for the list of interfaces on which
ACLs are set";
list interface { list interface {
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 { container ingress {
uses interface-acl; uses interface-acl;
description description
"The ACL's applied to ingress interface"; "The ACL's applied to ingress interface";
} }
container egress { container egress {
uses interface-acl; uses interface-acl;
description description
"The ACL's applied to egress interface"; "The ACL's applied to egress interface";
} }
} }
} }
} }
} }
<CODE ENDS> <CODE ENDS>
4.2. IETF Packet Fields module 4.2. IETF Packet Fields module
skipping to change at page 23, line 25 skipping to change at page 22, line 17
} }
} }
} }
<CODE ENDS> <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 'acl-type' node determines which of these fields layer fields. The "type" node determines which of these fields get
get included for any given ACL with the exception of TCP, UDP and included for any given ACL with the exception of TCP, UDP and ICMP
ICMP header fields. Those fields can be used in conjunction with any header fields. Those fields can be used in conjunction with any of
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.
<CODE BEGINS> file "ietf-packet-fields@2017-10-03.yang" <CODE BEGINS> file "ietf-packet-fields@2018-01-16.yang"
module ietf-packet-fields { module ietf-packet-fields {
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;
} }
import ietf-yang-types { import ietf-yang-types {
skipping to change at page 24, line 4 skipping to change at page 22, line 44
import ietf-inet-types { import ietf-inet-types {
prefix inet; prefix inet;
} }
import ietf-yang-types { import ietf-yang-types {
prefix yang; prefix yang;
} }
import ietf-ethertypes { import ietf-ethertypes {
prefix eth; prefix eth;
} }
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
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
agarwaso@cisco.com sagarwal12@gmail.com
Editor: Dana Blair Editor: Dana Blair
dblair@cisco.com"; dblair@cisco.com";
description description
"This YANG module defines groupings that are used by "This YANG module defines groupings that are used by
ietf-access-control-list YANG module. Their usage is not ietf-access-control-list YANG module. Their usage is not
limited to ietf-access-control-list and can be limited to ietf-access-control-list and can be
used anywhere as applicable. used anywhere as applicable.
Copyright (c) 2017 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 2017-10-03 { revision 2018-01-16 {
description description
"Added header fields for TCP, UDP, and ICMP."; "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 lt { enum lte {
description description
"Less than."; "Less than or equal.";
} }
enum gt { enum gte {
description description
"Greater than."; "Greater than or equal.";
} }
enum eq { enum eq {
description description
"Equal to."; "Equal to.";
} }
enum neq { enum neq {
description description
"Not equal to."; "Not equal to.";
} }
} }
description description
"The source and destination port range definitions "The source and destination port range definitions
can be further qualified using an operator. An can be further qualified using an operator. An
operator is needed only if lower-port is specified operator is needed only if lower-port is specified
and upper-port is not specified. The operator and upper-port is not specified. The operator
therefore further qualifies lower-port only."; therefore further qualifies lower-port only.";
} }
grouping acl-transport-header-fields { /*
description * Groupings
"Transport header fields"; */
container source-port-range { grouping port-range-or-operator {
presence "Enables setting source port range"; choice port-range-or-operator {
description case range {
"Inclusive range representing source ports to be used. leaf lower-port {
When only lower-port is present, it represents a single type inet:port-number;
port and eq operator is assumed to be default. must ". <= ../upper-port" {
error-message
When both lower-port and upper-port are specified, "The lower-port must be less than or equal to
it implies a range inclusive of both values. upper-port.";
}
If no port is specified, 'any' (wildcard) is assumed."; mandatory true;
description
leaf lower-port { "Lower boundry for a port.";
type inet:port-number;
mandatory true;
description
"Lower boundary for port.";
}
leaf upper-port {
type inet:port-number;
must ". >= ../lower-port" {
error-message
"The upper-port must be greater than or equal
to lower-port";
} }
description leaf upper-port {
"Upper boundary for port. If it exists, the upper port type inet:port-number;
must be greater or equal to lower-port."; mandatory true;
}
leaf operation {
type operator;
must "(../lower-port and not(../upper-port))" {
error-message
"If lower-port is specified, and an operator is also
specified, then upper-port should not be specified.";
description description
"If lower-port is specified, and an operator is also "Upper boundry for port.";
specified, then upper-port should not be specified.";
} }
default eq;
description
"Operator to be applied on the lower-port.";
}
}
container destination-port-range {
presence "Enables setting destination port range";
description
"Inclusive range representing destination ports to be used.
When only lower-port is present, it represents a single
port and eq operator is assumed to be default.
When both lower-port and upper-port are specified,
it implies a range inclusive of both values.
If no port is specified, 'any' (wildcard) is assumed. ";
leaf lower-port {
type inet:port-number;
mandatory true;
description
"Lower boundary for port.";
} }
leaf upper-port { case operator {
type inet:port-number; leaf operator {
must ". >= ../lower-port" { type operator;
error-message default eq;
"The upper-port must be greater than or equal description
to lower-port"; "Operator to be applied on the port below.";
} }
description leaf port {
"Upper boundary for port. If existing, the upper port must type inet:port-number;
be greater or equal to lower-port"; mandatory true;
}
leaf operations {
type operator;
must "(../lower-port and not(../upper-port))" {
error-message
"If lower-port is specified, and an operator is also
specified, then upper-port should not be specified.";
description description
"If lower-port is specified, and an operator is also "Port number along with operator on which to
specified, then upper-port should not be specified."; match.";
} }
default eq;
description
"Operator to be applied on the lower-port.";
} }
description
"Choice of specifying a port range or a single
port along with an operator.";
} }
description
"Grouping for port definitions in the form of a
choice statement.";
} }
grouping acl-ip-header-fields { grouping acl-ip-header-fields {
description description
"IP header fields common to ipv4 and ipv6"; "IP header fields common to ipv4 and ipv6";
reference reference
"RFC 791."; "RFC 791.";
leaf dscp { leaf dscp {
type inet:dscp; type inet:dscp;
skipping to change at page 28, line 32 skipping to change at page 26, line 26
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 719, RFC 2460";
} }
leaf protocol { leaf protocol {
type uint8; type uint8;
description description
"Internet Protocol number."; "Internet Protocol number. Refers to the protocol of the
payload. In IPv6, this field is known as 'next-header.";
reference "RFC 719, RFC 2460.";
}
container source-port-range-or-operator {
uses port-range-or-operator;
description
"Source port definition.";
}
container destination-port-range-or-operator {
uses port-range-or-operator;
description
"Destination port definition.";
} }
uses acl-transport-header-fields;
} }
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 30, line 13 skipping to change at page 28, line 17
type inet:ipv4-prefix; type inet:ipv4-prefix;
description description
"Source IPv4 address prefix."; "Source IPv4 address prefix.";
} }
} }
grouping acl-ipv6-header-fields { grouping acl-ipv6-header-fields {
description description
"Fields in IPv6 header"; "Fields in IPv6 header";
leaf next-header {
type uint8;
description
"Identifies the type of header immediately following the
IPv6 header. Uses the same values as the IPv4 Protocol
field.";
reference
"RFC 2460";
}
leaf destination-ipv6-network { leaf destination-ipv6-network {
type inet:ipv6-prefix; type inet:ipv6-prefix;
description description
"Destination IPv6 address prefix."; "Destination IPv6 address prefix.";
} }
leaf source-ipv6-network { leaf source-ipv6-network {
type inet:ipv6-prefix; type inet:ipv6-prefix;
description description
"Source IPv6 address prefix."; "Source IPv6 address prefix.";
skipping to change at page 36, line 5 skipping to change at page 34, line 5
<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 10.10.10.1/24, destined to
11.11.11.1/24. 11.11.11.1/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"> <data xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
<access-lists xmlns="urn:ietf:params:xml:ns:yang: <access-lists xmlns="urn:ietf:params:xml:ns:yang:ietf-access-control-list">
ietf-access-control-list"> <acl>
<acl> <name>sample-ipv4-acl</name>
<acl-name>sample-ipv4-acl</acl-name> <type>ipv4-acl-type</type>
<acl-type>ipv4-acl</acl-type> <aces>
<aces> <ace>
<ace> <name>rule1</name>
<rule-name>rule1</rule-name> <matches>
<matches> <l3>
<ipv4-acl> <ipv4>
<protocol>tcp</protocol> <protocol>tcp</protocol>
<destination-ipv4-network> <destination-ipv4-network>
11.11.11.1/24 11.11.11.1/24
</destination-ipv4-network> </destination-ipv4-network>
<source-ipv4-network> <source-ipv4-network>
10.10.10.1/24 10.10.10.1/24
</source-ipv4-network> </source-ipv4-network>
</ipv4-acl> </ipv4>
</matches> </l3>
<actions> </matches>
<packet-handling>deny</packet-handling> <actions>
</actions> <forwarding>drop</forwarding>
</ace> </actions>
</aces> </ace>
</acl> </aces>
</access-lists> </acl>
</data> </access-lists>
</data>
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 10.10.10.1/24 11.11.11.1/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 snippet:
<source-port-range> <source-port-range-or-operator>
<lower-port>16384</lower-port> <port-range-or-operator>
<upper-port>16387</upper-port> <range>
</source-port-range> <lower-port>16384</lower-port>
<upper-port>16387</upper-port>
</range>
</port-range-or-operator>
<source-port-range-or-operator>
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 snippet:
<source-port-range> <source-port-range-or-operator>
<lower-port>16384</lower-port> <port-range-or-operator>
<upper-port>65535</upper-port> <range>
</source-port-range> <lower-port>16384</lower-port>
<upper-port>65535</upper-port>
</range>
</port-range-or-operator>
</source-port-range-or-operator>
This represents source ports greater than/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 snippet:
<source-port-range> <source-port-range-or-operator>
<lower-port>21</lower-port> <port-range-or-operator>
</source-port-range> <operator>
<operator>eq</operator>
<port>21</port>
</operator>
</port-range-or-operator>
</source-port-range-or-operator>
This represents port 21. This represents port 21.
With the following XML snippet, the configuration is specifying all With the following XML snippet, the configuration is specifying all
ports that are not equal to 21. ports that are not equal to 21.
<source-port-range> <source-port-range-or-operator>
<lower-port>21</lower-port> <port-range-or-operator>
<operations>neq</operations> <operator>
</source-port-range> <operator>neq</operator>
<port>21</port>
</operator>
</port-range-or-operator>
</source-port-range-or-operator>
5. Security Considerations 5. Security Considerations
The YANG module defined in this memo is designed to be accessed via The YANG module defined in this memo is designed to be accessed via
the NETCONF [RFC6241]. The lowest NETCONF layer is the secure the NETCONF [RFC6241]. The lowest NETCONF layer is the secure
transport layer and the mandatory-to-implement secure transport is transport layer and the mandatory-to-implement secure transport is
SSH [RFC6242]. The NETCONF Access Control Model ( NACM [RFC6536]) SSH [RFC6242]. The NETCONF Access Control Model ( NACM [RFC6536])
provides the means to restrict access for particular NETCONF users to provides the means to restrict access for particular NETCONF users to
a pre-configured subset of all available NETCONF protocol operations a pre-configured subset of all available NETCONF protocol operations
and content. and content.
skipping to change at page 38, line 10 skipping to change at page 36, line 34
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/access-list-entries: This list specifies all the /access-lists/acl/aces: This list specifies all the configured access
configured access list entries on the device. Unauthorized write control entries on the device. Unauthorized write access to this
access to this list can allow intruders to access and control the list can allow intruders to access and control the system.
system. Unauthorized read access to this list can allow intruders to Unauthorized read access to this list can allow intruders to spoof
spoof packets with authorized addresses thereby compromising the packets with authorized addresses thereby compromising the system.
system.
6. IANA Considerations 6. IANA Considerations
This document registers a URI in the IETF XML registry [RFC3688]. This document registers a 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
skipping to change at page 39, line 14 skipping to change at page 37, line 36
Dean Bogdanovic, Kiran Agrahara Sreenivasa, Lisa Huang, and Dana Dean Bogdanovic, Kiran Agrahara Sreenivasa, Lisa Huang, and Dana
Blair each evaluated the YANG model in previous drafts separately, Blair each evaluated the YANG model in previous drafts separately,
and then worked together to created a ACL draft that was supported by and then worked together to created a ACL draft that was supported by
different vendors. That draft removed vendor specific features, and different vendors. That draft removed vendor specific features, and
gave examples to allow vendors to extend in their own proprietary gave examples to allow vendors to extend in their own proprietary
ACL. The earlier draft was superseded with this updated draft and ACL. The earlier draft was superseded with this updated draft and
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, and Jeff Haas for their review of and Schoenwalder, David Bannister, Jeff Haas, Kristian Larsson and Einar
suggestions to the draft. Nilsen-Nygaard for their review of and suggestions to the draft.
8. Open Issues 8. Open Issues
o The current model does not support the concept of "containers" o The current model does not support the concept of "containers"
used to contain multiple addresses per rule entry. used to contain multiple addresses per rule entry.
9. References 9. References
9.1. Normative References 9.1. Normative References
skipping to change at page 40, line 9 skipping to change at page 38, line 28
[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>.
9.2. Informative References 9.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-01 (work in progress), June ietf-netmod-yang-tree-diagrams-04 (work in progress),
2017. December 2017.
[RFC5101] Claise, B., Ed., "Specification of the IP Flow Information [RFC5101] Claise, B., Ed., "Specification of the IP Flow Information
Export (IPFIX) Protocol for the Exchange of IP Traffic Export (IPFIX) Protocol for the Exchange of IP Traffic
Flow Information", RFC 5101, DOI 10.17487/RFC5101, January Flow Information", RFC 5101, DOI 10.17487/RFC5101, January
2008, <https://www.rfc-editor.org/info/rfc5101>. 2008, <https://www.rfc-editor.org/info/rfc5101>.
Appendix A. Extending ACL model examples Appendix A. Extending ACL model examples
A.1. Example of extending existing model for route filtering A.1. A company proprietary module example
With proposed modular design, it is easy to extend the model with
other features. Those features can be standard features, like route
filters. Route filters match on specific IP addresses or ranges of
prefixes. Much like ACLs, they include some match criteria and
corresponding match action(s). For that reason, it is very simple to
extend existing ACL model with route filtering. The combination of a
route prefix and prefix length along with the type of match
determines how route filters are evaluated against incoming routes.
Different vendors have different match types and in this model we are
using only ones that are common across all vendors participating in
this draft. As in this example, the base ACL model can be extended
with company proprietary extensions, described in the next section.
module: example-ext-route-filter
augment /ietf-acl:access-lists/ietf-acl:acl/ietf-acl:aces/ietf-acl:ac
e/ietf-acl:matches:
+--rw (route-prefix)?
+--:(range)
+--rw (ipv4-range)?
| +--:(v4-lower-bound)
| | +--rw v4-lower-bound? inet:ipv4-prefix
| +--:(v4-upper-bound)
| +--rw v4-upper-bound? inet:ipv4-prefix
+--rw (ipv6-range)?
+--:(v6-lower-bound)
| +--rw v6-lower-bound? inet:ipv6-prefix
+--:(v6-upper-bound)
+--rw v6-upper-bound? inet:ipv6-prefix
file "example-ext-route-filter@2017-10-03.yang"
module example-ext-route-filter {
namespace "urn:ietf:params:xml:ns:yang:example-ext-route-filter";
prefix example-ext-route-filter;
import ietf-inet-types {
prefix "inet";
}
import ietf-access-control-list {
prefix "ietf-acl";
}
organization
"Route model group.";
contact
"abc@abc.com";
description "
This module describes route filter as a collection of
match prefixes. When specifying a match prefix, you
can specify an exact match with a particular route or
a less precise match. You can configure either a
common action that applies to the entire list or an
action associated with each prefix.
";
revision 2017-10-03 {
description
"Creating Route-Filter extension model based on
ietf-access-control-list model";
reference "Example route filter";
}
augment "/ietf-acl:access-lists/ietf-acl:acl/" +
"ietf-acl:aces/ietf-acl:ace/ietf-acl:matches" {
description "
This module augments the matches container in the ietf-acl
module with route filter specific actions";
choice route-prefix{
description "Define route filter match criteria";
case range {
description
"Route falls between the lower prefix/prefix-length
and the upperprefix/prefix-length.";
choice ipv4-range {
description "Defines the IPv4 prefix range";
leaf v4-lower-bound {
type inet:ipv4-prefix;
description
"Defines the lower IPv4 prefix/prefix length";
}
leaf v4-upper-bound {
type inet:ipv4-prefix;
description
"Defines the upper IPv4 prefix/prefix length";
}
}
choice ipv6-range {
description "Defines the IPv6 prefix/prefix range";
leaf v6-lower-bound {
type inet:ipv6-prefix;
description
"Defines the lower IPv6 prefix/prefix length";
}
leaf v6-upper-bound {
type inet:ipv6-prefix;
description
"Defines the upper IPv6 prefix/prefix length";
}
}
}
}
}
}
A.2. 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 found. All these
are company proprietary extensions or system feature extensions. are company proprietary extensions or system feature extensions.
"example-newco-acl" is just an example and it is expected from "example-newco-acl" is just an example and it is expected from
vendors to create their own proprietary models. vendors to create their own proprietary models.
The following figure is the tree structure of example-newco-acl. In The following figure is the tree structure of example-newco-acl. In
skipping to change at page 43, line 19 skipping to change at page 39, line 24
| +--:(protocol-payload) | +--:(protocol-payload)
| +--rw protocol-payload* [value-keyword] | +--rw protocol-payload* [value-keyword]
| +--rw value-keyword enumeration | +--rw value-keyword enumeration
+--rw (metadata)? +--rw (metadata)?
+--:(packet-length) +--:(packet-length)
+--rw packet-length? uint16 +--rw packet-length? uint16
augment /ietf-acl:access-lists/ietf-acl:acl/ietf-acl:aces/ietf-acl:ac augment /ietf-acl:access-lists/ietf-acl:acl/ietf-acl:aces/ietf-acl:ac
e/ietf-acl:actions: e/ietf-acl:actions:
+--rw (action)? +--rw (action)?
+--:(count) +--:(count)
| +--rw count? string | +--rw count? uint32
+--:(policer) +--:(policer)
| +--rw policer? string | +--rw policer? string
+--:(hiearchical-policer) +--:(hiearchical-policer)
+--rw hierarchitacl-policer? string +--rw hierarchitacl-policer? string
augment /ietf-acl:access-lists/ietf-acl:acl: augment /ietf-acl:access-lists/ietf-acl:acl/ietf-acl:aces/ietf-acl:ac
+--rw default-actions e/ietf-acl:actions:
+--rw deny? empty +--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 "urn:newco:params:xml:ns:yang:example-newco-acl";
prefix example-newco-acl; prefix example-newco-acl;
import ietf-access-control-list { import ietf-access-control-list {
skipping to change at page 43, line 48 skipping to change at page 40, line 5
} }
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 2017-10-03 { revision 2018-01-16 {
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 "/ietf-acl:access-lists/ietf-acl:acl/" +
"ietf-acl:aces/ietf-acl:ace/" + "ietf-acl:aces/ietf-acl:ace/" +
"ietf-acl:matches" { "ietf-acl:matches" {
description "Newco proprietary simple filter matches"; description "Newco proprietary simple filter matches";
choice protocol-payload-choice { choice protocol-payload-choice {
description "Newo 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";
skipping to change at page 44, line 40 skipping to change at page 40, line 46
augment "/ietf-acl:access-lists/ietf-acl:acl/" + augment "/ietf-acl:access-lists/ietf-acl:acl/" +
"ietf-acl:aces/ietf-acl:ace/" + "ietf-acl:aces/ietf-acl:ace/" +
"ietf-acl:actions" { "ietf-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 string; type uint32;
description ""; 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 ""; description "Name of the policer";
} }
} }
case hiearchical-policer { case hiearchical-policer {
description "Name of hierarchical policer to use to description "Name of hierarchical policer to use to
rate-limit traffic"; rate-limit traffic";
leaf hierarchitacl-policer { leaf hierarchitacl-policer {
type string; type string;
description ""; description "Name of the hierarchical policer.";
} }
} }
} }
} }
augment "/ietf-acl:access-lists/ietf-acl:acl" { augment "/ietf-acl:access-lists/ietf-acl:acl" +
"/ietf-acl:aces/ietf-acl:ace/" +
"ietf-acl:actions" {
description "Newco proprietary default action"; description "Newco proprietary default action";
container default-actions { leaf default-action {
description description
"Actions that occur if no access-list entry is matched."; "Actions that occur if no ace is matched.";
leaf deny { type identityref {
type empty; base ietf-acl:forwarding-action;
description "";
} }
default ietf-acl:drop;
} }
} }
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";
} }
skipping to change at page 45, line 44 skipping to change at page 42, line 4
description "Internet Control Message Protocol Version 6"; description "Internet Control Message Protocol Version 6";
} }
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 Draft authors expect that different vendors will provide their own
yang models as in the example above, which is the augmentation of the yang models as in the example above, which is the augmentation of the
base model base model
A.3. 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
skipping to change at page 46, line 39 skipping to change at page 42, line 42
chain input { chain input {
ip protocol tcp ip saddr 10.10.10.1/24 drop ip protocol tcp ip saddr 10.10.10.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.4. 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@2017-10-03.yang" <CODE BEGINS> file "ietf-ethertypes@2018-01-16.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 ie;
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>";
skipping to change at page 47, line 23 skipping to change at page 43, line 27
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 2017-10-03 { revision 2018-01-16 {
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;
type enumeration { type enumeration {
skipping to change at page 54, line 14 skipping to change at page 50, line 18
"SAE AS6802."; "SAE AS6802.";
} }
enum hsr { enum hsr {
value 35119; value 35119;
description description
"High-availability Seamless Redundancy (HSR). Hex "High-availability Seamless Redundancy (HSR). Hex
value of 0x892F."; value of 0x892F.";
reference reference
"IEC 62439-3:2016."; "IEC 62439-3:2016.";
} }
enum ctp {
value 36864;
description
"Ethernet Configuration Test Protocol (CTP). Hex
value of 0x9000.";
}
enum vlan-double-tagged {
value 37120;
description
"VLAN-tagged frame with double tagging. Hex value
of 0x9100.";
}
} }
} }
description description
"The uint16 type placeholder type is defined to enable "The uint16 type placeholder type is defined to enable
users to manage their own ethertypes not users to manage their own ethertypes not
covered by the module. Otherwise the module contains covered by the module. Otherwise the module contains
enum definitions for the more commonly used ethertypes."; enum definitions for the more commonly used ethertypes.";
} }
} }
<CODE ENDS> <CODE ENDS>
Authors' Addresses Authors' Addresses
Mahesh Jethanandani Mahesh Jethanandani
Cisco Systems, Inc
Email: mjethanandani@gmail.com Email: mjethanandani@gmail.com
Lisa Huang Lisa Huang
General Electric General Electric
Email: lyihuang16@gmail.com Email: lyihuang16@gmail.com
Sonal Agarwal Sonal Agarwal
Cisco Systems, Inc. Cisco Systems, Inc.
Email: agarwaso@cisco.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. 167 change blocks. 
813 lines changed or deleted 600 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/