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 <brian.e.carpenter@gmail.com> Wed, 06 October 2021 00:44 UTC

Return-Path: <brian.e.carpenter@gmail.com>
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 243A23A0DE2; Tue, 5 Oct 2021 17:44:57 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.099
X-Spam-Level:
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: ietfa.amsl.com (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com
Received: from mail.ietf.org ([4.31.198.44]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Feg4QuOLeHZj; Tue, 5 Oct 2021 17:44:53 -0700 (PDT)
Received: from mail-pj1-x1035.google.com (mail-pj1-x1035.google.com [IPv6:2607:f8b0:4864:20::1035]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id EF3D43A0D61; Tue, 5 Oct 2021 17:44:52 -0700 (PDT)
Received: by mail-pj1-x1035.google.com 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; d=gmail.com; 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; d=1e100.net; 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 smtp.gmail.com with ESMTPSA id 1sm9085020pfm.163.2021.10.05.17.44.48 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 05 Oct 2021 17:44:51 -0700 (PDT)
To: Michael Richardson <mcr+ietf@sandelman.ca>, Éric Vyncke <evyncke@cisco.com>
Cc: cbor@ietf.org, draft-ietf-cbor-network-addresses@ietf.org, The IESG <iesg@ietf.org>, d3e3e3@gmail.com, barryleiba@computer.org, cbor-chairs@ietf.org
References: <163344085669.17315.998599560097016034@ietfa.amsl.com> <24367.1633460118@localhost>
From: Brian E Carpenter <brian.e.carpenter@gmail.com>
Message-ID: <1fcf3889-57d1-83f5-2913-51ae9155130b@gmail.com>
Date: Wed, 06 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: <https://mailarchive.ietf.org/arch/msg/cbor/JwYRt-xDUmziHvTqWBpHTBpNAQg>
Subject: 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))
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: Wed, 06 Oct 2021 00:44:57 -0000

On 06-Oct-21 07:55, Michael Richardson wrote:
> 
> Captured as issue:
>    https://github.com/cbor-wg/cbor-network-address/issues/12
> 
> Éric Vyncke via Datatracker <noreply@ietf.org> 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 
any
> system than a string which can change, but it does change from one boot 
to
> 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.

    Brian

> 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 <mcr+IETF@sandelman.ca>   . o O ( IPv6 IøT consulting )
>            Sandelman Software Works Inc, Ottawa and Worldwide
> 
> 
> _______________________________________________
> CBOR mailing list
> CBOR@ietf.org
> https://www.ietf.org/mailman/listinfo/cbor
>