Re: [Cbor] Using packed CBOR in BIRD's custom protocol

Maria Matejka <maria.matejka@nic.cz> Thu, 08 June 2023 18:48 UTC

Return-Path: <maria.matejka@nic.cz>
X-Original-To: cbor@ietfa.amsl.com
Delivered-To: cbor@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 91686C15106B for <cbor@ietfa.amsl.com>; Thu, 8 Jun 2023 11:48:02 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.096
X-Spam-Level:
X-Spam-Status: No, score=-2.096 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, NICE_REPLY_A=-0.001, RCVD_IN_ZEN_BLOCKED_OPENDNS=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001, 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 (1024-bit key) header.d=nic.cz
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 cOe4toa7h6yu for <cbor@ietfa.amsl.com>; Thu, 8 Jun 2023 11:47:58 -0700 (PDT)
Received: from mail.nic.cz (mail.nic.cz [217.31.204.67]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 822CCC151063 for <cbor@ietf.org>; Thu, 8 Jun 2023 11:47:57 -0700 (PDT)
Received: from [IPV6:2001:1488:fffe:6:ffff:ffff:ffff:31] (unknown [IPv6:2001:1488:fffe:6:ffff:ffff:ffff:31]) by mail.nic.cz (Postfix) with ESMTPSA id D066E1C156F; Thu, 8 Jun 2023 20:47:50 +0200 (CEST)
Authentication-Results: mail.nic.cz; auth=pass smtp.auth=maria.matejka@nic.cz smtp.mailfrom=maria.matejka@nic.cz
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=nic.cz; s=default; t=1686250071; bh=SKCHAO4M8jgTAX3pMZztbiwqhtaPs5+sQ9qyG5BY8tQ=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From:Reply-To: Subject:To:Cc; b=FRrL/EK6xdqa+w6rI3YvNSiBiUHSUI9pbRSDvnENO0VAz8SHExPIZo8F3UsIv+9ov tFlBxbrgnPaWdoa0X7sGIfXcklNFiNzDypq9Q5fLQhktOP9ivwHow2Lj+G0wBjW2Se F2khRQiZN9fL7TL5mEKE1YvuBYQnlD2vhkbRrgtQ=
Content-Type: multipart/alternative; boundary="------------Ek5mwZdu5uxf5ynNOBDgpP98"
Message-ID: <09ed1f22-0012-21bf-f2c2-3e196d6c4d92@nic.cz>
Date: Thu, 08 Jun 2023 20:47:50 +0200
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.11.0
Content-Language: en-US, cs
To: Carsten Bormann <cabo@tzi.org>
Cc: cbor@ietf.org
References: <25a4a6ed-5b00-c900-c9c6-b83dd45b4003@nic.cz> <DDB41B62-C10F-443D-9982-AB88BF1BA76D@tzi.org>
From: Maria Matejka <maria.matejka@nic.cz>
In-Reply-To: <DDB41B62-C10F-443D-9982-AB88BF1BA76D@tzi.org>
X-Virus-Scanned: clamav-milter 0.103.7 at mail
X-Virus-Status: Clean
X-Rspamd-Server: mail
X-Rspamd-Pre-Result: action=no action; module=multimap; Matched map: WHITELISTED_IP
X-Rspamd-Queue-Id: D066E1C156F
X-Spamd-Bar: /
X-Spamd-Result: default: False [-0.10 / 20.00]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+,1:+,2:~]; ARC_NA(0.00)[]; WHITELISTED_IP(0.00)[2001:1488:fffe:6:ffff:ffff:ffff:31]; FROM_HAS_DN(0.00)[]; ASN(0.00)[asn:25192, ipnet:2001:1488::/32, country:CZ]
X-Rspamd-Action: no action
Archived-At: <https://mailarchive.ietf.org/arch/msg/cbor/gvxjQZ4mM6pHD7yMteWF16jqwAo>
Subject: Re: [Cbor] Using packed CBOR in BIRD's custom protocol
X-BeenThere: cbor@ietf.org
X-Mailman-Version: 2.1.39
Precedence: list
List-Id: "Concise Binary Object Representation \(CBOR\)" <cbor.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/cbor>, <mailto:cbor-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/cbor/>
List-Post: <mailto:cbor@ietf.org>
List-Help: <mailto:cbor-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/cbor>, <mailto:cbor-request@ietf.org?subject=subscribe>
X-List-Received-Date: Thu, 08 Jun 2023 18:48:02 -0000

Hi Carsten,

So if I understand it correctly, CBOR-packed is more like for in-wire 
compression than for application-level smart data compression.

The BGP YANG in combination with YANG-CBOR actually looks like a way to 
go, so there will be probably no need for a RFC, at least for now. I'll 
have to thoroughly read through the existing drafts on this and spin up 
some internal discussions before returning to this topic here.

Thank you for your response!

S pozdravem, Maria

On 6/7/23 13:07, Carsten Bormann wrote:
> Hi Maria,
>
> This is a very interesting use case, thank you for bringing it to the WG.
>
> The idea behind CBOR-packed is that we have a common unpacking mechanism, but leave room for multiple table (dictionary) building mechanisms; the CBOR-packed spec only provides a basic one (as a “batteries included” starter kit).
> So you definitely are not bound to tag 113 if you have a different way to build the table.
>
> The nesting behavior of tag 113 is really of interest if you have a common dictionary to which further instance-specific updates need to be made.  You wouldn’t necessarily use tag 113 for the outer dictionary — that might come from an application-defined tag or even from the knowledge of the media type (or other context).
>
> I don’t think 28/29 are a good way forward, as they rely on order-preserving processing, which may not be supported by a CBOR library.
>
> You do know about tag 52/54?  (RFC 9164.)
> Do you have an example where length indication (beyond what a byte string already does) would lead to easier data management?
>
> Defining a representation of BGP attributes in CBOR is a valid subject of an RFC.
> That could define tags, but your actual use of this might elide them (which would be seen as an “unwrap”, ~tag, in CDDL).
> Note that the BGP YANG project already provides such a representation (via YANG-CBOR); that may or may not be expeditious for your use.
>
> This message is just a quick response; we could pick up this subject in one of the next interims of the CBOR WG (next: 2023-06-14).
> Let’s prepare that with a few messages on the mailing list.
>
> Grüße, Carsten
>
>
>> On 2023-06-07, at 12:35, Maria Matejka<maria.matejka=40nic.cz@dmarc.ietf.org>  wrote:
>>
>> Hello!
>>
>> We're planning to implement a machine-friendly protocol for common and generic communication between BIRD and the surroundings, like GUIs and CLIs or automation machinery. (Currently, everybody is parsing our CLI, which is an awful mess.) We decided to go with CBOR and I'd like to consult with you whether our way is reasonable, and also ask some questions, as we're newbies in this area, if you don't mind.
>>
>> We're definitely going for the packed CBOR as our data can easily get annoyingly big if not packed. Yet we typically don't know the actual contents of the dictionary when starting to pack – and we don't like caching the data either before sending it to generate the dictionary to the beginning. Is there any possibility to send dictionary updates? I'm quite confused by the wording of section 3 of draft-ietf-cbor-packed-08 – at least my concerns are partially relieved by the Appendix A. I'm reading it this way – when we have anything to pack, we open a new 113-tag enclosing the rest of the message … and as soon as we find something more to add to the dictionary, we nest the 113-tags and we put the new values to the end of the dictionary by explicitly marking them by their tags. Is this a valid understanding of that section?
>>
>> Or should we better go for value-sharing by Marc A. Lehmann with tags 28 and 29 in this kind of setup?
>>
>> For the in-socket format, I'm also missing a possibility to explicitly say "the following object (data item) is exactly N bytes long" to allow for easier data management – shall we define this functionality and register it as a tag?
>>
>> And also we're going to encode routing information (like BGP attributes) which may need a standardized representation, yet it's just a map (in case of one route) or a map of maps (full RIB). I think that in this case, it doesn't deserve a tag, yet it may be handy to write an informational RFC about that. Is this the right way to go?
>>
>> Thank you for helping us.
>>
>> -- 
>> Maria Matejka | BIRD Team Leader | CZ.NIC, z.s.p.o.
>>
>> _______________________________________________
>> CBOR mailing list
>> CBOR@ietf.org
>> https://www.ietf.org/mailman/listinfo/cbor

-- 
Maria Matejka | BIRD Team Leader | CZ.NIC, z.s.p.o.