Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mptcp kernel updates #63713

Merged
merged 2 commits into from Jun 25, 2019
Merged

Mptcp kernel updates #63713

merged 2 commits into from Jun 25, 2019

Conversation

teto
Copy link
Member

@teto teto commented Jun 24, 2019

Motivation for this change

0.94 was updated twice and 0.95 branch was released yesterday https://github.com/multipath-tcp/mptcp/releases/tag/v0.95

I did some cleanup (added a shared structured config)

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nix-review --run "nix-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Assured whether relevant documentation is up to date
  • Fits CONTRIBUTING.md.

teto added 2 commits June 24, 2019 11:49
Also move to a pkgs/os-specific/linux/kernel/linux-mptcp-94.nix. makes
updates easier.
Added a structured config pkgs/os-specific/linux/kernel/mptcp-config.nix
that can be shared between the different kernels.
also removes 0.93, we want to maintain only the 2 latest upstream mptcp
kernels.
@teto
Copy link
Member Author

teto commented Jun 24, 2019

@layus

Copy link
Member

@layus layus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Eyeballed the code, LGTM.

@layus
Copy link
Member

layus commented Jun 24, 2019

It would be nice if we could have a simple nixos test for mptcp.

I have it mostly working, but for some reason mptcp is not detected by amiusingmptcp.de

here is my code

# mptcp.nix

{pkgs, ...}:
{
  imports = [ ./minimal.nix ];

  boot.kernelPackages = pkgs.linuxPackages_mptcp;

  environment.systemPackages = [
    pkgs.jshon
    pkgs.curl
  ];
  programs.bash.interactiveShellInit = with pkgs; ''
    amiusingmptcp() { ${curl.bin}/bin/curl 'http://amiusingmptcp.de/v1/check_connection' -qs | ${jshon}/bin/jshon -e proc -e mptcp; }
  '';

  virtualisation.qemu.networkingOptions = [
    # Replace virtio, otherwise mptcp is bypassed
    "-nic user,model=e1000"
    #"-net nic,netdev=user.0,model=virtio"
    #"-netdev user,id=user.0\${QEMU_NET_OPTS:+,$QEMU_NET_OPTS}"
  ];
}
# ./minimal.nix

{pkgs, lib, ...}:
{
  # Allow ssh
  services.openssh.enable = true;

  # Setup ssh key for root
  users.mutableUsers = false;
  users.extraUsers.root.password = "root";
  users.extraUsers.root.openssh.authorizedKeys.keyFiles = [
    ~/.ssh/id_ecdsa.pub
  ];

  #programs.zsh.enable = true;
  #users.defaultUserShell = "/var/run/current-system/sw/bin/zsh";

  # Disable X libs as this is a headless server
  environment.noXlibs = lib.mkDefault true;

  environment.systemPackages = [ pkgs.rxvt_unicode.terminfo ];

  # Define keymap for Qemu
  i18n = {
    consoleFont = "lat9w-16";
    consoleKeyMap = "be-latin1";
    defaultLocale = "en_US.UTF-8";
  };
}
nix-build ../nixpkgs/nixos -A vm -Q -I nixos-config=$PWD/mptcp.nix --show-trace

The issue is most probably with the virtualisation.qemu.networkingOptions where we need a proper interface emulation for mptcp to kick in.
If you manage to get this working, we would at least get some confidence that everything is working.

At the moment, I can affirm that your PR builds a working linux kernel :-).

@teto
Copy link
Member Author

teto commented Jun 25, 2019

oh that's great ! I've wanted to write a test for a long time but I can't get the time.
#59342 might force me to.

curling ttp://amiusingmptcp.de might not be reliable enough as proxies/middleboxes can block MPTCP. That's maybe what happens in your case ? You could check your network with tracebox (a UCL software).

@teto
Copy link
Member Author

teto commented Jun 25, 2019

to check I would be thinking of capturing MPTCP traffic with tshark (which has mptcp filter).

@teto
Copy link
Member Author

teto commented Jun 25, 2019

Merging this. Currently writing a test for nixos.

@teto teto merged commit de56d6b into NixOS:master Jun 25, 2019
@teto teto deleted the mptcp branch June 25, 2019 07:04
@layus
Copy link
Member

layus commented Jun 25, 2019

curling ttp://amiusingmptcp.de might not be reliable enough as proxies/middleboxes can block MPTCP. That's maybe what happens in your case ? You could check your network with tracebox (a UCL software).

It already dropped all mptcp headers when reaching eth0. It is most probably linked to qemu netdev emulation. I know for sure that virtio does not work (obviously) but the commands have changed since my last test years ago.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants