From: Jiayuan Chen <jiayuan.chen@linux.dev>
To: kuba@kernel.org, edumazet@google.com
Cc: mrpre@163.com, Jiayuan Chen <jiayuan.chen@linux.dev>,
"David S. Miller" <davem@davemloft.net>,
Paolo Abeni <pabeni@redhat.com>, Simon Horman <horms@kernel.org>,
Jonathan Corbet <corbet@lwn.net>,
Neal Cardwell <ncardwell@google.com>,
Kuniyuki Iwashima <kuniyu@amazon.com>,
David Ahern <dsahern@kernel.org>,
Steffen Klassert <steffen.klassert@secunet.com>,
Sabrina Dubroca <sd@queasysnail.net>,
Antony Antony <antony.antony@secunet.com>,
Christian Hopps <chopps@labn.net>,
netdev@vger.kernel.org, linux-doc@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: [PATCH net-next v4 0/2] tcp: add a new TW_PAWS drop reason
Date: Wed, 9 Apr 2025 19:26:03 +0800 [thread overview]
Message-ID: <20250409112614.16153-1-jiayuan.chen@linux.dev> (raw)
Devices in the networking path, such as firewalls, NATs, or routers, which
can perform SNAT or DNAT, use addresses from their own limited address
pools to masquerade the source address during forwarding, causing PAWS
verification to fail more easily under TW status.
Currently, packet loss statistics for PAWS can only be viewed through MIB,
which is a global metric and cannot be precisely obtained through tracing
to get the specific 4-tuple of the dropped packet. In the past, we had to
use kprobe ret to retrieve relevant skb information from
tcp_timewait_state_process().
We add a drop_reason pointer and a new counter.
---
v3 -> v4:
1. Update commit message and make it more concise.
2. Integrated Reviewed-by tag from v3.
https://lore.kernel.org/netdev/20250407140001.13886-1-jiayuan.chen@linux.dev/T/#t
v2 -> v3: Use new SNMP counter and drop reason suggested by Eric.
https://lore.kernel.org/netdev/5cdc1bdd9caee92a6ae932638a862fd5c67630e8@linux.dev/T/#t
I didn't provide a packetdrill script.
I struggled for a long time to get packetdrill to fix the client port, but
ultimately failed to do so...
Instead, I wrote my own program to trigger PAWS, which can be found at
https://github.com/mrpre/nettrigger/tree/main
'''
//assume nginx running on 172.31.75.114:9999, current host is 172.31.75.115
iptables -t filter -I OUTPUT -p tcp --sport 12345 --tcp-flags RST RST -j DROP
./nettrigger -i eth0 -s 172.31.75.115:12345 -d 172.31.75.114:9999 -action paws
'''
Jiayuan Chen (2):
tcp: add TCP_RFC7323_TW_PAWS drop reason
tcp: add LINUX_MIB_PAWS_TW_REJECTED counter
Documentation/networking/net_cachelines/snmp.rst | 2 ++
include/net/dropreason-core.h | 7 +++++++
include/net/tcp.h | 3 ++-
include/uapi/linux/snmp.h | 1 +
net/ipv4/proc.c | 1 +
net/ipv4/tcp_ipv4.c | 3 ++-
net/ipv4/tcp_minisocks.c | 9 ++++++---
net/ipv6/tcp_ipv6.c | 3 ++-
8 files changed, 23 insertions(+), 6 deletions(-)
--
2.47.1
next reply other threads:[~2025-04-09 11:27 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-04-09 11:26 Jiayuan Chen [this message]
2025-04-09 11:26 ` [PATCH net-next v4 1/2] tcp: add TCP_RFC7323_TW_PAWS drop reason Jiayuan Chen
2025-04-09 11:26 ` [PATCH net-next v4 2/2] tcp: add LINUX_MIB_PAWS_TW_REJECTED counter Jiayuan Chen
2025-04-09 15:58 ` [PATCH net-next v4 0/2] tcp: add a new TW_PAWS drop reason Eric Dumazet
2025-04-11 2:20 ` patchwork-bot+netdevbpf
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250409112614.16153-1-jiayuan.chen@linux.dev \
--to=jiayuan.chen@linux.dev \
--cc=antony.antony@secunet.com \
--cc=chopps@labn.net \
--cc=corbet@lwn.net \
--cc=davem@davemloft.net \
--cc=dsahern@kernel.org \
--cc=edumazet@google.com \
--cc=horms@kernel.org \
--cc=kuba@kernel.org \
--cc=kuniyu@amazon.com \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mrpre@163.com \
--cc=ncardwell@google.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=sd@queasysnail.net \
--cc=steffen.klassert@secunet.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox