draft-ietf-netmod-yang-types-07.txt   draft-ietf-netmod-yang-types-08.txt 
Network Working Group J. Schoenwaelder, Ed. Network Working Group J. Schoenwaelder, Ed.
Internet-Draft Jacobs University Internet-Draft Jacobs University
Intended status: Standards Track February 24, 2010 Intended status: Standards Track April 14, 2010
Expires: August 28, 2010 Expires: October 16, 2010
Common YANG Data Types Common YANG Data Types
draft-ietf-netmod-yang-types-07 draft-ietf-netmod-yang-types-08
Abstract Abstract
This document introduces a collection of common data types to be used This document introduces a collection of common data types to be used
with the YANG data modeling language. with the YANG data modeling language.
Status of this Memo Status of this Memo
This Internet-Draft is submitted to IETF in full conformance with the This Internet-Draft is submitted to IETF in full conformance with the
provisions of BCP 78 and BCP 79. provisions of BCP 78 and BCP 79.
skipping to change at page 1, line 37 skipping to change at page 1, line 37
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."
The list of current Internet-Drafts can be accessed at The list of current Internet-Drafts can be accessed at
http://www.ietf.org/ietf/1id-abstracts.txt. http://www.ietf.org/ietf/1id-abstracts.txt.
The list of Internet-Draft Shadow Directories can be accessed at The list of Internet-Draft Shadow Directories can be accessed at
http://www.ietf.org/shadow.html. http://www.ietf.org/shadow.html.
This Internet-Draft will expire on August 28, 2010. This Internet-Draft will expire on October 16, 2010.
Copyright Notice Copyright Notice
Copyright (c) 2010 IETF Trust and the persons identified as the Copyright (c) 2010 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
(http://trustee.ietf.org/license-info) in effect on the date of (http://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
skipping to change at page 4, line 8 skipping to change at page 4, line 8
modeling all areas of management information. modeling all areas of management information.
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
"SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and
"OPTIONAL" in this document are to be interpreted as described in BCP "OPTIONAL" in this document are to be interpreted as described in BCP
14, [RFC2119]. 14, [RFC2119].
2. Overview 2. Overview
This section provides a short overview over the types defined in This section provides a short overview over the types defined in
subsequent sections and their equivalent SMIv2 data types. A YANG subsequent sections and their equivalent Structure of Management
Information Version 2 (SMIv2) [RFC2578][RFC2579] data types. A YANG
data type is equivalent to an SMIv2 data type if the data types have data type is equivalent to an SMIv2 data type if the data types have
the same set of values and the semantics of the values are the same set of values and the semantics of the values are
equivalent. equivalent.
Table 1 lists the types defined in the ietf-yang-types YANG module Table 1 lists the types defined in the ietf-yang-types YANG module
and the corresponding SMIv2 types (if any). and the corresponding SMIv2 types (if any).
ietf-yang-types ietf-yang-types
+-----------------------+--------------------------------+ +-----------------------+--------------------------------+
skipping to change at page 6, line 7 skipping to change at page 6, line 7
| ipv6-prefix | - | | ipv6-prefix | - |
| domain-name | - | | domain-name | - |
| host | - | | host | - |
| uri | Uri (URI-TC-MIB) | | uri | Uri (URI-TC-MIB) |
+-----------------+-----------------------------------------------+ +-----------------+-----------------------------------------------+
Table 2 Table 2
3. Core YANG Derived Types 3. Core YANG Derived Types
<CODE BEGINS> file "ietf-yang-types@2010-02-03.yang" <CODE BEGINS> file "ietf-yang-types@2010-04-14.yang"
module ietf-yang-types { module ietf-yang-types {
namespace "urn:ietf:params:xml:ns:yang:ietf-yang-types-DRAFT-06"; namespace "urn:ietf:params:xml:ns:yang:ietf-yang-types";
prefix "yang"; prefix "yang";
organization organization
"IETF NETMOD (NETCONF Data Modeling Language) Working Group"; "IETF NETMOD (NETCONF Data Modeling Language) Working Group";
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>
WG Chair: David Partain WG Chair: David Partain
skipping to change at page 6, line 48 skipping to change at page 6, line 48
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 License to the license terms contained in, the Simplified BSD License
set forth in Section 4.c of the IETF Trust's Legal Provisions set forth in Section 4.c of the IETF Trust's Legal Provisions
Relating to IETF Documents 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.";
// RFC Ed.: replace XXXX with actual RFC number and remove this note // RFC Ed.: replace XXXX with actual RFC number and remove this note
// RFC Ed.: remove this note revision 2010-04-14 {
// Note: extracted from draft-ietf-netmod-yang-types-05.txt
revision 2010-02-03 {
description description
"Initial revision."; "Initial revision.";
reference reference
"RFC XXXX: Common YANG Data Types"; "RFC XXXX: Common YANG Data Types";
} }
// RFC Ed.: replace XXXX with actual RFC number and remove this note // RFC Ed.: replace XXXX with actual RFC number and remove this note
/*** collection of counter and gauge types ***/ /*** collection of counter and gauge types ***/
typedef counter32 { typedef counter32 {
type uint32; type uint32;
description description
"The counter32 type represents a non-negative integer "The counter32 type represents a non-negative integer
which monotonically increases until it reaches a which monotonically increases until it reaches a
skipping to change at page 7, line 33 skipping to change at page 7, line 31
value normally occur at re-initialization of the value normally occur at re-initialization of the
management system, and at other times as specified in the management system, and at other times as specified in the
description of a schema node using this type. If such description of a schema node using this type. If such
other times can occur, for example, the creation of an other times can occur, for example, the creation of an
a schema node of type counter32 at times other than a schema node of type counter32 at times other than
re-initialization, then a corresponding schema node re-initialization, then a corresponding schema node
should be defined, with an appropriate type, to indicate should be defined, with an appropriate type, to indicate
the last discontinuity. the last discontinuity.
The counter32 type should not be used for configuration The counter32 type should not be used for configuration
schema nodes. A default statement should not be used for schema nodes. A default statement SHOULD NOT be used in
attributes with a type value of counter32. combination with the type counter32.
This type is in the value set and its semantics equivalent This type is in the value set and its semantics equivalent
to the Counter32 type of the SMIv2."; to the Counter32 type of the SMIv2.";
reference reference
"RFC 2578: Structure of Management Information Version 2 (SMIv2)"; "RFC 2578: Structure of Management Information Version 2 (SMIv2)";
} }
typedef zero-based-counter32 { typedef zero-based-counter32 {
type yang:counter32; type yang:counter32;
default "0"; default "0";
description description
"The zero-based-counter32 type represents a counter32 "The zero-based-counter32 type represents a counter32
which has the defined `initial' value zero. which has the defined `initial' value zero.
Schema nodes of this type will be set to zero(0) on creation A schema node of this type will be set to zero(0) on creation
and will thereafter increase monotonically until it reaches and will thereafter increase monotonically until it reaches
a maximum value of 2^32-1 (4294967295 decimal), when it a maximum value of 2^32-1 (4294967295 decimal), when it
wraps around and starts increasing again from zero. wraps around and starts increasing again from zero.
Provided that an application discovers a new schema node Provided that an application discovers a new schema node
of this type within the minimum time to wrap it can use the of this type within the minimum time to wrap, it can use the
initial value as a delta. It is important for a management initial value as a delta. It is important for a management
station to be aware of this minimum time and the actual time station to be aware of this minimum time and the actual time
between polls, and to discard data if the actual time is too between polls, and to discard data if the actual time is too
long or there is no defined minimum time. long or there is no defined minimum time.
This type is in the value set and its semantics equivalent This type is in the value set and its semantics equivalent
to the ZeroBasedCounter32 textual convention of the SMIv2."; to the ZeroBasedCounter32 textual convention of the SMIv2.";
reference reference
"RFC 4502: Remote Network Monitoring Management Information "RFC 4502: Remote Network Monitoring Management Information
Base Version 2 using SMIv2"; Base Version 2 using SMIv2";
skipping to change at page 8, line 41 skipping to change at page 8, line 38
value normally occur at re-initialization of the value normally occur at re-initialization of the
management system, and at other times as specified in the management system, and at other times as specified in the
description of a schema node using this type. If such description of a schema node using this type. If such
other times can occur, for example, the creation of other times can occur, for example, the creation of
a schema node of type counter64 at times other than a schema node of type counter64 at times other than
re-initialization, then a corresponding schema node re-initialization, then a corresponding schema node
should be defined, with an appropriate type, to indicate should be defined, with an appropriate type, to indicate
the last discontinuity. the last discontinuity.
The counter64 type should not be used for configuration The counter64 type should not be used for configuration
schema nodes. A default statement should not be used for schema nodes. A default statement SHOULD NOT be used in
attributes with a type value of counter64. combination with the type counter64.
This type is in the value set and its semantics equivalent This type is in the value set and its semantics equivalent
to the Counter64 type of the SMIv2."; to the Counter64 type of the SMIv2.";
reference reference
"RFC 2578: Structure of Management Information Version 2 (SMIv2)"; "RFC 2578: Structure of Management Information Version 2 (SMIv2)";
} }
typedef zero-based-counter64 { typedef zero-based-counter64 {
type yang:counter64; type yang:counter64;
default "0"; default "0";
description description
"The zero-based-counter64 type represents a counter64 which "The zero-based-counter64 type represents a counter64 which
has the defined `initial' value zero. has the defined `initial' value zero.
Schema nodes of this type will be set to zero(0) on creation A schema node of this type will be set to zero(0) on creation
and will thereafter increase monotonically until it reaches and will thereafter increase monotonically until it reaches
a maximum value of 2^64-1 (18446744073709551615 decimal), a maximum value of 2^64-1 (18446744073709551615 decimal),
when it wraps around and starts increasing again from zero. when it wraps around and starts increasing again from zero.
Provided that an application discovers a new schema node Provided that an application discovers a new schema node
of this type within the minimum time to wrap it can use the of this type within the minimum time to wrap, it can use the
initial value as a delta. It is important for a management initial value as a delta. It is important for a management
station to be aware of this minimum time and the actual time station to be aware of this minimum time and the actual time
between polls, and to discard data if the actual time is too between polls, and to discard data if the actual time is too
long or there is no defined minimum time. long or there is no defined minimum time.
This type is in the value set and its semantics equivalent This type is in the value set and its semantics equivalent
to the ZeroBasedCounter64 textual convention of the SMIv2."; to the ZeroBasedCounter64 textual convention of the SMIv2.";
reference reference
"RFC 2856: Textual Conventions for Additional High Capacity "RFC 2856: Textual Conventions for Additional High Capacity
Data Types"; Data Types";
skipping to change at page 10, line 49 skipping to change at page 10, line 46
value MUST NOT exceed 2^32-1 (4294967295). Sub-identifiers value MUST NOT exceed 2^32-1 (4294967295). Sub-identifiers
are separated by single dots and without any intermediate are separated by single dots and without any intermediate
white space. white space.
Although the number of sub-identifiers is not limited, Although the number of sub-identifiers is not limited,
module designers should realize that there may be module designers should realize that there may be
implementations that stick with the SMIv2 limit of 128 implementations that stick with the SMIv2 limit of 128
sub-identifiers. sub-identifiers.
This type is a superset of the SMIv2 OBJECT IDENTIFIER type This type is a superset of the SMIv2 OBJECT IDENTIFIER type
since it is not restricted to 128 sub-identifiers."; since it is not restricted to 128 sub-identifiers. Hence,
this type SHOULD NOT be used to represent the SMIv2 OBJECT
IDENTIFIER type, the object-identifier-128 type SHOULD be
used instead.";
reference reference
"ISO/IEC 9834-1: Information technology -- Open Systems "ISO/IEC 9834-1: Information technology -- Open Systems
Interconnection -- Procedures for the operation of OSI Interconnection -- Procedures for the operation of OSI
Registration Authorities: General procedures and top Registration Authorities: General procedures and top
arcs of the ASN.1 Object Identifier tree"; arcs of the ASN.1 Object Identifier tree";
} }
typedef object-identifier-128 { typedef object-identifier-128 {
type object-identifier { type object-identifier {
pattern '\d*(\.\d*){1,127}'; pattern '\d*(\.\d*){1,127}';
skipping to change at page 15, line 7 skipping to change at page 15, line 7
reference reference
"W3C REC-xpath-19991116: XML Path Language (XPath) Version 1.0"; "W3C REC-xpath-19991116: XML Path Language (XPath) Version 1.0";
} }
} }
<CODE ENDS> <CODE ENDS>
4. Internet Specific Derived Types 4. Internet Specific Derived Types
<CODE BEGINS> file "ietf-inet-types@2010-02-03.yang" <CODE BEGINS> file "ietf-inet-types@2010-04-14.yang"
module ietf-inet-types { module ietf-inet-types {
namespace "urn:ietf:params:xml:ns:yang:ietf-inet-types-DRAFT-06"; namespace "urn:ietf:params:xml:ns:yang:ietf-inet-types";
prefix "inet"; prefix "inet";
organization organization
"IETF NETMOD (NETCONF Data Modeling Language) Working Group"; "IETF NETMOD (NETCONF Data Modeling Language) Working Group";
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>
WG Chair: David Partain WG Chair: David Partain
skipping to change at page 15, line 48 skipping to change at page 15, line 48
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 License to the license terms contained in, the Simplified BSD License
set forth in Section 4.c of the IETF Trust's Legal Provisions set forth in Section 4.c of the IETF Trust's Legal Provisions
Relating to IETF Documents 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.";
// RFC Ed.: replace XXXX with actual RFC number and remove this note // RFC Ed.: replace XXXX with actual RFC number and remove this note
// RFC Ed.: remove this note revision 2010-04-14 {
// Note: extracted from draft-ietf-netmod-yang-types-05.txt
revision 2010-02-03 {
description description
"Initial revision."; "Initial revision.";
reference reference
"RFC XXXX: Common YANG Data Types"; "RFC XXXX: Common YANG Data Types";
} }
// RFC Ed.: replace XXXX with actual RFC number and remove this note // RFC Ed.: replace XXXX with actual RFC number and remove this note
/*** collection of protocol field related types ***/ /*** collection of protocol field related types ***/
typedef ip-version { typedef ip-version {
type enumeration { type enumeration {
enum unknown { enum unknown {
value "0"; value "0";
description description
skipping to change at page 28, line 16 skipping to change at page 28, line 16
9.1. Normative References 9.1. Normative References
[RFC2119] Bradner, S., "Key words for use in RFCs to Indicate [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate
Requirement Levels", BCP 14, RFC 2119, March 1997. Requirement Levels", BCP 14, RFC 2119, March 1997.
[RFC3688] Mealling, M., "The IETF XML Registry", BCP 81, RFC 3688, [RFC3688] Mealling, M., "The IETF XML Registry", BCP 81, RFC 3688,
January 2004. January 2004.
[YANG] Bjorklund, M., Ed., "YANG - A data modeling language for [YANG] Bjorklund, M., Ed., "YANG - A data modeling language for
NETCONF", draft-ietf-netmod-yang-10 (work in progress). NETCONF", draft-ietf-netmod-yang-12 (work in progress).
9.2. Informative References 9.2. Informative References
[IDv6TREP] [IDv6TREP]
Kawamura, S. and M. Kawashima, "A Recommendation for IPv6 Kawamura, S. and M. Kawashima, "A Recommendation for IPv6
Address Text Representation", Address Text Representation",
draft-ietf-6man-text-addr-representation-06 (work in draft-ietf-6man-text-addr-representation-06 (work in
progress). progress).
[IEEE802] IEEE, "IEEE Standard for Local and Metropolitan Area [IEEE802] IEEE, "IEEE Standard for Local and Metropolitan Area
 End of changes. 20 change blocks. 
27 lines changed or deleted 27 lines changed or added

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