23 Commits

Author SHA1 Message Date
wangyu-
ccb52060b5 Update README.zh-cn.md 2018-06-21 01:54:28 +08:00
wangyu-
426b0388a0 Update README.md 2018-06-21 01:53:20 +08:00
wangyu-
d56e34bc22 fixed problem of --interval doesnt work 2018-05-21 22:28:38 -05:00
wangyu-
07ca7f2a35 Update README.zh-cn.md 2018-03-08 22:04:18 +08:00
wangyu-
27dbeaedcd Update README.md 2018-02-26 08:09:01 +08:00
wangyu-
aa96ba6885 Update README.md 2018-02-26 08:02:53 +08:00
wangyu-
8d1e773688 Update README.md 2018-02-26 08:01:31 +08:00
wangyu-
2547462ce9 Update README.md 2018-02-22 04:13:17 +08:00
wangyu-
5321005028 Update README.zh-cn.md 2018-02-22 04:12:37 +08:00
wangyu-
03ebe71dde Update README.md 2018-02-22 04:07:14 +08:00
wangyu-
a57f92da4b Update README.zh-cn.md 2018-02-22 04:06:57 +08:00
wangyu-
19aed91978 Update README.md 2018-02-22 04:06:07 +08:00
wangyu-
8f97c7df70 Update README.md 2018-02-22 03:46:17 +08:00
wangyu-
a444132e24 Update README.zh-cn.md 2018-02-22 03:04:06 +08:00
wangyu-
5ecb56cd96 Update README.md 2018-02-19 18:08:45 +08:00
wangyu-
98191c5b36 Add files via upload 2018-02-19 15:46:54 +08:00
wangyu-
3a0acf0de2 improve format of readme.md 2017-12-14 10:24:50 -06:00
wangyu-
08b3fdeb9e Add files via upload 2017-11-27 22:39:42 +08:00
wangyu-
f6475a5134 Update README.zh-cn.md 2017-11-26 23:03:19 -06:00
wangyu-
454696673d Add files via upload 2017-11-27 02:17:28 +08:00
wangyu-
bed88233f6 moved a log 2017-11-26 03:55:14 -06:00
wangyu-
d2bb8f31f4 fixed a statistic error when --disable-fec is used 2017-11-26 02:35:27 -06:00
wangyu-
5839aebbf6 Update README.zh-cn.md 2017-11-25 08:12:53 -06:00
8 changed files with 83 additions and 124 deletions

View File

@@ -1,8 +1,9 @@
# UDPspeeder
Network Speed-Up Tool. Boost your Connection on a High Lantency High Packet-Loss Link by using Forward Error Correction.
When used alone, UDPspeeder speeds-up only UDP connection. Nevertheless, if you used UDPspeeder + any UDP-based VPN together,
you can speed-up any traffic(include TCP/UDP/ICMP), currently OpenVPN/L2TP/ShadowVPN are confirmed to be supported。
A Tunnel which Improves your Network Quality on a High-latency Lossy Link by using Forward Error Correction.
When used alone, UDPspeeder improves only UDP connection. Nevertheless, if you used UDPspeeder + any UDP-based VPN together,
you can improve any traffic(include TCP/UDP/ICMP), currently OpenVPN/L2TP/ShadowVPN are confirmed to be supported。
![](/images/en/udpspeeder.PNG)
@@ -12,22 +13,10 @@ or
Assume your local network to your server is lossy. Just establish a VPN connection to your server with UDPspeeder + any UDP-based VPN, 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, UDPspeeder can also significantly improve your TCP latency and TCP single-thread download speed.
[UDPspeeder Wiki](https://github.com/wangyu-/UDPspeeder/wiki)
[简体中文](/doc/README.zh-cn.md)(内容更丰富)
###### Note
You can use udp2raw with UDPspeeder together to get better speed on some ISP with UDP QoS(UDP throttling).
udp2raw's repo
https://github.com/wangyu-/udp2raw-tunnel
You can also try tinyFecVPN, a lightweight high-performance VPN with build-in FEC support:
tinyFecVPN's repo:
https://github.com/wangyu-/tinyFecVPN
# Efficacy
tested on a link with 100ms latency and 10% packet loss at both direction
@@ -38,9 +27,9 @@ tested on a link with 100ms latency and 10% packet loss at both direction
![](/images/en/scp_compare2.PNG)
# Supported Platforms
Linux host (including desktop Linux,Android phone/tablet, OpenWRT router, or Raspberry PI).
Linux host (including desktop Linux,Android phone/tablet, OpenWRT router, or Raspberry PI), as well as Winodws/MacOS/BSD.
For Windows and MacOS You can run UDPspeeder 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.
<del>For Windows and MacOS You can run UDPspeeder 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.</del>
# How does it work
@@ -67,7 +56,7 @@ Check wikipedia for more info, https://en.wikipedia.org/wiki/ReedSolomon_erro
### Installing
Download binary release from https://github.com/wangyu-/UDPspeeder/releases
### Running (speed-up UDP only)
### Running (improves UDP traffic only)
Assume your server ip is 44.55.66.77, you have a service listening on udp port 7777.
```bash
@@ -86,7 +75,13 @@ Now connecting to UDP port 3333 at the client side is equivalent to connecting t
`-k` enables simple XOR encryption
# Improves all traffic with OpenVPN + UDPspeeder
See [UDPspeeder + openvpn config guide](https://github.com/wangyu-/UDPspeeder/wiki/UDPspeeder-openvpn-config-guide).
# Advanced Topic
### Full Options
```
UDPspeeder V2
@@ -145,6 +140,19 @@ echo timeout 5 > fifo.file
echo queue-len 100 > fifo.file
echo mode 0 > fifo.file
```
### Speed-Up any traffic with OpenVPN + UDPspeeder
Check [UDPspeeder + openvpn config guide](/doc/udpspeeder_openvpn.md).
# wiki
Check wiki for more info:
https://github.com/wangyu-/UDPspeeder/wiki
# Related repo
You can also try tinyfecVPN, a lightweight high-performance VPN with UDPspeeder's function built-in, repo:
https://github.com/wangyu-/tinyfecVPN
You can use udp2raw with UDPspeeder together to get better speed on some ISP with UDP QoS(UDP throttling), repo:
https://github.com/wangyu-/udp2raw-tunnel

View File

@@ -64,7 +64,7 @@ typedef short i16_t;
typedef u64_t my_time_t;
const int max_data_len=2200;
const int max_data_len=3600;
const int buf_len=max_data_len+200;

View File

@@ -11,23 +11,25 @@
![image0](/images/Capture2.PNG)
对于某些运营商UDPspeeder跟udp2raw配合可以达到更好的速度udp2raw负责把UDP伪装成TCP来绕过运营商的UDP限速。
[English](/README.md)
udp2raw的repo:
[UDPspeeder Wiki](https://github.com/wangyu-/UDPspeeder/wiki)
https://github.com/wangyu-/udp2raw-tunnel
##### 提示
如果你嫌UDPspeeder+OpenVPN麻烦你可以尝试tinyFecVPN一个集成了UDPspeeder功能的VPN
如果你嫌UDPspeeder+OpenVPN麻烦你可以尝试tinyfecVPN一个集成了UDPspeeder功能的VPN
tinyFecVPN的repo:
tinyfecVPN的repo:
https://github.com/wangyu-/tinyFecVPN
https://github.com/wangyu-/tinyfecVPN
#### 效果
![image0](/images/cn/ping_compare_cn.PNG)
![image0](/images/cn/scp_compare.PNG)
#### 原理简介
主要原理是通过冗余数据来对抗网络的丢包发送冗余数据的方式支持FEC(Forward Error Correction)和多倍发包其中FEC算法是Reed-Solomon。
@@ -48,12 +50,18 @@ FEC方式的原理图:
client支持多个udp连接server也支持多个client
#### 关键词
UDP加速器、双边UDP加速、全流量加速、开源加速器、游戏加速、网游加速器
# 简明操作说明
### 环境要求
Linux主机可以是桌面版可以是android手机/平板可以是openwrt路由器也可以是树莓派。Release中提供了`amd64``x86``arm``mips_be``mips_le`的预编译binary.
对于windows和mac用户在虚拟机中可以稳定使用speeder跑在Linux里其他应用照常跑在window里桥接模式测试可用。可以使用[这个](https://github.com/wangyu-/udp2raw-tunnel/releases/download/20171108.0/lede-17.01.2-x86_virtual_machine_image.zip)虚拟机镜像大小只有7.5mb免去在虚拟机里装系统的麻烦虚拟机自带ssh server可以scp拷贝文件可以ssh进去可以复制粘贴root密码123456
Windows、MacOS、BSD也已经原生支持
<del>对于windows和mac用户在虚拟机中可以稳定使用speeder跑在Linux里其他应用照常跑在window里桥接模式测试可用。可以使用[这个](https://github.com/wangyu-/udp2raw-tunnel/releases/download/20171108.0/lede-17.01.2-x86_virtual_machine_image.zip)虚拟机镜像大小只有7.5mb免去在虚拟机里装系统的麻烦虚拟机自带ssh server可以scp拷贝文件可以ssh进去可以复制粘贴root密码123456。</del>
android版需要通过terminal运行。
@@ -77,7 +85,7 @@ https://github.com/wangyu-/UDPspeeder/releases
现在client和server之间建立起了tunnel。想要连接44.55.66.77:7777只需要连接 127.0.0.1:3333。来回的所有的udp流量会被加速。
##### 备注:
##### 备注
`-f20:10`表示对每20个原始数据发送10个冗余包。`-f20:10``-f 20:10`都是可以的空格可以省略对于所有的单字节option都是如此。对于双字节option例如后面会提到的`--mode 0`,空格不可以省略。
@@ -85,10 +93,16 @@ https://github.com/wangyu-/UDPspeeder/releases
推荐使用`--mode 0`选项否则你可能需要考虑MTU问题。
##### 注意
这里推荐的参数是给日常/非游戏情况下使用的;玩游戏请用 [使用经验](https://github.com/wangyu-/UDPspeeder/wiki/使用经验) 里推荐的参数。
##### 提示
对于某些运营商UDPspeeder跟udp2raw配合可以达到更好的速度udp2raw负责把UDP伪装成TCP来绕过运营商的UDP限速。
udp2raw的repo:
https://github.com/wangyu-/udp2raw-tunnel
# 进阶操作说明
### 命令选项
@@ -159,7 +173,7 @@ log and help options:
数据发送和接受报告。开启后可以根据此数据推测出包速和丢包率等特征。`--report 10`表示每10秒生成一次报告。
##### `-i` 选项
指定一个时间窗口长度为n毫秒。同一个fec分组的数据在发送时候会被均匀分散到这n毫秒中可以对抗突发性的丢包默认值是0,因为这个功能需要用到时钟,在某些虚拟机里时钟不稳定,可能会导致个别包出现非常大的延迟,所以默认关掉了。这个功能很有用,默认参数效果不理想时可以尝试打开,比如用`-i 10`。这个选项的跟通信原理上常说的`交错fec` `交织fec`的原理是差不多的。
指定一个时间窗口长度为n毫秒。同一个fec分组的数据在发送时候会被均匀分散到这n毫秒中可以对抗突发性的丢包默认值是0(也就是不开启此功能)。 这个功能很有用,在推荐的参数效果不理想时可以尝试打开,比如用`-i 10``-i 20`。这个选项的跟通信原理上常说的`交错fec` `交织fec`的原理是差不多的。
##### `-j` 选项
为原始数据的发送增加一个延迟抖动值。这样上层应用计算出来的RTT方差会更大以等待后续冗余包的到达不至于发生在冗余包到达之前就触发重传的尴尬。配合-t选项使用。正常情况下跨国网络本身的延迟抖动就很大可以不用设-j。这个功能也需要时钟默认关掉了不过一般情况应该不需要这个功能。
@@ -197,89 +211,22 @@ echo mode 0 > fifo.file
##### `--disable-obscure`
UDPspeeder默认情况下会对每个发出的数据包随机填充和异或一些字节(4~32字节)这样通过抓包难以发现你发了冗余数据防止VPS被封。这个功能只是为了小心谨慎即使你关掉这个功能基本上也没问题关掉可以省一些带宽和CPU。`--disable-obscure`可以关掉这个功能。
# 推荐参数
https://github.com/wangyu-/UDPspeeder/wiki/推荐设置
# 使用经验
https://github.com/wangyu-/UDPspeeder/wiki/使用经验
# 应用
#### UDPspeeder + OpenVPN加速任何流量也适用于其他VPN
![image0](/images/Capture2.PNG)
可以和BBR/锐速叠加不过BBR/锐速部署在VPS上只对本地和VPS间的流量有效对从本地和第三方服务器间的流量无效。
需要在服务端开启ipforward和NAT。在客户端改路由表可以手动修改也可以由OpenVPN的redirect-gateway选项自动加好
Linux具体配置: [UDPspeeder + openvpn config guide](/doc/udpspeeder_openvpn.md).
Windows具体配置: [win10系统UDPspeeder+OpenVPN的完整设置](https://github.com/wangyu-/UDPspeeder/wiki/win10系统UDPspeeder-OpenVPN的完整设置)
如果UDPspeeder + OpenVPN对你来说显得太麻烦了你可以尝试一下tinyFecVPN,一个集成了UDPspeeder功能的VPN:
https://github.com/wangyu-/tinyFecVPN/
#### UDPspeeder + kcptun/finalspeed + $*** 同时加速tcp和udp流量
如果你需要用加速的tcp看视频和下载文件这样效果可能比没有BBR的UDPspeeder+vpn方案更好。另外如果你需要玩游戏但是嫌配VPN麻烦也可以用这种方案。
![image0](/images/cn/speeder_kcptun.PNG)
具体配置方法简介:
假设$\*\*\* server监听在在44.55.66.77的443端口(tcp和udp同时)。用kcptun把tcp 443映射到本地的tcp 1234用UDPspeeder把udp 443的映射到本地的udp 1234。
然后让$\*\*\* client 去连127.0.0.1:1234就可以了tcp和udp都被加速了。完整命令
```
run at server side:
./kcp_server -l ":4000" -t "127.0.0.1:443" -mode fast2
./speederv2 -s -l0.0.0.0:4001 -r127.0.0.1:443 -f20:10 -k "passwd"
run at client side:
./kcp_client -l ":1234" -r "44.55.66.77:4000" -mode fast2
./speederv2 -c -l0.0.0.0:1234 -r44.55.66.77:4001 -f20:10 -k "passwd"
```
这就是全部的命令了。issue里有很多人困惑于怎么把tcp和udp流量"分开",其实很简单就可以做到。
如果只需要加速UDP不需要加速TCP可以把kcptun换成其他的任意端口转发方式比如ncat/socat/ssh tunnel/iptables/[tinyPortMapper](https://github.com/wangyu-/tinyPortMapper/releases)。
如果你没有kcptun只有BBR/锐速的话也可以把kcptun换成ncat/socat/ssh tunnel/iptables/[tinyPortMapper](https://github.com/wangyu-/tinyPortMapper/releases)。这样TCP流量由锐速/BBR加速UDP由UDPspeeder加速。
另外,即使你不想使用$\*\*\*的TCP功能你也必须把$\*\*\*的TCP端口转发过来否则无法使用UDP功能这是socks5协议的工作方式决定的。($\*\*\*-redir方式不受此限制)
#### UDPspeeder + openvpn + $*** 混合方案也适用于其他VPN
也是我正在用的方案。优点是可以随时在vpn和$\*\*\*方案间快速切换。
实际部署起来比图中看起来的还要简单。不需要改路由表不需要写iptables规则和开启NAT需要做的只是用openvpn分配的ip访问$*** server。
![image0](/images/cn/speeder_vpn_s.PNG)
(也可以把图中的$*** server换成其他的socks5 server这样就不需要$*** client了)
可以和BBR/锐速叠加BBR/锐速只要部署在VPS上就有效。
也可以用[tinyFecVPN](https://github.com/wangyu-/tinyFecVPN/) + $\*\*\* ,配置起来更简单。
# 应用实例
#### win10系统UDPspeeder+OpenVPN的完整设置
https://github.com/wangyu-/UDPspeeder/wiki/win10系统UDPspeeder-OpenVPN的完整设置
#### UDPspeeder+OpenVPN运行在linux上透明加速linux本机的网络
https://github.com/wangyu-/tinyFecVPN/wiki/tinyFecVPN运行在linux上透明加速linux本机的网络
#### UDPspeeder+OpenVPN运行在虚拟机中加速windows和局域网内其他主机的网络
https://github.com/wangyu-/tinyFecVPN/wiki/tinyFecVPN运行在虚拟机中加速windows和局域网内其他主机的网络
#### 用树莓派做路由器,搭建透明代理,加速游戏主机的网络
https://github.com/wangyu-/UDPspeeder/wiki/用树莓派做路由器,搭建透明代理,加速游戏主机的网络
# 编译教程
暂时先参考udp2raw的这篇教程几乎一样的过程。
https://github.com/wangyu-/udp2raw-tunnel/blob/master/doc/build_guide.zh-cn.md
# wiki
更多内容请看 wiki:
https://github.com/wangyu-/UDPspeeder/wiki

BIN
images/cn/merlin1.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 115 KiB

BIN
images/cn/merlin2.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 132 KiB

BIN
images/cn/merlin3.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 149 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 33 KiB

View File

@@ -140,24 +140,27 @@ int from_normal_to_fec(conn_info_t & conn_info,char *data,int len,int & out_n,ch
}
}
if(out_n>0)
{
log_bare(log_trace,"seq= %u ",read_u32(out_arr[0]));
}
for(int i=0;i<out_n;i++)
{
inner_stat.output_packet_num++;
inner_stat.output_packet_size+=out_len[i];
log_bare(log_trace,"%d ",out_len[i]);
}
log_bare(log_trace,"\n");
}
mylog(log_trace,"from_normal_to_fec input_len=%d,output_n=%d\n",len,out_n);
if(out_n>0)
{
log_bare(log_trace,"seq= %u ",read_u32(out_arr[0]));
}
for(int i=0;i<out_n;i++)
{
inner_stat.output_packet_num++;
inner_stat.output_packet_size+=out_len[i];
log_bare(log_trace,"%d ",out_len[i]);
}
log_bare(log_trace,"\n");
//for(int i=0;i<n;i++)
//{
//delay_send(0,dest,s_arr[i],s_len);
@@ -576,6 +579,7 @@ void process_arg(int argc, char *argv[])
{"tun-mtu", required_argument, 0, 1},
{"disable-mssfix", no_argument, 0, 1},
{"keep-reconnect", no_argument, 0, 1},
{"interval", required_argument, 0,'i'},
{NULL, 0, 0, 0}
};
int option_index = 0;