🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #26543

Re: [RFC net-next v2 00/18] net: introduce ipxlat stateless IPv4/IPv6 translation

#26543
From: Ralf Lici
Date: Thu, 03 Dec 2026 18:05
64 lines
11827 bytes
Hi Xavier,

Sorry for the slow reply, I wanted a working prototype before answering.

On Mon, 23 Nov 2026 10:27:33 +0800, Xavier HSINYUAN <XavierHsinyuan@outlook.com> wrote:
> Hi Ralf,
>
> Thanks for looking into this!
>
> > Actually v2 has no netdevice attachment any more, the LWT is the only
> > harness in this series.
> >
>
> Ah, I was thinking of a possible future netdev attachment at the time.
> Thanks again for pointing that out.
>

Right, with the engine separate from the harness that is possible now,
and it may be a good follow-up for host CLAT deployments.

> > Which setup do you have in mind: SNAT before translation, filtering, or
> > accounting?
>
> My interest is mainly SNAT and counting before translation. Well,
> stateful SNAT seems a bit odd for IPv6, but with multiple upstreams we
> may need to adjust the source prefix based on the selected output
> interface for load balancing or failover.
>

That's a sensible setup, and v2 can't really do it because the selecting
route ends original-family processing before POST_ROUTING.

> That said, separating NAT and translation by utilizing netns and veth
> pairs could already provide this, but letting packets pass through
> original-family POST_ROUTING before translation would make setup (looks)
> simpler.
>

Agreed, that's why I decided to revisit the attachment point. v3
replaces the LWT harness with an nf_tables object (yet another model, I
know), referenced from filter chains at prerouting or postrouting
through objref. At postrouting the original family has already routed,
filtered and NATed the packet, and its conntrack entry is confirmed when
the packet leaves, so replies translated back are established and the
NAT is reversed. The translated packet then goes through the translated
family's routing and hooks, so interface-based decisions work there as
well.

During v1 I was wary of a netfilter attachment because of reinjecting
into the other family but patches 01-03 now take care of that and of the
fragmentation details, which made a hook far more tractable than it
looked. v3 docs will also spell out what each hook placement runs in
each family (which is the per-hook table I promised).

I plan to post v3 by early next week at the latest, with CLAT (NAT44 +
CLAT) and PLAT (NAPT66 + SIIT) examples and selftests covering both.
Your setup is a good real-world case, so feedback would be very welcome.

Thanks!

-- 
Ralf Lici
Mandelbit Srl
Technical Details
Message-ID: <20261203180552.924347-1-ralf@mandelbit.com>
Path: mbox-mo1.pugleaf.net!news-fra.pugleaf.net!feed-eu-txt.newsdeef.eu!feed-eu-ch.newsdeef.eu!srl.newsdeef.eu!news.mb-net.net!open-news-network.org!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-376809-linux-kernel-netdev=dewy.ru
References: <TYTPR01MB11000E65B4D5C27C27D7414B4CA762@TYTPR01MB11000.jpnprd01.prod.outlook.com> <20261114094722.114623-1-ralf@mandelbit.com> <TYTPR01MB11000B5AC6D9C174AC489EA62CA452@TYTPR01MB11000.jpnprd01.prod.outlook.com>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-fra.pugleaf.net!feed-eu-txt.newsdeef.eu!feed-eu-ch.newsdeef.eu!srl.newsdeef.eu!news.mb-net.net!open-news-network.org!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-376809-linux-kernel-netdev=dewy.ru
From: ralf@mandelbit.com (Ralf Lici)
Newsgroups: linux.kernel.netdev
Subject: Re: [RFC net-next v2 00/18] net: introduce ipxlat stateless IPv4/IPv6 translation
Date: Thu,  3 Dec 2026 19:05:51 +0100
Organization: Usenet Network
Message-ID: <20261203180552.924347-1-ralf@mandelbit.com>
References: <TYTPR01MB11000E65B4D5C27C27D7414B4CA762@TYTPR01MB11000.jpnprd01.prod.outlook.com> <20261114094722.114623-1-ralf@mandelbit.com> <TYTPR01MB11000B5AC6D9C174AC489EA62CA452@TYTPR01MB11000.jpnprd01.prod.outlook.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Injection-Info: usenet.network;
	logging-data="2561654"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:22eoo7nJ2RdMhJj9e6TM03vfhL4= sha256:JEPty7rm16UuwCo7hAvUTsGV+kztle8Z/LLnG9/O4C8=
	sha1:FHktCFM6EN8SHqKzEaCZNm0vfeo= sha256:lNtW+lpeS8rQL7f6CrZNFPyBe/Tr0+YlomYiBikRUQ8=
List-ID: <netdev.vger.kernel.org>
X-Mailpost-Empty-Hdrs: X-Spam-Level
X-Received: from localhost (localhost [127.0.0.1])
	by mail.dewy.ru (Postfix) with ESMTP id BC30E117A01; Thu,  3 Dec 2026 21:06:26 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -0.925
X-Spam-Status: No, score=-0.925 tagged_above=-9999 required=6.31
	tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1,
	HEADER_FROM_DIFFERENT_DOMAINS=0.001, MAILING_LIST_MULTI=-1,
	RCVD_IN_DNSWL_MED=-2.3, SORTED_RECIPS=2.474, SPF_HELO_NONE=0.001,
	SPF_PASS=-0.001] autolearn=ham autolearn_force=no
X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (2048-bit key)
	header.d=mandelbit.com
X-Received: from mail.dewy.ru ([127.0.0.1])
	by localhost (mail.dewy.ru [127.0.0.1]) (amavisd-new, port 10024)
	with ESMTP id 2TYI5pZ3Ipsw;
	Thu,  3 Dec 2026 21:06:24 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.105.105.114; helo=tor.lore.kernel.org; envelope-from=netdev+bounces-376809-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> 
X-Authentication-Results: OpenDMARC; dmarc=none (p=none dis=none) header.from=mandelbit.com
X-Received: from tor.lore.kernel.org (tor.lore.kernel.org [172.105.105.114])
	by mail.dewy.ru (Postfix) with ESMTPS id CE7611179F9; Thu,  3 Dec 2026 21:06:15 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92])
	by tor.lore.kernel.org (Postfix) with ESMTP id B6C412468A; Thu,  3 Dec 2026 18:06:14 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass;
	t=1796321171;
	b=1zcWuP9Nz56yRhQbzAJb/Pm6gfBFEJBqCbsIgClRxm/+qIO7HM4M+vqdc6MxpGR3f44v
	 rLWDNrLbXhGQfQY89CJnsCxVcTTYlu2qHUqIi/EwyXD6hxGtWf/OQQVDuqu3MkqPGPmSF
	 lDFFihO9D9R30M8GX9Jnq9C3yyXc5Dy37866yyo6lr80rHfc7MoMGnCF7gUfRH5JApw9D
	 2r8B+fH145Qq4Y6p66PrOxblwwUjIlONkaJ3F25haiUPru7xW5Ntb284OsI8BHTPpixVR
	 KMOTNUX+9P1McSciJPE6ueMabdXUBC/syw8WDAS9v7OKEohJUAgAPLWhFS9EBLL14HQ==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1796321171;
	h=X-Original-To:Received:DMARC-Filter:Received:DKIM-Signature:From:To:
	 Cc:Subject:Date:Message-ID:X-Mailer:In-Reply-To:References:
	 X-Mailing-List:List-Id:List-Post:List-Help:List-Subscribe:
	 List-Unsubscribe:List-Owner:Precedence:MIME-Version:
	 Content-Transfer-Encoding:X-Rspamd-Queue-Id;
	bh=xI6glpZQRaITVebxGFJeUEByuwoYSqwQaXIBdfSu8eU=;
	b=iRCsK4Lm1jfZNqb/88vltGsfDwloBl6QyEoFt0yjnr+dynSiSzKt2mhqJ8QNFMy2YvmE
	 yytGdWLZ47Csy8SgXPr8qB1aoPy2wJiBFugdUxrqDNfn9klm/36CXeEGm/fKUccg1GG9M
	 RahhP6InptrVaig4/Lo4AP/3+jlu3Q2JYswGxOaXXb3+O2sERIj4dl0ecHX0fd7+AMX7g
	 QnVTKlqwGFfIqnDy6vp9Z4Q8oVDyxYKfPcTqFUBY6cqy+QvghuWrAlZMlzZiRF5JiIch6
	 OrzZME8Cy0ObpLqCA9CdvaoYbfL5KVTYilG6SG4ywBtk+y4bT/wN3Sdu8fw7799dTuA==
X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; 
	dkim=pass header.d=mandelbit.com header.i=@mandelbit.com header.a=rsa-sha256 header.s=MBO0001 header.b=YDY53Dth;
	dmarc=none header.from=mandelbit.com;
	spf=pass smtp.mailfrom=mandelbit.com;
	arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-Received: from localhost.localdomain (localhost [127.0.0.1])
	by smtp.subspace.kernel.org (Postfix) with ESMTP id 9A7F3606A33E;
	Thu,  3 Dec 2026 18:06:11 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
	dkim=pass (2048-bit key, unprotected) header.d=mandelbit.com header.i=@mandelbit.com header.a=rsa-sha256 header.s=MBO0001 header.b=YDY53Dth
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=195.10.208.47
X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none;
	t=1796321170;
	b=KnWvD2oGADoEM2nvgrK+RN5pPRngEfGpawdBruAItVSbaVHJOAP1NmbfcG1ppyrTe7d4
	 1ryw0nzTvfvmY2jv2kODHhoc30oeFQflIZIOi088+KM4aQzt4oq8ZHiWQenh4iUVGHMW/
	 Cwz+deeWFaVyAEUhehmNZ9INcZjeY8JNrctryMXgESxYadYq78xfWuwLkk1LzxrXkWaKD
	 i96H406lcqLLi4eBZBUHwRBkyAtErWed83DUzPPm8Ywa7x7yBOd5BQjQVIciqXwxEQ/wB
	 lCSyb3pz2rBb7UK5iw+/wUU0epmPuy4X3Xj7QDoqsvgMHpgMhCGEXrIW1oYf8Hipc2Q==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1796321170;
	h=DMARC-Filter:Received:DKIM-Signature:From:To:Cc:Subject:Date:
	 Message-ID:X-Mailer:In-Reply-To:References:MIME-Version:
	 Content-Transfer-Encoding:X-Rspamd-Queue-Id;
	bh=xI6glpZQRaITVebxGFJeUEByuwoYSqwQaXIBdfSu8eU=;
	b=wlygo9CmG0Nups5sn66Co3d+NvHjmh5JUE0PzTGnSMjZu3ojedgyl9FC3uJZSZsmANOJ
	 9JApJ8IwjBbYS4hle+Jw3RWx2wTKmZ9O8rJp6kKoX70Vg6hpswE3rGqPgcInmyoOOQlDt
	 dMz9PcTfOdLhLhH0KmrzL3bptzEUbDg3tVbAwjFe9L1v0EauHGeusOIO69b3rWPRz54eA
	 54/cGBNi1sCY1TYblWjvGp0+jwP5jCs536di/YHhEWXblR32wAknDt1t0EW72UPjFN+Zz
	 Nz19SoTZCpVfiNWOfYfBKHDCJQAYk7FosVDj3XMVUXD7CZaIXJSMJQNm0isRsO4mkdg==
X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; 
	dmarc=none header.from=mandelbit.com;
	spf=pass smtp.mailfrom=mandelbit.com;
	dkim=pass header.d=mandelbit.com header.i=@mandelbit.com header.a=rsa-sha256 header.s=MBO0001 header.b=YDY53Dth;
	arc=none smtp.remote-ip=195.10.208.47
X-Received: from mout-b-107.mailbox.org (mout-b-107.mailbox.org [195.10.208.47])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256)
	(No client certificate requested)
	by smtp.subspace.kernel.org (Postfix) with ESMTPS id 49E2C606A322;
	Thu,  3 Dec 2026 18:06:08 +0000 (UTC)
X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 49E2C606A322
X-Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=mandelbit.com
X-Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=mandelbit.com
X-Received: from smtp102.mailbox.org (smtp102.mailbox.org [IPv6:2001:67c:2050:b231:465::102])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange X25519MLKEM768 server-signature RSA-PSS (4096 bits) server-digest SHA256)
	(No client certificate requested)
	by mout-b-107.mailbox.org (Postfix) with ESMTPS id 4jgMxm2wFVz3yLL;
	Thu, 03 Dec 2026 19:06:04 +0100 (CET)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mandelbit.com;
	s=MBO0001; t=1796321164;
	h=from:from:reply-to:subject:subject:date:date:message-id:message-id:
	 to:to:cc:cc:mime-version:mime-version:
	 content-transfer-encoding:content-transfer-encoding:
	 in-reply-to:in-reply-to:references:references;
	bh=xI6glpZQRaITVebxGFJeUEByuwoYSqwQaXIBdfSu8eU=;
	b=YDY53Dthy+uq6T37xdb4iLxRjYGN+fENtY4uflhIyzr3MpyWAVd5caeMPOUoqNEA329MUJ
	sSthNdaLntmA91jmjCK7LLkNYSKk1i4ODNaM/bPqfRARWKweWwMR2O9eokYAkrMg7pt++z
	lRnZR+U0o4blqHT3rwBm9oShYayetzpK5uWqdl/HhcThtq7qbSazMb9DQ2yTSsEki04sa1
	oxzefqaVfXMvNkTrjj6pPcJUerJhFx9dAIXWcn6JOxDWcZ3chUl0khZw+lz47bcP6xwZ3m
	zV3XNAZET1L+9AZi5XAsfITKZG9uKoZq1v5hEMj2bVl62MZmoeqTjbAGknVvPw==
X-Authentication-Results: outgoing_mbo_mout;
	dkim=none;
	spf=pass (outgoing_mbo_mout: domain of ralf@mandelbit.com designates 2001:67c:2050:b231:465::102 as permitted sender) smtp.mailfrom=ralf@mandelbit.com
X-Cc: antonio@mandelbit.com,
	bgalvani@redhat.com,
	coreteam@netfilter.org,
	davem@davemloft.net,
	dsahern@kernel.org,
	dxld@darkboxed.org,
	edumazet@kernel.org,
	fw@strlen.de,
	horms@kernel.org,
	idosch@nvidia.com,
	kuba@kernel.org,
	linux-kernel@vger.kernel.org,
	netdev@vger.kernel.org,
	netfilter-devel@vger.kernel.org,
	pabeni@redhat.com,
	pablo@netfilter.org,
	phil@nwl.cc,
	toke@kernel.org
X-Mailer: git-send-email 2.56.1
X-In-Reply-To: <TYTPR01MB11000B5AC6D9C174AC489EA62CA452@TYTPR01MB11000.jpnprd01.prod.outlook.com>
X-Mailing-List: netdev@vger.kernel.org
X-List-Post: <mailto:netdev@vger.kernel.org>
X-List-Help: <mailto:netdev+help@vger.kernel.org>
X-List-Subscribe: <mailto:netdev+subscribe@vger.kernel.org>
X-List-Unsubscribe: <mailto:netdev+unsubscribe@vger.kernel.org>
X-List-Owner: <mailto:netdev+owner@vger.kernel.org>
X-Precedence: list
X-Rspamd-Queue-Id: 4jgMxm2wFVz3yLL