PMTU Discovery

Daniel Schall Daniel-Schall at web.de
Wed Jan 5 11:23:16 CET 2011


Dear Guus,

 

while improving the PMTU Discovery algorithm, I found the following behavior
in the method "send_udppacket":

 

1)      The code checks, whether the data size is smaller than the MTU, thus
if it fits into a single UDP packet.

If not, you send the packet via TCP.

2)      The data is compressed, changing its size. (Usually, making it
smaller, but that's not always true.)

3)      The compressed data is sent.

 

My question is: What use is it, to check the data size prior to compression?

In a worst-case scenario, the uncompressed data could fit into a single UDP
packet, while the compressed data does not.

(This is especially true for encrypted data, which can only be compressed
badly.)

That would result in sending two fragmented UDP packets to the destination,
increasing overhead and making packet delivery more unreliable.

 

I suggest to implement a check, if the compressed data really is smaller
than the uncompressed one and decide, what to send over the wire.

To distinguish between compressed and uncompressed data, we could introduce
a flag in vpn_packet.

As you might have seen, I already included some flags in my commit, there'd
be enough room to add another, indicating whether compression was used or
not.

 

 

Best,

 

Daniel

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.tinc-vpn.org/pipermail/tinc-devel/attachments/20110105/237c47da/attachment.htm>


More information about the tinc-devel mailing list