Re: [Cbor] Supporting IPv6 Link-Local with scope (was Re: Éric Vyncke's Discuss on draft-ietf-cbor-network-addresses-09: (with DISCUSS and COMMENT))

Brian E Carpenter <> Wed, 06 October 2021 00:44 UTC

Return-Path: <>
Received: from localhost (localhost []) by (Postfix) with ESMTP id 243A23A0DE2; Tue, 5 Oct 2021 17:44:57 -0700 (PDT)
X-Virus-Scanned: amavisd-new at
X-Spam-Flag: NO
X-Spam-Score: -2.099
X-Spam-Status: No, score=-2.099 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, FREEMAIL_FROM=0.001, NICE_REPLY_A=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
Authentication-Results: (amavisd-new); dkim=pass (2048-bit key)
Received: from ([]) by localhost ( []) (amavisd-new, port 10024) with ESMTP id Feg4QuOLeHZj; Tue, 5 Oct 2021 17:44:53 -0700 (PDT)
Received: from ( [IPv6:2607:f8b0:4864:20::1035]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by (Postfix) with ESMTPS id EF3D43A0D61; Tue, 5 Oct 2021 17:44:52 -0700 (PDT)
Received: by with SMTP id ls14-20020a17090b350e00b001a00e2251c8so972243pjb.4; Tue, 05 Oct 2021 17:44:52 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;; s=20210112; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=VC7wFuSil9SB/8zsEk15+wrb+bBzU3YC7WmcfyoSymI=; b=ZhgHbm1Ejj11bo0WlN9IkGXcjQBigitGhtAxeA+rmmvQrmqM5BAW9K1bzAkk5W3dEQ 87F6um6xDKrQtLZNlisXf9W8CPbGIuAGmitnZ8s6+NYoXBeo6nV1bsTbHc0UQ0eqHasQ FCfbf//Bk5scOvmV76TFogdU1xzK+ysWpHvLy0OivZMubIGfCg7k525hwIgW6e6Oc1B8 eBdkiUZCvPeGJe3wcze1M22jNPYJ3np4mpF+IMxnV+pLBpdDoeeqQKWbqbe/I7JZ6LwN YKvrQpI/oK6t+vbqL/xozExOO0FVUu7kGM6vgLZBzxolGJeV2xW9KOQWHSqw2veN6AgU XzGQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;; s=20210112; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=VC7wFuSil9SB/8zsEk15+wrb+bBzU3YC7WmcfyoSymI=; b=QdipsaysbJk2/ah0gqVDTVyjLUvpmWH0M5nw4FE1bzaEpwMZW3LPVAhmFiSvO/UOuA rX+buVVfFfxUA1SLDf6hyFuHPgtwzZPuO7mLtRMQ+Evi2j9BFnb579m/SjizRGjeV/xy Le7A2VIWFIV9FA8NRlEjHx7HvYeGyyQ1Asl7RQBAQ5GGMN2OBBQCjzbc8K1zfGZYQixm giWaT1Ir715ZPdqvqF2mo1vDPyotdym/7gk7hcnq2SMPjTlqI7s7FgO8oMRcHycUeA1t Jm2O0adXPhCHS3R1BpBAyUYWIXoMUpqZUaR9Eh4MYRx8sOEBoRpyZqkdTUeKB51qPLm4 JCnA==
X-Gm-Message-State: AOAM530cK0g4+GtGK5xQvi+hpRAM8qFRJ1WfLSJ7ZINdm8y/5/6OYH9D x1M8+TcjdXiGba3gjCGgt8ZRigrGLVrPEQ==
X-Google-Smtp-Source: ABdhPJwVQkhElhznGwccAXfuUwbCvRbo5RXXb3N68xwY600EPshaff2J5XphgTwMZX5I0aQTOkDA8w==
X-Received: by 2002:a17:90a:b795:: with SMTP id m21mr7284568pjr.143.1633481092063; Tue, 05 Oct 2021 17:44:52 -0700 (PDT)
Received: from ?IPv6:2406:e003:11aa:d701:80b2:5c79:2266:e431? ([2406:e003:11aa:d701:80b2:5c79:2266:e431]) by with ESMTPSA id 1sm9085020pfm.163.2021. (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 05 Oct 2021 17:44:51 -0700 (PDT)
To: Michael Richardson <>, =?UTF-8?Q?=c3=89ric_Vyncke?= <>
Cc:,, The IESG <>,,,
References: <> <24367.1633460118@localhost>
From: Brian E Carpenter <>
Message-ID: <>
Date: Wed, 6 Oct 2021 13:44:45 +1300
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.10.0
MIME-Version: 1.0
In-Reply-To: <24367.1633460118@localhost>
Content-Type: text/plain; charset=utf-8
Content-Language: en-US
Content-Transfer-Encoding: quoted-printable
Archived-At: <>
Subject: Re: [Cbor] =?utf-8?q?Supporting_IPv6_Link-Local_with_scope_=28was_Re?= =?utf-8?q?=3A_=C3=89ric_Vyncke=27s_Discuss_on_draft-ietf-cbor-network-add?= =?utf-8?q?resses-09=3A_=28with_DISCUSS_and_COMMENT=29=29?=
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: "Concise Binary Object Representation \(CBOR\)" <>
List-Unsubscribe: <>, <>
List-Archive: <>
List-Post: <>
List-Help: <>
List-Subscribe: <>, <>
X-List-Received-Date: Wed, 06 Oct 2021 00:44:57 -0000

On 06-Oct-21 07:55, Michael Richardson wrote:
> Captured as issue:
> Éric Vyncke via Datatracker <> wrote:
>     > == DISCUSS ==
>     > Generic comment how are link-local address (LLA) with scope encoded ? I would
>     > expect CBOR to work also on LLA only networks... At the bare minimum, please
>     > state that link-local addresses cannot be encoded with their scope, hence, they
>     > cannot represent an interface.
>     > -- Section 3.1.3 --
>     > How can 2 valid link-local addresses (fe80::1%eth0, fe80::1%eth1) 
can be
>     > represented in order to identity two interfaces ?
> There are three kinds of things encoded:
>       a) addresses.
>       b) prefixes
>       c) interface definitions
> For (b) and (c), we could easily entertain (and did we discuss this in the
> thread that was CC'ed to 6man?) adding a third element to the array to store
> the interface ID.
> For (a), I'm not sure what we can do to add the interface ID, but see below.
> That's kinda the easy part.
> The hard part is deciding how to encode the scope.
> The simplest is as an integer, being the ifindex.
> CBOR makes that easy and efficient, and many systems don't have more than 24
> interfaces.  However, on systems where interfaces come/go a lot, the ifindex
> often increments anyway.  Using the ifindex is probably clearer on most 
> system than a string which can change, but it does change from one boot 
> another.

Correct, but the name can also change (I forget the magic command on Linux,
but it exists). In socket calls such as connect() you need the interface
index, and the conversion from interface id to interface index is a bit
system-dependent but typically involves getaddrinfo(). The only safe
assumption is that they're both dynamic, but which you need depends on
the exact use case.

I suggest that we should be able to support both formats. Since CBOR is typed,
that's easy enough.


> While the ifindex is system specific and has no outside meaning, the purposes
> where I imagine this being used would be in some system specific container.
> (My use case, which drove me to do this, actually probably needed scope-id)
> One way to do (a) could be to append to the IPv6 string.
> Another way would be not to bother, to always use the interface definition
> when a IPv6-LL is needed.  Whether the length is 0, 128, or the actual
> interface prefix (probably 64) is something we could specify.
> --
> Michael Richardson <>   . o O ( IPv6 IøT consulting )
>            Sandelman Software Works Inc, Ottawa and Worldwide
> _______________________________________________
> CBOR mailing list