Skip to content

Suggested parameters

Yancey Wang edited this page Nov 5, 2023 · 31 revisions

For non-game usage

For watching video, downloading and web browsing. It sends 10 redundant packets for every 20 packets, so the bandwidth usage is 1.5 times as normal. It may introduce 8ms+8ms round trip latency at most.

./speederv2 -s -l0.0.0.0:4096 -r127.0.0.1:7777   -k "passwd"  -f20:10  --timeout 8
./speederv2 -c -l0.0.0.0:3333 -r44.55.66.77:4096 -k "passwd"  -f20:10  --timeout 8

-f20:10 and --timeout 8 is the default value,you dont need to write them out explicitly.

If you network is very lossy,you may change -f20:10 to -f20:20.

If you want to save cpu usage, you may change -f20:10 to -f10:5.

For game usage

Sends 4 redundant packets for every 2 packets, with extra round-trip latency of at most 1ms+ 1ms.

./speederv2 -s -l0.0.0.0:4096 -r127.0.0.1:7777   -k "passwd"  -f2:4 --timeout 1
./speederv2 -c -l0.0.0.0:3333 -r44.55.66.77:4096 -k "passwd"  -f2:4 --timeout 1

You can also change -f2:4 to -f2:2 or -f2:6, depend on your network quality.

You can also use --timeout 0 to get zero latency, but its not suggested.

Its strongly suggested to not change the 2 in -f2:x, the reason will be explained later.

Compromise plan

make compromise between bandwidth usage and latency.

./speederv2 -s -l0.0.0.0:4096 -r127.0.0.1:7777   -k "passwd"  -f10:6 --timeout 4
./speederv2 -c -l0.0.0.0:3333 -r44.55.66.77:4096 -k "passwd"  -f10:6 --timeout 4

Sure, you can change -f10:6 to something like -f10:10.

Meaning of parameters

-fx:y send y redundant packets for every x packets. (Its not suggest to use x=1, with x=1 you have to pay attention to mtu problem. The detailed reason is explained in About-Large-Packet's-Passthrough)

--timeout t means the max latency allowed(for one direction)

Small t must be used with small x value, otherwise the overhead will be huge, and the bandwidth/cpu usage will become unpredictable. But this problem doesnt exist anymore if you used Fine-grained fec parameters(will be mentioned later) correctly.

You can use different parameters for client and server.

Other parameters

Anti burst packet-loss

you can use -i option to defend against burst packet loss. -i 10means enable interleaving FEC, and packets of each FEC group will be scattered into a inverval of 10ms.

For example, for the parameters mentioned above:

./speederv2 -s -l0.0.0.0:4096 -r127.0.0.1:7777   -k "passwd"  -f20:10 --timeout 8
./speederv2 -c -l0.0.0.0:3333 -r44.55.66.77:4096 -k "passwd"  -f20:10 --timeout 8

Add -i option into them, then they become:

./speederv2 -s -l0.0.0.0:4096 -r127.0.0.1:7777   -k "passwd"  -f20:10 --timeout 8 -i 10
./speederv2 -c -l0.0.0.0:3333 -r44.55.66.77:4096 -k "passwd"  -f20:10 --timeout 8 -i 10

Now burst packet-loss may be significantly reduced, at the cost of at most 10ms +10ms additional round-trip latency (compared with original parameters).

Parameters of -i option can be different at client/server side. You can also use -i option at only one side.

Fine-grained fec parameters

There is also an advanced form for -f option, you can specify multiple parameters for -f, for example:

-f1:3,2:4,20:10.

When used correctly it can effectively reduce the overhead of bandwidth cost. Suggested to read for experienced users.

Link:

https://github.com/wangyu-/UDPspeeder/wiki/Fine-grained-FEC-Parameters

Clone this wiki locally