Re: Question about RFC6724

Brian E Carpenter <brian.e.carpenter@gmail.com> Tue, 03 May 2022 21:03 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 E6179C15949E for <ipv6@ietfa.amsl.com>; Tue, 3 May 2022 14:03:16 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -3.955
X-Spam-Level:
X-Spam-Status: No, score=-3.955 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, RCVD_IN_ZEN_BLOCKED_OPENDNS=0.001, 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 tv-mL53AdqsW for <ipv6@ietfa.amsl.com>; Tue, 3 May 2022 14:03:15 -0700 (PDT)
Received: from mail-pl1-x62e.google.com (mail-pl1-x62e.google.com [IPv6:2607:f8b0:4864:20::62e]) (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 2D1C7C159481 for <ipv6@ietf.org>; Tue, 3 May 2022 14:03:15 -0700 (PDT)
Received: by mail-pl1-x62e.google.com with SMTP id j14so560726plx.3 for <ipv6@ietf.org>; Tue, 03 May 2022 14:03:15 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-language:content-transfer-encoding; bh=D0zEDESNFS8NqSEvfwTQv/GUrqV1AxeAqMn7xIpj/9s=; b=qwIggmtNdXRc5WuubcHGJZLs/Oh2dDH69w8u23CyPltBk0yXpKqjVguoswlPZwTuBf hYOr/xLLHVoYJP/ckhy2aDKPj77i+UVBcjlyuo4Ar7VeO1Ty863AUga8HPyJCDtm9ShD PymFMrKlCDawmgT+sA9JzTyR3iqKsiGdv2xw6ujCcCtnLhQDoRAmK4WR2oBJdCc0+pPk fPS4ydmu7uBJZDG/XdVM63S7jSTyux3OgHW4IHzlP6FITbelCOdSLwxmnQc/xcrjA7Sr F88DWt0Nzr/wJoKJD0IpwGBvFOzsg0cjNNm/2iwCQf0tz5EPy6gtwH1mTt8pY51NroQ4 4H6A==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=D0zEDESNFS8NqSEvfwTQv/GUrqV1AxeAqMn7xIpj/9s=; b=0rM/AwqT0m2q+jTxBWLQbHqVl5GqQBjSYs38Ak1f3P3EtfqJ7RLhXH2XHdfHtzxtGg 2qLgUSP55eX8+6FeIDt1mAKDln7c9vklgAj7Ec+FyCLiYflbKsG6kDhwlijWwha43hQ0 AETaNCv21C3pEpP98tJYiRaFCbToMz1hctbpKZR5AvYmCXBFMxK0vuNxHzZ8fLZm7hR3 YCHY9KVA1eH1GhTa7ehgBX1WQIHJsmcgS3Sp3fCmTfU/NsaaTggjp2hg93ftNflmBxBe bI7i4CBN7B5JsgHOnU5nbyJ2pj7yyfOllIvHzvGKemfE9IC5fq0eqBNzvZowSoKfY2k+ nKiQ==
X-Gm-Message-State: AOAM530NqyqBGRWc8qfkdvnMGv0fiJOuZZLfjGGOB2/JnKCho9yLVPfY 7CyDPT/shyAACVJUihDPBNw8lcOaO6qJKQ==
X-Google-Smtp-Source: ABdhPJxjz4Czkz1bF0PEfDg/K+fHzUqk+Wrc1OMPySI65/htcEUrNWHd1mz6hEhRs9RF0KhAC564dA==
X-Received: by 2002:a17:902:6bc9:b0:158:a0d3:d080 with SMTP id m9-20020a1709026bc900b00158a0d3d080mr18763904plt.24.1651611794061; Tue, 03 May 2022 14:03:14 -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 v8-20020a62a508000000b0050dc7628194sm6683911pfm.110.2022.05.03.14.03.11 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 03 May 2022 14:03:13 -0700 (PDT)
Subject: Re: Question about RFC6724
To: Philip Homburg <pch-ipv6-ietf-8@u-1.phicoh.com>, ipv6@ietf.org
References: <m1nlQqC-0000IEC@stereo.hq.phicoh.net> <efffe452-cbcb-e546-972b-e2bb22a98b62@gmail.com> <m1nlmFC-0000JkC@stereo.hq.phicoh.net>
From: Brian E Carpenter <brian.e.carpenter@gmail.com>
Message-ID: <f22f0aed-f3aa-7016-844f-89e5f576440d@gmail.com>
Date: Wed, 04 May 2022 09:03:08 +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: <m1nlmFC-0000JkC@stereo.hq.phicoh.net>
Content-Type: text/plain; charset="utf-8"; format="flowed"
Content-Language: en-US
Content-Transfer-Encoding: 7bit
Archived-At: <https://mailarchive.ietf.org/arch/msg/ipv6/loeZSJVdGr46YmqU939TcWjPlks>
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 21:03:17 -0000

On 03-May-22 18:42, Philip Homburg wrote:
>>> In the context of RFC 6724, can you give an example where limiting the
>>> CommonPrefixLen to 64 gives the wrong result?
>>
>> If read that way, it means that all IPv4-mapped addresses match each other
>> at /64. I'm sure that isn't the intention and I very much doubt that any
>> implementation does that. See my reply to Fred Templin.
> 
> If it is obviously wrong, then it should be possible to give an example
> where RFC 6724 gives the wrong results.

Well, if I put this in my hosts file:

10.1.0.10 printer.mynet.example.com
192.168.178.99 printer.mynet.example.com

then getaddrinfo() returns this, on a Windows host whose IPv4
address is 192.168.178.20:

(<AddressFamily.AF_INET: 2>, 0, 0, '', ('10.1.0.10', 0))
(<AddressFamily.AF_INET: 2>, 0, 0, '', ('192.168.178.99', 0))

If I swap the two entries in hosts, I get:

(<AddressFamily.AF_INET: 2>, 0, 0, '', ('192.168.178.99', 0))
(<AddressFamily.AF_INET: 2>, 0, 0, '', ('10.1.0.10', 0))

I regard that as rather broken; it's clearly not a longest match
at /104, which it should be. Maybe it's different on Linux, but
I don't have a Linux box running this morning.

> Any material change in RFC 6724, would basically be us (6man) trying to define
> address selection for IPv4.

Why is that a problem? Obviously, we'd ask intarea for feedback.
  
> There is a reason the common prefix len is now limited to 64. 

RFC 6724 doesn't actually say that; it only gives 64 as an example of
the prefix length in the case of link-local addresses. That's good,
because it makes the text valid for any future change in that area.

> The same
> reasoning applies to IPv4 (i.e., just comparing all address bits is as wrong
> for IPv4 as it is for IPv6).

In my example above, it's apparent that the comparison is not being
done at /104 (/24 in IPv4 terms) although it should be, since my subnet
is 192.168.178.00/24. That is almost certainly because RFC6724 doesn't spell
the IPv4-mapped case out.

Why does it really matter if the comparison is (redundantly) performed
on all 128 bits? fdee:face:fade::a will match fdee:face:fade::b at /127
instead of /64, but no harm is done that I can see. Similarly,
192.168.178.99 and 192.168.178.20 will match at a few bits longer than
/24.

Regards
     Brian