Commit Graph
17 Commits
Author SHA1 Message Date
Matthias Radestock 2649796369 discover pmtu with binary search
issue #15
2014-08-31 13:39:44 +01:00
Matthias Radestock 7dd0bcd1e0 deal with pmtu verification confirmation in forwarder goroutine
...rather than connection goroutine.
This is a precurser to smarter pmtu verification, the logic for which
is in the forwarder.
issue #15
2014-08-30 23:18:44 +01:00
Matthias Radestock 5b6dc2d762 (slightly) faster pmtu discovery
Issues with the previous scheme...

When we have just encountered an EMSGSIZE, the odds of encountering
another one straight away, when attemtping to send a verification
packet with the lower mtu, are slim, since for a new, lower mtu to be
set some packet must have made it further then the one that triggered
the icmp3.4 that gave rise to the EMSGSIZE, and we must have received
the resulting icmp3.4. All of which takes time.

Also, sending a bunch of udp packets in rapid succession is not a
great way to improve their chances of making it through to the other
peer, since they could easily all get dropped by a single congestion
event or other network glitch.

Now we send a single verification packet, wait for a short while, and
if we don't get a response then we send another one, wait for longer
period (2x), etc, until some upper bound is reached, at which point we
lower the pmtu and start the verification process again (same as
currently happens).

We are now also calling flush() to send the verification packet, just
as we do for ordinary packets. This makes for shorter code, consistent
error handling, and introduces a nice little recursion :)
2014-08-29 19:15:18 +01:00
Matthias Radestock 753af453ef fix off-by-14 error in fragmentation
This was harmless since it simply meant our fragments were not as long
as they could be.
2014-08-28 14:17:00 +01:00
Matthias Radestock 1a51ee8807 explain rationale for accounting for EthernetOverhead 2014-08-28 11:49:00 +01:00
Matthias Radestock eb5d6f0d89 refactor: extract Forwarder 2014-08-27 23:31:37 +01:00
Matthias Radestock 4710a59ac8 calculate an initial effectivePMTU
That way as soon as the forwarder is live we have a sensible value
2014-08-27 21:40:16 +01:00
Matthias Radestock 41d3a6dc7c log the *effective* pmtu when dropping frames
since that is more relevant
2014-08-27 21:38:18 +01:00
Matthias Radestock 6cec7a036c refactor: yet more clarity on naming around pmtu 2014-08-27 17:55:43 +01:00
Matthias Radestock f5e3450f0c refactor: clear distinction between actual and effective pmtu 2014-08-27 17:27:14 +01:00
Matthias Radestock b350924a63 refactor: remove unused field 2014-08-27 16:33:21 +01:00
Matthias Radestock 2a3256805f tiny refactor: rename, move 2014-08-26 21:28:40 +01:00
Matthias Radestock 6f30cf2daf 8 is better than 10
It's quite common for the real pmtu to be 8 less than what was
advertised.
2014-08-26 21:11:24 +01:00
Matthias Radestock c5d39fd5bf drop maxpayload in conjunction with clientPMTU
Seems odd to do the latter w/o the former. And wrong.
2014-08-26 21:09:23 +01:00
Matthias Radestock c6a796675d pay attention to EMSGSIZE errors when sending pmtu verification packets
and drop the pmtu accordingly
This way, when we actually *do* get pmtu info from the network/kernel
we can discover the correct pmtu much more quickly. Especially in the
absence of other traffic, forwarding of which was previously the only
place where we'd check for EMSGSIZE.

Fixes #12
2014-08-26 21:05:13 +01:00
Matthias Radestock f0182ba471 refactor: reduce indentation 2014-08-23 10:32:39 +01:00
Matthias Radestock e6feefa1fc initial commit 2014-08-18 17:55:26 +01:00