--- 1/draft-ietf-netmod-module-tags-02.txt 2018-10-17 06:13:08.906709184 -0700 +++ 2/draft-ietf-netmod-module-tags-03.txt 2018-10-17 06:13:08.922709395 -0700 @@ -1,20 +1,20 @@ Network Working Group C. Hopps Internet-Draft Deutsche Telekom Updates: rfc6087bis (if approved) L. Berger Intended status: Standards Track LabN Consulting, L.L.C. -Expires: January 1, 2019 D. Bogdanovic - June 30, 2018 +Expires: April 20, 2019 D. Bogdanovic + October 17, 2018 YANG Module Tags - draft-ietf-netmod-module-tags-02 + draft-ietf-netmod-module-tags-03 Abstract This document provides for the association of tags with YANG modules. The expectation is for such tags to be used to help classify and organize modules. A method for defining, reading and writing a modules tags is provided. Tags may be standardized and assigned during module definition; assigned by implementations; or dynamically defined and set by users. This document provides guidance to future model writers and, as such, this document updates @@ -28,376 +28,402 @@ Internet-Drafts are working documents of the Internet Engineering Task Force (IETF). Note that other groups may also distribute working documents as Internet-Drafts. The list of current Internet- Drafts is at https://datatracker.ietf.org/drafts/current/. Internet-Drafts are draft documents valid for a maximum of six months and may be updated, replaced, or obsoleted by other documents at any time. It is inappropriate to use Internet-Drafts as reference material or to cite them other than as "work in progress." - This Internet-Draft will expire on January 1, 2019. + This Internet-Draft will expire on April 20, 2019. Copyright Notice Copyright (c) 2018 IETF Trust and the persons identified as the document authors. All rights reserved. This document is subject to BCP 78 and the IETF Trust's Legal Provisions Relating to IETF Documents (https://trustee.ietf.org/license-info) in effect on the date of publication of this document. Please review these documents carefully, as they describe your rights and restrictions with respect to this document. Code Components extracted from this document must include Simplified BSD License text as described in Section 4.e of the Trust Legal Provisions and are provided without warranty as described in the Simplified BSD License. Table of Contents 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 2 2. Conventions Used in This Document . . . . . . . . . . . . . . 3 - 3. Tag Prefixes . . . . . . . . . . . . . . . . . . . . . . . . 3 + 3. Tag Values . . . . . . . . . . . . . . . . . . . . . . . . . 3 3.1. IETF Standard Tags . . . . . . . . . . . . . . . . . . . 3 3.2. Vendor Tags . . . . . . . . . . . . . . . . . . . . . . . 3 - 3.3. Local Tags . . . . . . . . . . . . . . . . . . . . . . . 3 - 3.4. Reserved Tags . . . . . . . . . . . . . . . . . . . . . . 3 + 3.3. User Tags . . . . . . . . . . . . . . . . . . . . . . . . 3 + 3.4. Reserved Tags . . . . . . . . . . . . . . . . . . . . . . 4 4. Tag Management . . . . . . . . . . . . . . . . . . . . . . . 4 4.1. Module Definition Association . . . . . . . . . . . . . . 4 4.2. Implementation Association . . . . . . . . . . . . . . . 4 4.3. Administrative Tagging . . . . . . . . . . . . . . . . . 4 5. Tags Module Structure . . . . . . . . . . . . . . . . . . . . 4 5.1. Tags Module Tree . . . . . . . . . . . . . . . . . . . . 4 5.2. Tags Module . . . . . . . . . . . . . . . . . . . . . . . 5 - 6. Other Classifications . . . . . . . . . . . . . . . . . . . . 6 - 7. Guidelines to Model Writers . . . . . . . . . . . . . . . . . 6 - 7.1. Define Standard Tags . . . . . . . . . . . . . . . . . . 6 - 8. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 7 - 8.1. YANG Module Tag Prefix Registry . . . . . . . . . . . . . 7 + 6. Other Classifications . . . . . . . . . . . . . . . . . . . . 7 + 7. Guidelines to Model Writers . . . . . . . . . . . . . . . . . 7 + 7.1. Define Standard Tags . . . . . . . . . . . . . . . . . . 7 + 8. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 8 + 8.1. YANG Module Tag Prefix Registry . . . . . . . . . . . . . 8 8.2. YANG Module IETF Tag Registry . . . . . . . . . . . . . . 8 - 9. References . . . . . . . . . . . . . . . . . . . . . . . . . 9 - 9.1. Normative References . . . . . . . . . . . . . . . . . . 9 + 9. References . . . . . . . . . . . . . . . . . . . . . . . . . 10 + 9.1. Normative References . . . . . . . . . . . . . . . . . . 10 9.2. Informative References . . . . . . . . . . . . . . . . . 10 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 10 1. Introduction The use of tags for classification and organization is fairly ubiquitous not only within IETF protocols, but in the internet itself (e.g., #hashtags). Tags can be usefully standardized, but they can also serve as a non-standardized mechanism available for users to define themselves. Our solution provides for both cases allowing for the most flexibility. In particular, tags may be standardized as well as assigned during module definition; assigned by implementations; or dynamically defined and set by users. - This document defines a module which provides a list of module - entries to allow for adding or removing of tags as well as viewing - the set of tags associated with a module. + This document defines a YANG module [RFC6020] which provides a list + of module entries to allow for adding or removing of tags as well as + viewing the set of tags associated with a module. + + This document defines an extension statement to be used to indicate + tags that SHOULD be added by the module implementation automatically + (i.e., outside of configuration). This document also defines an IANA registry for tag prefixes as well as a set of globally assigned tags. Section 7 provides guidelines for authors of YANG data models. This section updates [I-D.ietf-netmod-rfc6087bis]. 2. Conventions Used in This Document The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", - "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this - document are to be interpreted as described in [RFC2119]. - - Note that lower case versions of these key words are used in section - Section 7 where guidance is provided to future document authors. + "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and + "OPTIONAL" in this document are to be interpreted as described in + [RFC2119] [RFC8174] when, and only when, they appear in all capitals, + as shown here. -3. Tag Prefixes +3. Tag Values - All tags have a prefix indicating who owns their definition. An IANA - registry is used to support standardizing tag prefixes. Currently 3 - prefixes are defined with all others reserved. + All tags begin with a prefix indicating who owns their definition. + An IANA registry is used to support standardizing tag prefixes. + Currently 3 prefixes are defined with all others reserved. No + further structure is imposed by this document on the value following + the standard prefix, and the value can contain any yang type 'string' + characters except carriage-returns, newlines and tabs. 3.1. IETF Standard Tags An IETF standard tag is a tag that has the prefix "ietf:". All IETF standard tags are registered with IANA in a registry defined later in this document. 3.2. Vendor Tags A vendor tag is a tag that has the prefix "vendor:". These tags are defined by the vendor that implements the module, and are not standardized; however, it is RECOMMENDED that the vendor include - extra identification in the tag name to avoid collisions such as - using the enterpise or organization name in the second field (e.g., - vendor:example.com:system-management:...). + extra identification in the tag to avoid collisions such as using the + enterpise or organization name follwing the "vendor:" prefix (e.g., + vendor:example.com:vendor-defined-classifier). -3.3. Local Tags +3.3. User Tags - A local tag is any tag that has the prefix "local:". These tags are - defined by the local user/administrator and will never be - standardized. + A user tag is any tag that has the prefix "user:". These tags are + defined by the user/administrator and will never be standardized. 3.4. Reserved Tags - Any tag not starting with the prefix "ietf:", "vendor:" or "local:" - is reserved for future standardization. + Any tag not starting with the prefix "ietf:", "vendor:" or "user:" is + reserved for future standardization. 4. Tag Management Tags can become associated with a module in a number of ways. Tags - may be defined and associated at model design time, at implementation - time, or via user administrative control. As the main consumer of - tags are users, users may also remove any tag, no matter how the tag - became associated with a module. + may be defined and associated at module design time, at + implementation time, or via user administrative control. As the main + consumer of tags are users, users may also remove any tag, no matter + how the tag became associated with a module. 4.1. Module Definition Association - A module definition SHOULD indicate a set of tags to be automatically - added by the module implementer. If the module definition will be - standard the tags MUST also be standard tags (Section 3.1). Thus, - new modules can drive the addition of new standard tags to the IANA - registry, and the IANA registry can serve as a check against - duplication. + A module definition can indicate a set of tags to be added by the + module implementer. These design time tags are indicated using the + module-tag extension statement. If the module definition will be + IETF standards track, the tags MUST also be IETF standard tags + (Section 3.1). Thus, new modules can drive the addition of new + standard tags to the IANA registry, and the IANA registry can serve + as a check against duplication. 4.2. Implementation Association An implementation MAY include additional tags associated with a module. These tags may be standard or vendor specific tags. 4.3. Administrative Tagging - Tags of any kind can be assigned and removed with normal + Tags of any kind can be assigned and removed with using normal configuration mechanisms. - Implementations MUST ensure that a modules tag list is consistent - across any location from which the list is accessible. So if a user - adds a tag through configuration that tag should also be seen when - using any augmentation that exposes the modules tag list. - 5. Tags Module Structure 5.1. Tags Module Tree - The tree associated with the tags module is: + The tree associated with the "ietf-module-tags" module follows. The + meaning of the symbols can be found in [RFC8340]. module: ietf-module-tags - +--rw module-tags* [name] + +--rw module-tags + +--rw module* [name] +--rw name yang:yang-identifier - +--rw tag* string - +--rw masked-tag* string + +--rw tag* tag + +--rw masked-tag* tag 5.2. Tags Module - file "ietf-module-tags@2018-03-06.yang" + file "ietf-module-tags@2018-10-17.yang" module ietf-module-tags { - yang-version "1"; + yang-version 1.1; namespace "urn:ietf:params:xml:ns:yang:ietf-module-tags"; - prefix "mtags"; + prefix tags; import ietf-yang-types { prefix yang; } - organization "IETF NetMod Working Group (NetMod)"; - + organization + "IETF NetMod Working Group (NetMod)"; contact "NetMod Working Group - "; + // RFC Ed.: replace XXXX with actual RFC number and + // remove this note. + description - "This module describes a tagging mechanism for yang module. - Tags may be IANA assigned or privately defined types."; + "This module describes a mechanism associating tags with YANG + modules. Tags may be IANA assigned or privately defined. - revision "2018-03-06" { + Copyright (c) 2018 IETF Trust and the persons identified as + authors of the code. All rights reserved. + + Redistribution and use in source and binary forms, with or + without modification, is permitted pursuant to, and subject to + the license terms contained in, the Simplified BSD License set + forth in Section 4.c of the IETF Trust's Legal Provisions + Relating to IETF Documents + (https://trustee.ietf.org/license-info). + + The key words 'MUST', 'MUST NOT', 'REQUIRED', 'SHALL', 'SHALL + NOT', 'SHOULD', 'SHOULD NOT', 'RECOMMENDED', 'MAY', and + 'OPTIONAL' in the module text are to be interpreted as described + in RFC 2119 (https://tools.ietf.org/html/rfc2119). + + This version of this YANG module is part of RFC XXXX + (https://tools.ietf.org/html/rfcXXXX); see the RFC itself for + full legal notices."; + + // RFC Ed.: update the date below with the date of RFC publication + // and RFC number and remove this note. + + revision 2018-10-17 { description "Initial revision."; - reference "TBD"; + reference "RFC XXXX: YANG Module Tags"; } - list module-tags { - key "name"; + typedef tag { + type string { + length "1..max"; + pattern '[a-zA-Z_][a-zA-Z0-9\-_]*:[\S ]+'; + } + description + "A tag value is composed of a standard prefix followed by any type + 'string' value that does not include carriage return, newline or + tab characters."; + } + extension module-tag { + argument tag; description - "A list of modules and their associated tags"; + "The argument 'tag' is of type 'tag'. This extension statement is + used by module authors to indicate the tags that SHOULD be added + automatically by the system. As such the origin of the value + for the pre-defined tags should be set to 'system'."; + } + container module-tags { + description + "Contains the list of modules and their associated tags"; + list module { + key "name"; + description + "A list of modules and their associated tags"; leaf name { type yang:yang-identifier; mandatory true; description - "The YANG module or submodule name."; + "The YANG module name."; } - leaf-list tag { - type string; - + type tag; description - "A tag associated with the module. See the IANA 'YANG Module - Tag Prefix' registry for reserved prefixes and the IANA - 'YANG Module IETF Tag' registry for IETF standard tags. + "Tags associated with the module. See the IANA 'YANG Module + Tag Prefix' registry for reserved prefixes and the IANA 'YANG + Module IETF Tag' registry for IETF standard tags. - The operational view of this list will contain all - user-configured tags as well as any predefined tags that - have not been masked by the user using the masked-tag leaf - list below."; - } + The operational view of this list is constructed using the following steps: - leaf-list masked-tag { - type string; + 1) System added tags are added. + 2) User configured tags are added. + 3) Any tag that is equal to a masked-tag is removed."; + } + leaf-list masked-tag { + type tag; description "The list of tags that should not be associated with this - module. This user can remove (mask) predefined tags by - adding them to this list. It is not an error to add tags to - this list that are not predefined for the module."; + module. This user can remove (mask) tags by adding + them to this list. It is not an error to add tags to this + list that are not associated with the module."; + } } } } 6. Other Classifications - It's worth noting that a different yang module classification + It's worth noting that a different YANG module classification document exists [RFC8199]. That document is classifying modules in only a logical manner and does not define tagging or any other - mechanisms. It divides yang modules into 2 categories (service or + mechanisms. It divides YANG modules into 2 categories (service or element) and then into one of 3 origins: standard, vendor or user. It does provide a good way to discuss and identify modules in general. This document defines standard tags to support [RFC8199] style classification. 7. Guidelines to Model Writers This section updates [I-D.ietf-netmod-rfc6087bis]. 7.1. Define Standard Tags - A module SHOULD indicate, in the description statement of the module, - a set of tags that are to be associated with it. This description - should also include the appropriate conformance statement or - statements, using [RFC2119] language for each tag. + A module can indicate using module-tag extension statements a set of + tags that are to be automatically associated with it (i.e., not added + through configuration). module example-module { ... - description - "[Text describing the module...] + import module-tags { prefix tags; } - RFC TAGS: - The following tags MUST be included by an implementation: - - ietf:some-required-tag:foo - - ... - The following tags SHOULD be included by an implementation: - - ietf:some-recommended-tag:bar - - ... - The following tags MAY be included by an implementation: - - ietf:some-optional-tag:baz - - ... - "; + tags:module-tag "ietf:some-new-tag"; + tags:module-tag "ietf:some-other-tag"; ... } - One SHOULD only include conformance text if there will be tags listed - (i.e., there's no need to indicate an empty set). - - The module writer may use existing standard tags, or use new tags - defined in the model definition, as appropriate. New tags should be - assigned in the IANA registry defined below, see Section 8.2 below. + The module writer can use existing standard tags, or use new tags + defined in the model definition, as appropriate. For standardized + modules new tags MUST be assigned in the IANA registry defined below, + see Section 8.2 below. 8. IANA Considerations 8.1. YANG Module Tag Prefix Registry This registry allocates tag prefixes. All YANG module tags SHOULD begin with one of the prefixes in this registry. The allocation policy for this registry is Specification Required [RFC5226]. The initial values for this registry are as follows. prefix description -------- --------------------------------------------------- ietf: IETF Standard Tag allocated in the IANA YANG Module IETF Tag Registry. vendor: Non-standardized tags allocated by the module implementer. - local: Non-standardized tags allocated by and for the user. + user: Non-standardized tags allocated by and for the user. Other SDOs (standard organizations) wishing to standardize their own set of tags could allocate a top level prefix from this registry. 8.2. YANG Module IETF Tag Registry This registry allocates prefixes that have the standard prefix "ietf:". New values should be well considered and not achievable through a combination of already existing standard tags. The allocation policy for this registry is IETF Review [RFC5226]. The initial values for this registry are as follows. - [Editor's note: many of these tags may move to - [I-D.ietf-rtgwg-device-model] if/when that document is refactored to - use tags.] - +------------------------+------------------------------+-----------+ | Tag | Description | Reference | +------------------------+------------------------------+-----------+ - | ietf:rfc8199:element | A module for a network | [RFC8199] | + | ietf:rfc8199-element | A module for a network | [RFC8199] | | | element. | | | | | | - | ietf:rfc8199:service | A module for a network | [RFC8199] | + | ietf:rfc8199-service | A module for a network | [RFC8199] | | | service. | | | | | | - | ietf:rfc8199:standard | A module defined by a | [RFC8199] | + | ietf:rfc8199-standard | A module defined by a | [RFC8199] | | | standards organization. | | | | | | - | ietf:rfc8199:vendor | A module defined by a | [RFC8199] | + | ietf:rfc8199-vendor | A module defined by a | [RFC8199] | | | vendor. | | | | | | - | ietf:rfc8199:user | A module defined by the | [RFC8199] | + | ietf:rfc8199-user | A module defined by the | [RFC8199] | | | user. | | | | | | - | ietf:device:hardware | A module relating to device | [This | + | ietf:hardware | A module relating to | [This | | | hardware (e.g., inventory). | document] | | | | | - | ietf:device:software | A module relating to device | [This | + | ietf:software | A module relating to | [This | | | software (e.g., installed | document] | | | OS). | | | | | | - | ietf:device:qos | A module for managing | [This | + | ietf:qos | A module for managing | [This | | | quality of service. | document] | | | | | | ietf:protocol | A module representing a | [This | | | protocol. | document] | | | | | | ietf:system-management | A module relating to system | [This | | | management (e.g., a system | document] | - | | management protocol). | | + | | management protocol such as | | + | | syslog, TACAC+, SNMP, | | + | | netconf, ...). | | | | | | | ietf:network-service | A module relating to network | [This | | | service (e.g., a network | document] | - | | service protocol). | | + | | service protocol such as an | | + | | NTP server, DNS server, DHCP | | + | | server, etc). | | | | | | | ietf:oam | A module representing | [This | | | Operations, Administration, | document] | - | | and Maintenance. | | + | | and Maintenance (e.g., BFD). | | | | | | | ietf:routing | A module related to routing. | [This | | | | document] | | | | | - | ietf:routing:rib | A module related to routing | [This | - | | information bases. | document] | - | | | | - | ietf:routing:igp | An interior gateway protocol | [This | - | | module. | document] | - | | | | - | ietf:routing:egp | An exterior gateway protocol | [This | - | | module. | document] | - | | | | | ietf:signaling | A module representing | [This | | | control plane signaling. | document] | | | | | | ietf:lmp | A module representing a link | [This | | | management protocol. | document] | +------------------------+------------------------------+-----------+ Table 1: IETF Module Tag Registry 9. References @@ -412,36 +438,43 @@ [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate Requirement Levels", BCP 14, RFC 2119, DOI 10.17487/RFC2119, March 1997, . [RFC5226] Narten, T. and H. Alvestrand, "Guidelines for Writing an IANA Considerations Section in RFCs", RFC 5226, DOI 10.17487/RFC5226, May 2008, . + [RFC6020] Bjorklund, M., Ed., "YANG - A Data Modeling Language for + the Network Configuration Protocol (NETCONF)", RFC 6020, + DOI 10.17487/RFC6020, October 2010, + . + + [RFC8174] Leiba, B., "Ambiguity of Uppercase vs Lowercase in RFC + 2119 Key Words", BCP 14, RFC 8174, DOI 10.17487/RFC8174, + May 2017, . + [RFC8199] Bogdanovic, D., Claise, B., and C. Moberg, "YANG Module Classification", RFC 8199, DOI 10.17487/RFC8199, July 2017, . 9.2. Informative References - [I-D.ietf-rtgwg-device-model] - Lindem, A., Berger, L., Bogdanovic, D., and C. Hopps, - "Network Device YANG Logical Organization", draft-ietf- - rtgwg-device-model-02 (work in progress), March 2017. + [RFC8340] Bjorklund, M. and L. Berger, Ed., "YANG Tree Diagrams", + BCP 215, RFC 8340, DOI 10.17487/RFC8340, March 2018, + . Authors' Addresses Christan Hopps Deutsche Telekom Email: chopps@chopps.org - Lou Berger LabN Consulting, L.L.C. Email: lberger@labn.net Dean Bogdanovic Email: ivandean@gmail.com