{"id":13539398,"url":"https://github.com/wangyu-/tinyfecvpn","last_synced_at":"2025-05-15T13:08:04.205Z","repository":{"id":38411742,"uuid":"108623624","full_name":"wangyu-/tinyfecVPN","owner":"wangyu-","description":"A VPN Designed for Lossy Links, with Build-in Forward Error Correction(FEC) Support. Improves your Network Quality on a High-latency Lossy Link.","archived":false,"fork":false,"pushed_at":"2023-06-05T01:45:53.000Z","size":2368,"stargazers_count":2388,"open_issues_count":67,"forks_count":464,"subscribers_count":105,"default_branch":"master","last_synced_at":"2025-05-15T13:07:58.133Z","etag":null,"topics":["fec","proxy","reed-solomon","vpn"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/wangyu-.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2017-10-28T05:54:31.000Z","updated_at":"2025-05-15T08:49:38.000Z","dependencies_parsed_at":"2024-01-07T23:00:16.135Z","dependency_job_id":null,"html_url":"https://github.com/wangyu-/tinyfecVPN","commit_stats":null,"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wangyu-%2FtinyfecVPN","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wangyu-%2FtinyfecVPN/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wangyu-%2FtinyfecVPN/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wangyu-%2FtinyfecVPN/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/wangyu-","download_url":"https://codeload.github.com/wangyu-/tinyfecVPN/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254346624,"owners_count":22055808,"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":["fec","proxy","reed-solomon","vpn"],"created_at":"2024-08-01T09:01:25.053Z","updated_at":"2025-05-15T13:07:59.195Z","avatar_url":"https://github.com/wangyu-.png","language":"C++","funding_links":[],"categories":["\u003ca id=\"1a9934198e37d6d06b881705b863afc8\"\u003e\u003c/a\u003e通信\u0026\u0026代理\u0026\u0026反向代理\u0026\u0026隧道","\u003ca id=\"d62a971d37c69db9f3b9187318c3921a\"\u003e\u003c/a\u003e工具"],"sub_categories":["\u003ca id=\"56acb7c49c828d4715dce57410d490d1\"\u003e\u003c/a\u003e未分类-Proxy","\u003ca id=\"8ea8f890cf767c3801b5e7951fca3570\"\u003e\u003c/a\u003e公网访问局域网"],"readme":"# tinyfecVPN\n\nA Lightweight VPN with Build-in Forward Error Correction Support(or A Network Improving Tool which works at VPN mode). Improves your Network Quality on a High-latency Lossy Link. \n\n![image](/images/tinyFecVPN3.PNG)\n\ntinyfecVPN uses Forward Error Correction(Reed-Solomon code) to reduce packet loss rate, at the cost of additional bandwidth usage. \n\nAssume your local network to your server is lossy. Just establish a VPN connection to your server with tinyfecVPN, access your server via this VPN connection, then your connection quality will be significantly improved. With well-tuned parameters , you can easily reduce  IP or UDP/ICMP packet-loss-rate to less than 0.01% . Besides reducing packet-loss-rate, tinyfecVPN can also significantly improve your TCP latency and TCP single-thread download speed.\n\ntinyfecVPN uses same lib as [UDPspeeder](https://github.com/wangyu-/UDPspeeder), supports all FEC features of UDPspeeder. tinyfecVPN works at VPN mode,while UDPspeeder works at UDP tunnel mode.\n\n[tinyfecVPN wiki](https://github.com/wangyu-/tinyfecVPN/wiki)\n\n[简体中文](/doc/README.zh-cn.md)\n\n##### Note\nUDPspeeder's repo:\n\nhttps://github.com/wangyu-/UDPspeeder\n\n# Efficacy\nTested on a link with 100ms roundtrip and 10% packet loss at both direction. You can easily reproduce the test result by yourself.\n\n### Ping Packet Loss\n![](/images/en/ping_compare2.PNG)\n\n### SCP Copy Speed\n![](/images/en/scp_compare2.PNG)\n\n# Supported Platforms\nLinux host (including desktop Linux,\u003cdel\u003eAndroid phone/tablet\u003c/del\u003e, OpenWRT router, or Raspberry PI).Binaries for `amd64` `x86` `mips_be` `mips_le` `arm` are provided.\n\nFor Windows and MacOS, You can run tinyfecVPN inside [this](https://github.com/wangyu-/udp2raw-tunnel/releases/download/20171108.0/lede-17.01.2-x86_virtual_machine_image.zip) 7.5mb virtual machine image.\n\nNeed root or at least CAP_NET_ADMIN permission to run, for creating tun device.\n\n# How does it work\n\ntinyfecVPN uses FEC(Forward Error Correction) to reduce packet loss rate, at the cost of additional bandwidth usage. The algorithm for FEC is called Reed-Solomon.\n\n![](/images/FEC.PNG)\n\n### Reed-Solomon\n\n`\nIn coding theory, the Reed–Solomon code belongs to the class of non-binary cyclic error-correcting codes. The Reed–Solomon code is based on univariate polynomials over finite fields.\n`\n\n`\nIt is able to detect and correct multiple symbol errors. By adding t check symbols to the data, a Reed–Solomon code can detect any combination of up to t erroneous symbols, or correct up to ⌊t/2⌋ symbols. As an erasure code, it can correct up to t known erasures, or it can detect and correct combinations of errors and erasures. Reed–Solomon codes are also suitable as multiple-burst bit-error correcting codes, since a sequence of b + 1 consecutive bit errors can affect at most two symbols of size b. The choice of t is up to the designer of the code, and may be selected within wide limits.\n`\n\n![](/images/en/rs.png)\n\nCheck wikipedia for more info, https://en.wikipedia.org/wiki/Reed–Solomon_error_correction\n\n\n# Getting Started\n\n### Installing\n\nDownload binary release from https://github.com/wangyu-/tinyfecVPN/releases\n\n### Running\n\nAssume your server ip is `44.55.66.77`, you have a service listening on udp/tcp port `0.0.0.0:7777`. \n\n```\n# Run at server side:\n./tinyvpn -s -l0.0.0.0:4096 -f20:10 -k \"passwd\" --sub-net 10.22.22.0\n\n# Run at client side\n./tinyvpn -c -r44.55.66.77:4096 -f20:10 -k \"passwd\" --sub-net 10.22.22.0\n```\n\nNow, use `10.22.22.1:7777` to connect to your service,all traffic will be improved by FEC. If you ping `10.22.22.1`, you will get ping reply.\n\n##### Note\n\n`-f20:10` means sending 10 redundant packets for every 20 original packets.\n\n`-k` enables simple XOR encryption\n\nTo create tun device, you need root or cap_net_admin permission. Its suggested to run tinyfecVPN as non-root, check [this link](https://github.com/wangyu-/tinyfecVPN/wiki/run-tinyfecVPN-as-non-root) for more info.\n\nCurrently one server supports only one client. For multiple clients, start multiple servers. \n\n##### Note2\n\nYou can use udp2raw with tinyfecVPN together to get better speed on some ISP with UDP QoS(UDP throttling).\n\nudp2raw's repo：\n\nhttps://github.com/wangyu-/udp2raw-tunnel\n\n# Advanced Topic\n\n### Usage\n```\ntinyfecVPN\ngit version: b03df1b586    build date: Oct 31 2017 19:46:50\nrepository: https://github.com/wangyu-/tinyfecVPN/\n\nusage:\n    run as client: ./this_program -c -r server_ip:server_port  [options]\n    run as server: ./this_program -s -l server_listen_ip:server_port  [options]\n\ncommon options, must be same on both sides:\n    -k,--key              \u003cstring\u003e        key for simple xor encryption. if not set, xor is disabled\nmain options:\n    --sub-net             \u003cnumber\u003e        specify sub-net, for example: 192.168.1.0 , default: 10.22.22.0\n    --tun-dev             \u003cnumber\u003e        sepcify tun device name, for example: tun10, default: a random name such as tun987\n    -f,--fec              x:y             forward error correction, send y redundant packets for every x packets\n    --timeout             \u003cnumber\u003e        how long could a packet be held in queue before doing fec, unit: ms, default: 8ms\n    --mode                \u003cnumber\u003e        fec-mode,available values: 0, 1; 0 cost less bandwidth, 1 cost less latency;default: 0)\n    --report              \u003cnumber\u003e        turn on send/recv report, and set a period for reporting, unit: s\n    --keep-reconnect                      re-connect after lost connection,only for client.\nadvanced options:\n    --mtu                 \u003cnumber\u003e        mtu. for mode 0, the program will split packet to segment smaller than mtu_value.\n                                          for mode 1, no packet will be split, the program just check if the mtu is exceed.\n                                          default value: 1250\n    -j,--jitter           \u003cnumber\u003e        simulated jitter. randomly delay first packet for 0~\u003cnumber\u003e ms, default value: 0.\n                                          do not use if you dont know what it means.\n    -i,--interval         \u003cnumber\u003e        scatter each fec group to a interval of \u003cnumber\u003e ms, to protect burst packet loss.\n                                          default value: 0. do not use if you dont know what it means.\n    --random-drop         \u003cnumber\u003e        simulate packet loss, unit: 0.01%. default value: 0\n    --disable-obscure     \u003cnumber\u003e        disable obscure, to save a bit bandwidth and cpu\ndeveloper options:\n    --tun-mtu             \u003cnumber \u003e       mtu of the tun interface,most time you shouldnt change this\n    --disable-mssfix      \u003cnumber \u003e       disable mssfix for tcp connection\n    --fifo                \u003cstring\u003e        use a fifo(named pipe) for sending commands to the running program, so that you\n                                          can change fec encode parameters dynamically, check readme.md in repository for\n                                          supported commands.\n    -j ,--jitter          jmin:jmax       similiar to -j above, but create jitter randomly between jmin and jmax\n    -i,--interval         imin:imax       similiar to -i above, but scatter randomly between imin and imax\n    -q,--queue-len        \u003cnumber\u003e        max fec queue len, only for mode 0\n    --decode-buf          \u003cnumber\u003e        size of buffer of fec decoder,u nit: packet, default: 2000\n    --fix-latency                         try to stabilize latency, only for mode 0\n    --delay-capacity      \u003cnumber\u003e        max number of delayed packets\n    --disable-fec         \u003cnumber\u003e        completely disable fec, turn the program into a normal udp tunnel\n    --sock-buf            \u003cnumber\u003e        buf size for socket, \u003e=10 and \u003c=10240, unit: kbyte, default: 1024\nlog and help options:\n    --log-level           \u003cnumber\u003e        0: never    1: fatal   2: error   3: warn\n                                          4: info (default)      5: debug   6: trace\n    --log-position                        enable file name, function name, line number in log\n    --disable-color                       disable log color\n    -h,--help                             print this help message\n\n```\n### FEC Options\n\nThe program supports all options of UDPspeeder,check UDPspeeder repo for details:\n\nhttps://github.com/wangyu-/UDPspeeder\n\n### Addtional Options\n\n##### `--tun-dev`\n\nSpecify a tun device name to use. Example: `--tun-dev tun100`.\n\nIf not set,tinyfecVPN will randomly chose a name,such as `tun987`.\n\n##### `--sub-net`\n\nSpecify the sub-net of VPN. Example: `--sub-net 10.10.10.0`, in this way,server IP will be `10.10.10.1`,client IP will be `10.10.10.2`.\n\nThe last number of option should be zero, for exmaple `10.10.10.123` is invalild, and will be corrected automatically to `10.10.10.0`.\n\n##### `--keep-reconnect`\n\nOnly works at client side.\n\ntinyfecVPN server only handles one client at same time,the connection of a new client will kick old client,after being kicked,old client will just exit by default.\n\nIf `--keep-reconnect` is enabled , client will try to get connection back after lost connection or being kicked.\n\n# Performance Test(throughput)\n\nServer is a Vulr VPS in japan，CPU: single core 2.4GHz,ram: 512mb. Client is a Bandwagonhost VPS in USA，CPU: single core 2.0GHZ,ram: 96mb. To put pressure on the FEC algorithm, an additional 10% packet-loss rate was introduced at both direction.\n\n### Test command\n\n```\nServer side：\n./tinyvpn_amd64 -s -l 0.0.0.0:5533 --mode 0 -f20:10\niperf3 -s\n\nClient side：\n./tinyvpn_amd64 -c -r 44.55.66.77:5533 --mode 0 -f20:10\niperf3 -c 10.22.22.1 -P10\n```\n\n### Test result\n\n![image](/images/performance2.PNG)\n\nNote: the performance is mainly limited by the RS code lib.\n\n# Other\n\nAs a VPN software may contradict with local regulations, I had to introduce an intended restriction in the pre-released binaries: you can only use tinyfecVPN to access your own server.\n\nYou can easily get rid of this restriction by compiling the source code by yourself (take a look at the makefile). This restriction exits only at server side, only the server side binary needs to be compiled by yourself.\n\n(If you want to compile by yourself, use `git clone --recursive` instead of `git clone`, otherwise the submodule wont be cloned)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwangyu-%2Ftinyfecvpn","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwangyu-%2Ftinyfecvpn","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwangyu-%2Ftinyfecvpn/lists"}