Skip to contentSkip to conversation

doc: add MPTCP subtypes documentation to man page

PATCH In review Fernando Fernandez Mancera 2 participants 3 messages Oct 6 – Oct 7

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 doc: add MPTCP subtypes documentation to man page

In addition, document the limitation when there are multiple MPTCP options.

---
v2: added valid MPTCP situations suggested by Matthieu

---
 doc/payload-expression.txt | 41 ++++++++++++++++++++++++++++++++++++++
 1 file changed, 41 insertions(+)
doc/payload-expression.txt +41 -0
index ceccfdaa..53e92905 100644
@@ -805,6 +805,32 @@ TCP option matching also supports raw expression syntax to access arbitrary opti
 [verse]
 *tcp option* *@*'number'*,*'offset'*,*'length'
 
+.MPTCP subtypes
+[options="header"]
+|============================
+|Keyword| Description
+|mp-capable|
+Multipath capable
+|mp-join|
+Join connection
+|dss|
+Data sequence signal
+|add-addr|
+Add address
+|remove-addr|
+Remove address
+|mp-prio|
+Change subflow priority
+|mp-fail|
+Fallback to single-path TCP
+|mp-fastclose|
+Fast close
+|mp-tcprst|
+Subflow reset
+|============================
+
+Data types can be queried with 'nft describe tcp option mptcp subtype'.
+
 .IP Options
 [options="header"]
 |==================
@@ -833,6 +859,21 @@ filter input tcp option sack-perm exists counter
 filter input tcp option maxseg size lt 536
 --------------------
 
+.matching MPTCP suboptions
+--------------------
+filter input tcp option mptcp subtype mp-join drop
+--------------------
+
+[NOTE]
+====================
+Netfilter currently evaluates only the first MPTCP option found in the TCP
+header. If a packet contains multiple MPTCP options, a rule attempting to match
+the second option will never match. Having multiple MPTCP options in the same
+packet is valid, e.g the Linux MPTCP stack inserts 'remove-addr', 'mp-prio' and
+'mp-fail' after an MPTCP 'dss' option; 'mp-tcprst' can also be inserted after
+an 'mp-fastclose'.
+====================
+
 .matching IPv6 exthdr
 ---------------------
 ip6 filter input frag more-fragments 1 counter
Signature · 1 line
2.55.0
#1 lore raw
Quoted 7 lines · Fernando Fernandez Mancera

In addition, document the limitation when there are multiple MPTCP options.

---
v2: added valid MPTCP situations suggested by Matthieu
---

I have accidentally sent this to netdev mailing list too. Please ignore it, it only concerns netfilter-devel.

Sorry for the inconvenience.

Quoted 62 lines
  doc/payload-expression.txt | 41 ++++++++++++++++++++++++++++++++++++++
  1 file changed, 41 insertions(+)
doc/payload-expression.txt +41 -0
index ceccfdaa..53e92905 100644
@@ -805,6 +805,32 @@ TCP option matching also supports raw expression syntax to access arbitrary opti
  [verse]
  *tcp option* *@*'number'*,*'offset'*,*'length'
 
+.MPTCP subtypes
+[options="header"]
+|============================
+|Keyword| Description
+|mp-capable|
+Multipath capable
+|mp-join|
+Join connection
+|dss|
+Data sequence signal
+|add-addr|
+Add address
+|remove-addr|
+Remove address
+|mp-prio|
+Change subflow priority
+|mp-fail|
+Fallback to single-path TCP
+|mp-fastclose|
+Fast close
+|mp-tcprst|
+Subflow reset
+|============================
+
+Data types can be queried with 'nft describe tcp option mptcp subtype'.
+
  .IP Options
  [options="header"]
  |==================
@@ -833,6 +859,21 @@ filter input tcp option sack-perm exists counter
  filter input tcp option maxseg size lt 536
  --------------------
 
+.matching MPTCP suboptions
+--------------------
+filter input tcp option mptcp subtype mp-join drop
+--------------------
+
+[NOTE]
+====================
+Netfilter currently evaluates only the first MPTCP option found in the TCP
+header. If a packet contains multiple MPTCP options, a rule attempting to match
+the second option will never match. Having multiple MPTCP options in the same
+packet is valid, e.g the Linux MPTCP stack inserts 'remove-addr', 'mp-prio' and
+'mp-fail' after an MPTCP 'dss' option; 'mp-tcprst' can also be inserted after
+an 'mp-fastclose'.
+====================
+
  .matching IPv6 exthdr
  ---------------------
  ip6 filter input frag more-fragments 1 counter
Reviewed-by on v2 1/1
#2 lore raw
In reply to Fernando Fernandez Mancera

Hi Fernando,

Quoted 2 lines · Fernando Fernandez Mancera

In addition, document the limitation when there are multiple MPTCP options.

Thank you for the v2, it looks good to me!

Quoted 4 lines
doc/payload-expression.txt +0 -0
index ceccfdaa..53e92905 100644

(...)

Quoted 5 lines
doc/payload-expression.txt +1 -0
@@ -833,6 +859,21 @@ filter input tcp option sack-perm exists counter
 filter input tcp option maxseg size lt 536
 --------------------
 
+.matching MPTCP suboptions

doc/payload-expression.txt filter input tcp option sack-perm exists counter · line 872

Quoted 10 lines
doc/payload-expression.txt +10 -0
+--------------------
+filter input tcp option mptcp subtype mp-join drop
+--------------------
+
+[NOTE]
+====================
+Netfilter currently evaluates only the first MPTCP option found in the TCP
+header. If a packet contains multiple MPTCP options, a rule attempting to match
+the second option will never match. Having multiple MPTCP options in the same
+packet is valid, e.g the Linux MPTCP stack inserts 'remove-addr', 'mp-prio' and

(small nit: I would have added an extra '.' after 'e.g', but I don't think a v3 is needed to fix that.)

doc/payload-expression.txt filter input tcp option sack-perm exists counter · line 879

Quoted 7 lines
doc/payload-expression.txt +4 -0
+'mp-fail' after an MPTCP 'dss' option; 'mp-tcprst' can also be inserted after
+an 'mp-fastclose'.
+====================
+
 .matching IPv6 exthdr
 ---------------------
 ip6 filter input frag more-fragments 1 counter

Cheers,
Matt

Signature · 1 line
Sponsored by the NGI0 Core fund.