介绍
多路径TCP或 MPTCP协议是标准的扩展传输控制协议并在中进行了描述 RFC 8684号文件它允许设备同时使用多个接口通过单个MPTCP连接发送和接收TCP数据包。MPTCP可以聚合多个接口的带宽,也可以选择延迟最低的接口。它还允许在一条路径断开时进行故障切换,并将流量无缝地重新注入其他路径。
由于MPTCP,与TCP相比,能够并行或同时使用多个路径带来了新的使用情形:
- 无缝切换:从一条路径切换到另一条路径,同时保留已建立的连接,例如,自2013年以来,苹果主要出于这个原因在智能手机上使用多路径TCP。
- 最佳网络选择:根据某些条件,如延迟、损耗、成本、带宽等,使用“最佳”可用路径。
- 网络聚合:同时使用多条路径以获得更高的吞吐量,例如结合固定网络和移动网络以更快地发送文件。
如何查看系统是否支持mptcp协议
haidong@PC$: sysctl -a | grep mptcp
sysctl: permission denied on key 'fs.protected_fifos'
sysctl: permission denied on key 'fs.protected_hardlinks'
sysctl: permission denied on key 'fs.protected_regular'
sysctl: permission denied on key 'fs.protected_symlinks'
sysctl: permission denied on key 'kernel.apparmor_display_secid_mode'
sysctl: permission denied on key 'kernel.cad_pid'
sysctl: permission denied on key 'kernel.unprivileged_userns_apparmor_policy'
sysctl: permission denied on key 'kernel.usermodehelper.bset'
sysctl: permission denied on key 'kernel.usermodehelper.inheritable'
sysctl: permission denied on key 'net.core.bpf_jit_harden'
sysctl: permission denied on key 'net.core.bpf_jit_kallsyms'
sysctl: permission denied on key 'net.core.bpf_jit_limit'
sysctl: permission denied on key 'net.ipv4.tcp_fastopen_key'
net.ipv4.tcp_available_ulp = espintcp mptcp tls
sysctl: permission denied on key 'net.ipv6.conf.all.stable_secret'
sysctl: permission denied on key 'net.ipv6.conf.default.stable_secret'
sysctl: permission denied on key 'net.ipv6.conf.enp0s31f6.stable_secret'
sysctl: permission denied on key 'net.ipv6.conf.enp1s0.stable_secret'
sysctl: permission denied on key 'net.ipv6.conf.enp3s0.stable_secret'
sysctl: permission denied on key 'net.ipv6.conf.enx207bd2489c35.stable_secret'
sysctl: permission denied on key 'net.ipv6.conf.lo.stable_secret'
sysctl: permission denied on key 'vm.mmap_rnd_bits'
sysctl: permission denied on key 'vm.mmap_rnd_compat_bits'
net.mptcp.add_addr_timeout = 120
net.mptcp.allow_join_initial_addr_port = 1
net.mptcp.checksum_enabled = 0
net.mptcp.enabled = 1
net.mptcp.stale_loss_cnt = 4
sysctl: permission denied on key 'vm.stat_refresh'
参考:
MPTCP | Multipath TCP for Linux
https://juejin.cn/post/7406891999376343066
内核配置
https://juejin.cn/post/7407627016675852323?from=search-suggest
测试
https://juejin.cn/post/7406891999376343066?from=search-suggest