Re: [v6ops] Our IPv6-only home network and future experiments

"Soni \"They/Them\" L." <fakedme+ipv6@gmail.com> Fri, 12 April 2024 15:24 UTC

Return-Path: <fakedme+ipv6@gmail.com>
X-Original-To: v6ops@ietfa.amsl.com
Delivered-To: v6ops@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id DD869C14F71B for <v6ops@ietfa.amsl.com>; Fri, 12 Apr 2024 08:24:14 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -6.848
X-Spam-Level:
X-Spam-Status: No, score=-6.848 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_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_HI=-5, 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 LtUb7ZSpMV7o for <v6ops@ietfa.amsl.com>; Fri, 12 Apr 2024 08:24:14 -0700 (PDT)
Received: from mail-lf1-x131.google.com (mail-lf1-x131.google.com [IPv6:2a00:1450:4864:20::131]) (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 746C9C14E513 for <v6ops@ietf.org>; Fri, 12 Apr 2024 08:23:28 -0700 (PDT)
Received: by mail-lf1-x131.google.com with SMTP id 2adb3069b0e04-516a01c8490so1504930e87.1 for <v6ops@ietf.org>; Fri, 12 Apr 2024 08:23:28 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1712935406; x=1713540206; darn=ietf.org; h=content-transfer-encoding:in-reply-to:from:content-language :references:to:subject:user-agent:mime-version:date:message-id :sender:from:to:cc:subject:date:message-id:reply-to; bh=GWNI1/aWfSca4Y+18EmhepJcpfGIGCd03XZFfNTRA1s=; b=kFdP27iegOs+53IH3VySnNL+OlDf7Tx4MaUgJoJG176fP8MUy7ZlkmfNcyRGDlJTP1 09ENhKc9TsWc21gCrES84CZvQgws/WWDKSCuDD0Ogqo8M/hLBg2qc/bbIsY+/DpRoHgv X6uuUFu8TLAgaXQ8F0acI9IeFgHSXm75lDadwomfIen+vqY6UiGQ5mBOk5YH/9D7tAHd +4alu+fjtNTxuob5mUy4mepOdNADnxHdz3GbGzPMtH9LnKghuswCD95hFEN5jvatnK6f YLWDVEFB4l0hG6ySFfE15E42yIvPQTEsQ1IFwHF1c/iLm0xdJf4JK2aImRkivYUpCi/B xMjg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712935406; x=1713540206; h=content-transfer-encoding:in-reply-to:from:content-language :references:to:subject:user-agent:mime-version:date:message-id :sender:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=GWNI1/aWfSca4Y+18EmhepJcpfGIGCd03XZFfNTRA1s=; b=hup/Odhj3jTffNi9OxTG2IZT1UMwbKYdzhbOY8axytIXhQJEDDjPmUAjkAyPnSsnra aCA0K5kqAOyekXrkaTGPG8jNa4JtlOqF5RrbOkOzO0MNbMaQK1T6gd3nq8hpnV6wr1Tx mwedBhqb6ruUXzdU7C3haQMrYSBkouo/Rtr8LN85inopBJ1J2SkuFsWXhUTBONM8xtS4 q8hmxcP2jUMUsmLjZ7m9u0bQHdMDy/Sc5MNAxDA+7FEOhyK2h5XG17klQArwWcF/GRYv Kvd7krigXsJZMrBduGq/WRNvQ9Q7izhNpwww9MyH7JrZKt2TiH61g/DZI32sJZETRxaV /2QQ==
X-Forwarded-Encrypted: i=1; AJvYcCXx+VKvlVks7PONU6WgP9mheMm9C5o+2twY7bliUPFoHyleLjn9VCMGH2z9QgKjx7b/Bs3EZzcbbzjKSMEKig==
X-Gm-Message-State: AOJu0YzhzViXjpw2l/l8vMGOs97p8VznIC4jRDRZyXANQgyKRzedcKss CfLs3dExa5WRdFU49jg6XUiHPrUNz2o78hyyyWnUNerY47RSNRt6eclU6g==
X-Google-Smtp-Source: AGHT+IFlVfr4gRR0orTEnMIJ6aHzjKW6Qi2X7aHtCzwykxynFxEiAsS8IhktJQkj0MesoGa32z0XEQ==
X-Received: by 2002:a05:6512:6c4:b0:513:d167:f245 with SMTP id u4-20020a05651206c400b00513d167f245mr2215729lff.27.1712935406218; Fri, 12 Apr 2024 08:23:26 -0700 (PDT)
Received: from ?IPV6:2804:431:cfcd:6eab::536f:6e69? ([2804:431:cfcd:6eab::536f:6e69]) by smtp.googlemail.com with ESMTPSA id j11-20020a056512108b00b00518856136e0sm210746lfg.118.2024.04.12.08.23.24 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 12 Apr 2024 08:23:25 -0700 (PDT)
Sender: "Soni L." <fakedme@gmail.com>
Message-ID: <cb8d2c37-4819-4255-b91b-302cc8fe980e@gmail.com>
Date: Fri, 12 Apr 2024 12:23:21 -0300
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
To: Brian Candler <brian@nsrc.org>, IPv6 Operations <v6ops@ietf.org>
References: <91ee2782-c98a-4ccf-ae8f-71be571420b6@gmail.com> <0ea1d4ca-d00f-4b08-b5d6-16fe18415702@nsrc.org>
Content-Language: en-US
From: "Soni \"They/Them\" L." <fakedme+ipv6@gmail.com>
In-Reply-To: <0ea1d4ca-d00f-4b08-b5d6-16fe18415702@nsrc.org>
Content-Type: text/plain; charset="UTF-8"; format="flowed"
Content-Transfer-Encoding: 8bit
Archived-At: <https://mailarchive.ietf.org/arch/msg/v6ops/yHduq8qEVGuefOR6cgt6u7rbmSM>
Subject: Re: [v6ops] Our IPv6-only home network and future experiments
X-BeenThere: v6ops@ietf.org
X-Mailman-Version: 2.1.39
Precedence: list
List-Id: v6ops discussion list <v6ops.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/v6ops>, <mailto:v6ops-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/v6ops/>
List-Post: <mailto:v6ops@ietf.org>
List-Help: <mailto:v6ops-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/v6ops>, <mailto:v6ops-request@ietf.org?subject=subscribe>
X-List-Received-Date: Fri, 12 Apr 2024 15:24:14 -0000


On 2024-04-12 12:00, Brian Candler wrote:
> On 12/04/2024 15:04, Soni "They/Them" L. wrote:
>> If we get CLAT in libc working, then we'll move on to enabling the 
>> use of this OS on IPv4-only and dual-stack networks, but again 
>> without introducing an IPv4 stack. This can be done by taking IPv4 
>> packets from the wire, without passing through any functionality 
>> associated with an IPv4 stack (routing, packet filtering, or 
>> connection tracking), and turning them into IPv6 packets, which then 
>> go on to get processed by the IPv6 stack. The combination of CLAT in 
>> libc and this non-traditional SIIT would allow the OS to be deployed 
>> on existing IPv4-only and dual-stack networks, fully implemented 
>> without an IPv4 stack.
>
> Since you say "CLAT in libc", presumably this is in the context Linux 
> or other Unix-like systems. I expect you're already aware of the 
> "IPv6-mostly" mechanisms to signal to a client that it should use a 
> CLAT (RFC8925 for DHCP option 108, RFC8781 for PREF64 in router 
> advertisements).
>
> If you're thinking about doing this in libc, I presume the plan is to 
> map a call to open an IPv4 socket into a call for opening an IPv6 
> socket instead. This isn't an approach I've seen attempted before, and 
> it'll be really interesting to see how it pans out. Normally, CLAT 
> requires its own IPv6 address to use as the source (to distinguish 
> incoming 464XLAT traffic from regular IPv6 traffic). But since each 
> socket effectively will have its own CLAT then that may not be 
> necessary, since the kernel already keeps track of which ports belong 
> to which sockets.
>
> Potential issues I can see:
>
> 1. libc needs to decide whether to use the CLAT in preference to 
> regular IPv4 sockets, e.g. by detecting the presence of an active IPv4 
> stack or default route, and/or the presence of DHCP option 108.

The idea is to not have regular IPv4 sockets, it'll always use the CLAT. 
However,

>
> 2. Every process would have to do discovery of the NAT64 prefix for 
> itself, unless this information is published in a system-wide location 
> that can be queried (which should include RFC8781 so that no DNS64 is 
> required, or spoofing of ipv4only.arpa). It might get tricky if there 
> are multiple NAT64 prefixes learned from different interfaces; there 
> is a choice to be made.

Yeah we're just gonna stuff things into an /etc/clat.conf just like we 
have /etc/resolv.conf but uh anyway.

>
> 3. There are some cases where you might want to map IPv6 addresses 
> back to IPv4 addresses, e.g. the source address on recvfrom(). That 
> sounds doable.

Yeah this is doable, we can reject IPv6 source addresses (and thus IPv6 
connections/packets) in libc too.

>
>
> 4. What do you do if an application binds a socket to an explicit IPv4 
> address like 127.0.0.1? What about an IPv4 wildcard address 0.0.0.0? 
> Do you map to ::1 and ::, or do you just fail them?

0.0.0.0 is mapped to ::, we're still deciding how to best handle 
127.0.0.0/8, or broadcast/multicast... The latter will be necessary for 
DHCPv4 at the least.

>
> I note that there are several ways an application which listens for 
> incoming connections or binds source address for outgoing connections 
> might work:
>
> a. it could open a single socket bound to 0.0.0.0 (legacy IPv4-only 
> application)
> b. it could open two sockets, one bound to 0.0.0.0 and the other to :: 
> (with IPV6_V6ONLY for the latter)
> c. it could open a single socket bound to :: with IPV6_V6ONLY disabled
>
> If you fail case (a) then the application may not work at all; but if 
> you allow case (a) then case (b) may fail due to conflicting ports.  
> And the default for IPV6_V6ONLY is set system-wide in 
> /proc/sys/net/ipv6/bindv6only.

We're pretty excited about this part because, without an IPv4 stack, we 
don't have to worry about IPV6_V6ONLY. This is NAT64/SIIT, and not 
IPv4-mapped, thus it is not affected by IPV6_V6ONLY. In fact, we don't 
even need to support IPV6_V6ONLY, attempting to use it (either setting 
it on or off) can simply return an error.

If the same app binds on both sockets, it'll likely be using the same 
libc for both, and with any luck we can manage that at the libc level. 
We do not plan to support split deployments with a separate IPv4-only 
app and an IPv6-only app on the same port - a significant departure from 
classic IPv4-mapped, which does attempt to support this use-case, often 
to the pain of everyone involved. In fact, we'd even argue this approach 
solves a significant hurdle with traditional IPv4-mapped, because 
ultimately this is one of the reasons FreeBSD and some other BSDs don't 
ship IPv4-mapped support by default (or at all, as the case may be).

>
> Having said that, accepting incoming traffic for an application that 
> opens an IPv4-only socket is probably not a big concern. I'd just 
> wonder about an app that binds to 0.0.0.0 before making an outbound 
> connection.

Those are surprisingly easier to support, since they generally use a 
random port.

>
> Regards,
>
> Brian.
>