[Cbor] changes to draft-ietf-cbor-network-addresses-01.txt

Michael Richardson <mcr+ietf@sandelman.ca> Sun, 07 March 2021 23:37 UTC

Return-Path: <mcr+ietf@sandelman.ca>
X-Original-To: cbor@ietfa.amsl.com
Delivered-To: cbor@ietfa.amsl.com
Received: from localhost (localhost []) by ietfa.amsl.com (Postfix) with ESMTP id 484823A1EEA for <cbor@ietfa.amsl.com>; Sun, 7 Mar 2021 15:37:56 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.899
X-Spam-Status: No, score=-1.899 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
Received: from mail.ietf.org ([]) by localhost (ietfa.amsl.com []) (amavisd-new, port 10024) with ESMTP id XzV0BfQz4pDB for <cbor@ietfa.amsl.com>; Sun, 7 Mar 2021 15:37:54 -0800 (PST)
Received: from tuna.sandelman.ca (tuna.sandelman.ca []) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id DB2343A1EE9 for <cbor@ietf.org>; Sun, 7 Mar 2021 15:37:53 -0800 (PST)
Received: from localhost (localhost []) by tuna.sandelman.ca (Postfix) with ESMTP id 7FD93389C1; Sun, 7 Mar 2021 18:42:46 -0500 (EST)
Received: from tuna.sandelman.ca ([]) by localhost (localhost []) (amavisd-new, port 10024) with LMTP id cK5QsMN0Pe5W; Sun, 7 Mar 2021 18:42:42 -0500 (EST)
Received: from sandelman.ca (obiwan.sandelman.ca [IPv6:2607:f0b0:f:2::247]) by tuna.sandelman.ca (Postfix) with ESMTP id CF37D389BF; Sun, 7 Mar 2021 18:42:42 -0500 (EST)
Received: from localhost (localhost [IPv6:::1]) by sandelman.ca (Postfix) with ESMTP id CC7BF88A; Sun, 7 Mar 2021 18:37:48 -0500 (EST)
From: Michael Richardson <mcr+ietf@sandelman.ca>
To: cbor@ietf.org
CC: Brian E Carpenter <brian.e.carpenter@gmail.com>
In-Reply-To: <a15c4d67-e67f-c210-0477-29564c2b67e0@gmail.com>
References: <161266446471.542.2418789735601546566@ietfa.amsl.com> <a15c4d67-e67f-c210-0477-29564c2b67e0@gmail.com>
X-Mailer: MH-E 8.6+git; nmh 1.7+dev; GNU Emacs 26.1
X-Face: $\n1pF)h^`}$H>Hk{L"x@)JS7<%Az}5RyS@k9X%29-lHB$Ti.V>2bi.~ehC0; <'$9xN5Ub# z!G,p`nR&p7Fz@^UXIn156S8.~^@MJ*mMsD7=QFeq%AL4m<nPbLgmtKK-5dC@#:k
MIME-Version: 1.0
Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature"
Date: Sun, 07 Mar 2021 18:37:48 -0500
Message-ID: <30430.1615160268@localhost>
Archived-At: <https://mailarchive.ietf.org/arch/msg/cbor/R_zoa3B1KQdD0xKonw9q-7lPsmI>
Subject: [Cbor] changes to draft-ietf-cbor-network-addresses-01.txt
X-BeenThere: cbor@ietf.org
X-Mailman-Version: 2.1.29
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: Sun, 07 Mar 2021 23:37:56 -0000

>        Title           : CBOR tags for IPv4 and IPv6 addresses and prefixes
>	Filename        : draft-ietf-cbor-network-addresses-01.txt
> A diff from the previous version is available at:
> https://www.ietf.org/rfcdiff?url2=draft-ietf-cbor-network-addresses-01

Brian E Carpenter <brian.e.carpenter@gmail.com> wrote:
    bec> FYI, I am not tracking the CBOR list, but this caught my eye.

    bec> Since prefixes may be of any length and are not required to be
    bec> nibble-aligned, how is 2001:db8:1234::/47 encoded? Is it just this?

    bec>     TBD1([ 47, h'20010db81234'])

    bec> What is the specified behaviour if the byte string is too short or
    bec> too long?

The intention is that it is always zero-padded out to the needed prefix

I have added sections in draft-ietf-cbor-network-addresses-01 which addresses
this as _Encoder Considerations_ and _Decoder Considerations_

I can't recall who asked about Covert Channels, but there are indeed an
In particular, with non-byte aligned prefixes (like 47 above), the 48th bit
(and bits 48 to 128) should be forced to zero.

Brian also laments:

> Reminder: in draft-ietf-anima-prefix-management-07 (RFC Editor queue), we
> have the CDDL below. Of course we could have used your tags if they had
> existed.

>     prefval /= pref6val
>     pref6val = [version6, length, ?prefix]
>     version6 = 6
>     length = 0..128             ; requested or offered prefix length
>     prefix = bytes .size 16     ; offered prefix in binary format

So, one byte for 4/6, vs two bytes for a 1+1 tag.
Unclear if "prefix" can be shortened though.

I just adjusted my code to omit trailing zeros, and to force bits to zero
when sending and receiving.
(Oh, I don't force trailing bits in a byte to zero when sending yet)

My C code is short, I could put it in an appendix if someone thought that was
useful, but I'm afraid it might cause more comments.

]               Never tell me the odds!                 | ipv6 mesh networks [
]   Michael Richardson, Sandelman Software Works        |    IoT architect   [
]     mcr@sandelman.ca  http://www.sandelman.ca/        |   ruby on rails    [

Michael Richardson <mcr+IETF@sandelman.ca>   . o O ( IPv6 IøT consulting )
           Sandelman Software Works Inc, Ottawa and Worldwide