跳到主要内容

附录 B. 进一步的 augmentation: IP Connectivity 和 IS-IS Subservice

附录 B. 进一步的 augmentation: IP Connectivity 和 IS-IS Subservice​

本节提供两个额外的 YANG module, 用于完整覆盖 [RFC9417] 第 3.1 节图 2 中的示例. 缺失的两个 subservice 类型是 IP connectivity 和 Intermediate System to Intermediate System (IS-IS) 路由协议. 这些 module 作为示例给出; 未来还需要进一步工作来提出更完整的版本.

B.1. IP Connectivity Module 树视图​

该 subservice 表示位于两个不同 device 上的两个 IP 地址之间的单播连接性. 这样的 subservice 可以报告诸如 "No route found" 之类的症状. 以下树图 [RFC8340] 概述了 "example-service-assurance-ip-connectivity" module.

module: example-service-assurance-ip-connectivity

augment /sain:subservices/sain:subservice/sain:parameter:
+--rw parameters
+--rw device1 string
+--rw address1 inet:ip-address
+--rw device2 string
+--rw address2 inet:ip-address

为了指定所关注的连接性, 我们指定两个 IP 地址和两个 device. 该 subservice 保障的是 device 1 上的 IP address 1 与 device 2 上的 IP address 2 之间的连接性处于健康状态.

B.2. IS-IS Module 树视图​

以下树图 [RFC8340] 概述了 "example-service-assurance-is-is" module.

module: example-service-assurance-is-is

augment /sain:subservices/sain:subservice/sain:parameter:
+--rw parameters
+--rw instance-name string

该 subservice 的参数是要保障的 IS-IS 实例名称.

B.3. 全局树视图​

以下树图 [RFC8340] 概述了 "ietf-service-assurance", "ietf-service-assurance-device", "example-service-assurance-device-acme", "example-service-assurance-ip-connectivity", 和 "example-service-assurance-is-is" 这些 module.

module: ietf-service-assurance
  +--ro assurance-graph-last-change    yang:date-and-time
  +--rw subservices
  |  +--rw subservice* [type id]
  |     +--rw type                                        identityref
  |     +--rw id                                          string
  |     +--ro last-change?
  |     |       yang:date-and-time
  |     +--ro label?                                      string
  |     +--rw under-maintenance!
  |     |  +--rw contact    string
  |     +--rw (parameter)
  |     |  +--:(service-instance-parameter)
  |     |  |  +--rw service-instance-parameter
  |     |  |     +--rw service          string
  |     |  |     +--rw instance-name    string
  |     |  +--:(example-ip-connectivity:parameters)
  |     |  |  +--rw example-ip-connectivity:parameters
  |     |  |     +--rw example-ip-connectivity:device1     string
  |     |  |     +--rw example-ip-connectivity:address1
  |     |  |     |       inet:ip-address
  |     |  |     +--rw example-ip-connectivity:device2     string
  |     |  |     +--rw example-ip-connectivity:address2
  |     |  |             inet:ip-address
  |     |  +--:(example-is-is:parameters)
  |     |  |  +--rw example-is-is:parameters
  |     |  |     +--rw example-is-is:instance-name    string
  |     |  +--:(sain-device:parameters)
  |     |  |  +--rw sain-device:parameters
  |     |  |     +--rw sain-device:device    string
  |     |  +--:(example-device-acme:parameters)
  |     |  |  +--rw example-device-acme:parameters
  |     |  |     +--rw example-device-acme:device
  |     |  |     |       string
  |     |  |     +--rw example-device-acme:acme-specific-parameter
  |     |  |             string
  |     |  +--:(sain-interface:parameters)
  |     |     +--rw sain-interface:parameters
  |     |        +--rw sain-interface:device       string
  |     |        +--rw sain-interface:interface    string
  |     +--ro health-score                                int8
  |     +--ro symptoms-history-start?
  |     |       yang:date-and-time
  |     +--ro symptoms
  |     |  +--ro symptom* [start-date-time agent-id symptom-id]
  |     |     +--ro symptom-id             leafref
  |     |     +--ro agent-id               -> /agents/agent/id
  |     |     +--ro health-score-weight?   uint8
  |     |     +--ro start-date-time        yang:date-and-time
  |     |     +--ro stop-date-time?        yang:date-and-time
  |     +--rw dependencies
  |        +--rw dependency* [type id]
  |           +--rw type
  |           |       -> /subservices/subservice/type
  |           +--rw id                 leafref
  |           +--rw dependency-type?   identityref
  +--ro agents
  |  +--ro agent* [id]
  |     +--ro id          string
  |     +--ro symptoms* [id]
  |        +--ro id             string
  |        +--ro description    string
  +--ro assured-services
     +--ro assured-service* [service]
        +--ro service      leafref
        +--ro instances* [name]
           +--ro name           leafref
           +--ro subservices* [type id]
              +--ro type    -> /subservices/subservice/type
              +--ro id      leafref

B.4. IP Connectivity YANG Module​

module example-service-assurance-ip-connectivity {
yang-version 1.1;
namespace "urn:example:example-service-assurance-ip-connectivity";
prefix example-ip-connectivity;

import ietf-inet-types {
prefix inet;
reference
"RFC 6991: Common YANG Data Types";
}
import ietf-service-assurance {
prefix sain;
reference
"RFC 9418: YANG Modules for Service Assurance";
}

organization
"IETF OPSAWG Working Group";
contact
"WG Web: <https://datatracker.ietf.org/wg/opsawg/>
WG List: <mailto:[email protected]>
Author: Benoit Claise <mailto:[email protected]>
Author: Jean Quilbeuf <mailto:[email protected]>";
description
"This example module augments the ietf-service-assurance module
to add support for the subservice ip-connectivity.

It checks whether the IP connectivity between two IP addresses
belonging to two network devices is healthy.";

revision 2023-07-11 {
description
"Initial version.";
reference
"RFC 9418: YANG Modules for Service Assurance";
}

identity ip-connectivity-type {
base sain:subservice-base;
description
"Checks connectivity between two IP addresses.";
}

augment "/sain:subservices/sain:subservice/sain:parameter" {
when "derived-from-or-self(sain:type, 'ip-connectivity-type')";
description
"Augments the parameter choice from the ietf-service-assurance
module with a case specific to the ip-connectivity
subservice.";
container parameters {
description
"Parameters for the ip-connectivity subservice type.";
leaf device1 {
type string;
mandatory true;
description
"Device at the first end of the connection.";
}
leaf address1 {
type inet:ip-address;
mandatory true;
description
"Address at the first end of the connection.";
}
leaf device2 {
type string;
mandatory true;
description
"Device at the second end of the connection.";
}
leaf address2 {
type inet:ip-address;
mandatory true;
description
"Address at the second end of the connection.";
}
}
}
}

B.5. IS-IS YANG Module​

module example-service-assurance-is-is {
yang-version 1.1;
namespace "urn:example:example-service-assurance-is-is";
prefix example-is-is;

import ietf-service-assurance {
prefix sain;
reference
"RFC 9418: YANG Modules for Service Assurance";
}

organization
"IETF OPSAWG Working Group";
contact
"WG Web: <https://datatracker.ietf.org/wg/opsawg/>
WG List: <mailto:[email protected]>
Author: Benoit Claise <mailto:[email protected]>
Author: Jean Quilbeuf <mailto:[email protected]>";
description
"This example module augments the ietf-service-assurance module
to add support for the subservice is-is.

It checks whether an IS-IS instance is healthy.";

revision 2023-07-11 {
description
"Initial version.";
reference
"RFC 9418: YANG Modules for Service Assurance";
}

identity is-is-type {
base sain:subservice-base;
description
"Health of IS-IS routing protocol.";
}

augment "/sain:subservices/sain:subservice/sain:parameter" {
when "derived-from-or-self(sain:type, 'is-is-type')";
description
"Augments the parameter choice from the ietf-service-assurance
module with a case specific to the is-is subservice.";
container parameters {
description
"Parameters for the is-is subservice type.";
leaf instance-name {
type string;
mandatory true;
description
"The instance to monitor.";
}
}
}
}