mirror of
https://github.com/cwinfo/yggdrasil-go.git
synced 2024-11-22 11:50:28 +00:00
temporarily limit PMTU to 2048, as a workaround to some pathelogical behavior where a TCP stream carried over a UDP peer can throttle down to 0 in the presence of significant packet loss
This commit is contained in:
parent
d3dc7765f2
commit
bb3ae8b39b
@ -152,6 +152,15 @@ func (ss *sessions) createSession(theirPermKey *boxPubKey) *sessionInfo {
|
||||
sinfo.myNonce = *newBoxNonce()
|
||||
sinfo.theirMTU = 1280
|
||||
sinfo.myMTU = uint16(ss.core.tun.mtu)
|
||||
if sinfo.myMTU > 2048 {
|
||||
// FIXME this is a temporary workaround to an issue with UDP peers
|
||||
// UDP links need to fragment packets (within ygg) to get them over the wire
|
||||
// For some reason, TCP streams over UDP peers can get stuck in a bad state
|
||||
// When this happens, TCP throttles back, and each TCP retransmission loses fragments
|
||||
// On my wifi network, it seems to happen around the 22nd-23rd fragment of a large packet
|
||||
// By setting the path MTU to something small, this should (hopefully) mitigate the issue
|
||||
sinfo.myMTU = 2048
|
||||
}
|
||||
higher := false
|
||||
for idx := range ss.core.boxPub {
|
||||
if ss.core.boxPub[idx] > sinfo.theirPermPub[idx] {
|
||||
|
Loading…
Reference in New Issue
Block a user