[core] Re: Coreconf Notifications

Alex Huang Feng <alex.huang-feng@insa-lyon.fr> Wed, 24 July 2024 18:25 UTC

Return-Path: <alex.huang-feng@insa-lyon.fr>
X-Original-To: core@ietfa.amsl.com
Delivered-To: core@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id DDFFDC15107A; Wed, 24 Jul 2024 11:25:52 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -4.736
X-Spam-Level:
X-Spam-Status: No, score=-4.736 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, HTML_MESSAGE=0.001, RCVD_HELO_IP_MISMATCH=2.368, RCVD_IN_DNSWL_HI=-5, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_ZEN_BLOCKED_OPENDNS=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01, URIBL_DBL_BLOCKED_OPENDNS=0.001, URIBL_ZEN_BLOCKED_OPENDNS=0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (2048-bit key) header.d=insa-lyon.fr
Received: from mail.ietf.org ([50.223.129.194]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 8okGBn5CyrSw; Wed, 24 Jul 2024 11:25:48 -0700 (PDT)
Received: from smtpout01-ext2.partage.renater.fr (smtpout01-ext2.partage.renater.fr [194.254.240.33]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 59355C1CAE6B; Wed, 24 Jul 2024 11:25:47 -0700 (PDT)
Received: from zmtaauth03.partage.renater.fr (zmtaauth03.partage.renater.fr [194.254.240.26]) by smtpout10.partage.renater.fr (Postfix) with ESMTP id 3DF41662EB; Wed, 24 Jul 2024 20:25:40 +0200 (CEST)
Received: from zmtaauth03.partage.renater.fr (localhost [127.0.0.1]) by zmtaauth03.partage.renater.fr (Postfix) with ESMTPS id 314718000B; Wed, 24 Jul 2024 20:25:40 +0200 (CEST)
Received: from localhost (localhost [127.0.0.1]) by zmtaauth03.partage.renater.fr (Postfix) with ESMTP id 1DC3780189; Wed, 24 Jul 2024 20:25:40 +0200 (CEST)
DKIM-Filter: OpenDKIM Filter v2.10.3 zmtaauth03.partage.renater.fr 1DC3780189
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=insa-lyon.fr; s=CB289C06-95B8-49FE-9C4B-D197C6D2E7CB; t=1721845540; bh=8BGO+sbqbK5m1McCjyeaoXFlAdo4voApEJzYGQmdL6M=; h=From:Message-Id:Mime-Version:Date:To; b=koNZTsPLiQXgpHbizVW3fQEqXFUJyIIpIFzRWRg+zSvD9Kxu6oYfX9r5IF7Qbes0L n9R/+RclYlDbDAosYmhgfMqYpwBPoqJtYpcyiRAXGDXBhnfznC8moaB6LlA384HLT3 8mv/V7BA2P+KAitKD2rhu5yqQoSL79lSgYNbzu647YOTL5NRA7bo/VylMTGgj5Kyss P6h8GWX2zD3oCY4vIBjEzNIa3L9caFLysgdwtUe5idd/LA51rg+zKRJQv8PCOqP13t t+ONXxHJoc8ZG3397F/hd896yLEAZocoZkh2TDptkCo64lbBqjBc+ygDbLKqyHQjhn Xt8oCrtoMMZRw==
Received: from zmtaauth03.partage.renater.fr ([127.0.0.1]) by localhost (zmtaauth03.partage.renater.fr [127.0.0.1]) (amavis, port 10026) with ESMTP id u73C3kHzntQU; Wed, 24 Jul 2024 20:25:40 +0200 (CEST)
Received: from 31.133.130.166 (unknown [194.254.241.251]) by zmtaauth03.partage.renater.fr (Postfix) with ESMTPA id 5DB628000B; Wed, 24 Jul 2024 20:25:38 +0200 (CEST)
From: Alex Huang Feng <alex.huang-feng@insa-lyon.fr>
Message-Id: <E0D2CFE6-B0BD-4F0A-9F5C-4C29ADF16861@insa-lyon.fr>
Content-Type: multipart/alternative; boundary="Apple-Mail=_519AB3D8-BDAF-4543-9A8C-8FADB29D814D"
Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3774.600.62\))
Date: Wed, 24 Jul 2024 11:25:26 -0700
In-Reply-To: <397772B6-6DAE-4A2D-BFD0-7A77ABE1415E@tzi.org>
To: Carsten Bormann <cabo@tzi.org>
References: <E2DFFA8E-9766-4CB4-BCAA-6897402B8FB2@insa-lyon.fr> <5C0595E7-2071-4A6F-A0C8-6F9DE138535F@tzi.org> <C4AE55E1-0907-4BBD-A2BA-802063E10B50@insa-lyon.fr> <397772B6-6DAE-4A2D-BFD0-7A77ABE1415E@tzi.org>
X-Mailer: Apple Mail (2.3774.600.62)
X-Virus-Scanned: clamav-milter 0.103.8 at clamav02
X-Virus-Status: Clean
X-Renater-Ptge-SpamState: clean
X-Renater-Ptge-SpamScore: -100
X-Renater-Ptge-SpamCause: gggruggvucftvghtrhhoucdtuddrgeeftddriedugdduvdegucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecutffgpfetvffgtfenuceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujfgurhephffktgggufffjgevvfhfofesrgdtmherhhdtjeenucfhrhhomheptehlvgigucfjuhgrnhhgucfhvghnghcuoegrlhgvgidrhhhurghnghdqfhgvnhhgsehinhhsrgdqlhihohhnrdhfrheqnecuggftrfgrthhtvghrnhepueffveeuffffleelhedtleeltdeftddvveelgeegiefgtdehiefgjeegteeitdeknecuffhomhgrihhnpehgihhthhhusgdrtghomhdpvgigrghmphhlvgdrtghomhdpihgvthhfrdhorhhgnecukfhppeduleegrddvheegrddvgedurddvhedunecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehinhgvthepudelgedrvdehgedrvdeguddrvdehuddphhgvlhhopeefuddrudeffedrudeftddrudeiiedpmhgrihhlfhhrohhmpegrlhgvgidrhhhurghnghdqfhgvnhhgsehinhhsrgdqlhihohhnrdhfrhdpnhgspghrtghpthhtohepjedprhgtphhtthhopegtrggsohesthiiihdrohhrghdprhgtphhtthhopegurhgrfhhtqdhivghtfhdqtghorhgvqdgtohhmihesihgvthhfrdhorhhgpdhrtghpthhtoheptghorhgvsehivghtfhdrohhrghdprhgtphhtthhopehpihgvrhhrvgdrfhhrrghntghoihhssehi nhhsrgdqlhihohhnrdhfrhdprhgtphhtthhopehvihhvvghkrghnrghnuggrrdgsohhuughirgesihhnshgrqdhlhihonhdrfhhrpdhrtghpthhtohepvfhhohhmrghsrdfirhgrfhesshifihhsshgtohhmrdgtohhmpdhrtghpthhtohepsggvnhhoihhtrdgtlhgrihhsvgeshhhurgifvghirdgtohhm
Message-ID-Hash: CYPTJH6EXKKMDULFCBC2V4NFUGI3GXIF
X-Message-ID-Hash: CYPTJH6EXKKMDULFCBC2V4NFUGI3GXIF
X-MailFrom: alex.huang-feng@insa-lyon.fr
X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-core.ietf.org-0; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header
CC: draft-ietf-core-comi@ietf.org, core@ietf.org, Pierre Francois <pierre.francois@insa-lyon.fr>, Vivekananda Boudia <vivekananda.boudia@insa-lyon.fr>, "Thomas. Graf" <Thomas.Graf@swisscom.com>, Benoit Claise <benoit.claise@huawei.com>
X-Mailman-Version: 3.3.9rc4
Precedence: list
Subject: [core] Re: Coreconf Notifications
List-Id: "Constrained RESTful Environments (CoRE) Working Group list" <core.ietf.org>
Archived-At: <https://mailarchive.ietf.org/arch/msg/core/hizathgMFLz_ylBJtPvDNsJZR0I>
List-Archive: <https://mailarchive.ietf.org/arch/browse/core>
List-Help: <mailto:core-request@ietf.org?subject=help>
List-Owner: <mailto:core-owner@ietf.org>
List-Post: <mailto:core@ietf.org>
List-Subscribe: <mailto:core-join@ietf.org>
List-Unsubscribe: <mailto:core-leave@ietf.org>

Dear Carsten,

My apologies, checking again, you are right, tags are needed for RFC9254.

What I want to raise (and discuss) in this thread is NOT how the datetime specified in the leaf “eventTime” is encoded in CBOR.
I agree with Carsten that draft-bormann-cbor-yang-standin-00 can be used in draft-ahuang-netconf-notif-yang for better encoding the datetime.

As I said on the mic during the WG meeting, there is a gap on how YANG notifications are currently encoded in the different YANG encodings (XML, JSON, CBOR).
Having a common structure for such notifications is beneficial to YANG tooling (such as the integration of YANG into the Kafka Schema registry https://github.com/network-analytics/draft-daisy-kafka-yang-integration/blob/main/schema-registry-yangkit-integration-03.pdf)

What I am referring to as a structure is the metadata that needs to be present in the notification header.
The current understanding at NETCONF WG is that the notification header MUST have a eventTime leaf, as specified in RFC5277.
RFC5277 was dedicated to XML, but YANG notifications have been generalised with YANG-Push [RFC8641].

The current understanding is that in XML, a notification is encoded as follows:

<notification xmlns="urn:ietf:params:xml:ns:netconf:notification:1.0">
    <eventTime>2007-07-08T00:04:00Z</eventTime>       <— eventTime present
    <event xmlns="http://example.com/event/1.0">
        <eventClass>fault</eventClass>
        <reportingEntity>
            <card>ATM1</card>
        </reportingEntity>
        <severity>minor</severity>
    </event>
</notification>

JSON as:

{
    "ietf-notification:notification": {
        "eventTime": "2023-02-10T08:00:11.22Z”,     <—eventTime present
        "yang-defining-notif:event": {
            "eventClass": "fault",
            "reportingEntity": {
                "card": "ATM1"
            },
            "severity": "minor"
        }
    }
}

And CBOR (diag-notation) I would expect:
{
    "ietf-notification:notification": {
        "eventTime": "2023-02-10T08:00:11.22Z”,    <— eventTime present
        "yang-defining-notif:event": {
            "eventClass": "fault",
            "reportingEntity": {
                "card": "ATM1"
            },
            "severity": "minor"
        }
    }
}

That is what we are trying to solve with https://datatracker.ietf.org/doc/html/draft-ahuang-netconf-notif-yang-05; having a common schema for all the YANG notifications and having a YANG module defining such structure.

That is why I was suggesting to the authors of draft-ietf-core-comi-18 to use this draft as reference rather than RFC5277 (as Thomas Graf was saying, RFC5277 is expected to be obsoleted)

On a second note, I’d be happy to hear any feedback from the CORE WG whether updating RFC9254 is the way to go to solve this issue with CBOR notifications in https://datatracker.ietf.org/doc/html/draft-ahuang-netconf-notif-yang-05.

Cheers,
Alex

> On 20 Jul 2024, at 08:42, Carsten Bormann <cabo@tzi.org> wrote:
> 
> Hi Alex
> 
> On 2024-07-20, at 00:37, Alex Huang Feng <alex.huang-feng@insa-lyon.fr> wrote:
>> 
>> Thanks for the pointers, will check out this draft. My text does not state that the timestamp needs to be encoded as text-encoded date-time.
> 
> I would expect that you would want to encode these using standard YANG means, and (without YANG-CBOR with stand-in tags) that would be the RFC 3339 date-times used in RFC 6991.
> (Which resolution do you need in practice for eventtime, by the way?)
> 
> 
>> Are you suggesting that the draft should state the usage of tags for date-times? For implementations that does not support tags, isn’t it contra-productive?
> 
> You cannot do YANG-CBOR without CBOR tags, so I don’t think there is an actual problem.
> 
> By the way, you may want to look at the CoRE telemetry spec [1].
> This is six years old (we just didn’t have the RFCs in place for YANG-CBOR and YANG SID at the time, so the draft was a bit premature), but it solves many of the problems being discussed right now.
> (Henk will be at the Hackathon, so please talk to him about that.)
> 
> Grüße, Carsten
> 
> [1]: https://datatracker.ietf.org/doc/html/draft-birkholz-yang-core-telemetry-01
>