🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #12783

[PATCH net-next v2 4/4] selftests/net: packetdrill: add TCP MTU probing test

#12783
From: Yongjian Wang via B4 Relay
Date: Sun, 08 Nov 2026 14:39
72 lines
13075 bytes
From: Yongjian Wang <echoowall@gmail.com>

Packetization layer path MTU discovery (net.ipv4.tcp_mtu_probing=2) has
no selftest coverage.

Add a test for an active connection. Check that it starts at
tcp_base_mss, that it sends the first probe half way between
tcp_base_mss and the peer's MSS once cwnd allows it, and that an
acknowledged probe raises the MSS and leads to a larger probe.

Disable TCP timestamps since the MTU search range is computed before the
timestamp option is negotiated, which would otherwise make the MSS
depend on the header length at connect time.

Signed-off-by: Yongjian Wang <echoowall@gmail.com>
---
 .../net/packetdrill/tcp_mtu_probing_search.pkt     | 43 ++++++++++++++++++++++
 1 file changed, 43 insertions(+)

diff --git a/tools/testing/selftests/net/packetdrill/tcp_mtu_probing_search.pkt b/tools/testing/selftests/net/packetdrill/tcp_mtu_probing_search.pkt
new file mode 100644
index 000000000..65e466fbf
--- /dev/null
+++ b/tools/testing/selftests/net/packetdrill/tcp_mtu_probing_search.pkt
@@ -0,0 +1,43 @@
+// SPDX-License-Identifier: GPL-2.0
+// Test packetization layer path MTU discovery with tcp_mtu_probing=2: an
+// active connection starts at tcp_base_mss and raises its MSS by binary search
+// as probes are acknowledged.
+
+`./defaults.sh
+sysctl -q net.ipv4.tcp_mtu_probing=2
+sysctl -q net.ipv4.tcp_base_mss=1024
+sysctl -q net.ipv4.tcp_timestamps=0`
+
+    0 socket(..., SOCK_STREAM, IPPROTO_TCP) = 3
+   +0 fcntl(3, F_SETFL, O_RDWR|O_NONBLOCK) = 0
+   +0 connect(3, ..., ...) = -1 EINPROGRESS (Operation is now in progress)
+   +0 > S 0:0(0) <...>
+  +.1 < S. 0:0(0) ack 1 win 65535 <mss 1460,nop,nop,sackOK>
+   +0 > . 1:1(0) ack 1
+   +0 fcntl(3, F_SETFL, O_RDWR) = 0
+
+// The initial window is sent with tcp_base_mss. No probe yet, cwnd is below 11.
+   +0 write(3, ..., 40000) = 40000
+   +0 > P. 1:2049(2048) ack 1
+   +0 > P. 2049:4097(2048) ack 1
+   +0 > P. 4097:6145(2048) ack 1
+   +0 > P. 6145:8193(2048) ack 1
+   +0 > P. 8193:10241(2048) ack 1
+
+// The first probe is half way between tcp_base_mss and the peer's MSS.
+  +.1 < . 1:1(0) ack 10241 win 65535
+   +0 > . 10241:11483(1242) ack 1
+   +0 > P. 11483:13531(2048) ack 1
+   +0 > P. 13531:15579(2048) ack 1
+   +0 > P. 15579:17627(2048) ack 1
+   +0 > P. 17627:19675(2048) ack 1
+   +0 > P. 19675:21723(2048) ack 1
+   +0 > P. 21723:23771(2048) ack 1
+   +0 > P. 23771:25819(2048) ack 1
+   +0 > P. 25819:27867(2048) ack 1
+   +0 > P. 27867:29915(2048) ack 1
+
+// Acknowledging the probe raises the MSS, and the next probe is larger.
+  +.1 < . 1:1(0) ack 29915 win 65535
+   +0 > . 29915:31266(1351) ack 1
+   +0 > P. 31266:33750(2484) ack 1

-- 
Git-157)
Technical Details
Message-ID: <20261108-mtu-probing-series-v2-4-355d6490c3db@gmail.com>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-358779-linux-kernel-netdev=dewy.ru
References: <20261108-mtu-probing-series-v2-0-355d6490c3db@gmail.com>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-358779-linux-kernel-netdev=dewy.ru
From: devnull+echoowall.gmail.com@kernel.org (Yongjian Wang via B4 Relay)
Newsgroups: linux.kernel.netdev
Subject: [PATCH net-next v2 4/4] selftests/net: packetdrill: add TCP MTU
 probing test
Date: Sun, 08 Nov 2026 22:39:54 +0800
Organization: Usenet Network
Message-ID: <20261108-mtu-probing-series-v2-4-355d6490c3db@gmail.com>
References: <20261108-mtu-probing-series-v2-0-355d6490c3db@gmail.com>
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 7bit
Injection-Info: usenet.network;
	logging-data="143702"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:aujdRiwmX42ZO6+0wPWdIYSAzVE= sha256:U+xod9MuN6kTomyHgpf6IhthYvJTgFYBVOKi/B79FJQ=
	sha1:LOXsQa6OBgtpzUhxsFfKn3/iHXo= sha256:GgQ6+GbXA+CjDqOqPChxL5vfRZ60K6iDdyDO3VGnS3E=
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 D4B001135AF; Sun,  8 Nov 2026 17:42:58 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.5
X-Spam-Status: No, score=-3.5 tagged_above=-9999 required=6.31
	tests=[DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1,
	DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, MAILING_LIST_MULTI=-1,
	RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001,
	URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (2048-bit key)
	header.d=kernel.org
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 ycLatzZeeLFs;
	Sun,  8 Nov 2026 17:42:56 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-358779-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> 
X-Authentication-Results: OpenDMARC; dmarc=pass (p=quarantine dis=none) header.from=kernel.org
X-Received: from sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10])
	by mail.dewy.ru (Postfix) with ESMTPS id 3B9B71135AD; Sun,  8 Nov 2026 17:42:48 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92])
	by sea.lore.kernel.org (Postfix) with ESMTP id 7B24E60180; Sun,  8 Nov 2026 14:40:06 +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=3; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass;
	t=1794148801;
	b=qmtVtWVayXeZyrVlFJ5npGLKZ42SkMCPGfUsA2hxhT16tMqHtj+d6jBQUXaVI9zvFKhU
	 Ir7N3WzOzH2cPfxyL0Z0Emotm5vespJGbVVhRs5oheJN+w4TpuWf95OJZgh4DNhLwxX9Q
	 ZBPcTR2gww9WXwSz+hxF7b9658wzxKRe8BQvIuDizibLExsc3Dc7LMcmVz8VWiuP/RJP5
	 bBKh3inhyZIxg4kuvZffpyrS/88jTnEafOFemq0FOoy9LS5C3u600PgDwUh91nKw9STme
	 sJF7V+qNkoIf0B9HIOSwpzcJXs8skQ1QUMwz370zOXgbTjTkIzVEZ9cmHHbdswr0CIQ==
X-ARC-Message-Signature: i=3; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1794148801;
	h=X-Original-To:Received:Received:DKIM-Signature:Received:From:Date:
	 Subject:X-Mailing-List:List-Id:List-Post:List-Help:List-Subscribe:
	 List-Unsubscribe:List-Owner:Precedence:MIME-Version:Content-Type:
	 Message-Id:References:In-Reply-To:To:Cc:X-Mailer:
	 X-Developer-Signature:X-Developer-Key:X-Endpoint-Received:
	 X-Original-From:Reply-To:Content-Transfer-Encoding;
	bh=jpd8M4Q159pv4wav7dcjIJjGCvakvp5m27ExAjzeb2g=;
	b=SVZzaSEn1m7okM/tNwA460y9MwJzIOTD3DMQyH4mEDI1lVAnOCOlBTy2Xg+CRtzRHEqp
	 sEIdFMII/Wc36v6f6E4QNdcdKF8Gl+Zda33gjnXIyYTjIdYMUkQXt4j6EUxqzfNP3my5s
	 j5kAsw8Mgp5LN7IbUCDxRP1nRBHfVE3QfLWjFUFh07DVUOB0BhSBg+DL3aXQ9d/EJt9+X
	 f22wp5Fs0nFjQ8HQ6v4yUMNw3ixMD3crSZ4UPCN8jO0wiBgF+w5QIH1BppStLxEBUQx5Q
	 x0//mlBJqdxAb4p7nPvTqjn0/z0WlvxKrfzR01ch3z8JmhJcvKd6eI/bCCFt7pOcuFw==
X-ARC-Authentication-Results: i=3; smtp.subspace.kernel.org; 
	dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=OFOJrNTN;
	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 41C41606A334;
	Sun,  8 Nov 2026 14:40:01 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
	dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=OFOJrNTN
X-Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=100.103.45.18
X-ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass;
	t=1794148795;
	b=C4MqMflIusN5P7QN5jTTiq8ZzveF6G1Xm0dwSUTMl0xLtKaefHsbHF2ccisJxAMEdFZh
	 mtW/lGVNRikybRR7ij9BI0j5HPmBGEND726RmH4U8jX8jsAL7ERO4s+Joh/UGwEXgCZ9b
	 CH8cuyrX3MsHKXOEceVy6Lm7ees11iNj6rXiM0a0JDY5CxSP/xdTQPFCK/zv6mEkReZbf
	 eBKErK1fTmaRh9jred0XKGdtu6adCAc48OQ35+AsTF+BC+VXhLqosXQE5+Y0W0Uaz0SoV
	 xWe5PZ2J577bIXBIX18uRjQ9zuJ06u9jK1yaV7ZgxkKybuQY3jhNMbpTbO+NnbrVEvw==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1794148795;
	h=Received:DKIM-Signature:Received:From:Date:Subject:MIME-Version:
	 Content-Type:Message-Id:References:In-Reply-To:To:Cc:X-Mailer:
	 X-Developer-Signature:X-Developer-Key:X-Endpoint-Received:
	 X-Original-From:Reply-To:Content-Transfer-Encoding;
	bh=jpd8M4Q159pv4wav7dcjIJjGCvakvp5m27ExAjzeb2g=;
	b=OIrkr+m51VaA5LYo14fWDyvAHofWqtr7z/tVoTD+QwXsnRTwMpgsU743GSOQ7pjUNPOO
	 aXc1eyZHme7IO64o/H495gyg9cEioCzBY/Rz2TXalL6r4OEsKSvtQu1HKuVbUhKgACB7V
	 nKpMXkmZ8azZ24mHnIAtRhYeeoKm3nigtXM+yGWgdUYo3wE9PohG6FgcxN7qQ7THEK2Le
	 potJDpBhMI+l2stdNZjavCIPbz0oKLr4aHQzKdfaabr9TRboYD9IFIEqVqhJspV+CWYq9
	 0GR3t9KX9Gl/NwFMWh56n2K+zcdcRp1pHQ26pJmc2A8XLvvTFFDywcH2VCLvfba2NrQ==
X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; 
	dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=OFOJrNTN;
	arc=pass header.oldest-pass=0 smtp.remote-ip=100.103.45.18
X-Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange X25519 server-signature ECDSA (prime256v1))
	(No client certificate requested)
	by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1F0BC606A321;
	Sun,  8 Nov 2026 14:39:55 +0000 (UTC)
X-Authentication-Results: smtp.kernel.org; arc=none smtp.remote-ip=100.80.115.77
X-ARC-Seal: i=1; d=kernel.org; s=arc20260519; a=rsa-sha256; cv=none;
	t=1794148795;
	b=m580sTgFhFFh0i9hSCOgKpc0KQfAkGHRSq945SOhm5J/Yl0H4TQULCaRjrWvdKJFf66g
	 j+BYqND1lPYj8tEG+h4NQlv3ZGColpK7Up6CNtkUSNl5QpkRxMrIlw9URm6abkhpi0kLK
	 rUg1zM9U/otwZCOwPjPBIfITBkDb2U8mZgmHjuxtWjnqaT9Cl9QMasRNHjnzivQxRTTPc
	 yWeL689L6nu1wjGT/h7/dwbwfsOJpOm8UannIfO0HUjf4Ys421kexykvzcetczr8EuYQW
	 /T2A7BcU5BopXtGOr0PIHTx0CbTkCij2MpmJ12Wo9W0IE0tM76TUgIO3JEMzv9e9nEA==
X-ARC-Message-Signature: i=1; d=kernel.org; s=arc20260519; a=rsa-sha256;
	c=relaxed/relaxed; t=1794148795;
	h=DKIM-Signature:Received:From:Date:Subject:MIME-Version:Content-Type:
	 Message-Id:References:In-Reply-To:To:Cc:X-Mailer:
	 X-Developer-Signature:X-Developer-Key:X-Endpoint-Received:
	 X-Original-From:Reply-To:Content-Transfer-Encoding;
	bh=jpd8M4Q159pv4wav7dcjIJjGCvakvp5m27ExAjzeb2g=;
	b=pMT1mAEg8ZQUbzDor2t280I6/D/LX3TlL1peeTLuLD7gnRABH4O6aqCWXBUE0o9JJoOe
	 IOPoaET8tqj/RRi6/tcq5m/L7PtWdJ7lmaGGqeP6pwOTHn1BUxT/1irKbuU4gmVH+omTK
	 iJaX5+2NFblSHj9Z+QOvpBTFON8/qmkrVnciTW05zby+uOmKRe2W11qmr9JYJfnJLbCQV
	 qf/YNyMyph8pvMCWcqlHyN/qQANqpSLQb7NYx20aB1AGVa7BuzX1J+fqH9F5MGA9qLsWR
	 T/du7MHI1S+samLqW+ExzFy2hQ94ap11ArlHOC64HSUdMSSWIxhMMOvEUy4M2FVgUSA==
X-ARC-Authentication-Results: i=1; smtp.kernel.org; 
	arc=none smtp.remote-ip=100.80.115.77
X-Received: from lkml.kernel.org (nexus.subspace.kernel.org [100.80.115.77])
	(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.kernel.org (Postfix) with ESMTPS id 23B591F008A2;
	Sun,  8 Nov 2026 14:39:54 +0000 (UTC)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org;
	s=k20260515; t=1794148794;
	bh=jpd8M4Q159pv4wav7dcjIJjGCvakvp5m27ExAjzeb2g=;
	h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To;
	b=OFOJrNTNhAs6VV9NusNVzl5D2Ihtc+S4P9mQO/Vf1I6szshXuLbGwMXAJD5VwQhe1
	 PclramlQOE0ML4Y3HayTARbXQhHVtwrwzSvj21cr140CAr9kvD/C3v0G40nbYOcPvp
	 f5HKpgjKrn9qiwhqnYrzLh3wl0CkxzGex5KVuv1/kuo0mo9mXhavQWofhN3BSwoQId
	 Pw1kPqF4gXGe+GiZlh/5q+Dp8QUmN7TVb3vt5gC31UJ6GiB5O+QhmDv1JRwOn6JqA/
	 qfMjZ8npAuXkHwHm/CNSamR0ctWIAF9CuXfBMOYBWWtp2VHtfDdKrBphczYwZufaeZ
	 8C4S+i08q9rJQ==
X-Received: from nexus.subspace.kernel.org (localhost [IPv6:::1])
	by lkml.kernel.org (Postfix) with ESMTP id A786547FC3;
	Sun,  8 Nov 2026 14:39:53 +0000 (UTC)
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-In-Reply-To: <20261108-mtu-probing-series-v2-0-355d6490c3db@gmail.com>
X-Cc: linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org, 
 panweiping3@gmail.com, netdev@vger.kernel.org, 
 Yongjian Wang <echoowall@gmail.com>
X-Mailer: b4 0.16.0
X-Developer-Signature: v=1; a=ed25519-sha256; t=1794148792; l=2709;
 i=echoowall@gmail.com; s=20261026; h=from:subject:message-id;
 bh=6H7bHmrcx+NwgR2BDbVgQR3Zh+5FGAud6AanMriiUKs=;
 b=IF0QrQGeatzU48wsrF47IdTLRTtNbPESsNSiji6pEnMO9xs+BhemHYRsXBPLlLRKzTLxq/A5h
 QUJQ+geU4HNCmoO2RS4SjHRTLidrr4T5DuThSdH0TGSIDiO94RX0bAD
X-Developer-Key: i=echoowall@gmail.com; a=ed25519;
 pk=9XP6JhqjjPsHCF6UZZZTeqTRnXIa4+ufggnxXtTJ+no=
X-Endpoint-Received: by B4 Relay for echoowall@gmail.com/20261026 with
 auth_id=1323
X-Original-From: Yongjian Wang <echoowall@gmail.com>
X-Reply-To: echoowall@gmail.com