From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from gandalf.ozlabs.org (mail.ozlabs.org [IPv6:2404:9400:2221:ea00::3]) by passt.top (Postfix) with ESMTPS id 58FA85A026D for ; Mon, 1 May 2023 13:08:08 +0200 (CEST) Received: by gandalf.ozlabs.org (Postfix, from userid 1007) id 4Q90n0553xz4x45; Mon, 1 May 2023 21:08:04 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gibson.dropbear.id.au; s=201602; t=1682939284; bh=Q64Qz+cndgBWlMMaLJ3AbTLo1XY4eUBDLNtjT4KLtXU=; h=From:To:Cc:Subject:Date:From; b=jztRgbEcO2AhbDyxWmKt3jAsr6L3gN0PSNIeN1UkpPrXkSQBUmlvOJCVaCWdB87Dp vErEr7DRPxDKvh0An4iFzOOFcGWmt/5GO4sHfDMpN3jt+gGMpaTC32sgtbH+fR2TF+ JCNhwdgKQaG9XDhPRRVbjdEkWGbSYZNeTsmV8lM8= From: David Gibson To: Stefano Brivio , passt-dev@passt.top Subject: [PATCH 0/7] RFC: Allow NAT-to-host address to be configured explicitly Date: Mon, 1 May 2023 21:06:55 +1000 Message-Id: <20230501110702.3915529-1-david@gibson.dropbear.id.au> X-Mailer: git-send-email 2.40.1 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Message-ID-Hash: ZMYCG3UH7XYLPHXFF4HZHRFDRJ6ZFF4R X-Message-ID-Hash: ZMYCG3UH7XYLPHXFF4HZHRFDRJ6ZFF4R X-MailFrom: dgibson@gandalf.ozlabs.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: David Gibson X-Mailman-Version: 3.3.8 Precedence: list List-Id: Development discussion and patches for passt Archived-At: Archived-At: List-Archive: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Since the passt/pasta guest and host (usually) have the same address, it's not possible for the guest to address the host, which is a serious limitation. So, passt/pasta NATs the address of the default gateway to the host as a special case. That can be quite limiting however. Most obviously this prevents the guest from addressing the gateway, which is less common than needing to address the host, but certainly possible. The combination of the concepts of "gateway" and "nat to host" address makes for some extra confusion as well. This series separates the two concepts in both the code and the tests, and adds a command line option for configuring the NAT to host address explicitly (by default it remains the same as the gateway). This isn't quite ready for merge yet. First, I think there might be a bug I haven't managed to track down yet which causes intermittent failures in some of the UDP throughput tests. Second, I don't think we want to commit to this command line option just yet, without a look at what further NAT cleanups we might want to do (which I'll be looking at in the near term future). David Gibson (7): udp: Simplify setting of source IPv6 address for inbound packets udp: Simplify setting od destination IPv6 address for inbound packets nat: Split notion of gateway/router from from guest-visible host address nat: Simplify --no-map-gw handling nat: Centralise handling of gateway versus link-local address for host NAT Allow nat-to-host addresses to be overridden nat, test: Test --nat-to-host option conf.c | 113 ++++++++++++++++++++++++++++++------------ dhcp.c | 14 +++--- dhcpv6.c | 4 +- ndp.c | 4 +- passt.h | 14 +++--- pasta.c | 4 +- tcp.c | 17 +++---- test/lib/setup | 19 +++++-- test/lib/test | 12 +++++ test/passt/dhcp | 7 ++- test/passt/tcp | 10 ++-- test/passt/udp | 5 +- test/passt_in_ns/dhcp | 73 +++++++++++++++++++++++++++ test/passt_in_ns/tcp | 28 +++++------ test/passt_in_ns/udp | 14 +++--- test/pasta/tcp | 11 ++-- test/pasta/udp | 6 +-- test/perf/passt_tcp | 30 ++++++----- test/perf/passt_udp | 26 +++++----- test/perf/pasta_tcp | 26 +++++----- test/perf/pasta_udp | 22 ++++---- test/run | 4 +- test/two_guests/basic | 10 ++-- udp.c | 41 ++++++--------- 24 files changed, 313 insertions(+), 201 deletions(-) create mode 100644 test/passt_in_ns/dhcp -- 2.40.1