draft-ietf-netmod-smi-yang-00.txt   draft-ietf-netmod-smi-yang-01.txt 
Network Working Group J. Schoenwaelder Network Working Group J. Schoenwaelder
Internet-Draft Jacobs University Internet-Draft Jacobs University
Intended status: Standards Track April 13, 2011 Intended status: Standards Track July 1, 2011
Expires: October 15, 2011 Expires: January 2, 2012
Translation of SMIv2 MIB Modules to YANG Modules Translation of SMIv2 MIB Modules to YANG Modules
draft-ietf-netmod-smi-yang-00 draft-ietf-netmod-smi-yang-01
Abstract Abstract
YANG is a data modeling language used to model configuration and YANG is a data modeling language used to model configuration and
state data manipulated by the NETCONF protocol, NETCONF remote state data manipulated by the NETCONF protocol, NETCONF remote
procedure calls, and NETCONF notifications. The Structure of procedure calls, and NETCONF notifications. The Structure of
Management Information (SMIv2) defines fundamental data types, an Management Information (SMIv2) defines fundamental data types, an
object model, and the rules for writing and revising MIB modules for object model, and the rules for writing and revising MIB modules for
use with the SNMP protocol. This document defines a translation of use with the SNMP protocol. This document defines a translation of
SMIv2 MIB modules into YANG modules, enabling read-only access to SMIv2 MIB modules into YANG modules, enabling read-only access to
skipping to change at page 1, line 37 skipping to change at page 1, line 37
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 http://datatracker.ietf.org/drafts/current/. Drafts is at http://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 October 15, 2011. This Internet-Draft will expire on January 2, 2012.
Copyright Notice Copyright Notice
Copyright (c) 2011 IETF Trust and the persons identified as the Copyright (c) 2011 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 5, line 13 skipping to change at page 5, line 13
14, [RFC2119]. 14, [RFC2119].
2. Mapping of Special Types 2. Mapping of Special Types
The SMIv2 base types and some well known derived textual-conventions The SMIv2 base types and some well known derived textual-conventions
are mapped to YANG types according to Table 1. The mapping of the are mapped to YANG types according to Table 1. The mapping of the
OCTET STRING depends on the context. If an OCTET STRING type has an OCTET STRING depends on the context. If an OCTET STRING type has an
associated DISPLAY-HINT, then the corresponding YANG base type is the associated DISPLAY-HINT, then the corresponding YANG base type is the
string type. Otherwise, the binary type is used. Similarly, the string type. Otherwise, the binary type is used. Similarly, the
mapping of the INTEGER type depends on its usage as an enumeration or mapping of the INTEGER type depends on its usage as an enumeration or
a 32-bit integral type. a 32-bit integral type. Implementations are encouraged to provide
options to handle situations where DISPLAY-HINTs are added during a
revision of a module and backwards compatibility must be preserved.
Mapping of SMIv2 types to YANG types Mapping of SMIv2 types to YANG types
+------------+----------------+-----------------+-------------------+ +------------+----------------+-----------------+-------------------+
| SMIv2 | SMIv2 Type | YANG Module | YANG Type | | SMIv2 | SMIv2 Type | YANG Module | YANG Type |
| Module | | | | | Module | | | |
+------------+----------------+-----------------+-------------------+ +------------+----------------+-----------------+-------------------+
| SNMPv2-SMI | INTEGER | | enumeration | | SNMPv2-SMI | INTEGER | | enumeration |
| SNMPv2-SMI | INTEGER | | int32 | | SNMPv2-SMI | INTEGER | | int32 |
| SNMPv2-SMI | Integer32 | | int32 | | SNMPv2-SMI | Integer32 | | int32 |
skipping to change at page 10, line 46 skipping to change at page 10, line 46
"Revisions made by the Interfaces MIB WG, and published in "Revisions made by the Interfaces MIB WG, and published in
RFC 2233."; RFC 2233.";
} }
revision "1993-11-08" { revision "1993-11-08" {
description description
"Initial revision, published as part of RFC 1573."; "Initial revision, published as part of RFC 1573.";
} }
container ifMIB { container ifMIB {
config false; config false;
description
"[Automatically generated top-level container.]";
smiv2:oid "1.3.6.1.2.1.31"; smiv2:oid "1.3.6.1.2.1.31";
} }
6. Translation of the TEXTUAL-CONVENTION Macro 6. Translation of the TEXTUAL-CONVENTION Macro
The SMIv2 uses invocations of the TEXTUAL-CONVENTION macro to define The SMIv2 uses invocations of the TEXTUAL-CONVENTION macro to define
new types derived from the SMIv2 base types. Invocations of the new types derived from the SMIv2 base types. Invocations of the
TEXTUAL-CONVENTION macro MUST be translated into YANG typedef TEXTUAL-CONVENTION macro MUST be translated into YANG typedef
statements as detailed below. statements as detailed below.
skipping to change at page 15, line 29 skipping to change at page 15, line 29
SMIv2 OBJECT-TYPE macro invocations defining scalars or columnar SMIv2 OBJECT-TYPE macro invocations defining scalars or columnar
objects with a MAX-ACCESS of "not-accessible", "read-only", objects with a MAX-ACCESS of "not-accessible", "read-only",
"read-write" and ""read-create" are translated to YANG leaf "read-write" and ""read-create" are translated to YANG leaf
statements. The name of the leaf is the name associated with the statements. The name of the leaf is the name associated with the
SMIv2 OBJECT-TYPE macro invocation. SMIv2 OBJECT-TYPE macro SMIv2 OBJECT-TYPE macro invocation. SMIv2 OBJECT-TYPE macro
invocations with a MAX-ACCESS of "accessible-for-notify" are not invocations with a MAX-ACCESS of "accessible-for-notify" are not
translated to YANG data tree leafs but instead into YANG notification translated to YANG data tree leafs but instead into YANG notification
leafs. leafs.
All leaf statements for scalar objects are created in the container All leaf statements for scalar objects are created in the top-level
representing the SMIv2 module, see Section 5.1. The leaf statements container representing the SMIv2 module, see Section 5.1. The leaf
representing columnar objects are created in the list representing a statements representing columnar objects are created in the list
conceptual row, see Section 8.3. representing a conceptual row, see Section 8.3.
o The SMIv2 SYNTAX clause is mapped to the YANG type statement. o The SMIv2 SYNTAX clause is mapped to the YANG type statement.
SMIv2 range restrictions are mapped to YANG range statements while SMIv2 range restrictions are mapped to YANG range statements while
SMIv2 length restrictions are mapped to YANG length statements. SMIv2 length restrictions are mapped to YANG length statements.
SMIv2 INTEGER enumerations and SMIv2 BITS are mapped to YANG enum SMIv2 INTEGER enumerations and SMIv2 BITS are mapped to YANG enum
/ value and bit / position statements. / value and bit / position statements.
o The SMIv2 UNITS clause is mapped to the YANG units statement. o The SMIv2 UNITS clause is mapped to the YANG units statement.
o The SMIv2 MAX-ACCESS MAY be translated into an smiv2:max-access o The SMIv2 MAX-ACCESS MAY be translated into an smiv2:max-access
skipping to change at page 16, line 48 skipping to change at page 16, line 48
the entity's network management system to the next re- the entity's network management system to the next re-
initialization."; initialization.";
smiv2:max-access "read-only"; smiv2:max-access "read-only";
smiv2:oid "1.3.6.1.2.1.2.2.1.1"; smiv2:oid "1.3.6.1.2.1.2.2.1.1";
} }
8.3. Non-Augmenting Conceptual Table Translation Rules 8.3. Non-Augmenting Conceptual Table Translation Rules
An OBJECT-TYPE macro invocation defining a non-augmenting conceptual An OBJECT-TYPE macro invocation defining a non-augmenting conceptual
table is translated to a YANG container statement using the name of table is translated to a YANG container statement using the name of
the OBJECT-TYPE macro invocation. This container MUST be config the OBJECT-TYPE macro invocation. This container is created in the
false. The clauses of the macro are translated as follows: top-level container representing the SMIv2 module. The clauses of
the macro are translated as follows:
o The SMIv2 SYNTAX clause is ignored o The SMIv2 SYNTAX clause is ignored
o The SMIv2 UNITS clause is ignored. o The SMIv2 UNITS clause is ignored.
o The SMIv2 MAX-ACCESS clause is ignored. o The SMIv2 MAX-ACCESS clause is ignored.
o The SMIv2 STATUS clause is mapped to the YANG status statement. o The SMIv2 STATUS clause is mapped to the YANG status statement.
The generation of the YANG status statement is skipped if the The generation of the YANG status statement is skipped if the
value of the STATUS clause is current. value of the STATUS clause is current.
skipping to change at page 19, line 35 skipping to change at page 19, line 33
list ifRcvAddressEntry { list ifRcvAddressEntry {
key "ifIndex ifRcvAddressAddress"; key "ifIndex ifRcvAddressAddress";
description description
"A list of objects identifying an address for which the "A list of objects identifying an address for which the
system will accept packets/frames on the particular system will accept packets/frames on the particular
interface identified by the index value ifIndex."; interface identified by the index value ifIndex.";
smiv2:oid "1.3.6.1.2.1.31.1.4.1"; smiv2:oid "1.3.6.1.2.1.31.1.4.1";
leaf ifIndex { leaf ifIndex {
type leafref { type leafref {
path "/if-mib:ifTable/if-mib:ifEntry/if-mib:ifIndex"; path "/if-mib:ifMIB/if-mib:ifTable" +
"/if-mib:ifEntry/if-mib:ifIndex";
} }
description description
"[Automatically generated leaf for a foreign index.]"; "[Automatically generated leaf for a foreign index.]";
} }
leaf ifRcvAddressAddress { leaf ifRcvAddressAddress {
type yang:phys-address; type yang:phys-address;
description description
"An address for which the system will accept packets/frames "An address for which the system will accept packets/frames
on this entry's interface."; on this entry's interface.";
skipping to change at page 20, line 22 skipping to change at page 20, line 22
o The SMIv2 SYNTAX clause is ignored. o The SMIv2 SYNTAX clause is ignored.
o The SMIv2 UNITS clause is ignored. o The SMIv2 UNITS clause is ignored.
o The SMIv2 MAX-ACCESS clause is ignored. o The SMIv2 MAX-ACCESS clause is ignored.
o The SMIv2 STATUS clause is ignored. o The SMIv2 STATUS clause is ignored.
o The SMIv2 DESCRIPTION clause MAY be captured in a comment. o The SMIv2 DESCRIPTION clause MAY be captured in a comment.
statement.
o The SMIv2 REFERENCE clause MAY be captured in a comment. o The SMIv2 REFERENCE clause MAY be captured in a comment.
o The value of the SMIv2 OBJECT-TYPE macro invocation MAY be o The value of the SMIv2 OBJECT-TYPE macro invocation MAY be
captured in a comment. captured in a comment.
An OBJECT-TYPE macro invocation defining a conceptual row An OBJECT-TYPE macro invocation defining a conceptual row
augmentation is translated to a YANG augment statement using the path augmentation is translated to a YANG augment statement using the path
to the augmented table as its argument. The clauses of the OBJECT- to the augmented table as its argument. The clauses of the OBJECT-
TYPE macro are translated as follows: TYPE macro are translated as follows:
skipping to change at page 21, line 21 skipping to change at page 21, line 21
[RFC2863] is shown below. [RFC2863] is shown below.
/* /*
* ifXTable (1.3.6.1.2.1.31.1.1) * ifXTable (1.3.6.1.2.1.31.1.1)
* *
* A list of interface entries. The number of entries is * A list of interface entries. The number of entries is
* given by the value of ifNumber. This table contains * given by the value of ifNumber. This table contains
* additional objects for the interface table. * additional objects for the interface table.
*/ */
augment "/if-mib:ifTable/if-mib:ifEntry" { augment "/if-mib:ifMIB/if-mib:ifTable/if-mib:ifEntry" {
description description
"An entry containing additional management information "An entry containing additional management information
applicable to a particular interface."; applicable to a particular interface.";
smiv2:oid "1.3.6.1.2.1.31.1.1.1"; smiv2:oid "1.3.6.1.2.1.31.1.1.1";
leaf ifName { leaf ifName {
type snmpv2-tc:DisplayString; type snmpv2-tc:DisplayString;
description description
"The textual name of the interface. The value of this "The textual name of the interface. The value of this
object should be the name of the interface as assigned by object should be the name of the interface as assigned by
skipping to change at page 24, line 5 skipping to change at page 24, line 5
o The value of the SMIv2 NOTIFICATION-TYPE macro invocation MAY be o The value of the SMIv2 NOTIFICATION-TYPE macro invocation MAY be
translated into an smiv2:oid statement, see the YANG extension translated into an smiv2:oid statement, see the YANG extension
defined in Section 11. defined in Section 11.
10.2. Example: linkDown NOTIFICATION-TYPE of IF-MIB 10.2. Example: linkDown NOTIFICATION-TYPE of IF-MIB
The translation of the linkDown notification of the IF-MIB [RFC2863] The translation of the linkDown notification of the IF-MIB [RFC2863]
is shown below. is shown below.
notification linkDown { notification linkDown {
description
"A linkDown trap signifies that the SNMP entity, acting in
an agent role, has detected that the ifOperStatus object for
one of its communication links is about to enter the down
state from some other state (but not from the notPresent
state). This other state is indicated by the included value
of ifOperStatus.";
smiv2:oid "1.3.6.1.6.3.1.1.5.3";
container object-1 {
description description
"A linkDown trap signifies that the SNMP entity, acting in "[Automatically generated container for a notification object.";
an agent role, has detected that the ifOperStatus object for
one of its communication links is about to enter the down
state from some other state (but not from the notPresent
state). This other state is indicated by the included value
of ifOperStatus.";
smiv2:oid "1.3.6.1.6.3.1.1.5.3";
container object-1 { leaf ifIndex {
leaf ifIndex { type leafref {
type leafref { path "/if-mib:ifMIB/if-mib:ifTable" +
path "/if-mib:ifTable/if-mib:ifEntry/if-mib:ifIndex"; "/if-mib:ifEntry/if-mib:ifIndex";
}
description
"[Automatically generated leaf for a notification object.]";
} }
description
"[Automatically generated leaf for a notification object.]";
} }
}
container object-2 { container object-2 {
leaf ifIndex { description
type leafref { "[Automatically generated container for a notification object.";
path "/if-mib:ifTable/if-mib:ifEntry/if-mib:ifIndex";
} leaf ifIndex {
description type leafref {
"[Automatically generated leaf for a notification object path "/if-mib:ifMIB/if-mib:ifTable" +
index.]"; "/if-mib:ifEntry/if-mib:ifIndex";
} }
leaf ifAdminStatus { description
type leafref { "[Automatically generated leaf for a notification object
path "/if-mib:ifTable/if-mib:ifEntry/if-mib:ifAdminStatus"; index.]";
} }
description leaf ifAdminStatus {
"[Automatically generated leaf for a notification object.]"; type leafref {
path "/if-mib:ifMIB/if-mib:ifTable" +
"/if-mib:ifEntry/if-mib:ifAdminStatus";
} }
description
"[Automatically generated leaf for a notification object.]";
} }
}
container object-3 { container object-3 {
leaf ifIndex { description
type leafref { "[Automatically generated container for a notification object.";
path "/if-mib:ifTable/if-mib:ifEntry/if-mib:ifIndex";
} leaf ifIndex {
description type leafref {
"[Automatically generated leaf for a notification object path "/if-mib:ifMIB/if-mib:ifTable" +
index.]"; "/if-mib:ifEntry/if-mib:ifIndex";
} }
leaf ifOperStatus { description
type leafref { "[Automatically generated leaf for a notification object
path "/if-mib:ifTable/if-mib:ifEntry/if-mib:ifOperStatus"; index.]";
} }
description leaf ifOperStatus {
"[Automatically generated leaf for a notification object.]"; type leafref {
path "/if-mib:ifMIB/if-mib:ifTable" +
"/if-mib:ifEntry/if-mib:ifOperStatus";
} }
description
"[Automatically generated leaf for a notification object.]";
} }
} }
}
11. YANG Language Extension Definition 11. YANG Language Extension Definition
This section defines some YANG extension statements that can be used This section defines some YANG extension statements that can be used
to capture some information present in SMIv2 modules that is not to capture some information present in SMIv2 modules that is not
translated into core YANG statements. The YANG module references translated into core YANG statements. The YANG module references
[RFC2578] and [RFC2579]. [RFC2578] and [RFC2579].
<CODE BEGINS> file "ietf-yang-smiv2@2011-04-13.yang" <CODE BEGINS> file "ietf-yang-smiv2@2011-07-01.yang"
module ietf-yang-smiv2 { module ietf-yang-smiv2 {
namespace "urn:ietf:params:xml:ns:yang:ietf-yang-smiv2"; namespace "urn:ietf:params:xml:ns:yang:ietf-yang-smiv2";
prefix "smiv2"; prefix "smiv2";
organization organization
"IETF NETMOD (NETCONF Data Modeling Language) Working Group"; "IETF NETMOD (NETCONF Data Modeling Language) Working Group";
contact contact
skipping to change at page 27, line 6 skipping to change at page 27, line 6
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.: please update the date to the date of publication // RFC Ed.: please update the date to the date of publication
revision 2011-04-13 { revision 2011-07-01 {
description description
"Initial revision."; "Initial revision.";
reference reference
"RFC XXXX: Translation of SMIv2 MIB Modules to YANG Modules"; "RFC XXXX: Translation of SMIv2 MIB Modules to YANG Modules";
// RFC Ed.: replace XXXX with actual RFC number and remove this note // RFC Ed.: replace XXXX with actual RFC number and remove this note
} }
identity object-identity { identity object-identity {
description description
"Base identity for all SMIv2 OBJECT-IDENTITYs."; "Base identity for all SMIv2 OBJECT-IDENTITYs.";
skipping to change at page 28, line 7 skipping to change at page 28, line 7
extension defval { extension defval {
argument "value"; argument "value";
description description
"The defval statement takes as an argument a default value defined "The defval statement takes as an argument a default value defined
by an SMIv2 DEFVAL clause."; by an SMIv2 DEFVAL clause.";
reference reference
"RFC2578: Structure of Management Information Version 2 (SMIv2)"; "RFC2578: Structure of Management Information Version 2 (SMIv2)";
} }
extension alias {
argument "descriptor"
description
"The alias statement introduces an SMIv2 descriptor. The body of
the alias statement is expected to contain an oid statement that
provides the numeric OID associated with the descriptor.";
reference
"RFC2578: Structure of Management Information Version 2 (SMIv2)";
}
} }
<CODE ENDS> <CODE ENDS>
12. IANA Considerations 12. IANA Considerations
This document registers two URIs in the IETF XML registry [RFC3688]. This document registers two URIs in the IETF XML registry [RFC3688].
Following the format in RFC 3688, the following registrations have Following the format in RFC 3688, the following registrations have
been made. been made.
skipping to change at page 30, line 15 skipping to change at page 30, line 15
13. Security Considerations 13. Security Considerations
This document defines a translation of SMIv2 MIB modules into YANG This document defines a translation of SMIv2 MIB modules into YANG
modules, enabling read-only access to data objects defined in SMIv2 modules, enabling read-only access to data objects defined in SMIv2
MIB modules via NETCONF. The translation itself has no security MIB modules via NETCONF. The translation itself has no security
impact on the Internet. impact on the Internet.
Users of translated SMIv2 models that have been published as RFCs Users of translated SMIv2 models that have been published as RFCs
should consult the security considerations of the respective RFCs. should consult the security considerations of the respective RFCs.
In addition, the security considerations for the NETCONF protocol In addition, the security considerations for the NETCONF protocol
[RFC4741] should be consulted to understand how NETCONF protects [RFC6241] should be consulted to understand how NETCONF protects
potentially sensitive information. potentially sensitive information.
14. References 14. References
14.1. Normative References 14.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.
[RFC2578] McCloghrie, K., Ed., Perkins, D., Ed., and J. [RFC2578] McCloghrie, K., Ed., Perkins, D., Ed., and J.
skipping to change at page 31, line 46 skipping to change at page 31, line 46
[RFC3289] Baker, F., Chan, K., and A. Smith, "Management Information [RFC3289] Baker, F., Chan, K., and A. Smith, "Management Information
Base for the Differentiated Services Architecture", Base for the Differentiated Services Architecture",
RFC 3289, May 2002. RFC 3289, May 2002.
[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.
[RFC4181] Heard, C., "Guidelines for Authors and Reviewers of MIB [RFC4181] Heard, C., "Guidelines for Authors and Reviewers of MIB
Documents", BCP 111, RFC 4181, September 2005. Documents", BCP 111, RFC 4181, September 2005.
[RFC4741] Enns, R., "NETCONF Configuration Protocol", RFC 4741, [RFC6241] Enns, R., Ed., Bjorklund, M., Ed., Schoenwaelder, J., Ed.,
December 2006. and A. Bierman, Ed., "Network Configuration Protocol
(NETCONF)", RFC 6241, June 2011.
Author's Address Author's Address
Juergen Schoenwaelder Juergen Schoenwaelder
Jacobs University Jacobs University
Email: j.schoenwaelder@jacobs-university.de Email: j.schoenwaelder@jacobs-university.de
 End of changes. 28 change blocks. 
62 lines changed or deleted 92 lines changed or added

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