Skip to content

mptcpd: init at 0.13#355928

Merged
teto merged 2 commits intoNixOS:masterfrom
nim65s:mptcpd
Jan 6, 2025
Merged

mptcpd: init at 0.13#355928
teto merged 2 commits intoNixOS:masterfrom
nim65s:mptcpd

Conversation

@nim65s
Copy link
Contributor

@nim65s nim65s commented Nov 14, 2024

Hi,

This add https://github.com/multipath-tcp/mptcpd

And take some inspiration from @teto in https://github.com/teto/mptcp-flake/blob/main/pkgs/mptcpd/default.nix

Things done

  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandboxing enabled in nix.conf? (See Nix manual)
    • sandbox = relaxed
    • sandbox = true
  • Tested, as applicable:
  • Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
  • Tested basic functionality of all binary files (usually in ./result/bin/)
  • 24.11 Release Notes (or backporting 23.11 and 24.05 Release notes)
    • (Package updates) Added a release notes entry if the change is major or breaking
    • (Module updates) Added a release notes entry if the change is significant
    • (Module addition) Added a release notes entry if adding a new NixOS module
  • Fits CONTRIBUTING.md.

Add a 👍 reaction to pull requests you find important.

@mweinelt
Copy link
Member

And the module please!

@github-actions github-actions bot added 6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS 8.has: module (update) This PR changes an existing module in `nixos/` labels Nov 14, 2024
@nim65s
Copy link
Contributor Author

nim65s commented Nov 14, 2024

Thanks for the review !
I added the requested changes

@nim65s nim65s force-pushed the mptcpd branch 2 times, most recently from 7a30da0 to 6951940 Compare November 14, 2024 17:51
@mweinelt
Copy link
Member

The module needs to go into a separate commit named "nixos/mptcpd: init".

Co-authored-by: Martin Weinelt <131599+mweinelt@users.noreply.github.com>
@nim65s
Copy link
Contributor Author

nim65s commented Nov 14, 2024

ok, done.
Thanks !

Co-authored-by: Martin Weinelt <mweinelt@users.noreply.github.com>
@h7x4 h7x4 added the 8.has: module (new) This PR adds a module in `nixos/` label Nov 15, 2024
@mweinelt
Copy link
Member

@matttbe
Copy link

matttbe commented Nov 15, 2024

https://github.com/teto/mptcp-flake/blob/main/modules/mptcp/default.nix

@mweinelt Please note that this old nix module was designed for an old out-of-tree kernel supporting a different implementation of MPTCP than the one that is now in the upstream kernel. See this line:

Default mptcp kernel to use. For now the module works only with the out-of-tree module.

Most (all?) of the option and sysctl names I see there are for the previous out-of-tree, which are not needed. The routing modifications should not be needed as well.

@nim65s
Copy link
Contributor Author

nim65s commented Nov 15, 2024

I probably won't be able to work on this until Sunday, but feel free to push here if you need @mweinelt

@teto
Copy link
Member

teto commented Nov 15, 2024

I confirm @matttbe's remark. I think we could merge mptcpd and see for the module later. Testing it might need some work (I have never tested mptcpd in a multihomed setting). Ideally we would have a nixosTest for it but this means someone is using it and motivated enough to write and maintain it. @nim65s ar you going to use the module ?

@nim65s
Copy link
Contributor Author

nim65s commented Nov 15, 2024

I wanted to try mptcp on top of multiple vpn (zerotier / tailscale / maybe mycelium), yes, but I have no idea where I'm going, so maybe this is foolish / useless.

@ofborg ofborg bot added 8.has: package (new) This PR adds a new package 11.by: package-maintainer This PR was created by a maintainer of all the package it changes. 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux. labels Nov 15, 2024
@matttbe
Copy link

matttbe commented Dec 5, 2024

Hello,
It looks like most of the work has been done here (thanks for that and the reviews!), but I'm not sure what's missing to get this merged. Any help needed from "upstream"?

@mweinelt
Copy link
Member

mweinelt commented Dec 5, 2024

I'll defer to @teto and @nim65s.

@matttbe
Copy link

matttbe commented Jan 6, 2025

Hello,

@nim65s @teto : do you think the new module could be added later? It doesn't seem mandatory, right?

In this case, maybe this PR can be merged as it is, no? :)

@nim65s
Copy link
Contributor Author

nim65s commented Jan 6, 2025

From my point of view this can be merged as it. I did not test it yet, but this looks simple enough, and we can always improve it later if needed

@teto
Copy link
Member

teto commented Jan 6, 2025

I had planned to test it during holidays and completely forgot about it sry.
I built "mptcpd" but the bin/ folder doesn't contain mptcpd (the main program), just mptcpize (that I tried to run on a curl call without success, but maybe I used it wrong).
mptcpd allows to select a path management (how to create TCP subflows) via a plugin system so it would be nice to have at least one of them (I found 2 in the plugins folder anyway).
https://manpages.debian.org/testing/mptcpd/mptcpd.8.en.html

@matttbe
Copy link

matttbe commented Jan 6, 2025

@teto: thank you for having checked this!

I built "mptcpd" but the bin/ folder doesn't contain mptcpd (the main program)

By default, it should be in <prefix>/libexec. But I don't know how libexecdir is configured on NixOS.

just mptcpize (that I tried to run on a curl call without success, but maybe I used it wrong).

If the kernel supports MPTCP, libmptcpwrap.so.0.0.1 is installed at the right location (typically under <prefix>/lib/mptcpize/), and there are no middleboxes on the way explicitly blocking MPTCP, this command should tell you if MPTCP is supported or not:

mptcpize run curl https://check.mptcp.dev/ 

Note that it would be great to have the possibility to install only mptcpize, and not mptcpd (or not to start the service). Some people might not need mptcpd, e.g. if NM >= 1.40 is used, see here.

mptcpd allows to select a path management (how to create TCP subflows) via a plugin system so it would be nice to have at least one of them (I found 2 in the plugins folder anyway). https://manpages.debian.org/testing/mptcpd/mptcpd.8.en.html

Indeed, addr_adv.so and sspi.so should be built somewhere, typically installed in <prefix>/lib/mptcpd/

@teto
Copy link
Member

teto commented Jan 6, 2025

ok my bad it lives in result/libexec/mptcpd indeed. Is libexec something standard I should know of ?
mptcpize run curl https://check.mptcp.dev/ worked as well. Let's merge. We can make mptcpd optional the day someone requires it but let's not preemptively optimize. Ty for the work.

@teto teto merged commit 55c0a30 into NixOS:master Jan 6, 2025
@matttbe
Copy link

matttbe commented Jan 7, 2025

ok my bad it lives in result/libexec/mptcpd indeed. Is libexec something standard I should know of ?

Yes, it is standard:

The directory for installing executable programs to be run by other programs rather than by users.

According to: https://www.gnu.org/prep/standards/html_node/Directory-Variables.html

mptcpize run curl https://check.mptcp.dev/ worked as well. Let's merge. We can make mptcpd optional the day someone requires it but let's not preemptively optimize. Ty for the work.

Great, thank you for having merged this!

@teto
Copy link
Member

teto commented Jan 7, 2025

interesting because this was a point of discussion for LSP servers as well huggingface/llm.nvim#64 (comment). I need to read more on it, as it looks quite brittle to me but this is not the place. Thanks for your effort on MPTCP

@nim65s nim65s deleted the mptcpd branch May 9, 2025 08:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS 8.has: module (new) This PR adds a module in `nixos/` 8.has: module (update) This PR changes an existing module in `nixos/` 8.has: package (new) This PR adds a new package 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux. 11.by: package-maintainer This PR was created by a maintainer of all the package it changes.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants