Internet Engineering Task Force (IETF)                        M. Ellison
Request for Comments: 5935                   Ellison Software Consulting
Category: Standards Track                                      B. Natale
ISSN: 2070-1721                                                    MITRE
                                                             August 2010
        
Internet Engineering Task Force (IETF)                        M. Ellison
Request for Comments: 5935                   Ellison Software Consulting
Category: Standards Track                                      B. Natale
ISSN: 2070-1721                                                    MITRE
                                                             August 2010
        

Expressing SNMP SMI Datatypes in XML Schema Definition Language

用XML模式定义语言表示SNMP SMI数据类型

Abstract

摘要

This memo defines the IETF standard expression of Structure of Management Information (SMI) base datatypes in XML Schema Definition (XSD) language. The primary objective of this memo is to enable the production of XML documents that are as faithful to the SMI as possible, using XSD as the validation mechanism.

本备忘录以XML模式定义(XSD)语言定义了IETF管理信息结构(SMI)基本数据类型的标准表达式。本备忘录的主要目标是,使用XSD作为验证机制,生成尽可能忠实于SMI的XML文档。

Status of This Memo

关于下段备忘

This is an Internet Standards Track document.

这是一份互联网标准跟踪文件。

This document is a product of the Internet Engineering Task Force (IETF). It represents the consensus of the IETF community. It has received public review and has been approved for publication by the Internet Engineering Steering Group (IESG). Further information on Internet Standards is available in Section 2 of RFC 5741.

本文件是互联网工程任务组(IETF)的产品。它代表了IETF社区的共识。它已经接受了公众审查,并已被互联网工程指导小组(IESG)批准出版。有关互联网标准的更多信息,请参见RFC 5741第2节。

Information about the current status of this document, any errata, and how to provide feedback on it may be obtained at http://www.rfc-editor.org/info/rfc5935.

有关本文件当前状态、任何勘误表以及如何提供反馈的信息,请访问http://www.rfc-editor.org/info/rfc5935.

Copyright Notice

版权公告

Copyright (c) 2010 IETF Trust and the persons identified as the document authors. All rights reserved.

版权所有(c)2010 IETF信托基金和确定为文件作者的人员。版权所有。

This document is subject to BCP 78 and the IETF Trust's Legal Provisions Relating to IETF Documents (http://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.

本文件受BCP 78和IETF信托有关IETF文件的法律规定的约束(http://trustee.ietf.org/license-info)自本文件出版之日起生效。请仔细阅读这些文件,因为它们描述了您对本文件的权利和限制。从本文件中提取的代码组件必须包括信托法律条款第4.e节中所述的简化BSD许可证文本,并提供简化BSD许可证中所述的无担保。

Table of Contents

目录

   1. Introduction ....................................................2
   2. Conventions .....................................................4
   3. Requirements ....................................................4
   4. XSD for SMI Base Datatypes ......................................5
   5. Rationale .......................................................8
      5.1. Numeric Datatypes ..........................................8
      5.2. OctetString ................................................9
      5.3. Opaque ....................................................10
      5.4. IpAddress .................................................10
      5.5. ObjectIdentifier ..........................................10
   6. Security Considerations ........................................11
   7. IANA Considerations ............................................11
      7.1. SMI Base Datatypes Namespace Registration .................12
      7.2. SMI Base Datatypes Schema Registration ....................12
   8. Acknowledgements ...............................................12
   9. References .....................................................13
      9.1. Normative References ......................................13
      9.2. Informative References ....................................13
        
   1. Introduction ....................................................2
   2. Conventions .....................................................4
   3. Requirements ....................................................4
   4. XSD for SMI Base Datatypes ......................................5
   5. Rationale .......................................................8
      5.1. Numeric Datatypes ..........................................8
      5.2. OctetString ................................................9
      5.3. Opaque ....................................................10
      5.4. IpAddress .................................................10
      5.5. ObjectIdentifier ..........................................10
   6. Security Considerations ........................................11
   7. IANA Considerations ............................................11
      7.1. SMI Base Datatypes Namespace Registration .................12
      7.2. SMI Base Datatypes Schema Registration ....................12
   8. Acknowledgements ...............................................12
   9. References .....................................................13
      9.1. Normative References ......................................13
      9.2. Informative References ....................................13
        
1. Introduction
1. 介绍

Numerous use cases exist for expressing the management information described by SMI Management Information Base (MIB) modules in XML [XML]. Potential use cases reside both outside and within the traditional IETF network management community. For example, developers of some XML-based management applications may want to incorporate the rich set of data models provided by MIB modules. Developers of other XML-based management applications may want to access MIB module instrumentation via gateways to SNMP agents. Such applications benefit from the IETF standard mapping of SMI datatypes to XML datatypes via XSD [XMLSchema], [XSDDatatypes].

有许多用例用于以XML[XML]表示SMI管理信息库(MIB)模块所描述的管理信息。潜在用例存在于传统IETF网络管理社区内外。例如,一些基于XML的管理应用程序的开发人员可能希望合并MIB模块提供的丰富数据模型集。其他基于XML的管理应用程序的开发人员可能希望通过SNMP代理的网关访问MIB模块检测。这些应用程序受益于IETF通过XSD[XMLSchema]、[XSDDatatypes]将SMI数据类型映射到XML数据类型的标准映射。

MIB modules use SMIv2 [RFC2578] to describe data models. For legacy MIB modules, SMIv1 [RFC1155] was used. MIB data conveyed in variable bindings ("varbinds") within protocol data units (PDUs) of SNMP messages use the primitive, base datatypes defined by the SMI.

MIB模块使用SMIv2[RFC2578]来描述数据模型。对于传统MIB模块,使用了SMIv1[RFC1155]。SNMP消息的协议数据单元(PDU)内的变量绑定(“varbinds”)中传输的MIB数据使用SMI定义的基本数据类型。

The SMI allows for the creation of derivative datatypes, "textual conventions" ("TCs") [RFC2579]. A TC has a unique name, has a syntax that either refines or is a base SMI datatype, and has relatively precise application-level semantics. TCs facilitate correct application-level handling of MIB data, improve readability of MIB modules by humans, and support appropriate renderings of MIB data.

SMI允许创建派生数据类型,“文本约定”(“TCs”)[RFC2579]。TC有一个唯一的名称,其语法可以细化或是基本SMI数据类型,并且具有相对精确的应用程序级语义。TCs有助于MIB数据的正确应用程序级处理,提高MIB模块的可读性,并支持适当的MIB数据呈现。

Values in varbinds corresponding to MIB objects defined with TC syntax are always encoded as the base SMI datatype underlying the TC syntax. Thus, the XSD mappings defined in this memo provide support for values of MIB objects defined with TC syntax as well as for values of MIB objects defined with base SMI syntax. Using the translation of TC into base SMI datatypes any MIB module that uses TCs can be mapped into XSD using the mappings defined in this memo. For example, for IP addresses (both IPv4 and IPv6), MIB objects defined using the InetAddress TC (as per [RFC4001]) are encoded using the base SMI datatype underlying the InetAddress TC syntax rather than the IpAddress base datatype.

与使用TC语法定义的MIB对象相对应的varbinds中的值始终被编码为TC语法底层的基本SMI数据类型。因此,本备忘录中定义的XSD映射支持使用TC语法定义的MIB对象的值以及使用基本SMI语法定义的MIB对象的值。通过将TC转换为基本SMI数据类型,任何使用TCs的MIB模块都可以使用本备忘录中定义的映射映射到XSD。例如,对于IP地址(IPv4和IPv6),使用InetAddress TC(根据[RFC4001])定义的MIB对象使用InetAddress TC语法基础的基本SMI数据类型而不是IpAddress基本数据类型进行编码。

Various independent schemes have been devised for expressing SMI datatypes in XSD. These schemes exhibit a degree of commonality, especially concerning numeric SMI datatypes, but these schemes also exhibit sufficient differences, especially concerning the non-numeric SMI datatypes, precluding uniformity of expression and general interoperability.

已经设计了各种独立的方案来在XSD中表示SMI数据类型。这些方案表现出一定程度的通用性,特别是关于数字SMI数据类型,但这些方案也表现出足够的差异,特别是关于非数字SMI数据类型,排除了表达的一致性和通用互操作性。

Throughout this memo, the term "fidelity" refers to the quality of an accurate, consistent representation of SMI data values and the term "faithful" refers to the quality of reliably reflecting the semantics of SMI data values. Thus defined, the characteristics of fidelity and being faithful are essential to uniformity of expression and general interoperability in the XML representation of SMI data values.

在本备忘录中,术语“逼真度”指SMI数据值的准确、一致表示的质量,“忠实”指可靠反映SMI数据值语义的质量。因此,在SMI数据值的XML表示中,保真度和忠实性的特征对于表达的一致性和通用互操作性至关重要。

The primary purpose of this memo is to define the standard expression of SMI base datatypes in XML documents that is both uniform and interoperable. This standard expression enables Internet operators, management application developers, and users to benefit from a wider range of management tools and to benefit from a greater degree of unified management. Thus, standard expression enables and facilitates improvements to the timeliness, accuracy, and utility of management information.

本备忘录的主要目的是在XML文档中定义统一且可互操作的SMI基数据类型的标准表达式。此标准表达式使Internet运营商、管理应用程序开发人员和用户能够受益于更广泛的管理工具,并受益于更大程度的统一管理。因此,标准表达能够并有助于提高管理信息的及时性、准确性和实用性。

The overall objective of this memo, and of any related future memos as may be published, is to define the XSD equivalent [XSDDatatypes] of SMIv2 (STD 58) and to encourage XML-based protocols to carry, and XML-based applications to use, the management information defined in SMIv2-compliant MIB modules. The use of a standard mapping from SMIv2 to XML via XSD validation enables and promotes the efficient reuse of existing and future MIB modules and instrumentation by XML-based protocols and management applications.

本备忘录以及将来可能发布的任何相关备忘录的总体目标是定义SMIv2(STD 58)的XSD等效[XSDDatatypes],并鼓励基于XML的协议携带SMIv2兼容MIB模块中定义的管理信息,以及基于XML的应用程序使用这些信息。通过XSD验证使用从SMIv2到XML的标准映射,可以通过基于XML的协议和管理应用程序实现并促进现有和未来MIB模块和工具的高效重用。

Developers of certain XML-based management applications will find this specification sufficient for their purposes. Developers of other XML-based management applications may need to make more

某些基于XML的管理应用程序的开发人员会发现该规范足以满足他们的需要。其他基于XML的管理应用程序的开发人员可能需要做更多的工作

complete reuse of existing MIB modules, requiring standard XSD documents for TCs [RFC2579] and MIB structure [RFC2578]. Memos supporting such requirements are planned, but have not been produced at the time of this writing.

完全重用现有MIB模块,需要TCs[RFC2579]和MIB结构[RFC2578]的标准XSD文档。支持此类要求的备忘录已计划好,但在撰写本文时尚未编制。

Finally, it is worthwhile to note that the goal of fidelity to the SMIv2 standard (STD 58), as specified in the "Requirements" section below, is crucial to this effort. Fidelity leverages the established "rough consensus" of the precise SMIv2 data models contained in MIB modules, and leverages existing instrumentation, the "running code" implementing SMIv2 data models. This effort does not include any redesign of SMIv2 datatypes, data structures or textual conventions in order to overcome known limitations. Such work can be pursued by other efforts.

最后,值得注意的是,如下文“要求”部分所述,忠实于SMIv2标准(STD 58)的目标对这项工作至关重要。Fidelity利用MIB模块中包含的精确SMIv2数据模型的已建立的“粗略共识”,并利用现有的工具,即实现SMIv2数据模型的“运行代码”。这项工作不包括为克服已知限制而重新设计SMIv2数据类型、数据结构或文本约定。这种工作可以通过其他努力来进行。

2. Conventions
2. 习俗

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 RFC 2119 [RFC2119].

本文件中的关键词“必须”、“不得”、“要求”、“应”、“不应”、“应”、“不应”、“建议”、“可”和“可选”应按照RFC 2119[RFC2119]中所述进行解释。

3. Requirements
3. 要求

The following set of requirements is intended to produce XML documents that can be validated via the XSD defined in this specification to faithfully represent values carried "on-the-wire" in SNMP PDUs as defined by the SMI:

以下一组要求旨在生成可通过本规范中定义的XSD进行验证的XML文档,以忠实地表示SMI定义的SNMP PDU中“在线”携带的值:

R1. All SMI base datatypes MUST have a corresponding XSD datatype.

R1。所有SMI基本数据类型必须具有相应的XSD数据类型。

R2. SMIv2 is the normative SMI for this document. Prior to mapping datatypes into XSD, legacy SMIv1 modules MUST be converted (at least logically) in accordance with Section 2.1, inclusive, of the "Coexistence" RFC [RFC3584].

R2。SMIv2是本文件的标准SMI。在将数据类型映射到XSD之前,必须根据“共存”RFC[RFC3584]第2.1节(含第2.1节)转换旧版SMIv1模块(至少在逻辑上)。

R3. The XSD datatype specified for a given SMI datatype MUST be able to represent all valid values for that SMI datatype.

R3。为给定SMI数据类型指定的XSD数据类型必须能够表示该SMI数据类型的所有有效值。

R4. The XSD datatype specified for a given SMI datatype MUST represent any special encoding rules associated with that SMI datatype.

R4。为给定SMI数据类型指定的XSD数据类型必须表示与该SMI数据类型关联的任何特殊编码规则。

R5. The XSD datatype specified for a given SMI datatype MUST include any restrictions on values associated with the SMI datatype.

R5。为给定SMI数据类型指定的XSD数据类型必须包括对与SMI数据类型关联的值的任何限制。

R6. The XSD datatype specified for a given SMI datatype MUST be the most logical XSD datatype, with the fewest necessary restrictions on its set of values, consistent with the foregoing requirements.

R6。为给定SMI数据类型指定的XSD数据类型必须是逻辑性最强的XSD数据类型,对其值集的必要限制最少,符合上述要求。

R7. The XML output produced as a result of meeting the foregoing requirements SHOULD be the most coherent and succinct representation (i.e., avoiding superfluous "decoration") from the perspective of readability by humans.

R7。从人类可读性的角度来看,满足上述要求产生的XML输出应该是最连贯和简洁的表示(即,避免多余的“修饰”)。

4. XSD for SMI Base Datatypes
4. SMI基本数据类型的XSD

This document provides XSD datatype mappings for the SMIv2 base datatypes only -- i.e., the eleven "ObjectSyntax" datatypes defined in RFC 2578. These datatypes -- via tag values defined in the SMIv2 to identify them in varbinds -- constrain values carried "on-the-wire" in SNMP PDUs between SNMP management applications and SNMP agents:

本文档仅为SMIv2基本数据类型(即RFC2578中定义的11个“ObjectSyntax”数据类型)提供XSD数据类型映射。这些数据类型——通过SMIv2中定义的标记值在varbinds中标识它们——约束SNMP管理应用程序和SNMP代理之间的SNMP PDU中“在线”携带的值:

o INTEGER, Integer32

o 整数,整数32

o Unsigned32, Gauge32

o 未签名32,仪表32

o Counter32

o 计数器32

o TimeTicks

o 时间分段信号

o Counter64

o 计数器64

o OCTET STRING

o 八位组串

o Opaque

o 不透明的

o IpAddress

o IP地址

o OBJECT IDENTIFIER

o 对象标识符

The "BITS" pseudo-type (also referred to as a "construct" in RFC 2578) is treated as a Textual Convention, not a base datatype, for the purpose of this document.

在本文档中,“BITS”伪类型(在RFC2578中也称为“构造”)被视为文本约定,而不是基本数据类型。

BEGIN

开始

   <?xml version="1.0" encoding="utf-8"?>
   <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
   xmlns="urn:ietf:params:xml:ns:smi:base:1.0"
   targetNamespace="urn:ietf:params:xml:ns:smi:base:1.0"
   elementFormDefault="qualified"
   attributeFormDefault="unqualified"
   xml:lang="en">
        
   <?xml version="1.0" encoding="utf-8"?>
   <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
   xmlns="urn:ietf:params:xml:ns:smi:base:1.0"
   targetNamespace="urn:ietf:params:xml:ns:smi:base:1.0"
   elementFormDefault="qualified"
   attributeFormDefault="unqualified"
   xml:lang="en">
        
     <xs:annotation>
       <xs:documentation>
           Mapping of SMIv2 base datatypes from RFC 2578
        
     <xs:annotation>
       <xs:documentation>
           Mapping of SMIv2 base datatypes from RFC 2578
        

Contact: Mark Ellison Organization: Ellison Software Consulting Address: 38 Salem Road Atkinson, NH 03811 USA Telephone: +1 603-362-9270 E-Mail: ietf@EllisonSoftware.com

联系人:Mark Ellison组织:Ellison软件咨询地址:美国新罕布什尔州阿特金森塞勒姆路38号03811电话:+1 603-362-9270电子邮件:ietf@EllisonSoftware.com

Contact: Bob Natale Organization: MITRE Address: 300 Sentinel Drive 6th Floor Annapolis Junction, MD 20701 USA Telephone: +1 301-617-3008 E-Mail: rnatale@mitre.org

联系人:Bob Natale组织:MITRE地址:美国马里兰州安纳波利斯路口6楼300 Sentinel Drive电话:+1 301-617-3008电子邮件:rnatale@mitre.org

Last Updated: 201002260000Z

最后更新:20100260000Z

Copyright (c) 2010 IETF Trust and the persons identified as authors of the code. All rights reserved.

版权所有(c)2010 IETF信托基金和被确定为代码作者的人员。版权所有。

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 (http://trustee.ietf.org/license-info).

根据IETF信托有关IETF文件的法律规定第4.c节规定的简化BSD许可证中包含的许可条款,允许以源代码和二进制格式重新分发和使用,无论是否修改(http://trustee.ietf.org/license-info).

This version of this XML Schema Definition (XSD) document is part of RFC 5935; see the RFC itself for full legal notices.

此版本的XML模式定义(XSD)文档是RFC 5935的一部分;有关完整的法律通知,请参见RFC本身。

       </xs:documentation>
        
       </xs:documentation>
        
     </xs:annotation>
        
     </xs:annotation>
        
     <xs:simpleType name="INTEGER">
       <xs:restriction base="xs:int"/>
     </xs:simpleType>
        
     <xs:simpleType name="INTEGER">
       <xs:restriction base="xs:int"/>
     </xs:simpleType>
        
     <xs:simpleType name="Integer32">
       <xs:restriction base="xs:int"/>
     </xs:simpleType>
        
     <xs:simpleType name="Integer32">
       <xs:restriction base="xs:int"/>
     </xs:simpleType>
        
     <xs:simpleType name="Unsigned32">
       <xs:restriction base="xs:unsignedInt"/>
     </xs:simpleType>
        
     <xs:simpleType name="Unsigned32">
       <xs:restriction base="xs:unsignedInt"/>
     </xs:simpleType>
        
     <xs:simpleType name="Gauge32">
       <xs:restriction base="xs:unsignedInt"/>
     </xs:simpleType>
        
     <xs:simpleType name="Gauge32">
       <xs:restriction base="xs:unsignedInt"/>
     </xs:simpleType>
        
     <xs:simpleType name="Counter32">
       <xs:restriction base="xs:unsignedInt"/>
     </xs:simpleType>
        
     <xs:simpleType name="Counter32">
       <xs:restriction base="xs:unsignedInt"/>
     </xs:simpleType>
        
     <xs:simpleType name="TimeTicks">
       <xs:restriction base="xs:unsignedInt"/>
     </xs:simpleType>
        
     <xs:simpleType name="TimeTicks">
       <xs:restriction base="xs:unsignedInt"/>
     </xs:simpleType>
        
     <xs:simpleType name="Counter64">
       <xs:restriction base="xs:unsignedLong"/>
     </xs:simpleType>
        
     <xs:simpleType name="Counter64">
       <xs:restriction base="xs:unsignedLong"/>
     </xs:simpleType>
        
     <xs:simpleType name="OctetString">
       <xs:restriction base="xs:hexBinary">
         <xs:maxLength value="65535"/>
       </xs:restriction>
     </xs:simpleType>
        
     <xs:simpleType name="OctetString">
       <xs:restriction base="xs:hexBinary">
         <xs:maxLength value="65535"/>
       </xs:restriction>
     </xs:simpleType>
        
     <xs:simpleType name="Opaque">
       <xs:restriction base="xs:hexBinary"/>
     </xs:simpleType>
        
     <xs:simpleType name="Opaque">
       <xs:restriction base="xs:hexBinary"/>
     </xs:simpleType>
        
     <xs:simpleType name="IpAddress">
         <xs:restriction base="xs:string">
             <xs:pattern value=
             "(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\.){3}
                ([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])"/>
         </xs:restriction>
     </xs:simpleType>
        
     <xs:simpleType name="IpAddress">
         <xs:restriction base="xs:string">
             <xs:pattern value=
             "(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\.){3}
                ([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])"/>
         </xs:restriction>
     </xs:simpleType>
        
     <xs:simpleType name="ObjectIdentifier">
       <xs:restriction base="xs:string">
         <xs:pattern value=
         "(([0-1](\.[1-3]?[0-9]))|
           (2\.(0|([1-9]\d*))))
           (\.(0|([1-9]\d*))){0,126}"/>
       </xs:restriction>
     </xs:simpleType>
        
     <xs:simpleType name="ObjectIdentifier">
       <xs:restriction base="xs:string">
         <xs:pattern value=
         "(([0-1](\.[1-3]?[0-9]))|
           (2\.(0|([1-9]\d*))))
           (\.(0|([1-9]\d*))){0,126}"/>
       </xs:restriction>
     </xs:simpleType>
        
   </xs:schema>
   END
        
   </xs:schema>
   END
        
5. Rationale
5. 根本原因

The XSD datatypes, including any specified restrictions, were chosen based on fit with the requirements specified earlier in this document, and with attention to simplicity while maintaining fidelity to the SMI. Also, the "canonical representations" (i.e., refinements of the "lexical representations") documented in the W3C XSD specification [XMLSchema], [XSDDatatypes] are assumed.

XSD数据类型(包括任何指定的限制)是根据与本文档前面指定的需求的匹配情况选择的,并注意简单性,同时保持对SMI的忠实性。此外,假定W3C XSD规范[XMLSchema]、[XSDDatatypes]中记录的“规范表示”(即“词汇表示”的改进)。

5.1. Numeric Datatypes
5.1. 数字数据类型

All of the numeric XSD datatypes specified in the previous section -- INTEGER, Integer32, Unsigned32, Gauge32, Counter32, TimeTicks, and Counter64 -- comply with the relevant requirements

上一节中指定的所有数字XSD数据类型——INTEGER、Integer32、Unsigned32、Gauge32、Counter32、TimeTicks和Counter64——都符合相关要求

o They cover all valid values for the corresponding SMI datatypes.

o 它们涵盖了对应SMI数据类型的所有有效值。

o They comply with the standard encoding rules associated with the corresponding SMI datatypes.

o 它们符合与相应SMI数据类型关联的标准编码规则。

o They inherently match the range restrictions associated with the corresponding SMI datatypes.

o 它们固有地匹配与相应SMI数据类型关联的范围限制。

o They are the most direct XSD datatypes that exhibit the foregoing characteristics relative to the corresponding SMI datatypes (which is why no "restriction" statements -- other than the "base" XSD type -- are required in the XSD).

o 它们是最直接的XSD数据类型,表现出与相应SMI数据类型相关的上述特征(这就是为什么XSD中不需要“限制”语句(除了“基本”XSD类型)。

o The XML output produced from the canonical representation of these XSD datatypes is also the most direct from the perspective of readability by humans (i.e., no leading "+" sign and no leading zeros).

o 从人类可读性的角度来看,从这些XSD数据类型的规范表示生成的XML输出也是最直接的(即,没有前导的“+”符号和前导的零)。

Special note to application developers: compliance with this schema in an otherwise correct translation from raw ("on-the-wire" representation) SNMP MIB data produces values that are faithful to the original. However, the Gauge32, Counter32, Counter64, and TimeTicks datatypes have special application semantics that must be considered when using their raw values for anything other than display, printing, storage, or transmission of the literal value. RFC 2578 provides the necessary details.

应用程序开发人员特别注意:遵循此模式,从原始数据(即“在线”表示)转换为正确的SNMP MIB数据,将生成忠实于原始数据的值。但是,Gauge32、Counter32、Counter64和TimeTicks数据类型具有特殊的应用程序语义,在将其原始值用于文本值的显示、打印、存储或传输之外的任何内容时,必须考虑这些语义。RFC 2578提供了必要的详细信息。

5.2. OctetString
5.2. 八进制字符串

This XSD datatype corresponds to the SMI "OCTET STRING" datatype.

此XSD数据类型对应于SMI“八进制字符串”数据类型。

Several independent schemes for mapping SMI datatypes to XSD have used the XSD "string" type to represent "OCTET STRING", but this mapping does not conform to the requirements specified in this document. Most notably, "string" cannot faithfully represent all valid values (0 thru 255) that each octet in an "OCTET STRING" can have -- or at least cannot do so in a way that provides for easy human readability of the resulting XML output.

将SMI数据类型映射到XSD的几个独立方案使用XSD“string”类型来表示“OCTET string”,但这种映射不符合本文档中规定的要求。最值得注意的是,“字符串”不能忠实地表示“八位字节字符串”中的每个八位字节可以具有的所有有效值(0到255)——或者至少不能以一种为结果XML输出提供方便的可读性的方式这样做。

Consequently, the XSD datatype "hexBinary" is specified as the standard mapping of the SMI "OCTET STRING" datatype. In hexBinary, each octet is encoded as two hexadecimal digits; the canonical representation limits the set of allowed hexadecimal digits to 0-9 and uppercase A-F.

因此,XSD数据类型“hexBinary”被指定为SMI“OCTET STRING”数据类型的标准映射。在十六进制二进制中,每个八位字节编码为两个十六进制数字;规范表示法将允许的十六进制数字集限制为0-9和大写A-F。

The hexBinary representation of "OCTET STRING" complies with the relevant requirements:

“八进制字符串”的十六进制二进制表示符合相关要求:

o It covers all valid values for the corresponding SMI datatype.

o 它涵盖了对应SMI数据类型的所有有效值。

o It complies with the standard encoding rules associated with the corresponding SMI datatype.

o 它符合与相应SMI数据类型关联的标准编码规则。

o With the "maxLength" restriction to 65535 octets, the XSD datatype specification matches the restrictions associated with the corresponding SMI datatype.

o 当“maxLength”限制为65535个八位字节时,XSD数据类型规范匹配与相应SMI数据类型相关的限制。

o It is the most direct XSD datatype that exhibits the foregoing characteristics relative to the corresponding SMI datatype (which must allow for any valid binary octet value).

o 它是最直接的XSD数据类型,展示了与相应SMI数据类型(必须允许任何有效的二进制八位组值)相关的上述特征。

o The XML output produced from the canonical representation of this XSD datatype is not optimal with respect to readability by humans; however, that is a consequence of the SMI datatype itself. Where human readability is more of a concern, it is likely that the

o 从XSD数据类型的规范化表示生成的XML输出在可读性方面不是最佳的;然而,这是SMI数据类型本身的结果。当人们更关心可读性时,很可能

actual MIB objects in question will be represented by textual conventions that limit the set of values that will be included in the OctetStrings and will, thus, bypass the hexBinary typing.

讨论中的实际MIB对象将由文本约定表示,这些约定限制将包含在OctetString中的值集,因此将绕过hexBinary类型。

5.3. Opaque
5.3. 不透明的

The "hexBinary" XSD datatype is specified as the representation of the SMI "Opaque" datatype generally for the same reasons as "hexBinary" is specified for the "OctetString" datatype:

“hexBinary”XSD数据类型被指定为SMI“不透明”数据类型的表示形式,其原因通常与“OctetString”数据类型指定“hexBinary”的原因相同:

o It covers all valid values for the corresponding SMI datatype.

o 它涵盖了对应SMI数据类型的所有有效值。

o It complies with the standard encoding rules associated with the corresponding SMI datatype.

o 它符合与相应SMI数据类型关联的标准编码规则。

o There are no restriction issues associated with using "hexBinary" for "Opaque".

o 对“不透明”使用“hexBinary”没有相关的限制问题。

o It is the most direct XSD datatype that exhibits the foregoing characteristics relative to the corresponding SMI datatype (which must allow for any valid binary octet value).

o 它是最直接的XSD数据类型,展示了与相应SMI数据类型(必须允许任何有效的二进制八位组值)相关的上述特征。

o The XML output produced from the canonical representation of this XSD datatype is not optimal with respect to readability by humans; however, that is a consequence of the SMI datatype itself. Unmediated "Opaque" data is intended for consumption by applications, not humans.

o 从XSD数据类型的规范化表示生成的XML输出在可读性方面不是最佳的;然而,这是SMI数据类型本身的结果。非中介的“不透明”数据旨在供应用程序使用,而不是供人使用。

5.4. IpAddress
5.4. IP地址

The XSD "string" datatype is the natural choice to represent an IpAddress as XML output. The "pattern" restriction applied in this case results in a dotted-decimal string of four values between "0" and "255" separated by a period (".") character. This pattern also precludes leading zeros.

XSD“string”数据类型是将IpAddress表示为XML输出的自然选择。在本例中应用的“模式”限制会导致一个由四个值组成的带点十进制字符串,这些值介于“0”和“255”之间,由一个句点(“.”)字符分隔。此模式还排除了前导零。

Note that the SMI relies upon Textual Conventions (TCs) to specify an IPv6 address. As such, the representation of an IPv6 address as an XSD datatype is beyond the scope of this document.

请注意,SMI依赖文本约定(TCs)来指定IPv6地址。因此,将IPv6地址表示为XSD数据类型超出了本文档的范围。

5.5. ObjectIdentifier
5.5. 目标识别器

This XSD datatype corresponds to the SMI "OBJECT IDENTIFIER" datatype.

此XSD数据类型对应于SMI“对象标识符”数据类型。

The XSD "string" datatype is also the natural choice to represent an ObjectIdentifier as XML output, for the same reasons as for the IpAddress choice. The "pattern" restriction applied in this case results in a dotted-decimal string of up to 128 elements (referred to as "sub-ids"), each holding an "Unsigned32" integer value.

XSD“string”数据类型也是将ObjectIdentifier表示为XML输出的自然选择,原因与IpAddress选择相同。在本例中应用的“模式”限制会导致最多128个元素(称为“子ID”)的点十进制字符串,每个元素包含一个“Unsigned32”整数值。

Note that the first two components of an "OBJECT IDENTIFIER" each have a limited range of values as indicated in the XSD pattern restriction and as described in the ASN1.1/BER standard [ASN.1].

请注意,“对象标识符”的前两个组件都具有有限的值范围,如XSD模式限制和ASN1.1/BER标准[ASN.1]所述。

There are three values allocated for the root node, and at most 39 values for nodes subordinate to a root node value of 0 or 1.

为根节点分配了三个值,从属于根节点值0或1的节点最多分配39个值。

The minimum length of an "OBJECT IDENTIFIER" is two sub-ids and the representation of a zero-valued "OBJECT IDENTIFIER" is "0.0".

“对象标识符”的最小长度为两个子ID,零值“对象标识符”的表示形式为“0.0”。

Note that no explicit "minLength" restriction, which would be "3" to allow for the minimum of two sub-ids and a single separating dot, is required since the pattern itself enforces this restriction.

请注意,由于模式本身强制执行此限制,因此不需要明确的“minLength”限制,即允许至少两个子ID和一个分隔点的“3”。

6. Security Considerations
6. 安全考虑

Security considerations for any given SMI MIB module will be relevant to any XSD/XML mapping of that MIB module; however, the mapping defined in this document does not itself introduce any new security considerations.

任何给定SMI MIB模块的安全注意事项将与该MIB模块的任何XSD/XML映射相关;但是,本文档中定义的映射本身并没有引入任何新的安全注意事项。

If and when proxies or gateways are developed to convey SNMP management information from SNMP agents to XML-based management applications via XSD/XML mapping of MIB modules based on this specification and its planned siblings, special care will need to be taken to ensure that all applicable SNMP security mechanisms are supported in an appropriate manner yet to be determined.

如果开发了代理或网关,以便根据本规范及其计划的同级,通过MIB模块的XSD/XML映射,将SNMP管理信息从SNMP代理传递到基于XML的管理应用程序,需要特别注意,以确保所有适用的SNMP安全机制都以一种尚待确定的适当方式得到支持。

7. IANA Considerations
7. IANA考虑

In accordance with RFC 3688 [RFC3688], the IANA XML registry has been updated with the following namespace and schema registrations associated with this document:

根据RFC 3688[RFC3688],IANA XML注册表已更新为与本文档相关的以下名称空间和模式注册:

o urn:ietf:params:xml:ns:smi:base:1.0

o urn:ietf:params:xml:ns:smi:base:1.0

o urn:ietf:params:xml:schema:base:1.0

o urn:ietf:params:xml:schema:base:1.0

7.1. SMI Base Datatypes Namespace Registration
7.1. SMI基本数据类型命名空间注册

This document registers a URI for the SMI Base Datatypes XML namespace in the IETF XML registry. Following the format in RFC 3688, IANA has made the following registration:

本文档在IETF XML注册表中注册SMI基本数据类型XML命名空间的URI。IANA按照RFC 3688中的格式进行了以下注册:

   URI: urn:ietf:params:xml:ns:smi:base:1.0
        
   URI: urn:ietf:params:xml:ns:smi:base:1.0
        

Registration Contact: The IESG.

注册联系人:IESG。

XML: N/A, the requested URI is an XML namespace.

XML:N/A,请求的URI是一个XML名称空间。

7.2. SMI Base Datatypes Schema Registration
7.2. SMI基本数据类型架构注册

This document registers a URI for the SMI Base Datatypes XML schema in the IETF XML registry. Following the format in RFC 3688, IANA has made the following registration:

本文档在IETF XML注册表中注册SMI基本数据类型XML模式的URI。IANA按照RFC 3688中的格式进行了以下注册:

   URI: urn:ietf:params:xml:schema:smi:base:1.0
        
   URI: urn:ietf:params:xml:schema:smi:base:1.0
        

Registration Contact: The IESG.

注册联系人:IESG。

XML: Section 4 of this document.

XML:本文档的第4节。

8. Acknowledgements
8. 致谢

Dave Harrington provided strategic and technical leadership to the team that developed this particular specification. Yan Li did much of the research into existing approaches that was used as a baseline for the recommendations in this particular specification.

Dave Harrington为开发此特定规范的团队提供了战略和技术领导。Yan Li对现有方法进行了大量研究,这些方法被用作本特定规范中建议的基线。

This document owes much to "Datatypes for Netconf Data Models" [NETCONF-DATATYPES] and to many other sources (including libsmi and group discussions on the NETCONF mailing lists) developed by those who have researched and published candidate mappings of SMI datatypes to XSD.

本文档在很大程度上归功于“Netconf数据模型的数据类型”[Netconf-Datatypes],以及由研究和发布SMI数据类型到XSD的候选映射的人开发的许多其他来源(包括libsmi和Netconf邮件列表上的小组讨论)。

Individuals who participated in various discussions of this topic at IETF meetings and on IETF mailing lists include: Ray Atarashi, Yoshifumi Atarashi, Andy Bierman, Sharon Chisholm, Avri Doria, Rob Ennes, Mehmet Ersue, David Harrington, Alfred Hines, Eliot Lear, Chris Lonvick, Faye Ly, Randy Presuhn, Juergen Schoenwaelder, Andrea Westerinen, and Bert Wijnen.

在IETF会议和IETF邮件列表上参与该主题各种讨论的个人包括:Ray Atarashi、Yoshifumi Atarashi、Andy Bierman、Sharon Chisholm、Avri Doria、Rob Ennes、Mehmet Ersue、David Harrington、Alfred Hines、Eliot Lear、Chris Lonvick、Faye Ly、Randy Presohn、Juergen Schoenwaeld、Andrea Westerinen、,还有伯特·维恩。

9. References
9. 工具书类
9.1. Normative References
9.1. 规范性引用文件

[RFC1155] Rose, M. and K. McCloghrie, "Structure and identification of management information for TCP/IP-based internets", STD 16, RFC 1155, May 1990.

[RFC1155]Rose,M.和K.McCloghrie,“基于TCP/IP的互联网管理信息的结构和识别”,STD 16,RFC 1155,1990年5月。

[RFC2119] Bradner, S., "Key words for use in RFCs to Indicate Requirement Levels", BCP 14, RFC 2119, March 1997.

[RFC2119]Bradner,S.,“RFC中用于表示需求水平的关键词”,BCP 14,RFC 2119,1997年3月。

[RFC2578] McCloghrie, K., Ed., Perkins, D., Ed., and J. Schoenwaelder, Ed., "Structure of Management Information Version 2 (SMIv2)", STD 58, RFC 2578, April 1999.

[RFC2578]McCloghrie,K.,Ed.,Perkins,D.,Ed.,和J.Schoenwaeld,Ed.“管理信息的结构版本2(SMIv2)”,STD 58,RFC 2578,1999年4月。

[RFC3584] Frye, R., Levi, D., Routhier, S., and B. Wijnen, "Coexistence between Version 1, Version 2, and Version 3 of the Internet-standard Network Management Framework", BCP 74, RFC 3584, August 2003.

[RFC3584]Frye,R.,Levi,D.,Routhier,S.,和B.Wijnen,“互联网标准网络管理框架版本1,版本2和版本3之间的共存”,BCP 74,RFC 3584,2003年8月。

[XML] World Wide Web Consortium, "Extensible Markup Language (XML) 1.0", W3C XML, February 1998, <http://www.w3.org/TR/1998/REC-xml-19980210>.

[XML]万维网联盟,“可扩展标记语言(XML)1.0”,W3C XML,1998年2月<http://www.w3.org/TR/1998/REC-xml-19980210>.

[XMLSchema] World Wide Web Consortium, "XML Schema Part 1: Structures Second Edition", W3C XML Schema, October 2004, <http://www.w3.org/TR/xmlschema-1/>.

[XMLSchema]万维网联盟,“XML模式第1部分:结构第二版”,W3C XML模式,2004年10月<http://www.w3.org/TR/xmlschema-1/>.

[XSDDatatypes] World Wide Web Consortium, "XML Schema Part 2: Datatypes Second Edition", W3C XML Schema, October 2004, <http://www.w3.org/TR/xmlschema-2/>.

[XSDDatatypes]万维网联盟,“XML模式第2部分:数据类型第二版”,W3C XML模式,2004年10月<http://www.w3.org/TR/xmlschema-2/>.

9.2. Informative References
9.2. 资料性引用

[ASN.1] International Organization for Standardization, "Information processing systems - Open Systems Interconnection - Specification of Basic Encoding Rules for Abstract Syntax Notation One (ASN.1)", International Standard 8825, December 1987.

[ASN.1]国际标准化组织,“信息处理系统-开放系统互连-抽象语法符号1(ASN.1)基本编码规则规范”,国际标准88251987年12月。

[NETCONF-DATATYPES] Romascanu, D., "Datatypes for Netconf Data Models", Work in Progress, May 2007.

[NETCONF-DATATYPES]Romascanu,D.,“NETCONF数据模型的数据类型”,正在进行的工作,2007年5月。

[RFC2579] McCloghrie, K., Perkins, D., and J. Schoenwaelder, "Textual Conventions for SMIv2", STD 58, RFC 2579, April 1999.

[RFC2579]McCloghrie,K.,Perkins,D.,和J.Schoenwaeld,“SMIv2的文本约定”,STD 58,RFC 2579,1999年4月。

[RFC3688] Mealling, M., "The IETF XML Registry", BCP 81, RFC 3688, January 2004.

[RFC3688]Mealling,M.“IETF XML注册表”,BCP 81,RFC 3688,2004年1月。

[RFC4001] Daniele, M., Haberman, B., Routhier, S., and J. Schoenwaelder, "Textual Conventions for Internet Network Addresses", RFC 4001, February 2005.

[RFC4001]Daniele,M.,Haberman,B.,Routhier,S.,和J.Schoenwaeld,“互联网网络地址的文本约定”,RFC 4001,2005年2月。

Authors' Addresses

作者地址

Mark Ellison Ellison Software Consulting 38 Salem Road Atkinson, NH 03811 USA

马克·埃里森·埃里森软件咨询公司美国NH 03811州阿特金森塞勒姆路38号

   Phone: +1 603-362-9270
   EMail: ietf@ellisonsoftware.com
        
   Phone: +1 603-362-9270
   EMail: ietf@ellisonsoftware.com
        

Bob Natale MITRE 300 Sentinel Drive 6th Floor Annapolis Junction, MD 20701 USA

Bob Natale MITRE 300 Sentinel Drive美国马里兰州安纳波利斯路口6楼20701

   Phone: +1 301-617-3008
   EMail: rnatale@mitre.org
        
   Phone: +1 301-617-3008
   EMail: rnatale@mitre.org