{"id":5040,"date":"2021-02-08T17:40:52","date_gmt":"2021-02-08T08:40:52","guid":{"rendered":"https:\/\/blog.bitmeister.jp\/?p=5040"},"modified":"2021-02-08T17:40:52","modified_gmt":"2021-02-08T08:40:52","slug":"%e3%82%a2%e3%83%83%e3%83%97%e3%82%b9%e3%83%88%e3%83%aa%e3%83%bc%e3%83%a0%e7%89%88%e3%81%aemptcp%e3%82%92%e8%a9%a6%e3%81%97%e3%81%a6%e3%81%bf%e3%81%9f","status":"publish","type":"post","link":"https:\/\/blog.bitmeister.jp\/?p=5040","title":{"rendered":"\u30a2\u30c3\u30d7\u30b9\u30c8\u30ea\u30fc\u30e0\u7248\u306eMPTCP\u3092\u8a66\u3057\u3066\u307f\u305f"},"content":{"rendered":"<p>\u5f93\u6765\u3001Linux\u3067MPTCP\u3092\u5229\u7528\u3059\u308b\u5834\u5408\u300c<a href=\"http:\/\/multipath-tcp.org\/\">Linux Kernel MultiPath TCP project<\/a>\u300d\u304c\u516c\u958b\u3057\u3066\u3044\u308bLinux\u30ab\u30fc\u30cd\u30eb\u3092\u4f7f\u3046\u5fc5\u8981\u304c\u3042\u308a\u307e\u3057\u305f\u304c\u3001\u30a2\u30c3\u30d7\u30b9\u30c8\u30ea\u30fc\u30e0\u306eLinux\u30ab\u30fc\u30cd\u30eb 5.6\u4ee5\u964d\u3067MPTCP\u304c\u5229\u7528\u53ef\u80fd\u306b\u306a\u308a\u307e\u3057\u305f\u3002<\/p>\n<p>\u73fe\u5728\u3001MPTCP\u306e\u4ed5\u69d8\u306f\u300c<a href=\"https:\/\/tools.ietf.org\/html\/rfc6824\">RFC6824<\/a>\u300d\u3067\u898f\u5b9a\u3055\u308c\u305f&#8221;MPTCP v0&#8243;\u3068\u300c<a href=\"https:\/\/tools.ietf.org\/html\/rfc8684\">RFC8684<\/a>\u300d\u3067\u898f\u5b9a\u3055\u308c\u305f&#8221;MPTCP v1&#8243;\u306e2\u3064\u306e\u30d0\u30fc\u30b8\u30e7\u30f3\u304c\u5b58\u5728\u3057\u307e\u3059\u3002\u5f93\u6765\u7248\u306f&#8221;MPTCP v0&#8243;\u306b\u306e\u307f\u3001\u30a2\u30c3\u30d7\u30b9\u30c8\u30ea\u30fc\u30e0\u7248\u306f&#8221;MPTCP v1&#8243;\u306e\u307f\u306b\u5bfe\u5fdc\u3057\u3066\u304a\u308a\u3001&#8221;MPTCP v1&#8243;\u306f\u5f8c\u65b9\u4e92\u63db\u6027\u3092\u6301\u305f\u306a\u3044\u306e\u3067\u3001\u73fe\u6642\u70b9\u3067\u306f\u5f93\u6765\u7248\u3068\u30a2\u30c3\u30d7\u30b9\u30c8\u30ea\u30fc\u30e0\u7248\u3067MPTCP\u901a\u4fe1\u3092\u884c\u3046\u3053\u3068\u304c\u3067\u304d\u307e\u305b\u3093\u3002<\/p>\n<p>\u5f93\u6765\u7248\u304a\u3088\u3073&#8221;MPTCP v0&#8243;\u306b\u3064\u3044\u3066\u306f\u3001\u672c\u30d6\u30ed\u30b0\u3067\u3082\u904e\u53bb\u306b\u4ee5\u4e0b\u306e\u6295\u7a3f\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n<ul>\n<li>\u300c<a href=\"https:\/\/blog.bitmeister.jp\/?p=4340\">Multipath TCP(MPTCP)<\/a>\u300d<\/li>\n<li>\u300c<a href=\"https:\/\/blog.bitmeister.jp\/?p=4348\">MPTCP\u306e\u30d1\u30b1\u30c3\u30c8\u3092\u773a\u3081\u3066\u307f\u308b(\u305d\u306e1)<\/a>\u300d<\/li>\n<li>\u300c<a href=\"https:\/\/blog.bitmeister.jp\/?p=4358\">MPTCP\u306e\u30d1\u30b1\u30c3\u30c8\u3092\u773a\u3081\u3066\u307f\u308b(\u305d\u306e2)<\/a>\u300d<\/li>\n<\/ul>\n<p>\u4eca\u56de\u306f\u3001Ubuntu\u3067\u30a2\u30c3\u30d7\u30b9\u30c8\u30ea\u30fc\u30e0\u7248\u3092\u4f7f\u3063\u305f\u8907\u6570\u30b5\u30d6\u30d5\u30ed\u30fc\u3067\u306eMPTCP\u901a\u4fe1\u3092\u8a66\u3057\u3066\u307f\u307e\u3057\u305f\u3002<br \/>\n&nbsp;<br \/>\n&nbsp;<\/p>\n<p><!--more--><\/p>\n<h1>\u53c2\u8003\u30b5\u30a4\u30c8<\/h1>\n<p>\u4eca\u56de\u3001\u53c2\u8003\u306b\u3057\u305f\u30b5\u30a4\u30c8\u306f\u6b21\u306e\u901a\u308a\u3067\u3059\u3002<\/p>\n<li>\u300c<a href=\"https:\/\/github.com\/multipath-tcp\/mptcp_net-next\/wiki\">Linux MPTCP Upstream Project<\/a>\u300d<\/li>\n<li>\u300c<a href=\"https:\/\/netdevconf.info\/0x14\/pub\/slides\/59\/mptcp-netdev0x14-final.pdf\">Using Upstream MPTCP Linux Systems<\/a>\u300d<\/li>\n<li>\u300c<a href=\"https:\/\/developers.redhat.com\/blog\/2020\/08\/19\/multipath-tcp-on-red-hat-enterprise-linux-8-3-from-0-to-1-subflows\/\">Multipath TCP on Red Hat Enterprise Linux 8.3: From 0 to 1 subflows<\/a>\u300d<\/li>\n<li>\u300c<a href=\"https:\/\/access.redhat.com\/documentation\/en-us\/red_hat_enterprise_linux\/8\/html\/configuring_and_managing_networking\/getting-started-with-multipath-tcp_configuring-and-managing-networking\">CHAPTER 25. GETTING STARTED WITH MULTIPATH TCP<\/a>\u300d<\/li>\n<p>&nbsp;<br \/>\n&nbsp;<\/p>\n<h1>\u74b0\u5883\u69cb\u7bc9<\/h1>\n<p>VirtualBox\u3092\u4f7f\u3063\u3066\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u69cb\u6210\u3092\u4f5c\u6210\u3057\u307e\u3057\u305f\u3002<\/p>\n<p><a href=\"https:\/\/blog.bitmeister.jp\/wp-content\/uploads\/2021\/02\/0d40a5e4a645fc6b96e767d64ac0878e.png\" data-rel=\"lightbox-image-0\" data-rl_title=\"\" data-rl_caption=\"\" title=\"\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/blog.bitmeister.jp\/wp-content\/uploads\/2021\/02\/0d40a5e4a645fc6b96e767d64ac0878e-300x67.png\" alt=\"\" width=\"300\" height=\"67\" class=\"alignnone size-medium wp-image-5058\" srcset=\"https:\/\/blog.bitmeister.jp\/wp-content\/uploads\/2021\/02\/0d40a5e4a645fc6b96e767d64ac0878e-300x67.png 300w, https:\/\/blog.bitmeister.jp\/wp-content\/uploads\/2021\/02\/0d40a5e4a645fc6b96e767d64ac0878e.png 681w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<li>&#8220;Client&#8221;\u3068&#8221;Server&#8221;\u306f\u30a2\u30c3\u30d7\u30b9\u30c8\u30ea\u30fc\u30e0\u7248\u306eMPTCP\u5bfe\u5fdc\u30ab\u30fc\u30cd\u30eb\u3092\u5c0e\u5165\u3057\u305f\u65b0\u898fVM\u3092\u4f5c\u6210<\/li>\n<li>&#8220;Router&#8221;\u306fMPTCP\u672a\u5bfe\u5fdc\u30ab\u30fc\u30cd\u30eb\u306e\u65e2\u8a2dVM\u3092\u5229\u7528<\/li>\n<li>&#8220;Client&#8221;\u306f\u8907\u6570\u30b5\u30d6\u30d5\u30ed\u30fc\u3092\u8a66\u3057\u305f\u3044\u306e\u3067\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u30a4\u30f3\u30bf\u30d5\u30a7\u30fc\u30b9\u30922\u3064\u7528\u610f<\/li>\n<p>&nbsp;<br \/>\n&nbsp;<\/p>\n<h2>\u65b0\u898fVM\u4f5c\u6210<\/h2>\n<h3>OS\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb<\/h3>\n<p>\u4eca\u56de\u306f\u6b21\u306e\u7406\u7531\u304b\u3089\u300cUbuntu Server 21.04 (Hirsute Hippo) Daily Build\u300d\u3068\u3057\u307e\u3057\u305f\u3002<\/p>\n<li>\u8907\u6570\u30b5\u30d6\u30d5\u30ed\u30fc\u3067\u306e\u540c\u6642\u9001\u4fe1\u306fLinux\u30ab\u30fc\u30cd\u30eb 5.10\u4ee5\u964d<\/li>\n<li>\u5f8c\u8ff0\u306e\u300cSystemTap\u300d\u306b\u30ab\u30fc\u30cd\u30eb\u30c7\u30d0\u30c3\u30b0\u60c5\u5831\u304c\u5fc5\u8981<\/li>\n<p>&nbsp;<\/p>\n<p>\u6ce8\u610f\u70b9\u3068\u3057\u3066\u3001\u30ab\u30fc\u30cd\u30eb\u30c7\u30d0\u30c3\u30b0\u60c5\u5831\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u306b7GB\u7a0b\u5ea6\u3068\u3089\u308c\u308b\u306e\u3067<u>VM\u306e\u4eee\u60f3\u30cf\u30fc\u30c9\u30c7\u30a3\u30b9\u30af\u5bb9\u91cf\u3092\u30c7\u30d5\u30a9\u30eb\u30c8\u306e10GB\u304b\u3089\u6700\u4f4e\u3067\u308215GB\u306b\u5909\u66f4<\/u>\u3057\u3066\u304a\u304f\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002<br \/>\n&nbsp;<\/p>\n<h3>\u30ab\u30fc\u30cd\u30eb\u66f4\u65b0<\/h3>\n<p>\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u5b8c\u4e86\u6642\u70b9\u3067Linux\u30ab\u30fc\u30cd\u30eb\u306f5.8\u3067\u3042\u308a\u3001MPTCP\u901a\u4fe1\u81ea\u4f53\u306f\u53ef\u80fd\u3067\u3059\u304c<u>\u8907\u6570\u30b5\u30d6\u30d5\u30ed\u30fc\u3067\u9001\u4fe1\u3092\u884c\u3046\u306b\u306f5.10\u4ee5\u964d\u306b\u66f4\u65b0<\/u>\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002<br \/>\n&nbsp;<\/p>\n<ul>\n<li>\u300c<code>\/etc\/apt\/sources.list<\/code>\u300d\u306b\u4ee5\u4e0b\u3092\u8ffd\u8a18\u3057\u307e\u3059\u3002\n<pre><code>deb http:\/\/archive.ubuntu.com\/ubuntu hirsute-proposed main restricted universe multiverse\r\n<\/code><\/pre>\n<\/li>\n<\/ul>\n<ul>\n<li>\u30ab\u30fc\u30cd\u30eb\u30925.10\u306b\u66f4\u65b0\u3057\u307e\u3059\u3002\n<pre><code class=\"language-shell\" lang=\"shell\">$ sudo apt update\r\n$ sudo apt install linux-headers-5.10.0-14-generic linux-image-5.10.0-14-generic\r\n$ sudo reboot\r\n\r\n$ uname -a\r\nLinux mps 5.10.0-14-generic #15-Ubuntu SMP Fri Jan 29 15:10:03 UTC 2021 x86_64 x86_64 x86_64 GNU\/Linux\r\n$ cat \/proc\/sys\/net\/mptcp\/enabled \r\n1\r\n<\/code><\/pre>\n<p>\u306a\u304a\u3001\u30c7\u30d5\u30a9\u30eb\u30c8\u3067MPTCP\u306f\u6709\u52b9\u306b\u306a\u3063\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>&nbsp;<\/li>\n<\/ul>\n<h3>SystemTap\u5c0e\u5165<\/h3>\n<p>\u3053\u306e\u307e\u307eMPTCP\u901a\u4fe1\u3092\u8a66\u3059\u3053\u3068\u3082\u3067\u304d\u308b\u306e\u3067\u3059\u304c\u3001\u30a2\u30c3\u30d7\u30b9\u30c8\u30ea\u30fc\u30e0\u7248\u3067MPTCP\u901a\u4fe1\u3092\u884c\u3046\u306b\u306f\u3001\u5f93\u6765\u7248\u3068\u9055\u3044\u6b21\u306e\u3088\u3046\u306b\u30bd\u30b1\u30c3\u30c8\u751f\u6210\u6642\u306b\u300c<code>IPPROTO_MPTCP<\/code>\u300d\u3092\u6307\u5b9a\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n<pre><code class=\"language-c\" lang=\"c\">fd = socket(AF_INET, SOCK_STREAM, IPPROTO_MPTCP);\r\n<\/code><\/pre>\n<p>\u4eca\u56de\u306fRedhat\u306e\u8a18\u4e8b\u3092\u53c2\u8003\u306b\u300c<a href=\"https:\/\/www.sourceware.org\/systemtap\/\">SystemTap<\/a>\u300d\u3092\u4f7f\u3063\u305f\u65e2\u5b58\u30a2\u30d7\u30ea\u3092MPTCP\u901a\u4fe1\u306b\u5bfe\u5fdc\u3055\u305b\u3066\u307f\u307e\u3059\u3002<\/p>\n<p>&nbsp;<\/p>\n<ul>\n<li>Systemtap\u306e\u5b9f\u884c\u306b\u30ab\u30fc\u30cd\u30eb\u30c7\u30d0\u30c3\u30b0\u60c5\u5831\u304c\u5fc5\u8981\u306a\u306e\u3067\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u307e\u3059\u3002\n<pre><code class=\"language-shell\" lang=\"shell\">$ sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys C8CAB6595FDFF622\r\n$ codename=$(lsb_release -c | awk  '{print $2}')\r\n$ sudo tee \/etc\/apt\/sources.list.d\/ddebs.list &lt;&lt; EOF\r\ndeb http:\/\/ddebs.ubuntu.com\/ ${codename}      main restricted universe multiverse\r\ndeb http:\/\/ddebs.ubuntu.com\/ ${codename}-security main restricted universe multiverse\r\ndeb http:\/\/ddebs.ubuntu.com\/ ${codename}-updates  main restricted universe multiverse\r\ndeb http:\/\/ddebs.ubuntu.com\/ ${codename}-proposed main restricted universe multiverse\r\nEOF\r\n$ sudo apt-get update\r\n$ sudo apt-get install linux-image-$(uname -r)-dbgsym\r\n<\/code><\/pre>\n<\/li>\n<li>Systemtap\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\n<pre><code class=\"language-shell\" lang=\"shell\">$ sudo apt install build-essential\r\n$ sudo apt install systemtap\r\n<\/code><\/pre>\n<ul>\n<li>Systemtap\u5b9f\u884c\u6642\u306bgcc\u304c\u4f7f\u308f\u308c\u308b\u306e\u3067build-essential\u3092\u5165\u308c\u3066\u307e\u3059\u3002<\/li>\n<\/ul>\n<\/li>\n<li>\u30b9\u30af\u30ea\u30d7\u30c8\u300cmptcp.stap\u300d\u3092\u4f5c\u6210\n<pre><code>#! \/usr\/bin\/env stap\r\n\r\n%{\r\n#include &lt;linux\/in.h&gt;\r\n#include &lt;linux\/ip.h&gt;\r\n%}\r\n\r\nfunction mptcpify () %{\r\n    if (CONTEXT-&gt;kregs-&gt;si == SOCK_STREAM &amp;&amp;\r\n        (CONTEXT-&gt;kregs-&gt;dx == IPPROTO_TCP ||\r\n         CONTEXT-&gt;kregs-&gt;dx == 0)) {\r\n                CONTEXT-&gt;kregs-&gt;dx = IPPROTO_MPTCP;\r\n                STAP_RETVALUE = 1;\r\n    } else {\r\n           STAP_RETVALUE = 0;\r\n    }\r\n%}\r\n\r\nprobe kernel.function(\"__sys_socket\") {\r\n        if (mptcpify() == 1) {\r\n                printf(\"command %16s mptcpified\\n\", execname());\r\n        }\r\n}\r\n<\/code><\/pre>\n<ul>\n<li>\u672c\u30b9\u30af\u30ea\u30d7\u30c8\u3092\u5b9f\u884c\u3059\u308b\u3053\u3068\u3067\u3001socket()\u30b3\u30fc\u30eb\u6642\u306b<code>IPPROTO_TCP<\/code>\u3092<code>IPPROTO_MPTCP<\/code>\u306b\u5165\u308c\u66ff\u3048\u307e\u3059\u3002<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<h3>tcpdump\u66f4\u65b0<\/h3>\n<p>\u5fc5\u9808\u3067\u306f\u3042\u308a\u307e\u305b\u3093\u304c\u3001OS\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3067\u542b\u307e\u308c\u308b\u300c<a href=\"https:\/\/www.tcpdump.org\/\">tcpdump<\/a>\u300d\u306fMPTCP v1\u306b\u672a\u5bfe\u5fdc\u306a\u306e\u3067\u5bfe\u5fdc\u3057\u3066\u3044\u308b\u6700\u65b0\u7248\u306b\u66f4\u65b0\u3057\u307e\u3059\u3002<\/p>\n<ul>\n<li>\u6700\u65b0\u7248\u30bd\u30fc\u30b9\u3092\u30d3\u30eb\u30c9\u3057\u3066\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\n<pre><code class=\"language-shell\" lang=\"shell\">$ sudo apt install libpcap-dev\r\n$ wget https:\/\/www.tcpdump.org\/release\/tcpdump-4.99.0.tar.gz\r\n$ tar xf tcpdump-4.99.0.tar.gz\r\n$ cd tcpdump-4.99.0\/\r\n$ .\/configure\r\n$ make\r\n$ sudo make install\r\n$ sudo tcpdump --version\r\ntcpdump version 4.99.0\r\nlibpcap version 1.9.1 (with TPACKET_V3)\r\n<\/code><\/pre>\n<\/li>\n<\/ul>\n<h3>\u901a\u4fe1\u30a2\u30d7\u30ea\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb<\/h3>\n<p>Redhat\u306e\u8a18\u4e8b\u306b\u5023\u3044\u300cncat\u300d\u3001\u305d\u3057\u3066\u8907\u6570\u30b5\u30d6\u30d5\u30ed\u30fc\u9001\u4fe1\u306e\u78ba\u8a8d\u7528\u306b\u300ciperf\u300d\u3092\u5c0e\u5165\u3057\u307e\u3059\u3002<\/p>\n<pre><code class=\"language-shell\" lang=\"shell\">$ sudo apt install ncat iperf\r\n<\/code><\/pre>\n<p>&nbsp;<\/p>\n<p>\u3053\u3053\u307e\u3067\u3067MPTCP\u901a\u4fe1\u306b\u5fc5\u8981\u306a\u4e00\u5f0f\u3092VM\u306b\u5c0e\u5165\u3067\u304d\u307e\u3057\u305f\u3002\u3053\u306eVM\u30a4\u30e1\u30fc\u30b8\u3092\u30af\u30ed\u30fc\u30f3\u3057\u3066&#8221;Client&#8221;\u3068&#8221;Server&#8221;\u3068\u3057\u307e\u3059\u3002<\/p>\n<p>&nbsp;<\/p>\n<h1>\u52d5\u4f5c\u78ba\u8a8d<\/h1>\n<p>\u3055\u3066\u3001\u305d\u308c\u3067\u306f\u201dClient&#8221;\u3068&#8221;Server&#8221;\u3067\u901a\u4fe1\u3055\u305b\u3066\u307f\u307e\u3057\u3087\u3046\u3002<\/p>\n<h2>\u5358\u4e00\u30b5\u30d6\u30d5\u30ed\u30fc<\/h2>\n<p>\u307e\u305a\u306fRedhat\u306e\u8a18\u4e8b\u306e\u624b\u9806\u306b\u5f93\u3063\u3066\u3001\u5358\u4e00\u30b5\u30d6\u30d5\u30ed\u30fc\u3092\u8a66\u3057\u3066\u307f\u307e\u3059\u3002<\/p>\n<p>&nbsp;<\/p>\n<h3>Server<\/h3>\n<ul>\n<li>\u4e88\u3081SystemTap\u3067\u300cmptcp.stap\u300d\u3092\u5b9f\u884c\u3057\u3066\u304a\u304d\u307e\u3059\u3002\n<pre><code class=\"language-shell\" lang=\"shell\">$ sudo stap -vg mptcp.stap \r\nPass 1: parsed user script and 480 library scripts using 115216virt\/101484res\/7724shr\/93660data kb, in 300usr\/10sys\/314real ms.\r\nPass 2: analyzed script: 1 probe, 2 functions, 1 embed, 0 globals using 185872virt\/172964res\/8824shr\/164316data kb, in 1300usr\/100sys\/1388real ms.\r\nPass 3: using cached \/root\/.systemtap\/cache\/7e\/stap_7e56f03f2ab5129c2608bd38944e60b3_1608.c\r\nPass 4: using cached \/root\/.systemtap\/cache\/7e\/stap_7e56f03f2ab5129c2608bd38944e60b3_1608.ko\r\nPass 5: starting run.\r\n<\/code><\/pre>\n<\/li>\n<\/ul>\n<ul>\n<li>\u6b21\u306bncat\u3092\u30b5\u30fc\u30d0\u3068\u3057\u3066\u8d77\u52d5\u3057\u307e\u3059\u3002\n<pre><code class=\"language-shell\" lang=\"shell\">$ ncat -4lk 4321\r\n<\/code><\/pre>\n<\/li>\n<\/ul>\n<ul>\n<li>SystemTap\u3092\u5b9f\u884c\u3057\u305f\u30b3\u30f3\u30bd\u30fc\u30eb\u4e0a\u306b\u4ee5\u4e0b\u306e\u51fa\u529b\u304c\u8ffd\u52a0\u3055\u308c\u307e\u3059\u3002\n<pre><code class=\"language-shell\" lang=\"shell\">command             ncat mptcpified\r\n<\/code><\/pre>\n<p>&nbsp;<\/li>\n<\/ul>\n<h3>Client<\/h3>\n<ul>\n<li>Server\u540c\u69d8\u306b\u4e88\u3081SystemTap\u3067\u300cmptcp.stap\u300d\u3092\u5b9f\u884c\u3057\u3066\u304a\u304d\u307e\u3059\u3002\n<pre><code>$ sudo stap -vg mptcp.stap \r\nPass 1: parsed user script and 480 library scripts using 115220virt\/101760res\/8000shr\/93664data kb, in 290usr\/20sys\/313real ms.\r\nPass 2: analyzed script: 1 probe, 2 functions, 1 embed, 0 globals using 185876virt\/173188res\/9052shr\/164320data kb, in 1270usr\/90sys\/1359real ms.\r\nPass 3: using cached \/root\/.systemtap\/cache\/7e\/stap_7e56f03f2ab5129c2608bd38944e60b3_1608.c\r\nPass 4: using cached \/root\/.systemtap\/cache\/7e\/stap_7e56f03f2ab5129c2608bd38944e60b3_1608.ko\r\nPass 5: starting run.\r\n<\/code><\/pre>\n<\/li>\n<\/ul>\n<ul>\n<li>\u5b9f\u969b\u306bMPTCP\u901a\u4fe1\u3057\u3066\u3044\u308b\u304b\u306e\u78ba\u8a8d\u7528\u306btcpdump\u3092\u5b9f\u884c\u3057\u307e\u3059\u3002\n<pre><code class=\"language-shell\" lang=\"shell\">$ sudo tcpdump -i any port 4321 -n -nn\r\ntcpdump: data link type LINUX_SLL2\r\ntcpdump: verbose output suppressed, use -v[v]... for full protocol decode\r\nlistening on any, link-type LINUX_SLL2 (Linux cooked v2), snapshot length 262144 bytes\r\n\r\n<\/code><\/pre>\n<\/li>\n<li>\u6b21\u306bncat\u3092\u30af\u30e9\u30a4\u30a2\u30f3\u30c8\u3068\u3057\u3066\u8d77\u52d5\u3057\u307e\u3059\u3002\n<pre><code class=\"language-shell\" lang=\"shell\">$ ncat 192.168.30.20 4321\r\n<\/code><\/pre>\n<\/li>\n<\/ul>\n<ul>\n<li>SystemTap\u3092\u5b9f\u884c\u3057\u305f\u30b3\u30f3\u30bd\u30fc\u30eb\u4e0a\u306b\u4ee5\u4e0b\u306e\u51fa\u529b\u304c\u8ffd\u52a0\u3055\u308c\u307e\u3059\u3002\n<pre><code class=\"language-shell\" lang=\"shell\">command             ncat mptcpified\r\n<\/code><\/pre>\n<\/li>\n<\/ul>\n<ul>\n<li>tcpdump\u3092\u5b9f\u884c\u3057\u305f\u30b3\u30f3\u30bd\u30fc\u30eb\u4e0a\u306bmptcp\u30aa\u30d7\u30b7\u30e7\u30f3\u4ed8\u306e\u30d1\u30b1\u30c3\u30c8\u304c\u51fa\u529b\u3055\u308c\u307e\u3059\u3002\n<pre><code class=\"language-shell\" lang=\"shell\">06:17:53.978527 enp0s3 Out IP 192.168.10.20.35644 &gt; 192.168.30.20.4321: Flags [S], seq 804167068, win 64240, options [mss 1460,sackOK,TS val 1521023865 ecr 0,nop,wscale 7,mptcp capable v1], length 0\r\n06:17:53.979072 enp0s3 In  IP 192.168.30.20.4321 &gt; 192.168.10.20.35644: Flags [S.], seq 2369976460, ack 804167069, win 65160, options [mss 1460,sackOK,TS val 251220121 ecr 1521023865,nop,wscale 7,mptcp capable v1 {0x7948c13f4e14a250}], length 0\r\n06:17:53.979103 enp0s3 Out IP 192.168.10.20.35644 &gt; 192.168.30.20.4321: Flags [.], ack 1, win 502, options [nop,nop,TS val 1521023865 ecr 251220121,mptcp capable v1 {0xcc3b1bc6232e7271,0x7948c13f4e14a250}], length 0\r\n<\/code><\/pre>\n<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<p>\u3053\u308c\u3067\u5358\u4e00\u30b5\u30d6\u30d5\u30ed\u30fc\u3067MPTCP\u901a\u4fe1\u304c\u3067\u304d\u308b\u3053\u3068\u304c\u78ba\u8a8d\u3067\u304d\u307e\u3057\u305f\u3002<\/p>\n<p>&nbsp;<\/p>\n<h2>\u8907\u6570\u30b5\u30d6\u30d5\u30ed\u30fc<\/h2>\n<p>\u3044\u3088\u3044\u3088\u3001\u8907\u6570\u30b5\u30d6\u30d5\u30ed\u30fc\uff08\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u30a4\u30f3\u30bf\u30d5\u30a7\u30fc\u30b9\uff09\u3092\u540c\u6642\u306b\u4f7f\u3063\u3066\u201dClient&#8221;\u3068&#8221;Server&#8221;\u3067\u901a\u4fe1\u3055\u305b\u3066\u307f\u307e\u3059\u3002<\/p>\n<h3>Server<\/h3>\n<ul>\n<li>\u4e88\u3081SystemTap\u3067\u300cmptcp.stap\u300d\u3092\u5b9f\u884c\u3057\u3066\u304a\u304d\u307e\u3059\u3002<\/li>\n<li>\u8a31\u5bb9\u3059\u308b\u30b5\u30d6\u30d5\u30ed\u30fc\u6570\u3092\u8a2d\u5b9a\u3057\u307e\u3059\u3002\n<pre><code class=\"language-shell\" lang=\"shell\">$ sudo ip mptcp limits set subflow 2\r\n$ sudo ip mptcp limits show\r\nadd_addr_accepted 0 subflows 2\r\n<\/code><\/pre>\n<\/li>\n<\/ul>\n<ul>\n<li>iperf\u3092\u30b5\u30fc\u30d0\u3068\u3057\u3066\u8d77\u52d5\u3057\u307e\u3059\u3002\n<pre><code class=\"language-shell\" lang=\"shell\">$ iperf -s\r\n<\/code><\/pre>\n<\/li>\n<\/ul>\n<ul>\n<li>SystemTap\u3092\u5b9f\u884c\u3057\u305f\u30b3\u30f3\u30bd\u30fc\u30eb\u4e0a\u306b\u4ee5\u4e0b\u306e\u51fa\u529b\u304c\u8ffd\u52a0\u3055\u308c\u307e\u3059\u3002\n<pre><code class=\"language-shell\" lang=\"shell\">command             iperf mptcpified\r\n<\/code><\/pre>\n<p>&nbsp;<\/li>\n<\/ul>\n<h3>Client<\/h3>\n<ul>\n<li>\u4e88\u3081SystemTap\u3067\u300cmptcp.stap\u300d\u3092\u5b9f\u884c\u3057\u3066\u304a\u304d\u307e\u3059\u3002<\/li>\n<\/ul>\n<ul>\n<li>\u305d\u308c\u305e\u308c\u306e\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u30a4\u30f3\u30bf\u30d5\u30a7\u30fc\u30b9\u6307\u5b9a\u3067tcpdump\u3092\u5b9f\u884c\u3057\u307e\u3059\u3002\n<ul>\n<li>enp0s3\n<pre><code class=\"language-shell\" lang=\"shell\">$ sudo tcpdump -i enp0s3 dst port 5001 -n -nn\r\ntcpdump: data link type LINUX_SLL2\r\ntcpdump: verbose output suppressed, use -v[v]... for full protocol decode\r\nlistening on any, link-type LINUX_SLL2 (Linux cooked v2), snapshot length 262144 bytes\r\n<\/code><\/pre>\n<\/li>\n<li>enp0s8\n<pre><code class=\"language-shell\" lang=\"shell\">$ sudo tcpdump -i enp0s8 dst port 5001 -n -nn | more\r\ntcpdump: verbose output suppressed, use -v[v]... for full protocol decode\r\nlistening on enp0s8, link-type EN10MB (Ethernet), snapshot length 262144 bytes\r\n<\/code><\/pre>\n<\/li>\n<\/ul>\n<\/li>\n<li>\u30b5\u30d6\u30d5\u30ed\u30fc\u306e\u8a2d\u5b9a\u3092\u3057\u307e\u3059\u3002\n<ul>\n<li>\u4eca\u56de\u8a66\u3057\u305f\u6642\u306eClient\u306e\u7d4c\u8def\u8a2d\u5b9a\u306f\u6b21\u306e\u3068\u304a\u308a\u3067\u3059\u3002\n<pre><code class=\"language-shell\" lang=\"shell\">$ ip route\r\ndefault via 192.168.10.1 dev enp0s3 proto static metric 100 \r\ndefault via 192.168.20.1 dev enp0s8 proto static metric 200 \r\n192.168.10.0\/24 dev enp0s3 proto kernel scope link src 192.168.10.20 \r\n192.168.20.0\/24 dev enp0s8 proto kernel scope link src 192.168.20.20 \r\n<\/code><\/pre>\n<ul>\n<li>enp0s3\u306e\u30c7\u30d5\u30a9\u30eb\u30c8\u30b2\u30fc\u30c8\u30a6\u30a7\u30a4\u8a2d\u5b9a\u306e\u512a\u5148\u5ea6\u304c\u9ad8\u3044\u306e\u3067\u3001\u5148\u7a0b\u306f\u4f55\u3082\u8a2d\u5b9a\u3057\u306a\u304f\u3066\u3082enp0s3\u304cMPTCP\u901a\u4fe1\u306b\u4f7f\u308f\u308c\u3066\u3044\u307e\u3057\u305f\u3002<\/li>\n<\/ul>\n<\/li>\n<li>enp0s8(192.168.20.20)\u3092\u30b5\u30d6\u30d5\u30ed\u30fc\u3068\u3057\u3066\u4f7f\u3046\u3088\u3046\u306b\u8a2d\u5b9a\u3057\u307e\u3059\u3002\n<pre><code class=\"language-shell\" lang=\"shell\">$ sudo ip mptcp limits set subflow 2\r\n$ sudo ip mptcp limits show\r\nadd_addr_accepted 0 subflows 2 \r\n$ sudo ip mptcp endpoint add 192.168.20.20 subflow\r\n$ sudo ip mptcp endpoint show\r\n192.168.20.20 id 1 subflow \r\n<\/code><\/pre>\n<\/li>\n<\/ul>\n<ul>\n<li><u>\u8907\u6570\u30b5\u30d6\u30d5\u30ed\u30fc\u304b\u3089\u30d1\u30b1\u30c3\u30c8\u304c\u9001\u4fe1\u3055\u308c\u308b\u3088\u3046\u306b\u30dd\u30ea\u30b7\u30fc\u30eb\u30fc\u30c6\u30a3\u30f3\u30b0\u3092\u8a2d\u5b9a<\/u>\u3057\u307e\u3059\u3002\n<pre><code class=\"language-shell\" lang=\"shell\">$ sudo ip rule add from 192.168.10.20 table 1\r\n$ sudo ip route add 192.168.10.0\/24 dev enp0s3 scope link table 1\r\n$ sudo ip route add default via 192.168.10.1 dev enp0s3 table 1\r\n\r\n$ sudo ip rule add from 192.168.20.20 table 2\r\n$ sudo ip route add 192.168.20.0\/24 dev enp0s8 scope link table 2\r\n$ sudo ip route add default via 192.168.20.1 dev enp0s8 table 2\r\n\r\n$ ip route show table 1\r\ndefault via 192.168.10.1 dev enp0s3 \r\n192.168.10.0\/24 dev enp0s3 scope link \r\n$ ip route show table 2\r\ndefault via 192.168.20.1 dev enp0s8 \r\n192.168.20.0\/24 dev enp0s8 scope link\r\n<\/code><\/pre>\n<ul>\n<li>\u3053\u306e\u8a2d\u5b9a\u3092\u884c\u308f\u306a\u3044\u5834\u5408\u306f\u3001\u9001\u4fe1\u5143\u304c192.168.20.20\u306e\u30d1\u30b1\u30c3\u30c8\u3082enp0s3\u304b\u3089\u9001\u4fe1\u3055\u308c\u307e\u3059\u3002<\/li>\n<li>\u516c\u5f0fwiki\u3067\u3055\u308a\u3052\u306a\u304f\u66f8\u3044\u3066\u3042\u308b\u306e\u3067\u3059\u304c\u3001\u5272\u3068\u898b\u843d\u3068\u3057\u304c\u3061\u3067\u3059\u306d\u3002<br \/>\n<blockquote><p>Configure the routing rules to use multiple subflows from multiple interfaces: <a href=\"http:\/\/multipath-tcp.org\/pmwiki.php\/Users\/ConfigureRouting\">Configure Routing<\/a><\/p><\/blockquote>\n<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<\/li>\n<li>iperf\u3092\u30af\u30e9\u30a4\u30a2\u30f3\u30c8\u3068\u3057\u3066\u8d77\u52d5\u3057\u307e\u3059\u3002\n<pre><code class=\"language-shell\" lang=\"shell\">$ iperf -c 192.168.30.20 \r\n<\/code><\/pre>\n<\/li>\n<li>SystemTap\u3092\u5b9f\u884c\u3057\u305f\u30b3\u30f3\u30bd\u30fc\u30eb\u4e0a\u306b\u4ee5\u4e0b\u306e\u51fa\u529b\u304c\u8ffd\u52a0\u3055\u308c\u307e\u3059\u3002\n<pre><code class=\"language-shell\" lang=\"shell\">command             iperf mptcpified\r\n<\/code><\/pre>\n<\/li>\n<\/ul>\n<ul>\n<li>tcpdump\u3092\u5b9f\u884c\u3057\u305f\u305d\u308c\u305e\u308c\u306e\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u30a4\u30f3\u30bf\u30d5\u30a7\u30fc\u30b9\u304b\u3089mptcp\u30aa\u30d7\u30b7\u30e7\u30f3\u4ed8\u306e\u30d1\u30b1\u30c3\u30c8\u304c\u51fa\u529b\u3055\u308c\u308b\u306e\u304c\u78ba\u8a8d\u3067\u304d\u307e\u3059\u3002<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<p>\u3044\u304f\u3064\u304b\u30cf\u30de\u308a\u30dd\u30a4\u30f3\u30c8\u304c\u3042\u308a\u307e\u3057\u305f\u304c\u3001\u306a\u3093\u3068\u304bUbuntu\u3067\u8907\u6570\u30b5\u30d6\u30d5\u30ed\u30fc\u3092\u4f7f\u3063\u305fMPTCP\u901a\u4fe1\u3092\u884c\u3046\u3053\u3068\u304c\u3067\u304d\u307e\u3057\u305f\u3002\u307f\u306a\u3055\u3093\u3082\u305c\u3072\u3053\u308c\u3092\u6a5f\u4f1a\u306bMPTCP\u3092\u8a66\u3057\u3066\u307f\u3066\u306f\u3044\u304b\u304c\u3067\u3057\u3087\u3046\u304b\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5f93\u6765\u3001Linux\u3067MPTCP\u3092\u5229\u7528\u3059\u308b\u5834\u5408\u300cLinux Kernel MultiPath TCP project\u300d\u304c\u516c\u958b\u3057\u3066\u3044\u308bLinux\u30ab\u30fc\u30cd\u30eb\u3092\u4f7f\u3046\u5fc5\u8981\u304c\u3042\u308a\u307e\u3057\u305f\u304c\u3001\u30a2\u30c3\u30d7\u30b9\u30c8\u30ea\u30fc\u30e0\u306eLinux\u30ab\u30fc\u30cd\u30eb 5.6\u4ee5\u964d [&hellip;]<\/p>\n","protected":false},"author":5,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[17],"tags":[18,148],"class_list":["post-5040","post","type-post","status-publish","format-standard","hentry","category-tech","tag-linux","tag-mptcp"],"_links":{"self":[{"href":"https:\/\/blog.bitmeister.jp\/index.php?rest_route=\/wp\/v2\/posts\/5040","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.bitmeister.jp\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.bitmeister.jp\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.bitmeister.jp\/index.php?rest_route=\/wp\/v2\/users\/5"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.bitmeister.jp\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=5040"}],"version-history":[{"count":19,"href":"https:\/\/blog.bitmeister.jp\/index.php?rest_route=\/wp\/v2\/posts\/5040\/revisions"}],"predecessor-version":[{"id":5062,"href":"https:\/\/blog.bitmeister.jp\/index.php?rest_route=\/wp\/v2\/posts\/5040\/revisions\/5062"}],"wp:attachment":[{"href":"https:\/\/blog.bitmeister.jp\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=5040"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.bitmeister.jp\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=5040"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.bitmeister.jp\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=5040"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}