Internet Engineering Task Force (IETF)                          A. Clemm
Request for Comments: 8346                                        Huawei
Category: Standards Track                                      J. Medved
ISSN: 2070-1721                                                    Cisco
                                                                R. Varga
                                               Pantheon Technologies SRO
                                                                  X. Liu
                                                                   Jabil
                                                      H. Ananthakrishnan
                                                           Packet Design
                                                              N. Bahadur
                                                       Bracket Computing
                                                              March 2018
        
Internet Engineering Task Force (IETF)                          A. Clemm
Request for Comments: 8346                                        Huawei
Category: Standards Track                                      J. Medved
ISSN: 2070-1721                                                    Cisco
                                                                R. Varga
                                               Pantheon Technologies SRO
                                                                  X. Liu
                                                                   Jabil
                                                      H. Ananthakrishnan
                                                           Packet Design
                                                              N. Bahadur
                                                       Bracket Computing
                                                              March 2018
        

A YANG Data Model for Layer 3 Topologies

第三层拓扑的YANG数据模型

Abstract

摘要

This document defines a YANG data model for Layer 3 network topologies.

本文档定义了第3层网络拓扑的数据模型。

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 7841.

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

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

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

Copyright Notice

版权公告

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

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

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.

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

Table of Contents

目录

   1. Introduction ....................................................3
   2. Key Words .......................................................3
   3. Definitions and Acronyms ........................................4
   4. Model Structure .................................................5
   5. Layer 3 Unicast Topology Model Overview .........................6
   6. Layer 3 Unicast Topology YANG Module ............................7
   7. Interactions with Other YANG Modules ...........................15
   8. IANA Considerations ............................................15
   9. Security Considerations ........................................16
   10. References ....................................................17
      10.1. Normative References .....................................17
      10.2. Informative References ...................................19
   Appendix A.  Companion YANG Data Model for Implementations Not
                Compliant with NMDA ..................................20
   Appendix B.  Extending the Model ..................................24
     B.1.  Example OSPF Topology .....................................24
       B.1.1.  Model Overview ........................................24
       B.1.2.  OSPF Topology YANG Module .............................26
   Appendix C.  An Example ...........................................29
   Acknowledgments ...................................................34
   Contributors ......................................................34
   Authors' Addresses ................................................35
        
   1. Introduction ....................................................3
   2. Key Words .......................................................3
   3. Definitions and Acronyms ........................................4
   4. Model Structure .................................................5
   5. Layer 3 Unicast Topology Model Overview .........................6
   6. Layer 3 Unicast Topology YANG Module ............................7
   7. Interactions with Other YANG Modules ...........................15
   8. IANA Considerations ............................................15
   9. Security Considerations ........................................16
   10. References ....................................................17
      10.1. Normative References .....................................17
      10.2. Informative References ...................................19
   Appendix A.  Companion YANG Data Model for Implementations Not
                Compliant with NMDA ..................................20
   Appendix B.  Extending the Model ..................................24
     B.1.  Example OSPF Topology .....................................24
       B.1.1.  Model Overview ........................................24
       B.1.2.  OSPF Topology YANG Module .............................26
   Appendix C.  An Example ...........................................29
   Acknowledgments ...................................................34
   Contributors ......................................................34
   Authors' Addresses ................................................35
        
1. Introduction
1. 介绍

This document introduces a YANG [RFC7950] [RFC6991] data model for Layer 3 (L3) network topologies, specifically Layer 3 Unicast. The model allows an application to have a holistic view of the topology of a Layer 3 network, all contained in a single conceptual YANG datastore. The data model builds on top of, and augments, the data model for network topologies defined in [RFC8345].

本文档介绍了第3层(L3)网络拓扑的YANG[RFC7950][RFC6991]数据模型,特别是第3层单播。该模型允许应用程序全面查看第3层网络的拓扑结构,所有这些都包含在单个数据存储中。该数据模型建立在[RFC8345]中定义的网络拓扑数据模型之上,并对其进行了扩充。

This document also shows how the model can be further refined to cover different Layer 3 Unicast topology types. For this purpose, an example model is introduced that covers OSPF [RFC2328]. This example is intended purely for illustrative purpose; we expect that a complete OSPF model will be more comprehensive and refined than the example shown in this document.

本文档还展示了如何进一步完善模型,以覆盖不同的第3层单播拓扑类型。为此,本文介绍了一个涵盖OSPF[RFC2328]的示例模型。该示例仅用于说明目的;我们期望一个完整的OSPF模型将比本文中所示的示例更加全面和完善。

There are multiple applications for a topology data model. A number of use cases have been defined in Section 6 of [USECASE-REQS]. For example, nodes within the network can use the data model to capture their understanding of the overall network topology and expose it to a network controller. A network controller can then use the instantiated topology data to compare and reconcile its own view of the network topology with that of the network elements that it controls. Alternatively, nodes within the network could propagate this understanding to compare and reconcile this understanding either amongst themselves or with help of a controller. Beyond the network element itself, a network controller might even use the data model to represent its view of the topology that it controls and expose it to applications north of itself.

拓扑数据模型有多个应用程序。许多用例已在[USECASE-REQS]的第6节中定义。例如,网络中的节点可以使用数据模型获取其对整个网络拓扑的理解,并将其公开给网络控制器。然后,网络控制器可以使用实例化的拓扑数据,将其自己的网络拓扑视图与其控制的网络元素的视图进行比较和协调。或者,网络中的节点可以传播这种理解,以便在它们之间或在控制器的帮助下比较和协调这种理解。除了网元本身之外,网络控制器甚至可能使用数据模型来表示其控制的拓扑视图,并将其公开给其北部的应用程序。

The data model for Layer 3 Unicast topologies defined in this document is specified in the YANG module "ietf-l3-unicast-topology". This YANG module augments the general network topology model defined in [RFC8345] with information specific to Layer 3 Unicast. In this way, the general topology model is extended to be able to meet the needs of Layer 3 Unicast topologies.

本文件中定义的第3层单播拓扑的数据模型在模块“ietf-l3-单播拓扑”中规定。该模块使用第3层单播的特定信息扩充了[RFC8345]中定义的通用网络拓扑模型。通过这种方式,扩展了通用拓扑模型,使其能够满足第3层单播拓扑的需要。

Information that is kept in the Traffic Engineering Database (TED) will be specified in a separate model [YANG-TE] and is outside the scope of this specification.

保存在交通工程数据库(TED)中的信息将在单独的模型[YANG-TE]中指定,并且不在本规范的范围内。

2. Key Words
2. 关键词

The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in BCP 14 [RFC2119] [RFC8174] when, and only when, they appear in all capitals, as shown here.

本文件中的关键词“必须”、“不得”、“必需”、“应”、“不应”、“建议”、“不建议”、“可”和“可选”在所有大写字母出现时(如图所示)应按照BCP 14[RFC2119][RFC8174]所述进行解释。

3. Definitions and Acronyms
3. 定义和首字母缩略词

This document defines a YANG data model and thus uses many terms defined in YANG [RFC7950] and NETCONF [RFC6241]. Some terms, such as "datastore" and "data tree", are repeated here for clarity and context.

本文档定义了一个YANG数据模型,因此使用了YANG[RFC7950]和NETCONF[RFC6241]中定义的许多术语。一些术语,如“数据存储”和“数据树”,为了清晰和上下文,在这里重复。

Datastore: A conceptual place to store and access information. A datastore might be implemented, for example, using files, a database, flash memory locations, or combinations thereof. A datastore maps to an instantiated YANG data tree (definition adopted from [RFC8342]).

数据存储:存储和访问信息的概念性场所。例如,可以使用文件、数据库、闪存位置或其组合来实现数据存储。数据存储映射到实例化的YANG数据树(定义采用[RFC8342])。

Data subtree: An instantiated data node and the data nodes that are hierarchically contained within it.

数据子树:一个实例化的数据节点和其中分层包含的数据节点。

IS-IS: Intermediate System to Intermediate System protocol

IS-IS:中间系统到中间系统协议

LSP: Label Switched Path

标签交换路径

NETCONF: Network Configuration Protocol

网络配置协议

NMDA: Network Management Datastore Architecture

NMDA:网络管理数据存储体系结构

OSPF: Open Shortest Path First (a link-state routing protocol)

OSPF:开放最短路径优先(链路状态路由协议)

URI: Uniform Resource Identifier

URI:统一资源标识符

TED: Traffic Engineering Database

交通工程数据库

YANG: YANG is a data modeling language used to model configuration data, state data, Remote Procedure Calls, and notifications for network management protocols [RFC7950].

YANG:YANG是一种数据建模语言,用于对网络管理协议的配置数据、状态数据、远程过程调用和通知进行建模[RFC7950]。

4. Model Structure
4. 模型结构

The Layer 3 Unicast topology model is defined by YANG module "l3-unicast-topology". The relationship of this module with other YANG modules is roughly depicted in the figure below.

第三层单播拓扑模型由YANG模块“l3单播拓扑”定义。下图大致描述了该模块与其他模块的关系。

                      +-----------------------------+
                      |  +-----------------------+  |
                      |  |      ietf-network     |  |
                      |  +----------^------------+  |
                      |             |               |
                      |  +-----------------------+  |
                      |  | ietf-network-topology |  |
                      |  +----------+------------+  |
                      +-------------^---------------+
                                    |
                                    |
                       +------------^-------------+
                       | ietf-l3-unicast-topology |
                       +------------^-------------+
                                    |
                                    |
                        +-----------^-----------+
                        | example-ospf-topology |
                        +-----------------------+
        
                      +-----------------------------+
                      |  +-----------------------+  |
                      |  |      ietf-network     |  |
                      |  +----------^------------+  |
                      |             |               |
                      |  +-----------------------+  |
                      |  | ietf-network-topology |  |
                      |  +----------+------------+  |
                      +-------------^---------------+
                                    |
                                    |
                       +------------^-------------+
                       | ietf-l3-unicast-topology |
                       +------------^-------------+
                                    |
                                    |
                        +-----------^-----------+
                        | example-ospf-topology |
                        +-----------------------+
        

Figure 1: Overall Model Structure

图1:总体模型结构

YANG modules "ietf-network" and "ietf-network-topology" collectively define the basic network topology model [RFC8345]. YANG module "ietf-l3-unicast-topology" augments those models with additional definitions needed to represent Layer 3 Unicast topologies. This module in turn can be augmented by YANG modules with additional definitions for specific types of Layer 3 Unicast topologies, such as OSPF and IS-IS topologies.

“ietf网络”和“ietf网络拓扑”模块共同定义了基本网络拓扑模型[RFC8345]。YANG模块“ietf-l3-unicast-topology”使用表示第3层单播拓扑所需的附加定义来扩充这些模型。该模块又可以通过YANG模块来扩展,该模块具有针对特定类型的第3层单播拓扑(如OSPF和IS-IS拓扑)的附加定义。

The YANG modules "ietf-network" and "ietf-network-topology" are designed to be used in conjunction with implementations that support the Network Management Datastore Architecture (NMDA) defined in [RFC8342]. Accordingly, the same is true for the YANG modules that augment it. In order to allow implementations to use the model even in cases when NMDA is not supported, companion YANG modules (that SHOULD NOT be supported by implementations that support NMDA) are defined in Appendix A.

“ietf网络”和“ietf网络拓扑”模块设计用于与支持[RFC8342]中定义的网络管理数据存储体系结构(NMDA)的实现结合使用。因此,对于增强它的阳模也是如此。为了允许实现即使在不支持NMDA的情况下也使用该模型,附录A中定义了相关模块(支持NMDA的实现不应支持这些模块)。

5. Layer 3 Unicast Topology Model Overview
5. 第3层单播拓扑模型概述

The Layer 3 Unicast topology model is defined by YANG module "ietf-l3-unicast-topology". Its structure is depicted in the following diagram. The notation syntax follows [RFC8340]. For purposes of brevity, notifications are not depicted.

第3层单播拓扑模型由模块“ietf-l3-单播拓扑”定义。其结构如下图所示。符号语法如下[RFC8340]。为简洁起见,未描述通知。

   module: ietf-l3-unicast-topology
     augment /nw:networks/nw:network/nw:network-types:
       +--rw l3-unicast-topology!
     augment /nw:networks/nw:network:
       +--rw l3-topology-attributes
          +--rw name?   string
          +--rw flag*   l3-flag-type
     augment /nw:networks/nw:network/nw:node:
       +--rw l3-node-attributes
          +--rw name?        inet:domain-name
          +--rw flag*        node-flag-type
          +--rw router-id*   rt-types:router-id
          +--rw prefix* [prefix]
             +--rw prefix    inet:ip-prefix
             +--rw metric?   uint32
             +--rw flag*     prefix-flag-type
     augment /nw:networks/nw:network/nt:link:
       +--rw l3-link-attributes
          +--rw name?      string
          +--rw flag*      link-flag-type
          +--rw metric1?   uint64
          +--rw metric2?   uint64
     augment /nw:networks/nw:network/nw:node/nt:termination-point:
       +--rw l3-termination-point-attributes
          +--rw (termination-point-type)?
             +--:(ip)
             |  +--rw ip-address*       inet:ip-address
             +--:(unnumbered)
             |  +--rw unnumbered-id?    uint32
             +--:(interface-name)
                +--rw interface-name?   string
        
   module: ietf-l3-unicast-topology
     augment /nw:networks/nw:network/nw:network-types:
       +--rw l3-unicast-topology!
     augment /nw:networks/nw:network:
       +--rw l3-topology-attributes
          +--rw name?   string
          +--rw flag*   l3-flag-type
     augment /nw:networks/nw:network/nw:node:
       +--rw l3-node-attributes
          +--rw name?        inet:domain-name
          +--rw flag*        node-flag-type
          +--rw router-id*   rt-types:router-id
          +--rw prefix* [prefix]
             +--rw prefix    inet:ip-prefix
             +--rw metric?   uint32
             +--rw flag*     prefix-flag-type
     augment /nw:networks/nw:network/nt:link:
       +--rw l3-link-attributes
          +--rw name?      string
          +--rw flag*      link-flag-type
          +--rw metric1?   uint64
          +--rw metric2?   uint64
     augment /nw:networks/nw:network/nw:node/nt:termination-point:
       +--rw l3-termination-point-attributes
          +--rw (termination-point-type)?
             +--:(ip)
             |  +--rw ip-address*       inet:ip-address
             +--:(unnumbered)
             |  +--rw unnumbered-id?    uint32
             +--:(interface-name)
                +--rw interface-name?   string
        

The module augments the original "ietf-network" and "ietf-network-topology" modules as follows:

该模块扩充了原始的“ietf网络”和“ietf网络拓扑”模块,如下所示:

o A new network topology type is introduced, l3-unicast-topology. The corresponding container augments the network-types of the "ietf-network" module.

o 介绍了一种新的网络拓扑类型:l3单播拓扑。相应的容器增加了“ietf网络”模块的网络类型。

o Additional topology attributes are introduced, defined in a grouping that augments the "network" list of the network module. The attributes include a name for the topology and a set of flags (represented by a leaf-list). Each type of flag is represented by a separate identity. This allows additional flags to be introduced in augmenting modules using additional identities without needing to revise this module.

o 引入了其他拓扑属性,这些属性在一个分组中定义,该分组扩展了网络模块的“网络”列表。这些属性包括拓扑的名称和一组标志(由叶列表表示)。每种类型的标志都由单独的标识表示。这允许在使用附加标识的扩充模块中引入附加标志,而无需修改此模块。

o Additional data objects for nodes are introduced by augmenting the "node" list of the network module. New objects include a set of flags and a list of prefixes. Each prefix includes an IP prefix, a metric, and a prefix-specific set of flags.

o 通过增加网络模块的“节点”列表,为节点引入了额外的数据对象。新对象包括一组标志和一组前缀。每个前缀包括一个IP前缀、一个度量和一组特定于前缀的标志。

o Links (in the "ietf-network-topology" module) are augmented with a set of parameters that allow a link to be associated with a link name, another set of flags, and a link metric.

o 链路(在“ietf网络拓扑”模块中)增加了一组参数,允许链路与链路名称、另一组标志和链路度量相关联。

o Termination points (in the "ietf-network-topology" module) are augmented with a choice of IP address, identifier, or name.

o 终端点(在“ietf网络拓扑”模块中)通过选择IP地址、标识符或名称进行扩充。

In addition, the module defines a set of notifications to alert clients of any events concerning links, nodes, prefixes, and termination points. Each notification includes an indication of the type of event, the topology from which it originated, and the affected node, link, prefix, or termination point. Also, as a convenience to applications, additional data of the affected node, link, prefix, or termination point is included. While this makes notifications larger in volume than they need to be, it avoids the need for subsequent retrieval of context information that might have changed in the meantime.

此外,该模块还定义了一组通知,以提醒客户端有关链接、节点、前缀和终止点的任何事件。每个通知都包括事件类型、事件起源的拓扑以及受影响的节点、链接、前缀或终止点的指示。此外,为了方便应用程序,还包括受影响节点、链路、前缀或终止点的附加数据。虽然这使得通知的数量比需要的大,但它避免了随后检索可能同时发生更改的上下文信息的需要。

6. Layer 3 Unicast Topology YANG Module
6. 第三层单播拓扑模块

This YANG module makes reference to the following documents: [RFC2863] and [RFC8343].

本模块参考了以下文件:[RFC2863]和[RFC8343]。

   <CODE BEGINS> file "ietf-l3-unicast-topology@2018-02-26.yang"
   module ietf-l3-unicast-topology {
     yang-version 1.1;
     namespace
       "urn:ietf:params:xml:ns:yang:ietf-l3-unicast-topology";
     prefix "l3t";
     import ietf-network {
       prefix "nw";
     }
     import ietf-network-topology {
       prefix "nt";
     }
        
   <CODE BEGINS> file "ietf-l3-unicast-topology@2018-02-26.yang"
   module ietf-l3-unicast-topology {
     yang-version 1.1;
     namespace
       "urn:ietf:params:xml:ns:yang:ietf-l3-unicast-topology";
     prefix "l3t";
     import ietf-network {
       prefix "nw";
     }
     import ietf-network-topology {
       prefix "nt";
     }
        
     import ietf-inet-types {
       prefix "inet";
     }
     import ietf-routing-types {
       prefix "rt-types";
     }
     organization
       "IETF I2RS (Interface to the Routing System) Working Group";
     contact
       "WG Web:    <https://datatracker.ietf.org/wg/i2rs/>
        WG List:   <mailto:i2rs@ietf.org>
        Editor:    Alexander Clemm
                   <mailto:ludwig@clemm.org>
        Editor:    Jan Medved
                   <mailto:jmedved@cisco.com>
        Editor:    Robert Varga
                   <mailto:robert.varga@pantheon.tech>
        Editor:    Xufeng Liu
                   <mailto:xufeng.liu.ietf@gmail.com>
        Editor:    Nitin Bahadur
                   <mailto:nitin_bahadur@yahoo.com>
        Editor:    Hariharan Ananthakrishnan
                   <mailto:hari@packetdesign.com>";
     description
       "This module defines a model for Layer 3 Unicast
        topologies.
        
     import ietf-inet-types {
       prefix "inet";
     }
     import ietf-routing-types {
       prefix "rt-types";
     }
     organization
       "IETF I2RS (Interface to the Routing System) Working Group";
     contact
       "WG Web:    <https://datatracker.ietf.org/wg/i2rs/>
        WG List:   <mailto:i2rs@ietf.org>
        Editor:    Alexander Clemm
                   <mailto:ludwig@clemm.org>
        Editor:    Jan Medved
                   <mailto:jmedved@cisco.com>
        Editor:    Robert Varga
                   <mailto:robert.varga@pantheon.tech>
        Editor:    Xufeng Liu
                   <mailto:xufeng.liu.ietf@gmail.com>
        Editor:    Nitin Bahadur
                   <mailto:nitin_bahadur@yahoo.com>
        Editor:    Hariharan Ananthakrishnan
                   <mailto:hari@packetdesign.com>";
     description
       "This module defines a model for Layer 3 Unicast
        topologies.
        

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

版权所有(c)2018 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 (https://trustee.ietf.org/license-info).

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

        This version of this YANG module is part of
        RFC 8346; see the RFC itself for full legal notices.";
     revision "2018-02-26" {
       description
         "Initial revision.";
       reference
         "RFC 8346: A YANG Data Model for Layer 3 Topologies";
     }
        
        This version of this YANG module is part of
        RFC 8346; see the RFC itself for full legal notices.";
     revision "2018-02-26" {
       description
         "Initial revision.";
       reference
         "RFC 8346: A YANG Data Model for Layer 3 Topologies";
     }
        
     identity flag-identity {
       description "Base type for flags";
        
     identity flag-identity {
       description "Base type for flags";
        

}

}

     typedef l3-event-type {
       type enumeration {
         enum "add" {
           description
             "A Layer 3 node, link, prefix, or termination point has
             been added";
         }
         enum "remove" {
           description
             "A Layer 3 node, link, prefix, or termination point has
             been removed";
         }
         enum "update" {
           description
             "A Layer 3 node, link, prefix, or termination point has
             been updated";
         }
       }
       description "Layer 3 event type for notifications";
     }
        
     typedef l3-event-type {
       type enumeration {
         enum "add" {
           description
             "A Layer 3 node, link, prefix, or termination point has
             been added";
         }
         enum "remove" {
           description
             "A Layer 3 node, link, prefix, or termination point has
             been removed";
         }
         enum "update" {
           description
             "A Layer 3 node, link, prefix, or termination point has
             been updated";
         }
       }
       description "Layer 3 event type for notifications";
     }
        
     typedef prefix-flag-type {
       type identityref {
         base "flag-identity";
       }
       description "Prefix flag attributes";
     }
        
     typedef prefix-flag-type {
       type identityref {
         base "flag-identity";
       }
       description "Prefix flag attributes";
     }
        
     typedef node-flag-type {
       type identityref {
         base "flag-identity";
       }
       description "Node flag attributes";
     }
        
     typedef node-flag-type {
       type identityref {
         base "flag-identity";
       }
       description "Node flag attributes";
     }
        
     typedef link-flag-type {
       type identityref {
         base "flag-identity";
       }
       description "Link flag attributes";
     }
        
     typedef link-flag-type {
       type identityref {
         base "flag-identity";
       }
       description "Link flag attributes";
     }
        
     typedef l3-flag-type {
       type identityref {
         base "flag-identity";
       }
        
     typedef l3-flag-type {
       type identityref {
         base "flag-identity";
       }
        
       description "L3 flag attributes";
     }
        
       description "L3 flag attributes";
     }
        
     grouping l3-prefix-attributes {
       description
         "L3 prefix attributes";
       leaf prefix {
         type inet:ip-prefix;
         description
           "IP prefix value";
       }
       leaf metric {
         type uint32;
         description
           "Prefix metric";
       }
       leaf-list flag {
         type prefix-flag-type;
         description
           "Prefix flags";
       }
     }
     grouping l3-unicast-topology-type {
       description "Identifies the topology type to be L3 Unicast.";
       container l3-unicast-topology {
         presence "indicates L3 Unicast topology";
         description
           "The presence of the container node indicates L3 Unicast
           topology";
       }
     }
     grouping l3-topology-attributes {
       description "Topology scope attributes";
       container l3-topology-attributes {
         description "Contains topology attributes";
         leaf name {
           type string;
           description
             "Name of the topology";
         }
         leaf-list flag {
           type l3-flag-type;
           description
             "Topology flags";
         }
       }
     }
     grouping l3-node-attributes {
        
     grouping l3-prefix-attributes {
       description
         "L3 prefix attributes";
       leaf prefix {
         type inet:ip-prefix;
         description
           "IP prefix value";
       }
       leaf metric {
         type uint32;
         description
           "Prefix metric";
       }
       leaf-list flag {
         type prefix-flag-type;
         description
           "Prefix flags";
       }
     }
     grouping l3-unicast-topology-type {
       description "Identifies the topology type to be L3 Unicast.";
       container l3-unicast-topology {
         presence "indicates L3 Unicast topology";
         description
           "The presence of the container node indicates L3 Unicast
           topology";
       }
     }
     grouping l3-topology-attributes {
       description "Topology scope attributes";
       container l3-topology-attributes {
         description "Contains topology attributes";
         leaf name {
           type string;
           description
             "Name of the topology";
         }
         leaf-list flag {
           type l3-flag-type;
           description
             "Topology flags";
         }
       }
     }
     grouping l3-node-attributes {
        
       description "L3 node scope attributes";
       container l3-node-attributes {
         description
           "Contains node attributes";
         leaf name {
           type inet:domain-name;
           description
             "Node name";
         }
         leaf-list flag {
           type node-flag-type;
           description
             "Node flags";
         }
         leaf-list router-id {
           type rt-types:router-id;
           description
             "Router-id for the node";
         }
         list prefix {
           key "prefix";
           description
             "A list of prefixes along with their attributes";
           uses l3-prefix-attributes;
         }
       }
     }
     grouping l3-link-attributes {
       description
         "L3 link scope attributes";
       container l3-link-attributes {
         description
           "Contains link attributes";
         leaf name {
           type string;
           description
             "Link Name";
         }
         leaf-list flag {
           type link-flag-type;
           description
             "Link flags";
         }
         leaf metric1 {
           type uint64;
           description
               "Link Metric 1";
         }
        
       description "L3 node scope attributes";
       container l3-node-attributes {
         description
           "Contains node attributes";
         leaf name {
           type inet:domain-name;
           description
             "Node name";
         }
         leaf-list flag {
           type node-flag-type;
           description
             "Node flags";
         }
         leaf-list router-id {
           type rt-types:router-id;
           description
             "Router-id for the node";
         }
         list prefix {
           key "prefix";
           description
             "A list of prefixes along with their attributes";
           uses l3-prefix-attributes;
         }
       }
     }
     grouping l3-link-attributes {
       description
         "L3 link scope attributes";
       container l3-link-attributes {
         description
           "Contains link attributes";
         leaf name {
           type string;
           description
             "Link Name";
         }
         leaf-list flag {
           type link-flag-type;
           description
             "Link flags";
         }
         leaf metric1 {
           type uint64;
           description
               "Link Metric 1";
         }
        
         leaf metric2 {
           type uint64;
           description
               "Link Metric 2";
         }
       }
     }
     grouping l3-termination-point-attributes {
       description "L3 termination point scope attributes";
       container l3-termination-point-attributes {
         description
           "Contains termination point attributes";
         choice termination-point-type {
           description
             "Indicates the termination point type";
           case ip {
             leaf-list ip-address {
               type inet:ip-address;
               description
                 "IPv4 or IPv6 address.";
             }
           }
           case unnumbered {
             leaf unnumbered-id {
               type uint32;
               description
                 "Unnumbered interface identifier.
                  The identifier will correspond to the ifIndex value
                  of the interface, i.e., the ifIndex value of the
                  ifEntry that represents the interface in
                  implementations where the Interfaces Group MIB
                  (RFC 2863) is supported.";
               reference
                 "RFC 2863: The Interfaces Group MIB";
             }
           }
           case interface-name {
             leaf interface-name {
               type string;
               description
                 "Name of the interface.  The name can (but does not
                  have to) correspond to an interface reference of a
                  containing node's interface, i.e., the path name of a
                  corresponding interface data node on the containing
                  node reminiscent of data type interface-ref defined
                  in RFC 8343. It should be noted that data type
                  interface-ref of RFC 8343 cannot be used directly,
        
         leaf metric2 {
           type uint64;
           description
               "Link Metric 2";
         }
       }
     }
     grouping l3-termination-point-attributes {
       description "L3 termination point scope attributes";
       container l3-termination-point-attributes {
         description
           "Contains termination point attributes";
         choice termination-point-type {
           description
             "Indicates the termination point type";
           case ip {
             leaf-list ip-address {
               type inet:ip-address;
               description
                 "IPv4 or IPv6 address.";
             }
           }
           case unnumbered {
             leaf unnumbered-id {
               type uint32;
               description
                 "Unnumbered interface identifier.
                  The identifier will correspond to the ifIndex value
                  of the interface, i.e., the ifIndex value of the
                  ifEntry that represents the interface in
                  implementations where the Interfaces Group MIB
                  (RFC 2863) is supported.";
               reference
                 "RFC 2863: The Interfaces Group MIB";
             }
           }
           case interface-name {
             leaf interface-name {
               type string;
               description
                 "Name of the interface.  The name can (but does not
                  have to) correspond to an interface reference of a
                  containing node's interface, i.e., the path name of a
                  corresponding interface data node on the containing
                  node reminiscent of data type interface-ref defined
                  in RFC 8343. It should be noted that data type
                  interface-ref of RFC 8343 cannot be used directly,
        
                  as this data type is used to reference an interface
                  in a datastore of a single node in the network, not
                  to uniquely reference interfaces across a network.";
               reference
                 "RFC 8343: A YANG Data Model for Interface Management";
             }
           }
         }
       }
     }
     augment "/nw:networks/nw:network/nw:network-types" {
       description
         "Introduces new network type for L3 Unicast topology";
       uses l3-unicast-topology-type;
     }
     augment "/nw:networks/nw:network" {
       when "nw:network-types/l3t:l3-unicast-topology" {
         description
           "Augmentation parameters apply only for networks with
           L3 Unicast topology";
       }
       description
           "L3 Unicast for the network as a whole";
       uses l3-topology-attributes;
     }
     augment "/nw:networks/nw:network/nw:node" {
       when "../nw:network-types/l3t:l3-unicast-topology" {
         description
           "Augmentation parameters apply only for networks with
           L3 Unicast topology";
       }
       description
           "L3 Unicast node-level attributes ";
       uses l3-node-attributes;
     }
     augment "/nw:networks/nw:network/nt:link" {
       when "../nw:network-types/l3t:l3-unicast-topology" {
         description
           "Augmentation parameters apply only for networks with
           L3 Unicast topology";
       }
       description
         "Augments topology link attributes";
       uses l3-link-attributes;
     }
     augment "/nw:networks/nw:network/nw:node/"
            +"nt:termination-point" {
       when "../../nw:network-types/l3t:l3-unicast-topology" {
        
                  as this data type is used to reference an interface
                  in a datastore of a single node in the network, not
                  to uniquely reference interfaces across a network.";
               reference
                 "RFC 8343: A YANG Data Model for Interface Management";
             }
           }
         }
       }
     }
     augment "/nw:networks/nw:network/nw:network-types" {
       description
         "Introduces new network type for L3 Unicast topology";
       uses l3-unicast-topology-type;
     }
     augment "/nw:networks/nw:network" {
       when "nw:network-types/l3t:l3-unicast-topology" {
         description
           "Augmentation parameters apply only for networks with
           L3 Unicast topology";
       }
       description
           "L3 Unicast for the network as a whole";
       uses l3-topology-attributes;
     }
     augment "/nw:networks/nw:network/nw:node" {
       when "../nw:network-types/l3t:l3-unicast-topology" {
         description
           "Augmentation parameters apply only for networks with
           L3 Unicast topology";
       }
       description
           "L3 Unicast node-level attributes ";
       uses l3-node-attributes;
     }
     augment "/nw:networks/nw:network/nt:link" {
       when "../nw:network-types/l3t:l3-unicast-topology" {
         description
           "Augmentation parameters apply only for networks with
           L3 Unicast topology";
       }
       description
         "Augments topology link attributes";
       uses l3-link-attributes;
     }
     augment "/nw:networks/nw:network/nw:node/"
            +"nt:termination-point" {
       when "../../nw:network-types/l3t:l3-unicast-topology" {
        
         description
           "Augmentation parameters apply only for networks with
           L3 Unicast topology";
       }
       description "Augments topology termination point configuration";
       uses l3-termination-point-attributes;
     }
     notification l3-node-event {
       description
         "Notification event for L3 node";
       leaf l3-event-type {
         type l3-event-type;
         description
           "Event type";
       }
       uses nw:node-ref;
       uses l3-unicast-topology-type;
       uses l3-node-attributes;
     }
     notification l3-link-event {
       description
         "Notification event for L3 link";
       leaf l3-event-type {
         type l3-event-type;
         description
           "Event type";
       }
       uses nt:link-ref;
       uses l3-unicast-topology-type;
       uses l3-link-attributes;
     }
     notification l3-prefix-event {
       description
         "Notification event for L3 prefix";
       leaf l3-event-type {
         type l3-event-type;
         description
           "Event type";
       }
       uses nw:node-ref;
       uses l3-unicast-topology-type;
       container prefix {
         description
           "Contains L3 prefix attributes";
         uses l3-prefix-attributes;
       }
     }
     notification termination-point-event {
        
         description
           "Augmentation parameters apply only for networks with
           L3 Unicast topology";
       }
       description "Augments topology termination point configuration";
       uses l3-termination-point-attributes;
     }
     notification l3-node-event {
       description
         "Notification event for L3 node";
       leaf l3-event-type {
         type l3-event-type;
         description
           "Event type";
       }
       uses nw:node-ref;
       uses l3-unicast-topology-type;
       uses l3-node-attributes;
     }
     notification l3-link-event {
       description
         "Notification event for L3 link";
       leaf l3-event-type {
         type l3-event-type;
         description
           "Event type";
       }
       uses nt:link-ref;
       uses l3-unicast-topology-type;
       uses l3-link-attributes;
     }
     notification l3-prefix-event {
       description
         "Notification event for L3 prefix";
       leaf l3-event-type {
         type l3-event-type;
         description
           "Event type";
       }
       uses nw:node-ref;
       uses l3-unicast-topology-type;
       container prefix {
         description
           "Contains L3 prefix attributes";
         uses l3-prefix-attributes;
       }
     }
     notification termination-point-event {
        
       description
         "Notification event for L3 termination point";
       leaf l3-event-type {
         type l3-event-type;
         description
           "Event type";
       }
       uses nt:tp-ref;
       uses l3-unicast-topology-type;
       uses l3-termination-point-attributes;
     }
   }
        
       description
         "Notification event for L3 termination point";
       leaf l3-event-type {
         type l3-event-type;
         description
           "Event type";
       }
       uses nt:tp-ref;
       uses l3-unicast-topology-type;
       uses l3-termination-point-attributes;
     }
   }
        

<CODE ENDS>

<代码结束>

7. Interactions with Other YANG Modules
7. 与其他模块的交互作用

As described in Section 4, the model defined in this document builds on top of, and augments, the YANG modules defined in [RFC8345]. Specifically, the "ietf-l3-unicast-topology" module augments the "ietf-network" and "ietf-network-topology" modules. In addition, the model makes use of data types defined in [RFC6991].

如第4节所述,本文件中定义的模型建立在[RFC8345]中定义的YANG模块之上,并对其进行了扩充。具体而言,“ietf-l3-单播拓扑”模块扩充了“ietf网络”和“ietf网络拓扑”模块。此外,该模型还使用了[RFC6991]中定义的数据类型。

The model defined in this document is a protocol-independent YANG data model with Layer 3 topology information. It is separate from and not linked with data models that are used to configure routing protocols or routing information, e.g., "ietf-routing" [RFC8022] and "ietf-rib-extension" [YANG-RIB]. That said, the model does import a type definition from model "ietf-routing-types" [RFC8294].

本文档中定义的模型是具有第3层拓扑信息的独立于协议的YANG数据模型。它与用于配置路由协议或路由信息的数据模型(例如“ietf路由”[RFC8022]和“ietf rib扩展”[YANG-rib])分开,且不与之链接。也就是说,该模型确实从模型“ietf路由类型”[RFC8294]导入了类型定义。

The model complies with the requirements for the ephemeral state found in [RFC8242]. For ephemeral topology data that is server provided, the process tasked with maintaining topology information will load information from the routing process (such as OSPF) into the data model without relying on a configuration datastore.

该模型符合[RFC8242]中的短暂状态要求。对于服务器提供的临时拓扑数据,负责维护拓扑信息的进程将从路由进程(如OSPF)将信息加载到数据模型中,而不依赖于配置数据存储。

8. IANA Considerations
8. IANA考虑

This document registers the following namespace URIs in the "IETF XML Registry" [RFC3688]:

本文档在“IETF XML注册表”[RFC3688]中注册以下命名空间URI:

URI: urn:ietf:params:xml:ns:yang:ietf-l3-unicast-topology Registrant Contact: The IESG. XML: N/A; the requested URI is an XML namespace.

URI:urn:ietf:params:xml:ns:yang:ietf-l3-unicast-topology注册人联系人:IESG。XML:不适用;请求的URI是一个XML命名空间。

URI: urn:ietf:params:xml:ns:yang:ietf-l3-unicast-topology-state Registrant Contact: The IESG. XML: N/A; the requested URI is an XML namespace.

URI:urn:ietf:params:xml:ns:yang:ietf-l3-unicast-topology-state注册人联系人:IESG。XML:不适用;请求的URI是一个XML命名空间。

This document registers the following YANG modules in the "YANG Module Names" registry [RFC6020]:

本文件在“YANG模块名称”注册表[RFC6020]中注册以下YANG模块:

   Name: ietf-l3-unicast-topology
   Namespace: urn:ietf:params:xml:ns:yang:ietf-l3-unicast-topology
   Prefix: l3t
   Reference: RFC 8346
        
   Name: ietf-l3-unicast-topology
   Namespace: urn:ietf:params:xml:ns:yang:ietf-l3-unicast-topology
   Prefix: l3t
   Reference: RFC 8346
        
   Name: ietf-l3-unicast-topology-state
   Namespace: urn:ietf:params:xml:ns:yang:ietf-l3-unicast-topology-state
   Prefix: l3t-s
   Reference: RFC 8346
        
   Name: ietf-l3-unicast-topology-state
   Namespace: urn:ietf:params:xml:ns:yang:ietf-l3-unicast-topology-state
   Prefix: l3t-s
   Reference: RFC 8346
        
9. Security Considerations
9. 安全考虑

The YANG modules specified in this document define a schema for data that is designed to be accessed via network management protocols such as NETCONF [RFC6241] or RESTCONF [RFC8040]. The lowest NETCONF layer is the secure transport layer, and the mandatory-to-implement secure transport is Secure Shell (SSH) [RFC6242]. The lowest RESTCONF layer is HTTPS, and the mandatory-to-implement secure transport is TLS [RFC5246].

本文档中指定的模块为数据定义了一个模式,该模式旨在通过网络管理协议(如NETCONF[RFC6241]或restcconf[RFC8040])进行访问。最低的NETCONF层是安全传输层,实现安全传输的强制要求是安全Shell(SSH)[RFC6242]。最低的RESTCONF层是HTTPS,实现安全传输的强制层是TLS[RFC5246]。

The NETCONF access control model [RFC8341] provides the means to restrict access for particular NETCONF or RESTCONF users to a preconfigured subset of all available NETCONF or RESTCONF protocol operations and content.

NETCONF访问控制模型[RFC8341]提供了将特定NETCONF或RESTCONF用户的访问限制为所有可用NETCONF或RESTCONF协议操作和内容的预配置子集的方法。

In general, Layer 3 Unicast topologies are system-controlled and provide ephemeral topology information. In an NMDA-compliant server, they are only part of <operational>, which provides read-only access to clients, so they are less vulnerable. That said, the YANG modules do in principle allow information to be configurable.

通常,第3层单播拓扑由系统控制,并提供短暂的拓扑信息。在兼容NMDA的服务器中,它们只是<operational>的一部分,后者提供对客户端的只读访问,因此不易受到攻击。也就是说,YANG模块原则上允许配置信息。

There are a number of data nodes defined in these YANG modules that are writable/creatable/deletable (i.e., config true, which is the default). These data nodes may be considered sensitive or vulnerable in some network environments. Write operations (e.g., edit-config) to these data nodes without proper protection can have a negative effect on network operations. These are the subtrees and data nodes and their sensitivity/vulnerability in the "ietf-l3-unicast-topology" module:

这些模块中定义了许多数据节点,这些节点是可写/可创建/可删除的(即config true,这是默认值)。在某些网络环境中,这些数据节点可能被视为敏感或易受攻击。对这些数据节点的写入操作(如编辑配置)如果没有适当的保护,可能会对网络操作产生负面影响。这些是“ietf-l3-unicast-topology”模块中的子树和数据节点及其敏感度/漏洞:

o l3-topology-attributes: A malicious client could attempt to sabotage the configuration of any of the contained attributes, i.e., the name or the flag data nodes.

o l3拓扑属性:恶意客户端可能试图破坏任何包含属性的配置,即名称或标志数据节点。

o l3-node-attributes: A malicious client could attempt to sabotage the configuration of important node attributes, such as the router-id or node prefix.

o l3节点属性:恶意客户端可能试图破坏重要节点属性的配置,例如路由器id或节点前缀。

o l3-link-attributes: A malicious client could attempt to sabotage the configuration of important link attributes, such as name, flag, and metrics of the link.

o l3链接属性:恶意客户端可能会试图破坏重要链接属性的配置,例如链接的名称、标志和度量。

o l3-termination-point-attributes: A malicious client could attempt to sabotage the configuration information of a termination point, such as the termination point's IP address and interface name.

o l3终结点属性:恶意客户端可能试图破坏终结点的配置信息,例如终结点的IP地址和接口名称。

10. References
10. 工具书类
10.1. Normative References
10.1. 规范性引用文件

[RFC2119] Bradner, S., "Key words for use in RFCs to Indicate Requirement Levels", BCP 14, RFC 2119, DOI 10.17487/RFC2119, March 1997, <https://www.rfc-editor.org/info/rfc2119>.

[RFC2119]Bradner,S.,“RFC中用于表示需求水平的关键词”,BCP 14,RFC 2119,DOI 10.17487/RFC2119,1997年3月<https://www.rfc-editor.org/info/rfc2119>.

[RFC2328] Moy, J., "OSPF Version 2", STD 54, RFC 2328, DOI 10.17487/RFC2328, April 1998, <https://www.rfc-editor.org/info/rfc2328>.

[RFC2328]Moy,J.,“OSPF版本2”,STD 54,RFC 2328,DOI 10.17487/RFC2328,1998年4月<https://www.rfc-editor.org/info/rfc2328>.

[RFC2863] McCloghrie, K. and F. Kastenholz, "The Interfaces Group MIB", RFC 2863, DOI 10.17487/RFC2863, June 2000, <https://www.rfc-editor.org/info/rfc2863>.

[RFC2863]McCloghrie,K.和F.Kastenholz,“接口组MIB”,RFC 2863,DOI 10.17487/RFC2863,2000年6月<https://www.rfc-editor.org/info/rfc2863>.

[RFC3688] Mealling, M., "The IETF XML Registry", BCP 81, RFC 3688, DOI 10.17487/RFC3688, January 2004, <https://www.rfc-editor.org/info/rfc3688>.

[RFC3688]Mealling,M.,“IETF XML注册表”,BCP 81,RFC 3688,DOI 10.17487/RFC3688,2004年1月<https://www.rfc-editor.org/info/rfc3688>.

[RFC5246] Dierks, T. and E. Rescorla, "The Transport Layer Security (TLS) Protocol Version 1.2", RFC 5246, DOI 10.17487/RFC5246, August 2008, <https://www.rfc-editor.org/info/rfc5246>.

[RFC5246]Dierks,T.和E.Rescorla,“传输层安全(TLS)协议版本1.2”,RFC 5246,DOI 10.17487/RFC5246,2008年8月<https://www.rfc-editor.org/info/rfc5246>.

[RFC6020] Bjorklund, M., Ed., "YANG - A Data Modeling Language for the Network Configuration Protocol (NETCONF)", RFC 6020, DOI 10.17487/RFC6020, October 2010, <https://www.rfc-editor.org/info/rfc6020>.

[RFC6020]Bjorklund,M.,Ed.“YANG-网络配置协议的数据建模语言(NETCONF)”,RFC 6020,DOI 10.17487/RFC6020,2010年10月<https://www.rfc-editor.org/info/rfc6020>.

[RFC6241] Enns, R., Ed., Bjorklund, M., Ed., Schoenwaelder, J., Ed., and A. Bierman, Ed., "Network Configuration Protocol (NETCONF)", RFC 6241, DOI 10.17487/RFC6241, June 2011, <https://www.rfc-editor.org/info/rfc6241>.

[RFC6241]Enns,R.,Ed.,Bjorklund,M.,Ed.,Schoenwaeld,J.,Ed.,和A.Bierman,Ed.,“网络配置协议(NETCONF)”,RFC 6241,DOI 10.17487/RFC6241,2011年6月<https://www.rfc-editor.org/info/rfc6241>.

[RFC6242] Wasserman, M., "Using the NETCONF Protocol over Secure Shell (SSH)", RFC 6242, DOI 10.17487/RFC6242, June 2011, <https://www.rfc-editor.org/info/rfc6242>.

[RFC6242]Wasserman,M.“在安全外壳上使用NETCONF协议(SSH)”,RFC 6242,DOI 10.17487/RFC6242,2011年6月<https://www.rfc-editor.org/info/rfc6242>.

[RFC6991] Schoenwaelder, J., Ed., "Common YANG Data Types", RFC 6991, DOI 10.17487/RFC6991, July 2013, <https://www.rfc-editor.org/info/rfc6991>.

[RFC6991]Schoenwaeld,J.,Ed.,“常见杨数据类型”,RFC 6991,DOI 10.17487/RFC69911913年7月<https://www.rfc-editor.org/info/rfc6991>.

[RFC7950] Bjorklund, M., Ed., "The YANG 1.1 Data Modeling Language", RFC 7950, DOI 10.17487/RFC7950, August 2016, <https://www.rfc-editor.org/info/rfc7950>.

[RFC7950]Bjorklund,M.,Ed.“YANG 1.1数据建模语言”,RFC 7950,DOI 10.17487/RFC7950,2016年8月<https://www.rfc-editor.org/info/rfc7950>.

[RFC7951] Lhotka, L., "JSON Encoding of Data Modeled with YANG", RFC 7951, DOI 10.17487/RFC7951, August 2016, <https://www.rfc-editor.org/info/rfc7951>.

[RFC7951]Lhotka,L.,“用YANG建模的数据的JSON编码”,RFC 7951,DOI 10.17487/RFC7951,2016年8月<https://www.rfc-editor.org/info/rfc7951>.

[RFC8040] Bierman, A., Bjorklund, M., and K. Watsen, "RESTCONF Protocol", RFC 8040, DOI 10.17487/RFC8040, January 2017, <https://www.rfc-editor.org/info/rfc8040>.

[RFC8040]Bierman,A.,Bjorklund,M.,和K.Watsen,“RESTCONF协议”,RFC 8040,DOI 10.17487/RFC8040,2017年1月<https://www.rfc-editor.org/info/rfc8040>.

[RFC8174] Leiba, B., "Ambiguity of Uppercase vs Lowercase in RFC 2119 Key Words", BCP 14, RFC 8174, DOI 10.17487/RFC8174, May 2017, <https://www.rfc-editor.org/info/rfc8174>.

[RFC8174]Leiba,B.,“RFC 2119关键词中大写与小写的歧义”,BCP 14,RFC 8174,DOI 10.17487/RFC8174,2017年5月<https://www.rfc-editor.org/info/rfc8174>.

[RFC8294] Liu, X., Qu, Y., Lindem, A., Hopps, C., and L. Berger, "Common YANG Data Types for the Routing Area", RFC 8294, DOI 10.17487/RFC8294, December 2017, <https://www.rfc-editor.org/info/rfc8294>.

[RFC8294]Liu,X.,Qu,Y.,Lindem,A.,Hopps,C.,和L.Berger,“路由区域的常见YANG数据类型”,RFC 8294,DOI 10.17487/RFC82942017年12月<https://www.rfc-editor.org/info/rfc8294>.

[RFC8341] Bierman, A. and M. Bjorklund, "Network Configuration Access Control Model", STD 91, RFC 8341, DOI 10.17487/RFC8341, March 2018, <https://www.rfc-editor.org/info/rfc8341>.

[RFC8341]Bierman,A.和M.Bjorklund,“网络配置访问控制模型”,STD 91,RFC 8341,DOI 10.17487/RFC8341,2018年3月<https://www.rfc-editor.org/info/rfc8341>.

[RFC8342] Bjorklund, M., Schoenwaelder, J., Shafer, P., Watsen, K., and R. Wilton, "Network Management Datastore Architecture (NMDA)", RFC 8342, DOI 10.17487/RFC8342, March 2018, <https://www.rfc-editor.org/info/rfc8342>.

[RFC8342]Bjorklund,M.,Schoenwaeld,J.,Shafer,P.,Watsen,K.,和R.Wilton,“网络管理数据存储体系结构(NMDA)”,RFC 8342,DOI 10.17487/RFC8342,2018年3月<https://www.rfc-editor.org/info/rfc8342>.

[RFC8345] Clemm, A., Medved, J., Varga, R., Bahadur, N., Ananthakrishnan, H., and X. Liu, "A YANG Data Model for Network Topologies", RFC 8345, DOI 10.17487/RFC8345, March 2018, <https://www.rfc-editor.org/info/rfc8345>.

[RFC8345]Clemm,A.,Medved,J.,Varga,R.,Bahadur,N.,Ananthakrishnan,H.,和X.Liu,“网络拓扑的杨数据模型”,RFC 8345,DOI 10.17487/RFC83452018年3月<https://www.rfc-editor.org/info/rfc8345>.

10.2. Informative References
10.2. 资料性引用

[RFC8022] Lhotka, L. and A. Lindem, "A YANG Data Model for Routing Management", RFC 8022, DOI 10.17487/RFC8022, November 2016, <https://www.rfc-editor.org/info/rfc8022>.

[RFC8022]Lhotka,L.和A.Lindem,“路由管理的YANG数据模型”,RFC 8022,DOI 10.17487/RFC8022,2016年11月<https://www.rfc-editor.org/info/rfc8022>.

[RFC8242] Haas, J. and S. Hares, "Interface to the Routing System (I2RS) Ephemeral State Requirements", RFC 8242, DOI 10.17487/RFC8242, September 2017, <https://www.rfc-editor.org/info/rfc8242>.

[RFC8242]Haas,J.和S.Hares,“路由系统接口(I2RS)临时状态要求”,RFC 8242,DOI 10.17487/RFC8242,2017年9月<https://www.rfc-editor.org/info/rfc8242>.

[RFC8340] Bjorklund, M. and L. Berger, Ed., "YANG Tree Diagrams", BCP 215, RFC 8340, DOI 10.17487/RFC8340, March 2018, <https://www.rfc-editor.org/info/rfc8340>.

[RFC8340]Bjorklund,M.和L.Berger,编辑,“杨树图”,BCP 215,RFC 8340,DOI 10.17487/RFC8340,2018年3月<https://www.rfc-editor.org/info/rfc8340>.

[RFC8343] Bjorklund, M., "A YANG Data Model for Interface Management", RFC 8343, DOI 10.17487/RFC8343, March 2018, <https://www.rfc-editor.org/info/rfc8343>.

[RFC8343]Bjorklund,M.,“用于接口管理的YANG数据模型”,RFC 8343,DOI 10.17487/RFC8343,2018年3月<https://www.rfc-editor.org/info/rfc8343>.

[USECASE-REQS] Hares, S. and M. Chen, "Summary of I2RS Use Case Requirements", Work in Progress, draft-ietf-i2rs-usecase-reqs-summary-03, November 2016.

[USECASE-REQS]Hares,S.和M.Chen,“I2RS用例需求概要”,正在进行的工作,草稿-ietf-I2RS-USECASE-REQS-Summary-032016年11月。

[YANG-RIB] Lindem, A. and Y. Qu, "RIB YANG Data Model", Work in Progress, draft-acee-rtgwg-yang-rib-extend-06, January 2018.

[YANG-RIB]Lindem,A.和Y.Qu,“RIB-YANG数据模型”,正在进行的工作,草稿-acee-rtgwg-YANG-RIB-extend-062018年1月。

[YANG-TE] Liu, X., Bryskin, I., Beeram, V., Saad, T., Shah, H., and O. Gonzalez de Dios, "YANG Data Model for Traffic Engineering (TE) Topologies", Work in Progress, draft-ietf-teas-yang-te-topo-15, February 2018.

[YANG-TE]Liu,X.,Bryskin,I.,Beeram,V.,Saad,T.,Shah,H.,和O.Gonzalez de Dios,“交通工程(TE)拓扑的YANG数据模型”,正在进行的工作,草案-ietf-teas-YANG-TE-topo-15,2018年2月。

Appendix A. Companion YANG Data Model for Implementations Not Compliant with NMDA

附录A.不符合NMDA的实施数据模型

The YANG module "ietf-l3-unicast-topology" defined in this document augments two modules defined in [RFC8345]: "ietf-network" and "ietf-network-topology". These two modules were designed to be used in conjunction with implementations that support the Network Management Datastore Architecture (NMDA) defined in [RFC8342]. In order to allow implementations to use the model in cases when NMDA is not supported, [RFC8345] defines two companion modules, "ietf-network- state" and "ietf-network-topology-state", that represent state models of networks and network topologies, respectively.

本文件中定义的模块“ietf-l3-单播拓扑”扩充了[RFC8345]中定义的两个模块:“ietf网络”和“ietf网络拓扑”。这两个模块旨在与支持[RFC8342]中定义的网络管理数据存储体系结构(NMDA)的实现结合使用。为了允许实现在不支持NMDA的情况下使用该模型,[RFC8345]定义了两个配套模块,“ietf网络状态”和“ietf网络拓扑状态”,分别表示网络和网络拓扑的状态模型。

In order to be able to use the model for Layer 3 topologies defined in this document in conjunction with implementations not compliant with NMDA, a corresponding companion module needs to be introduced as well. This companion module, "ietf-l3-unicast-topology-state", mirrors "ietf-l3-unicast-topology". However, the module augments "ietf-network-state" and "ietf-network-topology-state" (instead of "ietf-network" and "ietf-network-topology"), and all of its data nodes are non-configurable.

为了能够将本文档中定义的第3层拓扑模型与不符合NMDA的实现结合使用,还需要引入相应的配套模块。该配套模块“ietf-l3-单播-拓扑-状态”反映了“ietf-l3-单播-拓扑”。但是,该模块增加了“ietf网络状态”和“ietf网络拓扑状态”(而不是“ietf网络”和“ietf网络拓扑”),其所有数据节点都是不可配置的。

Similar considerations apply to any module that augments "ietf-l3- unicast-topology", such as the example module defined in Appendix B (i.e., example-ospf-topology). For implementations that are not compliant with NMDA, companion modules that represent state information and that are non-configurable will need to be introduced. These modules augment "ietf-l3-unicast-topology-state" instead of "ietf-l3-unicast-topology". Companion modules for the example module defined in Appendix B are not provided (since it is just an example).

类似的考虑也适用于增强“ietf-l3-单播拓扑”的任何模块,如附录B中定义的示例模块(即示例ospf拓扑)。对于不符合NMDA的实现,需要引入表示状态信息且不可配置的配套模块。这些模块增加了“ietf-l3-单播-拓扑-状态”而不是“ietf-l3-单播-拓扑”。未提供附录B中定义的示例模块的配套模块(因为它只是一个示例)。

Like "ietf-network-state" and "ietf-network-topology-state", "ietf-l3-unicast-topology" SHOULD NOT be supported by implementations that support NMDA. The module is therefore defined in an appendix.

与“ietf网络状态”和“ietf网络拓扑状态”一样,“ietf-l3-单播-拓扑”不应得到支持NMDA的实现的支持。因此,在附录中定义了该模块。

The definition of the module follows below. As the structure of the module mirrors that of its underlying module, the YANG tree is not depicted separately.

模块的定义如下。由于模块的结构反映了其底层模块的结构,因此不会单独描述杨树。

   <CODE BEGINS> file "ietf-l3-unicast-topology-state@2018-02-26.yang"
   module ietf-l3-unicast-topology-state {
     yang-version 1.1;
     namespace
       "urn:ietf:params:xml:ns:yang:ietf-l3-unicast-topology-state";
     prefix "l3t-s";
     import ietf-network-state {
       prefix "nw-s";
        
   <CODE BEGINS> file "ietf-l3-unicast-topology-state@2018-02-26.yang"
   module ietf-l3-unicast-topology-state {
     yang-version 1.1;
     namespace
       "urn:ietf:params:xml:ns:yang:ietf-l3-unicast-topology-state";
     prefix "l3t-s";
     import ietf-network-state {
       prefix "nw-s";
        
     }
     import ietf-network-topology-state {
       prefix "nt-s";
     }
     import ietf-l3-unicast-topology {
       prefix "l3t";
     }
     organization
       "IETF I2RS (Interface to the Routing System) Working Group";
     contact
       "WG Web:    <https://datatracker.ietf.org/wg/i2rs/>
        WG List:   <mailto:i2rs@ietf.org>
        Editor:    Alexander Clemm
                   <mailto:ludwig@clemm.org>
        Editor:    Jan Medved
                   <mailto:jmedved@cisco.com>
        Editor:    Robert Varga
                   <mailto:robert.varga@pantheon.tech>
        Editor:    Xufeng Liu
                   <mailto:xufeng.liu.ietf@gmail.com>
        Editor:    Nitin Bahadur
                   <mailto:nitin_bahadur@yahoo.com>
        Editor:    Hariharan Ananthakrishnan
                   <mailto:hari@packetdesign.com>";
     description
       "This module defines a model for Layer 3 Unicast topology
        state, representing topology that either is learned or
        results from applying topology that has been configured per
        the 'ietf-l3-unicast-topology' model, mirroring the
        corresponding data nodes in this model.
        
     }
     import ietf-network-topology-state {
       prefix "nt-s";
     }
     import ietf-l3-unicast-topology {
       prefix "l3t";
     }
     organization
       "IETF I2RS (Interface to the Routing System) Working Group";
     contact
       "WG Web:    <https://datatracker.ietf.org/wg/i2rs/>
        WG List:   <mailto:i2rs@ietf.org>
        Editor:    Alexander Clemm
                   <mailto:ludwig@clemm.org>
        Editor:    Jan Medved
                   <mailto:jmedved@cisco.com>
        Editor:    Robert Varga
                   <mailto:robert.varga@pantheon.tech>
        Editor:    Xufeng Liu
                   <mailto:xufeng.liu.ietf@gmail.com>
        Editor:    Nitin Bahadur
                   <mailto:nitin_bahadur@yahoo.com>
        Editor:    Hariharan Ananthakrishnan
                   <mailto:hari@packetdesign.com>";
     description
       "This module defines a model for Layer 3 Unicast topology
        state, representing topology that either is learned or
        results from applying topology that has been configured per
        the 'ietf-l3-unicast-topology' model, mirroring the
        corresponding data nodes in this model.
        

This model mirrors 'ietf-l3-unicast-topology' but contains only read-only state data. The model is not needed when the underlying implementation infrastructure supports the Network Management Datastore Architecture (NMDA).

此模型镜像“ietf-l3-单播拓扑”,但仅包含只读状态数据。当底层实现基础设施支持网络管理数据存储体系结构(NMDA)时,不需要该模型。

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

版权所有(c)2018 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 (https://trustee.ietf.org/license-info).

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

        This version of this YANG module is part of RFC 8346;
        see the RFC itself for full legal notices.";
        
        This version of this YANG module is part of RFC 8346;
        see the RFC itself for full legal notices.";
        
     revision "2018-02-26" {
       description
         "Initial revision.";
       reference
         "RFC 8346: A YANG Data Model for Layer 3 Topologies";
     }
     augment "/nw-s:networks/nw-s:network/nw-s:network-types" {
       description
         "Introduce new network type for L3 Unicast topology";
       uses l3t:l3-unicast-topology-type;
     }
     augment "/nw-s:networks/nw-s:network" {
       when "nw-s:network-types/l3t-s:l3-unicast-topology" {
         description
           "Augmentation parameters apply only for networks with
           L3 Unicast topology";
       }
       description
           "L3 Unicast for the network as a whole";
       uses l3t:l3-topology-attributes;
     }
     augment "/nw-s:networks/nw-s:network/nw-s:node" {
       when "../nw-s:network-types/l3t-s:l3-unicast-topology" {
         description
           "Augmentation parameters apply only for networks with
           L3 Unicast topology";
       }
       description
           "L3 Unicast node-level attributes ";
       uses l3t:l3-node-attributes;
     }
     augment "/nw-s:networks/nw-s:network/nt-s:link" {
       when "../nw-s:network-types/l3t-s:l3-unicast-topology" {
         description
           "Augmentation parameters apply only for networks with
           L3 Unicast topology";
       }
       description
         "Augments topology link attributes";
       uses l3t:l3-link-attributes;
     }
     augment "/nw-s:networks/nw-s:network/nw-s:node/"
            +"nt-s:termination-point" {
       when "../../nw-s:network-types/l3t-s:l3-unicast-topology" {
         description
           "Augmentation parameters apply only for networks with
           L3 Unicast topology";
       }
        
     revision "2018-02-26" {
       description
         "Initial revision.";
       reference
         "RFC 8346: A YANG Data Model for Layer 3 Topologies";
     }
     augment "/nw-s:networks/nw-s:network/nw-s:network-types" {
       description
         "Introduce new network type for L3 Unicast topology";
       uses l3t:l3-unicast-topology-type;
     }
     augment "/nw-s:networks/nw-s:network" {
       when "nw-s:network-types/l3t-s:l3-unicast-topology" {
         description
           "Augmentation parameters apply only for networks with
           L3 Unicast topology";
       }
       description
           "L3 Unicast for the network as a whole";
       uses l3t:l3-topology-attributes;
     }
     augment "/nw-s:networks/nw-s:network/nw-s:node" {
       when "../nw-s:network-types/l3t-s:l3-unicast-topology" {
         description
           "Augmentation parameters apply only for networks with
           L3 Unicast topology";
       }
       description
           "L3 Unicast node-level attributes ";
       uses l3t:l3-node-attributes;
     }
     augment "/nw-s:networks/nw-s:network/nt-s:link" {
       when "../nw-s:network-types/l3t-s:l3-unicast-topology" {
         description
           "Augmentation parameters apply only for networks with
           L3 Unicast topology";
       }
       description
         "Augments topology link attributes";
       uses l3t:l3-link-attributes;
     }
     augment "/nw-s:networks/nw-s:network/nw-s:node/"
            +"nt-s:termination-point" {
       when "../../nw-s:network-types/l3t-s:l3-unicast-topology" {
         description
           "Augmentation parameters apply only for networks with
           L3 Unicast topology";
       }
        
       description "Augments topology termination point configuration";
       uses l3t:l3-termination-point-attributes;
     }
     notification l3-node-event {
       description
         "Notification event for L3 node";
       leaf l3-event-type {
         type l3t:l3-event-type;
         description
           "Event type";
       }
       uses nw-s:node-ref;
       uses l3t:l3-unicast-topology-type;
       uses l3t:l3-node-attributes;
     }
     notification l3-link-event {
       description
         "Notification event for L3 link";
       leaf l3-event-type {
         type l3t:l3-event-type;
         description
           "Event type";
       }
       uses nt-s:link-ref;
       uses l3t:l3-unicast-topology-type;
       uses l3t:l3-link-attributes;
     }
     notification l3-prefix-event {
       description
         "Notification event for L3 prefix";
       leaf l3-event-type {
         type l3t:l3-event-type;
         description
           "Event type";
       }
       uses nw-s:node-ref;
       uses l3t:l3-unicast-topology-type;
       container prefix {
         description
           "Contains L3 prefix attributes";
         uses l3t:l3-prefix-attributes;
       }
     }
     notification termination-point-event {
       description
         "Notification event for L3 termination point";
       leaf l3-event-type {
         type l3t:l3-event-type;
        
       description "Augments topology termination point configuration";
       uses l3t:l3-termination-point-attributes;
     }
     notification l3-node-event {
       description
         "Notification event for L3 node";
       leaf l3-event-type {
         type l3t:l3-event-type;
         description
           "Event type";
       }
       uses nw-s:node-ref;
       uses l3t:l3-unicast-topology-type;
       uses l3t:l3-node-attributes;
     }
     notification l3-link-event {
       description
         "Notification event for L3 link";
       leaf l3-event-type {
         type l3t:l3-event-type;
         description
           "Event type";
       }
       uses nt-s:link-ref;
       uses l3t:l3-unicast-topology-type;
       uses l3t:l3-link-attributes;
     }
     notification l3-prefix-event {
       description
         "Notification event for L3 prefix";
       leaf l3-event-type {
         type l3t:l3-event-type;
         description
           "Event type";
       }
       uses nw-s:node-ref;
       uses l3t:l3-unicast-topology-type;
       container prefix {
         description
           "Contains L3 prefix attributes";
         uses l3t:l3-prefix-attributes;
       }
     }
     notification termination-point-event {
       description
         "Notification event for L3 termination point";
       leaf l3-event-type {
         type l3t:l3-event-type;
        
         description
           "Event type";
       }
       uses nt-s:tp-ref;
       uses l3t:l3-unicast-topology-type;
       uses l3t:l3-termination-point-attributes;
     }
   }
        
         description
           "Event type";
       }
       uses nt-s:tp-ref;
       uses l3t:l3-unicast-topology-type;
       uses l3t:l3-termination-point-attributes;
     }
   }
        

<CODE ENDS>

<代码结束>

Appendix B. Extending the Model
附录B.扩展模型

The model can be extended for specific Layer 3 Unicast types. Examples include OSPF and IS-IS topologies. This appendix introduces a YANG module that defines a simple topology model for OSPF. This module is intended to serve as an example that illustrates how the general topology model can be refined across multiple levels. It does not constitute a full-fledged OSPF topology model, which may be more comprehensive and refined than the model that is described here.

该模型可以扩展到特定的第3层单播类型。示例包括OSPF和IS-IS拓扑。本附录介绍了定义OSPF简单拓扑模型的YANG模块。本模块旨在作为一个示例,说明如何跨多个级别细化通用拓扑模型。它并不构成一个成熟的OSPF拓扑模型,它可能比这里描述的模型更全面、更精细。

B.1. Example OSPF Topology
B.1. OSPF拓扑示例
B.1.1. Model Overview
B.1.1. 模型概述

The following model shows how the Layer 3 Unicast topology model can be extended, in this case, to cover OSPF topologies. For this purpose, a set of augmentations are introduced in a separate YANG module, "example-ospf-topology", whose structure is depicted in the following diagram. As before, the notation syntax follows [RFC8340]. Note that one of the lines has been wrapped to adhere to the 72-character line limitation of RFCs.

下面的模型显示了如何扩展第3层单播拓扑模型(在本例中)以覆盖OSPF拓扑。为此,在单独的模块“示例ospf拓扑”中引入了一组增强,其结构如下图所示。与前面一样,符号语法遵循[RFC8340]。请注意,其中一行已被包装,以符合RFCs的72字符行限制。

   module: example-ospf-topology
   augment /nw:networks/nw:network/nw:network-types/
     l3t:l3-unicast-topology:
     +--rw ospf!
   augment /nw:networks/nw:network/l3t:l3-topology-attributes:
     +--rw ospf-topology-attributes
        +--rw area-id?   area-id-type
   augment /nw:networks/nw:network/nw:node/l3t:l3-node-attributes:
     +--rw ospf-node-attributes
        +--rw (router-type)?
        |  +--:(abr)
        |  |  +--rw abr?               empty
        |  +--:(asbr)
        |  |  +--rw asbr?              empty
        |  +--:(internal)
        |  |  +--rw internal?          empty
        |  +--:(pseudonode)
        |     +--rw pseudonode?        empty
        +--rw dr-interface-id?   uint32
   augment /nw:networks/nw:network/nt:link/l3t:l3-link-attributes:
     +--rw ospf-link-attributes
   augment /l3t:l3-node-event:
     +---- ospf!
     +---- ospf-node-attributes
        +---- (router-type)?
        |  +--:(abr)
        |  |  +---- abr?               empty
        |  +--:(asbr)
        |  |  +---- asbr?              empty
        |  +--:(internal)
        |  |  +---- internal?          empty
        |  +--:(pseudonode)
        |     +---- pseudonode?        empty
        +---- dr-interface-id?   uint32
   augment /l3t:l3-link-event:
     +---- ospf!
     +---- ospf-link-attributes
        
   module: example-ospf-topology
   augment /nw:networks/nw:network/nw:network-types/
     l3t:l3-unicast-topology:
     +--rw ospf!
   augment /nw:networks/nw:network/l3t:l3-topology-attributes:
     +--rw ospf-topology-attributes
        +--rw area-id?   area-id-type
   augment /nw:networks/nw:network/nw:node/l3t:l3-node-attributes:
     +--rw ospf-node-attributes
        +--rw (router-type)?
        |  +--:(abr)
        |  |  +--rw abr?               empty
        |  +--:(asbr)
        |  |  +--rw asbr?              empty
        |  +--:(internal)
        |  |  +--rw internal?          empty
        |  +--:(pseudonode)
        |     +--rw pseudonode?        empty
        +--rw dr-interface-id?   uint32
   augment /nw:networks/nw:network/nt:link/l3t:l3-link-attributes:
     +--rw ospf-link-attributes
   augment /l3t:l3-node-event:
     +---- ospf!
     +---- ospf-node-attributes
        +---- (router-type)?
        |  +--:(abr)
        |  |  +---- abr?               empty
        |  +--:(asbr)
        |  |  +---- asbr?              empty
        |  +--:(internal)
        |  |  +---- internal?          empty
        |  +--:(pseudonode)
        |     +---- pseudonode?        empty
        +---- dr-interface-id?   uint32
   augment /l3t:l3-link-event:
     +---- ospf!
     +---- ospf-link-attributes
        

The module augments "ietf-l3-unicast-topology" as follows:

该模块扩充了“ietf-l3-单播拓扑”,如下所示:

o A new topology type for an OSPF topology is introduced.

o 介绍了一种新的OSPF拓扑类型。

o Additional topology attributes are defined in a new grouping that augments l3-topology-attributes of the "ietf-l3-unicast-topology" module. The attributes include an OSPF area-id identifying the OSPF area.

o 在一个新的分组中定义了其他拓扑属性,该分组扩展了“ietf-l3-unicast-topology”模块的l3拓扑属性。这些属性包括标识OSPF区域的OSPF区域id。

o Additional data objects for nodes are introduced by augmenting the l3-node-attributes of the "ietf-l3-unicast-topology" module. New objects include router-type and dr-interface-id for pseudonodes.

o 通过增加“ietf-l3-unicast-topology”模块的l3节点属性,为节点引入了额外的数据对象。新对象包括伪节点的路由器类型和dr接口id。

o Links are augmented with OSPF link attributes.

o 链路由OSPF链路属性扩充。

In addition, the module extends notifications for events concerning Layer 3 nodes and links with OSPF attributes.

此外,该模块还扩展了与具有OSPF属性的第3层节点和链路有关的事件通知。

It should be noted that the model defined here represents topology and is intended as an example. It does not define how to configure OSPF routers or interfaces.

应该注意的是,这里定义的模型表示拓扑结构,并用作示例。它没有定义如何配置OSPF路由器或接口。

B.1.2. OSPF Topology YANG Module
B.1.2. OSPF拓扑模块

The OSPF Topology YANG module is specified below. As mentioned, the module is intended as an example for how the Layer 3 Unicast topology model can be extended to cover OSPF topologies, but it is not normative. Accordingly, the module is not delimited with <CODE BEGINS> and <CODE ENDS> tags.

下面指定了OSPF拓扑模块。如前所述,该模块旨在作为第3层单播拓扑模型如何扩展以涵盖OSPF拓扑的示例,但并不规范。因此,模块不使用<CODE BEGINS>和<CODE ENDS>标记分隔。

  file "example-ospf-topology@2017-12-16.yang"
  module example-ospf-topology {
      yang-version 1.1;
      namespace "urn:example:example-ospf-topology";
      prefix "ex-ospft";
      import ietf-yang-types {
          prefix "yang";
      }
      import ietf-network {
          prefix "nw";
      }
      import ietf-network-topology {
          prefix "nt";
      }
      import ietf-l3-unicast-topology {
          prefix "l3t";
      }
      description
         "This module is intended as an example for how the
          Layer 3 Unicast topology model can be extended to cover
          OSPF topologies.";
      typedef area-id-type {
          type yang:dotted-quad;
          description
              "Area ID type.";
      }
      grouping ospf-topology-type {
        
  file "example-ospf-topology@2017-12-16.yang"
  module example-ospf-topology {
      yang-version 1.1;
      namespace "urn:example:example-ospf-topology";
      prefix "ex-ospft";
      import ietf-yang-types {
          prefix "yang";
      }
      import ietf-network {
          prefix "nw";
      }
      import ietf-network-topology {
          prefix "nt";
      }
      import ietf-l3-unicast-topology {
          prefix "l3t";
      }
      description
         "This module is intended as an example for how the
          Layer 3 Unicast topology model can be extended to cover
          OSPF topologies.";
      typedef area-id-type {
          type yang:dotted-quad;
          description
              "Area ID type.";
      }
      grouping ospf-topology-type {
        
          description
              "Identifies the OSPF topology type.";
          container ospf {
              presence "indicates OSPF Topology";
              description
                  "Its presence identifies the OSPF topology type.";
          }
      }
      augment "/nw:networks/nw:network/nw:network-types/"
      + "l3t:l3-unicast-topology" {
          description
              "Defines the OSPF topology type.";
          uses ospf-topology-type;
      }
      augment "/nw:networks/nw:network/l3t:l3-topology-attributes" {
          when "../nw:network-types/l3t:l3-unicast-topology/" +
              "ex-ospft:ospf" {
              description
                  "Augments only for OSPF topology";
              }
          description
              "Augments topology configuration";
          container ospf-topology-attributes {
              description
                  "Contains topology attributes";
              leaf area-id {
                  type area-id-type;
                  description
                      "OSPF area ID";
              }
          }
      }
      augment "/nw:networks/nw:network/nw:node/l3t:l3-node-attributes" {
          when "../../nw:network-types/l3t:l3-unicast-topology/" +
              "ex-ospft:ospf" {
              description
                  "Augments only for OSPF topology";
          }
          description
              "Augments node configuration";
          uses ospf-node-attributes;
      }
      augment "/nw:networks/nw:network/nt:link/l3t:l3-link-attributes" {
          when "../../nw:network-types/l3t:l3-unicast-topology/" +
              "ex-ospft:ospf" {
              description
                  "Augments only for OSPF topology";
          }
        
          description
              "Identifies the OSPF topology type.";
          container ospf {
              presence "indicates OSPF Topology";
              description
                  "Its presence identifies the OSPF topology type.";
          }
      }
      augment "/nw:networks/nw:network/nw:network-types/"
      + "l3t:l3-unicast-topology" {
          description
              "Defines the OSPF topology type.";
          uses ospf-topology-type;
      }
      augment "/nw:networks/nw:network/l3t:l3-topology-attributes" {
          when "../nw:network-types/l3t:l3-unicast-topology/" +
              "ex-ospft:ospf" {
              description
                  "Augments only for OSPF topology";
              }
          description
              "Augments topology configuration";
          container ospf-topology-attributes {
              description
                  "Contains topology attributes";
              leaf area-id {
                  type area-id-type;
                  description
                      "OSPF area ID";
              }
          }
      }
      augment "/nw:networks/nw:network/nw:node/l3t:l3-node-attributes" {
          when "../../nw:network-types/l3t:l3-unicast-topology/" +
              "ex-ospft:ospf" {
              description
                  "Augments only for OSPF topology";
          }
          description
              "Augments node configuration";
          uses ospf-node-attributes;
      }
      augment "/nw:networks/nw:network/nt:link/l3t:l3-link-attributes" {
          when "../../nw:network-types/l3t:l3-unicast-topology/" +
              "ex-ospft:ospf" {
              description
                  "Augments only for OSPF topology";
          }
        
          description
              "Augments link configuration";
          uses ospf-link-attributes;
      }
      grouping ospf-node-attributes {
          description
              "OSPF node scope attributes";
          container ospf-node-attributes {
              description
                  "Contains node attributes";
              choice router-type {
                  description
                      "Indicates router type";
                  case abr {
                      leaf abr {
                          type empty;
                          description
                              "The node is ABR";
                      }
                  }
                  case asbr {
                      leaf asbr {
                          type empty;
                          description
                              "The node is ASBR";
                      }
                  }
                  case internal {
                      leaf internal {
                          type empty;
                          description
                              "The node is internal";
                      }
                  }
                  case pseudonode {
                      leaf pseudonode {
                          type empty;
                          description
                              "The node is pseudonode";
                      }
                  }
              }
              leaf dr-interface-id {
                  when "../pseudonode" {
                      description
                          "Valid only for pseudonode";
                  }
                  type uint32;
        
          description
              "Augments link configuration";
          uses ospf-link-attributes;
      }
      grouping ospf-node-attributes {
          description
              "OSPF node scope attributes";
          container ospf-node-attributes {
              description
                  "Contains node attributes";
              choice router-type {
                  description
                      "Indicates router type";
                  case abr {
                      leaf abr {
                          type empty;
                          description
                              "The node is ABR";
                      }
                  }
                  case asbr {
                      leaf asbr {
                          type empty;
                          description
                              "The node is ASBR";
                      }
                  }
                  case internal {
                      leaf internal {
                          type empty;
                          description
                              "The node is internal";
                      }
                  }
                  case pseudonode {
                      leaf pseudonode {
                          type empty;
                          description
                              "The node is pseudonode";
                      }
                  }
              }
              leaf dr-interface-id {
                  when "../pseudonode" {
                      description
                          "Valid only for pseudonode";
                  }
                  type uint32;
        
                  default "0";
                  description
                      "For pseudonodes, DR interface-id";
              }
          }
      }
      grouping ospf-link-attributes {
          description
              "OSPF link scope attributes";
          container ospf-link-attributes {
              description
                  "Contains OSPF link attributes";
          }
      } // ospf-link-attributes
      augment "/l3t:l3-node-event" {
          description
              "OSPF node event";
          uses ospf-topology-type;
          uses ospf-node-attributes;
      }
      augment "/l3t:l3-link-event" {
          description
              "OSPF link event";
          uses ospf-topology-type;
          uses ospf-link-attributes;
      }
  }
        
                  default "0";
                  description
                      "For pseudonodes, DR interface-id";
              }
          }
      }
      grouping ospf-link-attributes {
          description
              "OSPF link scope attributes";
          container ospf-link-attributes {
              description
                  "Contains OSPF link attributes";
          }
      } // ospf-link-attributes
      augment "/l3t:l3-node-event" {
          description
              "OSPF node event";
          uses ospf-topology-type;
          uses ospf-node-attributes;
      }
      augment "/l3t:l3-link-event" {
          description
              "OSPF link event";
          uses ospf-topology-type;
          uses ospf-link-attributes;
      }
  }
        
Appendix C. An Example
附录C.一个例子

This section contains an example of an instance data tree in JSON encoding [RFC7951]. The example instantiates "ietf-l3-unicast-topology" for the topology that is depicted in the following diagram. There are three nodes: D1, D2, and D3. D1 has three termination points: 1-0-1, 1-2-1, and 1-3-1. D2 has three termination points as well: 2-1-1, 2-0-1, and 2-3-1. D3 has two termination points: 3-1-1 and 3-2-1. In addition, there are six links, two between each pair of nodes, with one going in each direction.

本节包含JSON编码[RFC7951]中的实例数据树示例。该示例为下图所示的拓扑实例化“ietf-l3-单播拓扑”。有三个节点:D1、D2和D3。D1有三个端点:1-0-1、1-2-1和1-3-1。D2也有三个端点:2-1-1、2-0-1和2-3-1。D3有两个端点:3-1-1和3-2-1。此外,有六个链路,每对节点之间有两个链路,每个方向有一个链路。

                +------------+                   +------------+
                |     D1     |                   |     D2     |
               /-\          /-\                 /-\          /-\
               | | 1-0-1    | |---------------->| | 2-1-1    | |
               | |    1-2-1 | |<----------------| |    2-0-1 | |
               \-/  1-3-1   \-/                 \-/  2-3-1   \-/
                |   /----\   |                   |   /----\   |
                +---|    |---+                   +---|    |---+
                    \----/                           \----/
                     A  |                             A  |
                     |  |                             |  |
                     |  |                             |  |
                     |  |       +------------+        |  |
                     |  |       |     D3     |        |  |
                     |  |      /-\          /-\       |  |
                     |  +----->| | 3-1-1    | |-------+  |
                     +---------| |    3-2-1 | |<---------+
                               \-/          \-/
                                |            |
                                +------------+
        
                +------------+                   +------------+
                |     D1     |                   |     D2     |
               /-\          /-\                 /-\          /-\
               | | 1-0-1    | |---------------->| | 2-1-1    | |
               | |    1-2-1 | |<----------------| |    2-0-1 | |
               \-/  1-3-1   \-/                 \-/  2-3-1   \-/
                |   /----\   |                   |   /----\   |
                +---|    |---+                   +---|    |---+
                    \----/                           \----/
                     A  |                             A  |
                     |  |                             |  |
                     |  |                             |  |
                     |  |       +------------+        |  |
                     |  |       |     D3     |        |  |
                     |  |      /-\          /-\       |  |
                     |  +----->| | 3-1-1    | |-------+  |
                     +---------| |    3-2-1 | |<---------+
                               \-/          \-/
                                |            |
                                +------------+
        

Figure 2: A Network Topology Example

图2:网络拓扑示例

The corresponding instance data tree is depicted below. Note that some lines have been wrapped to adhere to the 72-character line limitation of RFCs.

下面描述了相应的实例数据树。请注意,一些行已被包装,以遵守RFC的72字符行限制。

   {
     "ietf-network:networks": {
       "network": [
         {
           "network-types": {
             "ietf-l3-unicast-topology:l3-unicast-topology": {}
           },
           "network-id": "l3-topo-example",
           "node": [
             {
               "node-id": "D1",
               "termination-point": [
                 {
                   "tp-id": "1-0-1",
                   "ietf-l3-unicast-topology:
                     l3-termination-point-attributes": {
                     "unnumbered-id:": 101
                   }
                 },
                 {
                   "tp-id": "1-2-1",
        
   {
     "ietf-network:networks": {
       "network": [
         {
           "network-types": {
             "ietf-l3-unicast-topology:l3-unicast-topology": {}
           },
           "network-id": "l3-topo-example",
           "node": [
             {
               "node-id": "D1",
               "termination-point": [
                 {
                   "tp-id": "1-0-1",
                   "ietf-l3-unicast-topology:
                     l3-termination-point-attributes": {
                     "unnumbered-id:": 101
                   }
                 },
                 {
                   "tp-id": "1-2-1",
        
                   "ietf-l3-unicast-topology:
                     l3-termination-point-attributes": {
                     "unnumbered-id:": 121
                   }
                 },
                 {
                   "tp-id": "1-3-1",
                   "ietf-l3-unicast-topology:
                     l3-termination-point-attributes": {
                     "unnumbered-id:": 131
                   }
                 }
               ],
               "ietf-l3-unicast-topology:l3-node-attributes": {
                 "router-id": ["203.0.113.1"]
               }
             },
             {
               "node-id": "D2",
               "termination-point": [
                 {
                   "tp-id": "2-0-1",
                   "ietf-l3-unicast-topology:
                     l3-termination-point-attributes": {
                     "unnumbered-id:": 201
                   }
                 },
                 {
                   "tp-id": "2-1-1",
                   "ietf-l3-unicast-topology:
                     l3-termination-point-attributes": {
                     "unnumbered-id:": 211
                   }
                 },
                 {
                   "tp-id": "2-3-1",
                   "ietf-l3-unicast-topology:
                     l3-termination-point-attributes": {
                     "unnumbered-id:": 231
                   }
                 }
               ],
               "ietf-l3-unicast-topology:l3-node-attributes": {
                 "router-id": ["203.0.113.2"]
               }
             },
             {
               "node-id": "D3",
        
                   "ietf-l3-unicast-topology:
                     l3-termination-point-attributes": {
                     "unnumbered-id:": 121
                   }
                 },
                 {
                   "tp-id": "1-3-1",
                   "ietf-l3-unicast-topology:
                     l3-termination-point-attributes": {
                     "unnumbered-id:": 131
                   }
                 }
               ],
               "ietf-l3-unicast-topology:l3-node-attributes": {
                 "router-id": ["203.0.113.1"]
               }
             },
             {
               "node-id": "D2",
               "termination-point": [
                 {
                   "tp-id": "2-0-1",
                   "ietf-l3-unicast-topology:
                     l3-termination-point-attributes": {
                     "unnumbered-id:": 201
                   }
                 },
                 {
                   "tp-id": "2-1-1",
                   "ietf-l3-unicast-topology:
                     l3-termination-point-attributes": {
                     "unnumbered-id:": 211
                   }
                 },
                 {
                   "tp-id": "2-3-1",
                   "ietf-l3-unicast-topology:
                     l3-termination-point-attributes": {
                     "unnumbered-id:": 231
                   }
                 }
               ],
               "ietf-l3-unicast-topology:l3-node-attributes": {
                 "router-id": ["203.0.113.2"]
               }
             },
             {
               "node-id": "D3",
        
               "termination-point": [
                 {
                   "tp-id": "3-1-1",
                   "ietf-l3-unicast-topology:
                     l3-termination-point-attributes": {
                     "unnumbered-id:": 311
                   }
                 },
                 {
                   "tp-id": "3-2-1",
                   "ietf-l3-unicast-topology:
                     l3-termination-point-attributes": {
                     "unnumbered-id:": 321
                   }
                 }
               ],
               "ietf-l3-unicast-topology:l3-node-attributes": {
                 "router-id": ["203.0.113.3"]
               }
             }
           ],
           "ietf-network-topology:link": [
             {
               "link-id": "D1,1-2-1,D2,2-1-1",
               "source": {
                 "source-node": "D1",
                 "source-tp": "1-2-1"
               }
               "destination": {
                 "dest-node": "D2",
                 "dest-tp": "2-1-1"
               },
               "ietf-l3-unicast-topology:l3-link-attributes": {
                 "metric1": "100"
               }
             },
             {
               "link-id": "D2,2-1-1,D1,1-2-1",
               "source": {
                 "source-node": "D2",
                 "source-tp": "2-1-1"
               }
               "destination": {
                 "dest-node": "D1",
                 "dest-tp": "1-2-1"
               },
               "ietf-l3-unicast-topology:l3-link-attributes": {
                 "metric1": "100"
        
               "termination-point": [
                 {
                   "tp-id": "3-1-1",
                   "ietf-l3-unicast-topology:
                     l3-termination-point-attributes": {
                     "unnumbered-id:": 311
                   }
                 },
                 {
                   "tp-id": "3-2-1",
                   "ietf-l3-unicast-topology:
                     l3-termination-point-attributes": {
                     "unnumbered-id:": 321
                   }
                 }
               ],
               "ietf-l3-unicast-topology:l3-node-attributes": {
                 "router-id": ["203.0.113.3"]
               }
             }
           ],
           "ietf-network-topology:link": [
             {
               "link-id": "D1,1-2-1,D2,2-1-1",
               "source": {
                 "source-node": "D1",
                 "source-tp": "1-2-1"
               }
               "destination": {
                 "dest-node": "D2",
                 "dest-tp": "2-1-1"
               },
               "ietf-l3-unicast-topology:l3-link-attributes": {
                 "metric1": "100"
               }
             },
             {
               "link-id": "D2,2-1-1,D1,1-2-1",
               "source": {
                 "source-node": "D2",
                 "source-tp": "2-1-1"
               }
               "destination": {
                 "dest-node": "D1",
                 "dest-tp": "1-2-1"
               },
               "ietf-l3-unicast-topology:l3-link-attributes": {
                 "metric1": "100"
        
               }
             },
             {
               "link-id": "D1,1-3-1,D3,3-1-1",
               "source": {
                 "source-node": "D1",
                 "source-tp": "1-3-1"
               }
               "destination": {
                 "dest-node": "D3",
                 "dest-tp": "3-1-1"
               },
               "ietf-l3-unicast-topology:l3-link-attributes": {
                 "metric1": "100"
               }
             },
             {
               "link-id": "D3,3-1-1,D1,1-3-1",
               "source": {
                 "source-node": "D3",
                 "source-tp": "3-1-1"
               }
               "destination": {
                 "dest-node": "D1",
                 "dest-tp": "1-3-1"
               },
               "ietf-l3-unicast-topology:l3-link-attributes": {
                 "metric1": "100"
               }
             },
             {
               "link-id": "D2,2-3-1,D3,3-2-1",
               "source": {
                 "source-node": "D2",
                 "source-tp": "2-3-1"
               }
               "destination": {
                 "dest-node": "D3",
                 "dest-tp": "3-2-1"
               },
               "ietf-l3-unicast-topology:l3-link-attributes": {
                 "metric1": "100"
               }
             },
             {
               "link-id": "D3,3-2-1,D2,2-3-1",
               "source": {
                 "source-node": "D3",
        
               }
             },
             {
               "link-id": "D1,1-3-1,D3,3-1-1",
               "source": {
                 "source-node": "D1",
                 "source-tp": "1-3-1"
               }
               "destination": {
                 "dest-node": "D3",
                 "dest-tp": "3-1-1"
               },
               "ietf-l3-unicast-topology:l3-link-attributes": {
                 "metric1": "100"
               }
             },
             {
               "link-id": "D3,3-1-1,D1,1-3-1",
               "source": {
                 "source-node": "D3",
                 "source-tp": "3-1-1"
               }
               "destination": {
                 "dest-node": "D1",
                 "dest-tp": "1-3-1"
               },
               "ietf-l3-unicast-topology:l3-link-attributes": {
                 "metric1": "100"
               }
             },
             {
               "link-id": "D2,2-3-1,D3,3-2-1",
               "source": {
                 "source-node": "D2",
                 "source-tp": "2-3-1"
               }
               "destination": {
                 "dest-node": "D3",
                 "dest-tp": "3-2-1"
               },
               "ietf-l3-unicast-topology:l3-link-attributes": {
                 "metric1": "100"
               }
             },
             {
               "link-id": "D3,3-2-1,D2,2-3-1",
               "source": {
                 "source-node": "D3",
        
                 "source-tp": "3-2-1"
               }
               "destination": {
                 "dest-node": "D2",
                 "dest-tp": "2-3-1"
               },
               "ietf-l3-unicast-topology:l3-link-attributes": {
                 "metric1": "100"
               }
             }
           ]
         }
       ]
     }
   }
        
                 "source-tp": "3-2-1"
               }
               "destination": {
                 "dest-node": "D2",
                 "dest-tp": "2-3-1"
               },
               "ietf-l3-unicast-topology:l3-link-attributes": {
                 "metric1": "100"
               }
             }
           ]
         }
       ]
     }
   }
        

Figure 3: Instance Data Tree

图3:实例数据树

Acknowledgments

致谢

We wish to acknowledge the helpful contributions, comments, and suggestions that were received from Alia Atlas, Andy Bierman, Benoit Claise, Joel Halpern, Susan Hares, Ladislav Lhotka, Carl Moberg, Carlos Pignataro, Juergen Schoenwaelder, Michal Vasco, and Kent Watsen.

我们希望感谢Alia Atlas、Andy Bierman、Benoit Claise、Joel Halpern、Susan Hares、Ladislav Lhotka、Carl Moberg、Carlos Pignataro、Juergen Schoenwaeld、Michal Vasco和Kent Watsen提供的有益贡献、意见和建议。

Contributors

贡献者

The model presented in this document was contributed to by more people than can be listed on the author list. Additional contributors include:

本文档中介绍的模型由作者列表中列出的更多人提供。其他贡献者包括:

o Vishnu Pavan Beeram, Juniper

o 毗瑟奴-帕万-比拉姆,杜松

o Igor Bryskin, Huawei

o 伊戈尔·布莱斯金,华为

o Ken Gray, Cisco

o 肯格雷,思科

o Aihua Guo, Huawei

o 华为郭爱华

o Tom Nadeau, Brocade

o 汤姆·纳多,博科

o Tony Tkacik

o 托尼·特卡奇克

o Aleksandr Zhdankin, Cisco

o Aleksandr Zhdankin,思科

Authors' Addresses

作者地址

Alexander Clemm Huawei USA - Futurewei Technologies Inc. Santa Clara, CA United States of America

Alexander Clemm Huawei USA-美国加利福尼亚州圣克拉拉市Futurewi Technologies Inc.美国

   Email: ludwig@clemm.org, alexander.clemm@huawei.com
        
   Email: ludwig@clemm.org, alexander.clemm@huawei.com
        

Jan Medved Cisco

简·梅德维德·思科

   Email: jmedved@cisco.com
        
   Email: jmedved@cisco.com
        

Robert Varga Pantheon Technologies SRO

罗伯特·瓦尔加万神殿科技有限公司

   Email: robert.varga@pantheon.tech
        
   Email: robert.varga@pantheon.tech
        

Xufeng Liu Jabil

徐峰刘捷普

   Email: xufeng.liu.ietf@gmail.com
        
   Email: xufeng.liu.ietf@gmail.com
        

Hariharan Ananthakrishnan Packet Design

Hariharan-Ananthakrishnan数据包设计

   Email: hari@packetdesign.com
        
   Email: hari@packetdesign.com
        

Nitin Bahadur Bracket Computing

Nitin Bahadur括号计算

   Email: nitin_bahadur@yahoo.com
        
   Email: nitin_bahadur@yahoo.com