* [PATCH net-next v2 0/2] tcp: document and test MTU probing black hole fallback
@ 2026-11-18 8:10 Yongjian Wang via B4 Relay
2026-11-18 8:10 ` [PATCH net-next v2 1/2] tcp: document black hole detection for tcp_mtu_probing Yongjian Wang via B4 Relay
2026-11-18 8:10 ` [PATCH net-next v2 2/2] selftests/net: packetdrill: test tcp_mtu_probe_floor Yongjian Wang via B4 Relay
0 siblings, 2 replies; 3+ messages in thread
From: Yongjian Wang via B4 Relay @ 2026-11-18 8:10 UTC (permalink / raw)
To: corbet, edumazet, davem, kuba, shuah, pabeni
Cc: Yongjian Wang, rdunlap, linux-doc, horms, ncardwell, kuniyu,
skhan, netdev, linux-kernel, linux-kselftest
ip-sysctl.rst does not say when TCP detects a black hole with
tcp_mtu_probing=1 or how the MSS drops afterwards. Patch 1 documents
both. Patch 2 adds a packetdrill test for the part that had no
coverage: each further retransmission timeout halves the MSS, down to
tcp_mtu_probe_floor.
On x86_64 KVM, the new test passed in IPv4, IPv6 and IPv4-mapped IPv6.
Variants expecting no floor or no halving failed in all three modes.
Changes in v2:
- Spell out the 200 ms RTO, say when the time starts and when it is
checked, and give the resulting detection time (Eric, patch 1).
- Say that the MSS is only lowered, and that each further
retransmission timeout lowers it again (Eric, patch 1).
- Add a test for tcp_mtu_probe_floor (patch 2).
- Link to v1: https://lore.kernel.org/r/20261117-tcp-mtu-probing-doc-v1-v1-1-552ae04de4ef@gmail.com
Signed-off-by: Yongjian Wang <echoowall@gmail.com>
---
Yongjian Wang (2):
tcp: document black hole detection for tcp_mtu_probing
selftests/net: packetdrill: test tcp_mtu_probe_floor
Documentation/networking/ip-sysctl.rst | 21 ++++++++++++
.../tcp_mtu_probing_blackhole_floor.pkt | 37 ++++++++++++++++++++++
2 files changed, 58 insertions(+)
---
base-commit: 6ff4c5942a301675eb12e5b49d53a81e604624a1
change-id: 20261117-tcp-mtu-probing-doc-v1-351cb754fa7b
Best regards,
--
Yongjian Wang <echoowall@gmail.com>
^ permalink raw reply [flat|nested] 3+ messages in thread
* [PATCH net-next v2 1/2] tcp: document black hole detection for tcp_mtu_probing
2026-11-18 8:10 [PATCH net-next v2 0/2] tcp: document and test MTU probing black hole fallback Yongjian Wang via B4 Relay
@ 2026-11-18 8:10 ` Yongjian Wang via B4 Relay
2026-11-18 8:10 ` [PATCH net-next v2 2/2] selftests/net: packetdrill: test tcp_mtu_probe_floor Yongjian Wang via B4 Relay
1 sibling, 0 replies; 3+ messages in thread
From: Yongjian Wang via B4 Relay @ 2026-11-18 8:10 UTC (permalink / raw)
To: corbet, edumazet, davem, kuba, shuah, pabeni
Cc: Yongjian Wang, rdunlap, linux-doc, horms, ncardwell, kuniyu,
skhan, netdev, linux-kernel, linux-kselftest
From: Yongjian Wang <echoowall@gmail.com>
ip-sysctl.rst says that tcp_mtu_probing=1 enables MTU probing once an
ICMP black hole is detected, but not when that happens or what TCP
does then.
Describe both, as implemented in tcp_write_timeout() and
tcp_mtu_probing(). Also add the missing defaults of tcp_mtu_probing
and tcp_base_mss.
Signed-off-by: Yongjian Wang <echoowall@gmail.com>
Reviewed-by: Eric Dumazet <edumazet@kernel.org>
---
Documentation/networking/ip-sysctl.rst | 21 +++++++++++++++++++++
1 file changed, 21 insertions(+)
diff --git a/Documentation/networking/ip-sysctl.rst b/Documentation/networking/ip-sysctl.rst
index 0b7bfbd98a92..6ac8b3fb9aae 100644
--- a/Documentation/networking/ip-sysctl.rst
+++ b/Documentation/networking/ip-sysctl.rst
@@ -412,6 +412,8 @@ tcp_base_mss - INTEGER
Path MTU discovery (MTU probing). If MTU probing is enabled,
this is the initial MSS used by the connection.
+ Default: 1024
+
tcp_mtu_probe_floor - INTEGER
If MTU probing is enabled this caps the minimum MSS used for search_low
for the connection.
@@ -711,6 +713,25 @@ tcp_mtu_probing - INTEGER
- 1 - Disabled by default, enabled when an ICMP black hole detected
- 2 - Always enabled, use initial MSS of tcp_base_mss.
+ A black hole is detected when the retransmission timer fires after
+ the handshake and retransmissions have stayed unacknowledged for as
+ long as tcp_retries1 retransmissions would take with an RTO starting
+ at 200 ms and doubling each time, which is 3 seconds with the
+ default tcp_retries1. This time is counted from the first
+ retransmission and only checked when the timer fires, so a flow
+ with a 200 ms RTO detects the black hole at the fifth timeout,
+ about 6 seconds after the original transmission.
+
+ With value 1, the first detection enables MTU probing and lowers
+ the MSS to tcp_base_mss if it is larger. From then on, and from the
+ first detection with value 2, each further retransmission timeout
+ lowers search_low to half its MSS, keeping it at most tcp_base_mss
+ and at least tcp_mtu_probe_floor and tcp_min_snd_mss, and lowers the
+ MSS to match if it is larger. Once MTU probing is enabled, the
+ connection also probes for a larger MSS, as with value 2.
+
+ Default: 0
+
tcp_probe_interval - UNSIGNED INTEGER
Controls how often to start TCP Packetization-Layer Path MTU
Discovery reprobe. The default is reprobing every 10 minutes as
--
Git-157)
^ permalink raw reply [flat|nested] 3+ messages in thread
* [PATCH net-next v2 2/2] selftests/net: packetdrill: test tcp_mtu_probe_floor
2026-11-18 8:10 [PATCH net-next v2 0/2] tcp: document and test MTU probing black hole fallback Yongjian Wang via B4 Relay
2026-11-18 8:10 ` [PATCH net-next v2 1/2] tcp: document black hole detection for tcp_mtu_probing Yongjian Wang via B4 Relay
@ 2026-11-18 8:10 ` Yongjian Wang via B4 Relay
1 sibling, 0 replies; 3+ messages in thread
From: Yongjian Wang via B4 Relay @ 2026-11-18 8:10 UTC (permalink / raw)
To: corbet, edumazet, davem, kuba, shuah, pabeni
Cc: Yongjian Wang, rdunlap, linux-doc, horms, ncardwell, kuniyu,
skhan, netdev, linux-kernel, linux-kselftest
From: Yongjian Wang <echoowall@gmail.com>
tcp_mtu_probe_floor has no selftest coverage.
Add a test where a full-sized segment keeps timing out without any ICMP
feedback. After the first detection falls back to tcp_base_mss, check
that each further retransmission timeout halves the MSS, and that the
MSS stops at tcp_mtu_probe_floor.
Use tcp_retries1=1 and disable TLP, as in
tcp_mtu_probing_blackhole_no_tlp_retries1_is_1.pkt, so that every
retransmission comes from the RTO timer.
Signed-off-by: Yongjian Wang <echoowall@gmail.com>
---
.../tcp_mtu_probing_blackhole_floor.pkt | 37 ++++++++++++++++++++++
1 file changed, 37 insertions(+)
diff --git a/tools/testing/selftests/net/packetdrill/tcp_mtu_probing_blackhole_floor.pkt b/tools/testing/selftests/net/packetdrill/tcp_mtu_probing_blackhole_floor.pkt
new file mode 100644
index 000000000000..dd040d9beca0
--- /dev/null
+++ b/tools/testing/selftests/net/packetdrill/tcp_mtu_probing_blackhole_floor.pkt
@@ -0,0 +1,37 @@
+// SPDX-License-Identifier: GPL-2.0
+// Test that after black hole detection, each further retransmission timeout
+// halves the MSS, but not below tcp_mtu_probe_floor.
+
+`./defaults.sh
+sysctl -q net.ipv4.tcp_mtu_probing=1
+sysctl -q net.ipv4.tcp_base_mss=1024
+sysctl -q net.ipv4.tcp_mtu_probe_floor=300
+sysctl -q net.ipv4.tcp_retries1=1
+sysctl -q net.ipv4.tcp_early_retrans=0`
+
+ 0 socket(..., SOCK_STREAM, IPPROTO_TCP) = 3
+ +0 setsockopt(3, SOL_SOCKET, SO_REUSEADDR, [1], 4) = 0
+ +0 bind(3, ..., ...) = 0
+ +0 listen(3, 1) = 0
+
+ +0 < S 0:0(0) win 65535 <mss 1460,nop,nop,sackOK>
+ +0 > S. 0:0(0) ack 1 <mss 1460,nop,nop,sackOK>
+ +.1 < . 1:1(0) ack 1 win 65535
+ +0 accept(3, ..., ...) = 4
+
+ +0 write(4, ..., 1460) = 1460
+ +0 > P. 1:1461(1460) ack 1
+ +.3 > P. 1:1461(1460) ack 1
+
+// The first detection falls back to tcp_base_mss.
+ +.6 > . 1:1025(1024) ack 1
+
+// Each further timeout halves the MSS.
+ +1.2 > . 1:513(512) ack 1
+
+// Half of 512 is below tcp_mtu_probe_floor, so the floor is used.
+ +2.4 > . 1:301(300) ack 1
+
+// The MSS does not go below the floor.
+ +4.8 > . 1:301(300) ack 1
+ +.1 < . 1:1(0) ack 1461 win 65535
--
Git-157)
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2026-11-18 8:10 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-18 8:10 [PATCH net-next v2 0/2] tcp: document and test MTU probing black hole fallback Yongjian Wang via B4 Relay
2026-11-18 8:10 ` [PATCH net-next v2 1/2] tcp: document black hole detection for tcp_mtu_probing Yongjian Wang via B4 Relay
2026-11-18 8:10 ` [PATCH net-next v2 2/2] selftests/net: packetdrill: test tcp_mtu_probe_floor Yongjian Wang via B4 Relay
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®