From: Nerdwurx on
Hi list,

I'm wondering about the reliability of sending UDP packets that are
larger than the MTU of the link. I know that, contrary to TCP, UDP does
not do fragments, but IP has some fragmentation ability, so it should
take care of that regardless. Even though IPv6 with it's PMTU discovery
doesn't fragment on intermediate nodes, the endpoint stacks supposedly
still do fragmentation, if I've read that correctly, so the IP version
shouldn't really matter.

Therefore, it would be possible to send UDP packets that are larger than
the MTU, and still have them arrive either properly or not at all, just
like normal UDP packets. I thus wonder if there is any drawback to doing
that, except that the additional packets may increase loss rates?
Especially, should I better fragment myself and put some sequence
numbers in it, or is that just going to do the same thing at best?

Thanks in advance!

--
Please don't reply to the email address in the header.
From: Rick Jones on
Nerdwurx <me(a)privacy.net> wrote:
> I'm wondering about the reliability of sending UDP packets that are
> larger than the MTU of the link. I know that, contrary to TCP, UDP
> does not do fragments, but IP has some fragmentation ability, so it
> should take care of that regardless.

TCP does not have fragmentation. It has segmentation and reassembly.
While it will do its segmentation in ways to try to avoid IP having to
fragment the IP datagrams carrying the TCP segments, that is not a
100% thing.

As you note, UDP makes no attempt to either segment or fragment its
datagrams and leaves that task entirely to IP.

If one fragment of an IP datagram is lost, the entire IP datagram is
unusable. All fragments of the IP datagram must arrive to be usable.
So, if there is a packet loss probability of p, it means that the
probability of a packet getting to its destination is (1-p). If there
are N fragments of the IP datagram, the probability of all the
fragments getting there are (1-p)^N . You can see then that a given
packet loss probability becomes a much larger datagram loss
probability.

> Even though IPv6 with it's PMTU discovery doesn't fragment on
> intermediate nodes, the endpoint stacks supposedly still do
> fragmentation, if I've read that correctly, so the IP version
> shouldn't really matter.

Even IPv4 PMTU discovery does not fragment in intermediate nodes. The
datagram/fragment needing (further) fragmentation but with the DF bit
is dropped and an ICMP message is sent to the source, which will have
to adjust its behaviour and resend the data.

> Therefore, it would be possible to send UDP packets that are larger
> than the MTU, and still have them arrive either properly or not at
> all, just like normal UDP packets. I thus wonder if there is any
> drawback to doing that, except that the additional packets may
> increase loss rates? Especially, should I better fragment myself
> and put some sequence numbers in it, or is that just going to do the
> same thing at best?

PathMTU discovery will increase the effective packet loss rate since
it drops traffic in the middle when it "hits" - you will have to make
sure you account for that in your application design.

Also, whereas (generally) TCP only has to retransmit those segments
which were lost, the UDP application will have to retransmit the
entire message being carried in the UDP datagram. This means that
more data will be "unnecessarily" retransmitted (even though such a
retransmission is required), which will lessen efficiency of the
network. The extent is one of those (in)famous "it depends" things.

rick jones
--
The computing industry isn't as much a game of "Follow The Leader" as
it is one of "Ring Around the Rosy" or perhaps "Duck Duck Goose."
- Rick Jones
these opinions are mine, all mine; HP might not want them anyway... :)
feel free to post, OR email to rick.jones2 in hp.com but NOT BOTH...
From: Rick Jones on
Nerdwurx <me(a)privacy.net> wrote:

> Especially, should I better fragment myself and put some sequence
> numbers in it, or is that just going to do the same thing at best?

Unless you never have more than one message (UDP datagram) outstanding
at a time, or you don't care about messages/ UDP datagrams being
re-ordered, you need some sort of information in each message to allow
the receiver to put them into the correct order - independent of
whether or not those messages get fragmented.

rick jones
--
Process shall set you free from the need for rational thought.
these opinions are mine, all mine; HP might not want them anyway... :)
feel free to post, OR email to rick.jones2 in hp.com but NOT BOTH...
From: Nerdwurx on
Thanks for the quick and detailed replies, it's exactly what I needed to
know!

Regards


--
Please don't reply to the email address in the header.