Re: Question about RFC6724

Brian E Carpenter <brian.e.carpenter@gmail.com> Tue, 03 May 2022 02:02 UTC

Return-Path: <brian.e.carpenter@gmail.com>
X-Original-To: ipv6@ietfa.amsl.com
Delivered-To: ipv6@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 89724C15E6D6 for <ipv6@ietfa.amsl.com>; Mon, 2 May 2022 19:02:13 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -3.956
X-Spam-Level:
X-Spam-Status: No, score=-3.956 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=-1.857, SPF_HELO_NONE=0.001, SPF_PASS=-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 ([50.223.129.194]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id iZ2MxuSo5wd5 for <ipv6@ietfa.amsl.com>; Mon, 2 May 2022 19:02:12 -0700 (PDT)
Received: from mail-pj1-x102c.google.com (mail-pj1-x102c.google.com [IPv6:2607:f8b0:4864:20::102c]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 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 30BB5C15E6C0 for <ipv6@ietf.org>; Mon, 2 May 2022 19:00:55 -0700 (PDT)
Received: by mail-pj1-x102c.google.com with SMTP id cu23-20020a17090afa9700b001d98d8e53b7so1078053pjb.0 for <ipv6@ietf.org>; Mon, 02 May 2022 19:00:55 -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=j67odHsxA52kjZxCXodbmpGmhac9A513JoiOLvjTPUA=; b=nE1R/5lhLL7xzEBWw+u3KGcKaW/F0qviYLqu4hQOnTR949XMHKaOxCdWPADPqJjpU3 rcsl1HSUzeHAKjpTrj+uuPW7SXzc4V5v3uNuZxAA80/2kPUjw6Tm6o6at+plCgogurwI F557e+8Niq7vbOeAwDtsJlKr6xmWy2EOGOp+fcKegRxYXV1Ni2h/oxwoqLPZniMWX2Qv GqKoMLu8jcVJlnvxeYrilf0GWB0xXqsPCKiTN1DLnI1Jlt4z6akTPGevp+/ct2hqNAUt VnsLrgom41xT9NIGgpLAl2w1QgCCwpfPP8rRuiSCrl8Sn7nVEgtZrIodKUb0iLX9WkkP j6hg==
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=j67odHsxA52kjZxCXodbmpGmhac9A513JoiOLvjTPUA=; b=lTugHK/5Tv7OKnoHXBcrIfcJuub+/H2szArGSygM7dQeMbsMLmCY+3bTRPa6fE6jS2 nG6c5Pnww7s+uSz2DW87VsxfMK2OGHCs4JAwcXf6RwkrfsenPIEUWFQ5/CoG5Onide+o GnMEXAEJluhViyq4RH9i5rI1rd24fSaN9yX9JAMqAdIjYutOBr3oOHyCg+4GQTjoqaEP lnTq9FbDDb83KA04/LgLazKgcFagWkFZ6oiNkMSVgLdGKYROiM5ep4G4OjQDHioPesQy Zn8SDDLdxuYz2zcwt3iOhrgjAQMf2lbWFL/03oGuszs91dn8w00GVMccmGY2Kk/BS9dH eVcw==
X-Gm-Message-State: AOAM533C3CxzQg8+IjgdnECkJHVJ0Uf6auJjV2Vhr+TolyMJYagfMej3 pKeZcpm9q4XG0JoyGS9DtxautaFOKl+iSw==
X-Google-Smtp-Source: ABdhPJyeSbZy+ln/C8DojLVLCLqGpn8nR2ApqyjmvQ0ProzuBRHVBYUZh6vEWzjV0+B1IIpZymkPQQ==
X-Received: by 2002:a17:90b:4c91:b0:1dc:57bc:4caa with SMTP id my17-20020a17090b4c9100b001dc57bc4caamr2274521pjb.10.1651543254328; Mon, 02 May 2022 19:00:54 -0700 (PDT)
Received: from ?IPv6:2406:e003:1005:b501:80b2:5c79:2266:e431? ([2406:e003:1005:b501:80b2:5c79:2266:e431]) by smtp.gmail.com with ESMTPSA id n7-20020a170902f60700b0015e8d4eb2acsm5349469plg.246.2022.05.02.19.00.52 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 02 May 2022 19:00:53 -0700 (PDT)
Subject: Re: Question about RFC6724
To: JINMEI Tatuya / 神明達哉 <jinmei@wide.ad.jp>
Cc: 6man <ipv6@ietf.org>
References: <985e9c94-b6f7-b45d-208d-e9b26664540b@gmail.com> <CAJE_bqfpURs++e9FaECp7zJFD3tTz4FGizYUo58U_7Ge1sWa0Q@mail.gmail.com>
From: Brian E Carpenter <brian.e.carpenter@gmail.com>
Message-ID: <75032723-c9a3-c59c-33cf-1744c538b7aa@gmail.com>
Date: Tue, 03 May 2022 14:00:49 +1200
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: <CAJE_bqfpURs++e9FaECp7zJFD3tTz4FGizYUo58U_7Ge1sWa0Q@mail.gmail.com>
Content-Type: text/plain; charset="utf-8"; format="flowed"
Content-Language: en-US
Content-Transfer-Encoding: quoted-printable
Archived-At: <https://mailarchive.ietf.org/arch/msg/ipv6/sFyLeBJHhv59EP-m6jIDdvMw4Js>
X-BeenThere: ipv6@ietf.org
X-Mailman-Version: 2.1.34
Precedence: list
List-Id: "IPv6 Maintenance Working Group \(6man\)" <ipv6.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/ipv6>, <mailto:ipv6-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/ipv6/>
List-Post: <mailto:ipv6@ietf.org>
List-Help: <mailto:ipv6-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/ipv6>, <mailto:ipv6-request@ietf.org?subject=subscribe>
X-List-Received-Date: Tue, 03 May 2022 02:02:13 -0000

Hi Jinmei-san,

On 03-May-22 11:42, JINMEI Tatuya / 神明達哉 wrote:
> On Sun, May 1, 2022 at 9:33 PM Brian E Carpenter
> <brian.e.carpenter@gmail.com> wrote:
> 
>>> 2.2.  Common Prefix Length
>>>
>>>     We define the common prefix length CommonPrefixLen(S, D) of a source
>>>     address S and a destination address D as the length of the longest
>>>     prefix (looking at the most significant, or leftmost, bits) that the
>>>     two addresses have in common, up to the length of S's prefix (i.e.,
>>>     the portion of the address not including the interface ID).  For
>>>     example, CommonPrefixLen(fe80::1, fe80::2) is 64.
>>
>> The "interface ID" is simply a non-concept for IPv4-mapped IPv6 addresses. So what do implementations do?
> 
> I've just checked an implementation I'm relatively familiar with, and
> found that it seems to completely ignore the "up to the length of S's
> prefix" part:
> https://github.com/freebsd/freebsd-src/blob/271f6d52a606e86c11b366082f11fe69350f24da/lib/libc/net/getaddrinfo.c#L924
> that is, it compares the entire 128-bit IPv6 addresses and 32-bit IPv4
> addresses.

I think that makes a lot of sense. There's no real advantage in stopping
the match at /64, and it's only by going beyond /96 that it can be
useful for IPv4-mapped, if a host happens to have more than one IPv4
address.
  
> But I don't think the specification simply "doesn't work for
> ::ffff:0:0/96" (or IPv4 addresses).
> Since 'S' is a local address, the implementation should also be able
> to get the corresponding netmask
> (which should be contiguous in practice, and can be converted to a
> "prefix length").

Right, but the text is written as if every address is a GUA (or ULA)
in a /64 subnet. It looks as if implementers have simply ignored
the statement about the prefix.

> An implementation could apply that prefix and compare the
> corresponding IPv4 addresses
> up to that length of bits.
> Extending it to the form of IPv4-mapped IPv6 addresses would be straightforward,
> although the RFC text could have been clearer for that case.

Exactly, and I think that should be logged in the errata for future
reference. (Also, architecturally, we don't want the /64 burnt into
code, for reasons discussed often on this list.)

Thanks,
    Brian