gfcp: A high-performance variant of KCP for Go.
Jeff Johnson c10130a529 README: Formatting and minor corrections. | 3 years ago | |
---|---|---|
.github | 3 years ago | |
.deepsource.toml | 3 years ago | |
.gitignore | 3 years ago | |
.gitlab-ci.yml | 3 years ago | |
.mergify.yml | 3 years ago | |
.whitesource | 3 years ago | |
LICENSE | 3 years ago | |
README.md | 3 years ago | |
SECURITY.md | 3 years ago | |
gfcp.go | 3 years ago | |
gfcp_entropy.go | 3 years ago | |
gfcp_fec.go | 3 years ago | |
gfcp_fec_test.go | 3 years ago | |
gfcp_network_test.go | 3 years ago | |
gfcp_readloop_generic.go | 3 years ago | |
gfcp_readloop_linux.go | 3 years ago | |
gfcp_sess.go | 3 years ago | |
gfcp_sess_test.go | 3 years ago | |
gfcp_snsi.go | 3 years ago | |
gfcp_test.go | 3 years ago | |
gfcp_updater.go | 3 years ago | |
go.mod | 3 years ago | |
go.sum | 3 years ago |
gfcptun: An fast and low-latency connection tunnel using GFCP over UDP.
sysctl
tuning parameters UDP handling - see
https://www.sciencedirect.com/topics/computer-science/bandwidth-delay-product
for BDP background information:net.core.rmem_max=26214400 // BDP (Bandwidth Delay Product)
net.core.rmem_default=26214400
net.core.wmem_max=26214400
net.core.wmem_default=26214400
net.core.netdev_max_backlog=2048 // (Proportional To Receive Window)
-sockbuf 16777217
Client: ./gfcp_client -r "LISTEN_IP:4321" -l ":8765" -mode fast3 -nocomp -autoexpire 900 -sockbuf 33554434 -dscp 46
Server: ./gfcp_server -t "TARGET_IP:8765" -l ":4321" -mode fast3 -nocomp -sockbuf 33554434 -dscp 46
Application🠚TunOut[8765/TCP]🠚Internet🠚TunIn[4321/UDP]🠚Server[8765/TCP]
-mode fast3 -ds 10 -ps 3
etc.-rcvwnd
on client and -sndwnd
on server in unison.
( 'Wnd' * ( 'MTU' / 'RTT' ) )
fast3
🠚fast2
🠚fast
🠚normal
🠚default
-smuxbuf
16MB or more - actual value to use depends on link congestion
and available memory.SMUXv2 can limit per-stream memory usage. Enable with -smuxver 2
, and tune
-streambuf
.
-smuxver 2 -streambuf 8388608
for 8MiB buffer per stream.Start tuning by limiting the stream buffer on the receiving side of the link.
SMUXv2 configuration is not negotiated, so must be set manually on both sides of the GFCP link.
GOGC
varuable tuning:
Notes for SMUX tuning:
The buffer pool mechanism maintains a high watermark for in-flight objects from the pool, as to survive periodic garbage collection.
Memory will be returned to the system by the Go runtime when idle. Variables
that can be used for tuning this are -sndwnd
,-rcvwnd
,-ds
, and -ps
.
These parameters affect the high watermark - the larger the value, the
higher the total memory consumption at any given moment.
The -smuxbuf
setting and GOMAXPROCS
variable adjust the balance between
concurrency limits and overall resource usage.
-smuxbuf
will increase practical concurrency limits, however,
the -smuxbuf
value is not linerally proprotional to total concurrency
handling, mostly due to the runtime's non-deterministic garbage collection
interactions. Because of this, only empirical testing can provide feedback
needed for making usable, real-life tuning recommendations.Optional compression using Snappy is available.
Compression may save bandwidth for redundant, low-entropy data, but will increase overhead in all other cases (and increase CPU usage).
-nocomp
to disable.USR1
signal, detailed link information will be displayed.-mode manual -nodelay 1 -interval 20 -resend 2 -nc 1