From: Guus Sliepen Date: Sun, 26 Apr 2020 12:48:18 +0000 (+0200) Subject: Improved PMTU probe algorithm. X-Git-Url: http://git.meshlink.io/?a=commitdiff_plain;ds=sidebyside;h=bc2e55e940e45748a49f1a7eb44b156917fca469;hp=bc2e55e940e45748a49f1a7eb44b156917fca469;p=meshlink Improved PMTU probe algorithm. This changes the PMTU probing algorithm to: - Send frequent (10 second interval) small UDP packets (~60 bytes) to probe whether UDP is possible at all, and to keep NAT mappings alive. - Initial PMTU probing sends 1 packet every 0.333 seconds, starting with the interface MTU (which is assumed to be the most likely PMTU), then doing a bisection with up to 20 probes if that didn't work. - After the PMTU has been fixed, it sends one packet of size PMTU and one of PMTU+1, to check whether there are changes in the PMTU. Furthermore, probes are now sent on-demand where possible. Small probes are always sent every 10 second between nodes that have a meta-connection, since they need to keep their NAT mappings alive to be able to assist with UDP hole punching. But large probes, and small probes between nodes that don't share a meta-connection, are only sent if there is actual channel traffic between the nodes. A final optimization is that probe replies are now short (~60 bytes) packets that encode the length of the probe request. Before, around 9000 bytes/minute would be used for probes, with this commit only 2280 bytes/minute will be used in case there is channel traffic, otherwise only 720 bytes/minute will be used. ---