Internet-Draft | YANG-Push to Apache Kafka Integration | February 2024 |
Graf | Expires 27 August 2024 | [Page] |
This document describes the motivation and architecture of a native YANG-Push notifications and YANG Schema integration into Apache Kafka Message Broker and YANG Schema Registry.¶
This note is to be removed before publishing as an RFC.¶
Discussion of this document takes place on the Operations and Management Area Working Group Working Group mailing list (nmop@ietf.org), which is archived at https://mailarchive.ietf.org/arch/browse/nmop/.¶
Source for this draft and an issue tracker can be found at https://github.com/network-analytics/draft-daisy-kafka-yang-integration/.¶
This Internet-Draft is submitted in full conformance with the provisions of BCP 78 and BCP 79.¶
Internet-Drafts are working documents of the Internet Engineering Task Force (IETF). Note that other groups may also distribute working documents as Internet-Drafts. The list of current Internet-Drafts is at https://datatracker.ietf.org/drafts/current/.¶
Internet-Drafts are draft documents valid for a maximum of six months and may be updated, replaced, or obsoleted by other documents at any time. It is inappropriate to use Internet-Drafts as reference material or to cite them other than as "work in progress."¶
This Internet-Draft will expire on 27 August 2024.¶
Copyright (c) 2024 IETF Trust and the persons identified as the document authors. All rights reserved.¶
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 Revised BSD License text as described in Section 4.e of the Trust Legal Provisions and are provided without warranty as described in the Revised BSD License.¶
Nowadays network operators are using YANG [RFC7950] to model their configurations and obtain YANG modelled data from their networks. It is well understood that plain text are initially intended for humans and need effort to make it machine readable due to the lack of semantics. YANG modeled data is addressing this need.¶
Increasingly more network operators organizing their data in a Data Mesh [Deh22] where a message broker such as Apache Kafka [Kaf11] or RabbitMQ [Rab07] facilitates the exchange of messages among data processing components like a stream processor to filter, enrich, correlate or aggregate, or a time series database to store data.¶
Even though YANG is intend to ease the handling of data, this promise has not yet been fulfilled for Network Telemetry [RFC9232]. From subscribing on a YANG datastore, publishing a YANG modeled notifications message from the network and viewing the data in a time series database, manual labor is needed to perform a data transformation to make a message broker and its data processing components with YANG notifications interoparable.¶
This document focuses on YANG-Push [RFC8641] as the messaging protocol between the network node and the Network Telemetry [RFC9232] data collection. It describes the main components and the aimed architecture for deploying such solution in a production network. Then, hightlights the integration of the YANG 1.1 [RFC7950] as a schema modeling language within the Apache Kafka and Confluent Schema Registry [Con18] environment.¶
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.¶
This document makes use of the terms defined in [RFC8639], Apache Kafka [Kaf11] and Confluent Schema Registry Documentation [ConDoc18].¶
The following terms are used as defined in [RFC8639].¶
The following terms are used as defined in Apache Kafka [Kaf11].¶
The following terms are used as defined in Confluent Schema Registry Documentation [ConDoc18].¶
With [RFC3535] the IAB set the requirements for Network Management in 2003. From these requirements NETCONF [RFC6241], NETCONF Notifications [RFC5277] and Restconf [RFC8040] has been defined to configure through <edit-config> and retrieve operational data through <get> and NETCONF notifications through <notification> from a YANG datastore on a network node.¶
With YANG-Push, as defined in [RFC8639], [RFC8640] and [RFC8641], periodical and on-change subscriptions to the YANG datastore can be dynamically or statically configured. When notifications are dynamically configured, messages are published over the established NETCONF session, while when it is statically configured messages are published through HTTPS-based [I-D.ietf-netconf-https-notif] or UDP-based [I-D.ietf-netconf-udp-notif] transport. Section 3.7 of [RFC8641] describes push-update messages where the YANG subscribed data is being published, where Section 2.7 of [RFC8639] describes the subscription state change notifications where changes in the subscription are being described.¶
Apache Kafka [Kaf11] is a message broker that supports producing and consuming messages from so called topics. Each topic has one or more partitions where messages are replicated or loadbalanced to scale out. With the introduction of Confluent Schema Registry [Con18] a topic can contain one or more subjects. A subject refers to a Schema defining the structure of the message. The Schema then is used to validate messages sent through topics and are idenfied by an Schema ID. The Schema ID is issued when the Schema is registered to the Confluent Schema Registry. Once the Schema ID is obtained, it can be prefixed to the message with a Apache Kafka serializer. Messages can then be validated against Schema at the producer or at the consumer from a topic to ensure Schema integrity of the message. The type of Schema evolution scheme can be defined per subject, wherever non backward compatibility changes are allowed or not.¶
There are three main objectives for native YANG-Push notifications and YANG Schema integration into Apache Kafka Message Broker.¶
The preservation of the YANG semantics, that includes the YANG data types as defined in [RFC6991] and the nested structure of the YANG module, throughout the data processing chain ensures that metrics can be processed and visualized as they were originally intended. Not only for the user but also for an automated closed loop operation action.¶
[RFC7950] defines in Section 7.21.3 and 7.21.4 the description and reference statement. This information is intended for the user, describing in a human-readable fashion the meaning of a definition. In Data Mesh, this information can be imported from the YANG Schema Registry into a Stream Catalog where subjects within Apache Kafka are identifyable and searchable. An example of a Stream Catalog is Apache Atlas [Atl15]. It can also be applied for time series data visualization in a similar fashion.¶
Since the YANG Schema is preserved for operational metrics in Apache Kafka, a standartization for integration between network data collection and stream processor or time series database is implied.¶
The architecture consists of 6 elements. Figure 1 gives an overview on the workflow.¶
+------------------------------------------------------------+ | Time Series Database | +------------------------------------------------------------+ ^ | (11) Ingest Data | According to Schema +------------------------------------------------------------+ | Time Series Database Ingestion | +------------------------------------------------------------+ (9) Get | ^ ^ (8) Validate Kafka Message Schema | | | Against Schema on Consumer | | | | | | | | (10) Issue | (7) Produce Kafka Message v | Schema (5) Post | with Schema ID prefixed +--------------------+ Schema +--------------------+ | YANG | <-------------- | Data Collection | | Schema Registry | --------------> | YANG-Push Receiver | +--------------------+ (6) Issue +--------------------+ Schema ID (3) Get | ^ (2) Receive YANG-Push Schema | | Subscription Start Message | | ^ | | | | | | (4) Publish YANG-Push v | | Message with Subscription ID +--------------------+ +--------------------+ | Network | (1) Subscribe | Network Node | | Orchestration | ---------------> | YANG-Push Publisher| +--------------------+ +--------------------+
The workflow diagram (Figure 1) describes the steps from establishing the YANG-Push subscription to Time Series Database ingestion.¶
With step number (1) in the workflow diagram, a YANG-Push subscription is according to Section 2.4 and 2.5 of [RFC8639] dynamically or statically configured, and with step (2) subscription state change notifications are sent according to section 2.7 from the YANG-Push publisher to the receiver to inform which event stream filter has been applied to which subscription ID.¶
[I-D.ietf-netconf-yang-notifications-versioning] adds the capability to subscribe to a specific YANG module revision or a YANG module which needs to be backward compatible to in step (1) and adds the module name, revision and revision-label information into the subscription state change notifications in step (2).¶
Figure 2 provides and example how to create a YANG-Push configured subscription with NETCONF in XML [W3C.REC-xml-20081126] with UDP-based [I-D.ietf-netconf-udp-notif] transport¶
<rpc message-id="101" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0"> <edit-config> <target> <running/> </target> <config> <subscriptions xmlns="urn:ietf:params:xml:ns:yang:ietf-subscribed-notifications"> <subscription> <id>6666</id> <datastore xmlns="urn:ietf:params:xml:ns:yang:ietf-yang-push" xmlns:ds="urn:ietf:params:xml:ns:yang:ietf-datastores">ds:operational</datastore> <datastore-xpath-filter xmlns="urn:ietf:params:xml:ns:yang:ietf-yang-push" xmlns:if="urn:ietf:params:xml:ns:yang:ietf-interfaces">/if:interfaces</datastore-xpath-filter> <revision xmlns="urn:ietf:params:xml:ns:yang:ietf-yang-push-revision">2018-02-20</revision> <transport xmlns:unt="urn:ietf:params:xml:ns:yang:ietf-udp-notif-transport">unt:udp-notif</transport> <encoding>encode-json</encoding> <receivers> <receiver> <name>subscription-specific-receiver-def</name> <receiver-instance-ref xmlns="urn:ietf:params:xml:ns:yang:ietf-subscribed-notif-receivers">global-udp-notif-receiver-def</receiver-instance-ref> </receiver> </receivers> <periodic xmlns="urn:ietf:params:xml:ns:yang:ietf-yang-push"> <period>6000</period> </periodic> </subscription> <receiver-instances xmlns="urn:ietf:params:xml:ns:yang:ietf-subscribed-notif-receivers"> <receiver-instance> <name>global-udp-notif-receiver-def</name> <udp-notif-receiver xmlns="urn:ietf:params:xml:ns:yang:ietf-udp-notif-transport"> <address>192.0.5.1</address> <port>12345</port> <enable-segmentation>false</enable-segmentation> <max-segment-size/> </udp-notif-receiver> </receiver-instance> </receiver-instances> </subscriptions> </config> </edit-config> </rpc>
Figure 3 provides an example of a JSON encoded, [RFC7951], subscription-started state change notification message over HTTPS-based [I-D.ietf-netconf-https-notif] or UDP-based [I-D.ietf-netconf-udp-notif] transport for the same subscription.¶
{ "ietf-notification:notification": { "eventTime": "2023-03-25T08:30:11.22Z", "ietf-notification-sequencing:sysName": "example-router", "ietf-notification-sequencing:sequenceNumber": 1, "ietf-subscribed-notification:subscription-started": { "id": 6666, "ietf-yang-push:datastore": "ietf-datastores:operational", "ietf-yang-push:datastore-xpath-filter": "/if:interfaces", "ietf-yang-push-revision:revision": "2014-05-08", "ietf-yang-push-revision:module-name": "ietf-interfaces", "ietf-yang-push-revision:revision-label": "", "ietf-distributed-notif:message-observation-domain-id": [1,2], "transport": "ietf-udp-notif-transport:udp-notif", "encoding": "encode-json", "ietf-yang-push:periodic": { "ietf-yang-push:period": 100 } } } }
With step number (4) in the workflow diagram, a YANG-Push push-update or push-change-update message, depending on wherever periodical or on-change subscription has been established, is sent from the YANG-Push publisher to the receiver according to Section 3.7 of [RFC8639].¶
[I-D.ahuang-netconf-notif-yang] defines the NETCONF notification header specified in [RFC5277] in YANG to enable JSON and CBOR encoding.¶
[I-D.tgraf-netconf-notif-sequencing] adds sysName, messagePublisherId and sequenceNumber in the NETCONF notification header to each message to identify from which network node and publishing process, according to [I-D.ietf-netconf-distributed-notif] a network node with distributed architecture could have multiple messagePublisherId's, the message has been published from. The sequenceNumber enables to recognize loss from the YANG-Push publisher in step (1) down to the Time Series Database Ingestion in step (11).¶
[I-D.tgraf-netconf-yang-push-observation-time] adds observation-time or state-changed-observation-time in the YANG-Push push-update or push-change-update message, depending on wherever periodical or on-change subscription has been established. observation-time describes when the operational metrics was obtained from the YANG datastore. Where state-changed-observation-time describes when the network state change was observed.¶
Figure 4 provides an example of a JSON encoded, [RFC7951], push-update notification message over HTTPS-based [I-D.ietf-netconf-https-notif] or UDP-based [I-D.ietf-netconf-udp-notif] transport for the same subscription.¶
{ "ietf-notification:notification": { "eventTime": "2023-03-25T08:30:11.22Z", "ietf-notification-sequencing:sysName": "example-router", "ietf-notification-sequencing:sequenceNumber": 1, "ietf-yang-push:push-update": { "id": 6666, "ietf-yang-push-netobs-timestamping:observation-time": "2023-03-25T08:30:11.22Z", "datastore-contents": { "ietf-interfaces:interfaces": [ { "interface": { "name": "eth0", "type": "iana-if-type:ethernetCsmacd", "oper-status": "up", "mtu": 1500 } } ] } } } }
Figure 5 provides an example of a JSON encoded, [RFC7951], push-change-update notification message over HTTPS-based [I-D.ietf-netconf-https-notif] or UDP-based [I-D.ietf-netconf-udp-notif] transport for the same subscription.¶
{ "ietf-notification:notification": { "eventTime": "2023-03-25T08:30:11.22Z", "ietf-notification-sequencing:sysName": "example-router", "ietf-notification-sequencing:sequenceNumber": 1, "ietf-yang-push:push-change-update": { "id": 2222, "ietf-yang-push-netobs-timestamping:state-changed-observation-time": "2023-03-25T08:30:11.22Z", "datastore-contents": { "yang-patch": { "patch-id": "patch_54", "comment": "Changing encoding to JSON and increasing the period to 10 minutes", "edit": [ { "edit-id": "id_change_1", "operation": "merge", "target": "/ietf-subscribed-notifications:subscriptions/subscription[id=2222]", "value": { "ietf-subscribed-notifications:encoding": "ietf-subscribed-notifications:encode-json", "ietf-yang-push:periodic": { "period": 60000 } } } ] } } } } }
For all the YANG modules and revisions of each subscription ID in the subscription state change notification received in step number (3) in the workflow diagram, all the YANG module dependencies need to be determined through the YANG Library [RFC8525], and then through NETCONF <get-schema> rpc calls according to [RFC6022] all YANG modules need to be retrieved as described in step (3) in the workflow diagram.¶
[I-D.lincla-netconf-yang-library-augmentation] extends the YANG Library so that not only the submodule but also the augmentation list can be obtained.¶
The YANG data model for datastore push subscriptions is defined in Section 4.1 and 5 in [RFC8641]. It is unclear wherever the subscribed data in the YANG datastore is referenced or the portion of the YANG schema with datastore-subtree-filter or datastore-xpath-filter. This will be further clarified in point number (1) in Section 5.¶
A new YANG module augmenting ietf-notification, ietf-subscribed-notifications and the referenced YANG data in datastore-subtree-filter or datastore-xpath-filter could re-establish semantics, see point number (1) and (2) in Section 5, needed for Schema registration and also enable the possibility to add additional metadata such as the applied event stream filter, YANG module name, revision and revision-label from the subscription state change notifications as described in Section 3.1.¶
Confluent Schema Registry is pluggable. Currently Supports AVRO, JSON Schema and Protobuf. The YANG support is being developed at [Yak24] as part of this architecture. Enable to register, obtain and compare [YSR24] YANG Schemas. One YANG Schema with all its augmentations is being registered per YANG-Push subscription ID. for each YANG Schema a locally significant Schema ID is being issued as described in step (6) in the workflow diagram.¶
curl -X POST -H "Content Type: application/vnd.schemaregistry.v1+json" -d @ietf-interfaces@2018-02-20.json http://localhost:8081/subjects/ietf-interfaces/
curl http://localhost:8081/subjects/ ubjects/ | jq
curl http://localhost:8081/subjects/ietf-interfaces/versions
curl http://localhost:8081/subjects/ietf-interfaces/versions/1
The previously issued Schema ID is prefixed to the previously in Section 3.3 described metadata augmented YANG push push-update message and serialized to a Apache Kafka topic in step (7) of the workflow diagram.¶
From the Apache Kafka topic the message is being consumed and the prefixed Schema ID is being used in step (9) of the workflow diagram to retrieve the YANG Schema to validate the Schema integrity of the message.¶
The time series database ingestion specifications are being derived with the in Section 3.6 already retrieved Schema ID and YANG-Push push-update messages can be now ingested and indexed into the database table according to their semantics.¶
IETF 115:¶
IETF 116:¶
IETF 118:¶
Lists all current open points to be either further researched and clarified or tested with running code.¶
Note to the RFC-Editor: Please remove this section before publishing.¶
Note to the RFC-Editor: Please remove this section before publishing.¶
Ahmed Elhassany is developing a YANG Schema Extension in Confluent Schema Registry.¶
The source code can be obtained here: [YSR24], the progress report here: [YSRPR24], and was validated at the IETF 117 hackathon.¶
Zhuoyao Lin developed as part of her internship a library to parse YANG-Push subscription notifications, identify YANG module dependencises with YANG Library [RFC8525] and obtain with NETCONF <get-schema> rpc calls [RFC6022] all YANG modules from YANG-Push publisher.¶
The source code can be obtained here: [LYP23] and was validated at the IETF 117 hackathon.¶
The authors would like to thank Yannick Buchs and Benoit Claise for their review and valuable comments. Ahmed Elhassany, Alex Huang Feng, Jean Quilbeuf and Zhuoyao Lin for review and contributing code and providing examples and inputs to the open points.¶