PMTU Discovery

Daniel Schall Daniel-Schall at web.de
Thu Jan 6 22:33:28 CET 2011


On Wednesday, January 05, 2011 2:30 PM, Guus Sliepen wrote:

> The PMTU discovery process already takes compression into account, and the
MTU it sets is always small enough so that even an incompressible packet
that will expand somewhat can still be safely sent via UDP.
> Furthermore, ICMP packets will have been sent and PMTU clamping will be
used so that the sender will usually not send packets that are larger than
the PMTU tinc found. The fallback to TCP is only used when the PMTU
discovery has not yet finished, and when someone still sends a packet that
is too large and cannot be handled otherwise (for example, non-IP protocols
or some routing protocols that add their own footer to IP packets).

> > 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.

> Although that could be done I don't think it is worth the effort for the
few packets that might benefit from it.

I don't get, why you do this the hard way with so much uncertainties.
PMTU Discovery could be done easier by sending data packets of arbitrary
size WITHOUT compressing them.
That would enable the nodes to check the real data size that fits through
the channel.

Although PMTU Discovery works with compressed packets and some "magic" to
allow badly compressible packets as well, I think just sending uncompressed
packets would be a lot easier and more reliable.

I have attached some code that slightly modifies the PMTU process.

First, the method "send_udppacket" checks, if compression is enabled and if
it really reduces the size of the packet.
If not, the packet is sent uncompressed. A flag in vpn_packet_t is set
accordingly to allow the remote node to check whether decompression is
needed or not.

Second, the method "send_mtu_probe" now sends 3 packets between minmtu and
maxmtu, with compression disabled. ("send_udppacket" takes this into
account.)
The method "mtu_probe_h" receives the MTU probes and adjusts the min/max mtu
of the nodes accordingly. Afterwards, it replies the MTU packet to the
sender.
That enables the sender to get the MTU correctly as well.

In case you don't like my coding style / submission style, please feel free
to incorporate the changes to your repository your own way.
I did not yet manage to set up an own git repository with remote access, nor
was I able to set up git-email support till now.

If you could provide some git branches for external developers, that'd be
really great!


By the way, I also removed the method "usleep" from your code, since my
version of mingw has the method already built in. Therefore, there is no
need to define/implement the method on your own.
Maybe you need to include that method conditionally, depending if there
already exists a built-in "usleep" method.

In this commit, I also finished rewriting the logging part. Each log level
has now a flag and you can combine log levels you want to log by ORing the
according flags.
CTRL+C enables DEBUG_SCARY_THINGS similar to the old behavior.


Best,

Daniel
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: 2f5f7d011a400417ce04bd0226cbd04026724d4b.txt
URL: <http://www.tinc-vpn.org/pipermail/tinc-devel/attachments/20110106/014bf342/attachment.txt>


More information about the tinc-devel mailing list