RFC 5277 - NETCONF 事件通知
RFC 5277 - NETCONF 事件通知
摘要
This document defines mechanisms that provide an asynchronous message notification delivery service for the Network Configuration protocol (NETCONF). This is an optional capability built on top of the base NETCONF definition. This document defines the capabilities and operations necessary to support this service.
本文档定义了为网络配置协议(NETCONF)提供异步消息通知传递服务的机制。这是构建在基本NETCONF定义之上的可选功能。本文档定义了支持此服务所需的功能和操作。
1. 介绍
[NETCONF] can be conceptually partitioned into four layers:[NETCONF]在概念上可分为四层:
Layer Example
+-------------+ +-------------------------------------------+
| Content | | Configuration data |
+-------------+ +-------------------------------------------+
| |
+-------------+ +-------------------------------------------+
| Operations | |<get-config>, <edit-config>, <notification>|
+-------------+ +-------------------------------------------+
| | |
+-------------+ +-----------------------------+ |
| RPC | | <rpc>, <rpc-reply> | |
+-------------+ +-----------------------------+ |
| | |
+-------------+ +-------------------------------------------+
| Transport | | BEEP, SSH, SSL, console |
| Protocol | | |
+-------------+ +-------------------------------------------+
Figure 1
This document defines mechanisms that provide an asynchronous message notification delivery service for the [NETCONF] protocol. This is an optional capability built on top of the base NETCONF definition. This memo defines the capabilities and operations necessary to support this service.
本文档定义了为[NETCONF]协议提供异步消息通知传递服务的机制。这是构建在基本NETCONF定义之上的可选功能。本备忘录定义了支持此服务所需的功能和操作。
1.1. Definition of Terms术语的定义
The key words “MUST”, “MUST NOT”, “REQUIRED”, “SHALL”, “SHALL NOT”, “SHOULD”, “SHOULD NOT”, “RECOMMENDED”, “MAY”, and “OPTIONAL” in this document are to be interpreted as described in [RFC2119].本文件中的关键词”必须”、”不得”、”必需”、”应”、”不应”、”应”、”不应”、”建议”、”可”和”可选”应按照[RFC2119]中所述进行解释。
Element: An [XML] Element. / 一个[XML]元素。
Subscription: An agreement and method to receive event notifications over a NETCONF session. A concept related to the delivery of notifications (if there are any to send) involving destination and selection of notifications. It is bound to the lifetime of a session. / 订阅:通过NETCONF会话接收事件通知的协议和方法。与通知交付(如果有任何通知要发送)相关的概念,涉及通知的目的地和选择。它绑定到会话的生存期。
Operation: This term is used to refer to NETCONF protocol operations [NETCONF]. Within this document, operation refers to NETCONF protocol operations defined in support of NETCONF notifications. / 操作:此术语用于指NETCONF协议操作[NETCONF]。在本文档中,操作是指为支持NETCONF通知而定义的NETCONF协议操作。
Event: An event is something that happens that may be of interest - a configuration change, a fault, a change in status, crossing a threshold, or an external input to the system, for example. Often, this results in an asynchronous message, sometimes referred to as a notification or event notification, being sent to interested parties to notify them that this event has occurred. / 事件:事件是可能引起关注的事件-例如,配置更改、故障、状态更改、超过阈值或系统的外部输入。通常,这会导致异步消息(有时称为通知或事件通知)被发送给相关方,以通知他们该事件已发生。
Replay: The ability to send/re-send previously logged notifications upon request. These notifications are sent asynchronously. This feature is implemented by the NETCONF server and invoked by the NETCONF client. / Replay:根据请求发送/重新发送以前记录的通知的功能。这些通知是异步发送的。此功能由NETCONF服务器实现,并由NETCONF客户端调用。
Stream: An event stream is a set of event notifications matching some forwarding criteria and available to NETCONF clients for subscription. / 流:事件流是一组符合某些转发条件的事件通知,可供NETCONF客户端订阅。
Filter: A parameter that indicates which subset of all possible events are of interest. A filter is defined as one or more filter elements [NETCONF], each of which identifies a portion of the overall filter. / 筛选器:一个参数,指示所有可能事件的哪个子集是感兴趣的。过滤器定义为一个或多个过滤器元件[NETCONF],每个元件标识整个过滤器的一部分。
1.2. Motivation动机
The motivation for this work is to enable the sending of asynchronous messages that are consistent with the data model (content) and security model used within a NETCONF implementation.
这项工作的动机是允许发送与NETCONF实现中使用的数据模型(内容)和安全模型一致的异步消息。
The scope of the work aims at meeting the following operational needs:
工作范围旨在满足以下运营需求:
o Initial release should ensure it supports notifications in support of configuration operations. / 初始版本应确保它支持支持配置操作的通知。
o It should be possible to use the same data model for notifications as for configuration operations 对于通知和配置操作,应该可以使用相同的数据模型。
o The solution should support a reasonable message size limit (i.e., not too short). / 解决方案应支持合理的消息大小限制(即,不要太短)。
o The notifications should be carried over a connection-oriented delivery mechanism. / 通知应通过面向连接的传递机制传递。
o A subscription mechanism for notifications should be provided. This takes into account that a NETCONF server does not send notifications before being asked to do so, and that it is the NETCONF client who initiates the flow of notifications. / 应提供通知的订阅机制。这考虑到NETCONF服务器在被要求发送通知之前不会发送通知,并且是NETCONF客户端发起通知流。
o A filtering mechanism for sending notifications should be put in place within the NETCONF server. / 应在NETCONF服务器中设置发送通知的过滤机制。
o The information contained in a notification should be sufficient so that it can be analyzed independent of the transport mechanism. In other words, the data content fully describes a notification; protocol information is not needed to understand a notification. / 通知中包含的信息应足够,以便能够独立于传输机制进行分析。换句话说,数据内容充分描述了通知;理解通知不需要协议信息。
o The server should have the capability to replay locally logged notifications. / 服务器应该能够重播本地记录的通知。
2. 通知相关操作
2.1. 订阅以接收事件通知
The event notification subscription is initiated by the NETCONF client and responded to by the NETCONF server. A subscription is bound to a single stream for the lifetime of the subscription. When the event notification subscription is created, the events of interest are specified.
事件通知订阅由NETCONF客户端启动,并由NETCONF服务器响应。订阅在订阅的生存期内绑定到单个流。创建事件通知订阅时,将指定感兴趣的事件。
Content for an event notification subscription can be selected by applying user-specified filters.
可以通过应用用户指定的筛选器来选择事件通知订阅的内容。
2.1.1. <创建订阅>创建订阅>
Description:
This operation initiates an event notification subscription that will send asynchronous event notifications to the initiator of the command until the subscription terminates. / 此操作启动事件通知订阅,该订阅将向命令的启动器发送异步事件通知,直到订阅终止。
Parameters:参数:
Stream:流:
An optional parameter,
一个可选参数,
Filter:过滤器:
An optional parameter,
一个可选参数,
Start Time:开始时间:
A parameter,
一个参数,
Stop Time:停止时间:
An optional parameter,
可选参数
Positive Response:积极回应:
If the NETCONF server can satisfy the request, the server sends an
如果NETCONF服务器能够满足请求,服务器将发送一个
Negative Response:否定回答:
An
3. 支持概念
3.1. 能力交换
The ability to process and send event notifications is advertised during the capability exchange between the NETCONF client and server.
处理和发送事件通知的能力在NETCONF客户端和服务器之间的能力交换期间公布。
3.1.1. 能力标识符
"urn:ietf:params:netconf:capability:notification:1.0"
3.1.2. 能力示例
<hello xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
<capabilities>
<capability>
urn:ietf:params:xml:ns:netconf:base:1.0
</capability>
<capability>
urn:ietf:params:netconf:capability:startup:1.0
</capability>
<capability>
urn:ietf:params:netconf:capability:notification:1.0
</capability>
</capabilities>
<session-id>4</session-id>
</hello>
3.2. Event Streams / 事件流
An event stream is defined as a set of event notifications matching some forwarding criteria.
事件流定义为一组符合某些转发条件的事件通知。
3.2.1. Event Stream Definition 事件流定义
Event streams are predefined on the managed device. The configuration of event streams is outside the scope of this document. However, it is envisioned that event streams are either pre-established by the vendor (pre-configured), user configurable (e.g., part of the device’s configuration), or both. Device vendors may allow event stream configuration via the NETCONF protocol (i.e.,
事件流是在受管设备上预定义的。事件流的配置不在本文档的范围内。然而,可以设想,事件流要么由供应商预先建立(预先配置),要么由用户配置(例如,设备配置的一部分),要么两者都是。设备供应商可能允许通过NETCONF协议配置事件流(即,
3.2.2. Event Stream Content Format事件流内容格式
The contents of all event streams made available to a NETCONF client (i.e., the notification sent by the NETCONF server) MUST be encoded in XML.
NETCONF客户端可用的所有事件流的内容(即NETCONF服务器发送的通知)必须用XML编码。
3.2.3. 默认事件流
A NETCONF server implementation supporting the notification capability MUST support the “NETCONF” notification event stream. This stream contains all NETCONF XML event notifications supported by the NETCONF server. The exact string “NETCONF” is used during the advertisement of stream support during the
支持通知功能的NETCONF服务器实现必须支持”NETCONF”通知事件流。此流包含NETCONF服务器支持的所有NETCONF XML事件通知。在
4. 事件通知的XML模式
The following [XMLSchema] defines NETCONF Event Notifications.
以下[XMLSchema]定义了NETCONF事件通知。
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns="urn:ietf:params:xml:ns:netconf:notification:1.0"
xmlns:netconf="urn:ietf:params:xml:ns:netconf:base:1.0"
targetNamespace=
"urn:ietf:params:xml:ns:netconf:notification:1.0"
elementFormDefault="qualified"
attributeFormDefault="unqualified"
xml:lang="en">
5. 过滤示例
The following section provides examples to illustrate the various methods of filtering content on an event notification subscription.
以下部分提供了示例,以说明筛选事件通知订阅内容的各种方法。
5.1. 子树过滤
XML subtree filtering is not well-suited for creating elaborate filter definitions given that it only supports equality comparisons and application of the logical OR operators (e.g., in an event subtree, give me all event notifications that have severity=critical, severity=major, or severity=minor). Nevertheless, it may be used for defining simple event notification forwarding filters as shown below.
XML子树筛选不太适合创建复杂的筛选定义,因为它只支持相等比较和逻辑OR运算符的应用(例如,在事件子树中,为我提供严重性=严重、严重性=主要或严重性=次要的所有事件通知)。然而,它可以用于定义简单的事件通知转发过滤器,如下所示。
5.2. XPATH过滤器
The following [XPATH] example illustrates how to select fault EventClass notifications that have severities of critical, major, or minor. The filtering criteria evaluation is as follows:
下面的[XPATH]示例说明了如何选择严重性为critical、major或minor的fault EventClass通知。过滤标准评估如下:
((fault) & ((severity=critical) | (severity=major) | (severity =
minor)))
6. 交织能力
6.1. 描述
The :interleave capability indicates that the NETCONF peer supports the ability to interleave other NETCONF operations within a notification subscription. This means the NETCONF server MUST receive, process, and respond to NETCONF requests on a session with an active notification subscription. This capability helps scalability by reducing the total number of NETCONF sessions required by a given operator or management application.
:interleave功能表示NETCONF对等方支持在通知订阅中交错其他NETCONF操作。这意味着NETCONF服务器必须在具有活动通知订阅的会话上接收、处理和响应NETCONF请求。此功能通过减少给定操作员或管理应用程序所需的NETCONF会话总数来帮助实现可伸缩性。
6.2. 依赖关系
This capability is dependent on the notification capability being supported.
此功能取决于所支持的通知功能。
6.3. 能力标识符
The :interleave capability is identified by the following capability string:
:交织功能由以下功能字符串标识:
urn:ietf:params:netconf:capability:interleave:1.0
本文档基于 RFC 5277 标准,提供了 NETCONF 事件通知机制的详细说明。