{"id":13825965,"url":"https://github.com/greensea/mptunnel","last_synced_at":"2025-07-08T22:33:03.067Z","repository":{"id":20150425,"uuid":"23420843","full_name":"greensea/mptunnel","owner":"greensea","description":"MPUDP Tunnel (User space MultiPath UDP)","archived":false,"fork":false,"pushed_at":"2016-08-29T02:47:30.000Z","size":152,"stargazers_count":174,"open_issues_count":8,"forks_count":31,"subscribers_count":18,"default_branch":"master","last_synced_at":"2024-11-20T04:33:26.875Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-2-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/greensea.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-08-28T08:27:49.000Z","updated_at":"2024-11-12T05:36:06.000Z","dependencies_parsed_at":"2022-08-07T09:15:54.133Z","dependency_job_id":null,"html_url":"https://github.com/greensea/mptunnel","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/greensea/mptunnel","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/greensea%2Fmptunnel","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/greensea%2Fmptunnel/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/greensea%2Fmptunnel/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/greensea%2Fmptunnel/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/greensea","download_url":"https://codeload.github.com/greensea/mptunnel/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/greensea%2Fmptunnel/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":264360308,"owners_count":23596102,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-04T09:01:30.006Z","updated_at":"2025-07-08T22:33:02.780Z","avatar_url":"https://github.com/greensea.png","language":"C","funding_links":[],"categories":["C","C (286)","\u003ca id=\"01e6651181d405ecdcd92a452989e7e0\"\u003e\u003c/a\u003e工具"],"sub_categories":["\u003ca id=\"9d6789f22a280f5bb6491d1353b02384\"\u003e\u003c/a\u003e隧道\u0026\u0026穿透"],"readme":"# mptunnel\nMultiPath Tunnel (Simpified user space MPUDP)\n\n[中文说明点此](README.zh_CN.md)\n\n## ABOUT\n\nMultiPath Tunnel is a multipath UDP implementation in user space. Like MultiPath TCP, you can establish\nseveral connections from local to remote server.\n\nMPTCP(MultiPath TCP) is a good idea to make network connection robust, but it only works on TCP. I was\nsearching for MPUDP implementation but got nothing, so I write this tool.\n\n\n## CONCEPTION\n\n```\n                        .---- bridge server 1 ----.\n                       /                            \\\n Server A --- mpclient ------- bridge server 2 ------- mpserver --- Server B\n                       \\                            /\n                        `---- bridge server 3 ----`\n```\n\nThere are two server named Server A and Server B. The network connection between Server A and Server B is\nunstable (with high packet loss ratio). Thus, we like to establish an multipath tunnel between Server A\nand Server B, hoping the connection between Server A and Server B become more stable (decrease\npacket loss ratio).\n\n_mpclient_ is the client part of mptunnel, it could be run on ServerA. You must tell mpclient the\ninformation of bridge servers. Once mpclient is started, it open a local UDP port for listen, forward\nany packet to/from bridge servers.\n\n_mpserver_ is the server part of mptunnel, it could be run on ServerB. You must tell mpserver the\ninformation of Server B. Once mpserver is started, it will forward any packet to/from Server B.\n\nBridge servers is simple, it only forward packets from mpclient to mpserver, or packets from mpserver to\nmpclient. You can use _nc_ or _socat_ to deploy a bridge server.\n\n\n## EXAMPLE\n\nI want to connection to my OpenVPN server, but the connection is unstable, packet loss ratio is high. The\nTCP throughput over the OpenVPN tunnel is very small due to high packet loss ratio. To increase TCP\nthroughput (decrease packet loss ratio), I can run a MPUDP to OpenVPN server and establish OpenVPN connection\non it.\n\nOpenVPN is listen on UDP port 1194, I run mpserver on OpenVPN server like this:\n\n```\nmpserver 2000 127.0.0.1 1194\n```\n\nOn local, run mpclient:\n\n```\nmpclient mpclient.conf\n```\n\nBelow is the content of mpclient.conf \n\n```\n1.1.1.1 4000\nbridge1.myhost.com 4000\nbridge2.myhost.com 4000\n```\n\n1.1.1.1 is the IP of OpenVPN server. It's okay to use it as a bridge server.\n\nOn each bridge server, use _socat_ to forward packet:\n\n```\nsocat udp-listen:4000 udp4:1.1.1.1:2000\n```\n\nBridge server will listen on UDP port 3001, forward any recieved packet to 1.1.1.1:2000, and vice versa.\n\n\nNow I make OpenVPN client to connect localhost:3000 which mpclient listening on, then OpenVPN will\nestablish an OpenVPN connection over MultiPath UDP tunnel.\n\n\n## BUGS\n\n* mptunnel add some control information into packets, including synchronous information. mpserver and mpclient must be start at the same time. If mpclient or mpserver terminated, you have to restart both mpserver and mpclient to reestablish the tunnel.\n\n* Currently you can only specify signle target host. Any one knows is there any C library of SOCKS5 proxy? I think making mpclient as a SOCKS proxy server will make it more easy to use.\n\n* mptunnel encrypt packets defaultly, but it will decrease the throughput. I do some tests on my PC with Athlon II P320 Processor, the actual throughput is 3Mbps while using three tunnels, after I disable encryption the throughput increase to 300Mbps. If you dont't like mptunnel to encrypt packets, set environment variable MPTUNNEL_ENCRYPT=0\n\n## DEPENDENCIES\n\nTo compile mptunnel, these libraries are required:\n\n* libev\n\n## SEE ALSO\n\n[mlvpn](https://github.com/zehome/MLVPN/), A similar solution for multipath UDP.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgreensea%2Fmptunnel","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgreensea%2Fmptunnel","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgreensea%2Fmptunnel/lists"}