IP-MPTCP(8)

๐Ÿ’– ip-mptcp โ€” the MPTCP path manager, explained by your bestie ๐Ÿ’–

okay so this is ip-mptcp, a page from the Linux manual, section 8. it's the ip sub-command situation for MPTCP path manager config, and honestly? it's giving networking main character energy. let's get into it ๐Ÿซถ


โœจ NAME โœจ

ip-mptcp โ€” MPTCP path manager configuration. that's it, that's the name, no notes ๐Ÿ’…


๐ŸŒธ SYNOPSIS ๐ŸŒธ

the way you invoke this, in all its forms:

ip [ OPTIONS ] mptcp { endpoint  | limits  | help  }

ip mptcp endpoint add IFADDR [ port PORT ] [ dev IFNAME ] [ id ID ] [
        FLAG-LIST ]

ip mptcp endpoint delete id ID [ IFADDR ]

ip mptcp endpoint change [ id ID ] [ IFADDR ] [ port PORT ] CHANGE-OPT

ip mptcp endpoint show [ id ID ]

ip mptcp endpoint flush

FLAG-LIST := [ FLAG-LIST ] FLAG

FLAG := [ signal | subflow | laminar | backup | fullmesh ]

CHANGE-OPT := [ backup | nobackup | fullmesh | nofullmesh ]

ip mptcp limits set [ subflow SUBFLOW_NR ] [ add_addr_accepted
        ADD_ADDR_ACCEPTED_NR ]

ip mptcp limits show

ip mptcp monitor

like, look at all those little brackets. so many optional things. it's lowkey iconic ๐ŸŒˆ


๐Ÿฆ‹ DESCRIPTION ๐Ÿฆ‹

so MPTCP is a transport protocol built on top of TCP that lets TCP connections use multiple paths to maximize resource usage and increase redundancy. basically it's TCP but with more friends. โœจ

the ip-mptcp sub-commands let you configure several aspects of the MPTCP path manager, which is the thing in charge of subflow creation. it's the group-chat admin of your connections fr fr.

๐ŸŽ€ the endpoint object ๐ŸŽ€

this one specifies the IP addresses that will be used and/or announced for additional subflows:

  • ip mptcp endpoint add โ€” add new MPTCP endpoint
  • ip mptcp endpoint delete โ€” delete existing MPTCP endpoint
  • ip mptcp endpoint show โ€” get existing MPTCP endpoint
  • ip mptcp endpoint flush โ€” flush all existing MPTCP endpoints

and now the little arguments that go with them, one by one, no skipping bestie:

  • IFADDR โ€” an IPv4 or IPv6 address. when used with the delete id operation, an IFADDR is only included when the ID is 0. that's the rule, periodt.
  • PORT โ€” when a port number is specified, incoming MPTCP subflows for already established MPTCP sockets will be accepted on the specified port, regardless the original listener port accepting the first MPTCP subflow and/or this peer being actually on the client side. this option has to be used in combination with the signal flag. so like, signal or it doesn't count ๐Ÿ’€
  • IFNAME โ€” the network interface name attached to the endpoint. it's important to specify this device name linked to the address to make sure the system knows how to route packets from the specified IP address to the correct network interface. without this, it might be required to add IP rules and routes to have the expected behavior. so basically if you skip it, you're gonna be out here hand-writing routes. your call ๐Ÿ™ˆ
  • ID โ€” a unique numeric identifier, between 0 and 255, for the given endpoint. it is not possible to add endpoints with ID 0, because this special ID is reserved for the initial subflow. for rules linked to the initial subflow, the path-manager will look at endpoints matching the same address, and port if set, ignoring the ID. 0 is booked, bestie, it's taken, move along ๐Ÿ‘‘
  • signal โ€” the endpoint will be announced/signalled to each peer via an MPTCP ADD_ADDR sub-option. typically, a server would be responsible for this. upon reception of an ADD_ADDR sub-option, the other peer, typically the client side, can try to create additional subflows, see ADD_ADDR_ACCEPTED_NR. it's the "hey everyone look at me" flag ๐Ÿ“ฃ
  • subflow โ€” if additional subflow creation is allowed by the MPTCP limits, the MPTCP path manager will try to create an additional subflow using this endpoint as the source address after the MPTCP connection is established. a client would typically do this. very "i'll start something new" of it ๐Ÿฆ‹
  • laminar โ€” the endpoint will be used to create new subflows from the associated address to additional addresses announced by the other peer. this will be done if allowed by the MPTCP limits, and if the associated address is not already being used by another subflow from the same MPTCP connection. note that the fullmesh flag takes precedence over the laminar one. without any of these two flags, the path-manager will create new subflows to additional addresses announced by the other peer by selecting the source address from the routing tables, which is harder to configure if the announced address is not known in advance. so laminar is the tidy, structured queen and routing-table guessing is the chaos option ๐Ÿ’…
  • backup โ€” if this is a subflow endpoint, the subflows created using this endpoint will have the backup flag set during the connection process. this flag instructs the remote peer to only send data on a given subflow when all non-backup subflows are unavailable. when using the default packet scheduler with a 'backup' endpoint, outgoing data from the local peer is also affected: packets will only be sent from this endpoint when all non-backup subflows are unavailable. backup = the understudy. only goes on when the lead is out ๐ŸŽญ
  • fullmesh โ€” if this is a subflow endpoint and additional subflow creation is allowed by the MPTCP limits, the MPTCP path manager will try to create an additional subflow for each known peer address, using this endpoint as the source address. this will occur after the MPTCP connection is established. if the peer did not announce any additional addresses using the MPTCP ADD_ADDR sub-option, this will behave the same as a plain subflow endpoint. when the peer does announce addresses, each received ADD_ADDR sub-option will trigger creation of an additional subflow to generate a full mesh topology. this fullmesh flag should always be used in combination with the subflow one to be useful, except for the address used by the initial subflow, where subflow is then optional. it's giving "everybody connects to everybody" and honestly? obsessed ๐ŸŒ
  • implicit โ€” in some scenarios, an MPTCP subflow can use a local address mapped by an implicit endpoint created by the in-kernel path manager. once set, the implicit flag cannot be removed, but other flags can be added to the endpoint. implicit endpoints cannot be created from user-space. so it's a permanent-marker situation, no erasing โœ๏ธ

๐Ÿ“ the limits object ๐Ÿ“

this one specifies the constraints for subflow creations:

  • ip mptcp limits show โ€” get current MPTCP subflow creation limits
  • ip mptcp limits set โ€” change the MPTCP subflow creation limits

and the two knobs inside it:

  • SUBFLOW_NR โ€” specifies the maximum number of additional subflows allowed for each MPTCP connection. additional subflows can be created due to: incoming accepted ADD_ADDR sub-option, local subflow endpoints, additional subflows started by the peer. three ways in, one cap to rule them all ๐Ÿงš
  • ADD_ADDR_ACCEPTED_NR โ€” specifies the maximum number of incoming ADD_ADDR sub-options accepted for each MPTCP connection. after receiving the specified number of ADD_ADDR sub-options, any other incoming one will be ignored for the MPTCP connection lifetime. when an ADD_ADDR sub-option is accepted and there are no local fullmesh endpoints, the MPTCP path manager will try to create a new subflow using the address in the ADD_ADDR sub-option as the destination address and a source address determined using local routing resolution. when fullmesh endpoints are available, the MPTCP path manager will try to create new subflows using each fullmesh endpoint as a source address and the peer's ADD_ADDR address as the destination. in both cases the SUBFLOW_NR limit is enforced. so many rules but it all tracks, trust ๐Ÿซถ

๐ŸŒˆ monitor ๐ŸŒˆ

monitor displays creation and deletion of MPTCP connections as well as addition or removal of remote addresses and subflows. it's the live feed, the storytime, the reality show of your connections. sit back and watch ๐Ÿ‘€


๐Ÿ’œ AUTHOR ๐Ÿ’œ

Original Manpage by Paolo Abeni <pabeni@redhat.com>


and that's the whole page bestie, no cap, every single flag accounted for ๐Ÿ’–

this little love letter comes to you from iproute2, dated 4 Apr 2020 โ€” yes the source and the date, we're giving credit where it's due, always ๐ŸŒธโœจ slay, and go configure those endpoints ๐Ÿ’…๐Ÿ‘‘