[libnice] Dividing data for UDP packets in nice_agent_send

Youness Alaoui kakaroto at kakaroto.homelinux.net
Tue Jun 17 12:05:07 PDT 2014


Indeed, nice_agent_send will send it as as a single UDP packet. If the size
is bigger than the MTU, the packet will be split by the kernel though, but
I believe it will be reconstructed on the other side as a single packet.
The issue with split packets bigger than the MTU is that if one of the
packets is lost, the entire message is lost.
Since you're adding a header, you can save a lot by avoiding the memcpy and
using the nice_agent_send_message. Each NiceOutputMessage will represent a
single UDP packet, and you can construct your message using the bufffers
inside the NiceOutputMessage. We use that internally when we need to wrap
data inside a header without doing any memcpy for increased performance.

I hope this helps,

On Tue, Jun 17, 2014 at 12:15 PM, Olivier Crête <olivier.crete at collabora.com
> wrote:

> Hi,
> If you're not in reliable mode, each call to nice_agent_send() will
> result in one UDP packet.
> On Tue, 2014-06-17 at 13:35 +0200, Radosław Kołodziejczyk wrote:
> > Hello all,
> >
> >
> > I have a question about nice_agent_send. We're writing an app that
> > would like to wrap a very minimal protocol around UDP transport to
> > have a kind of minimalistic error detection. To do so we would have to
> > make sure that each of our data packets are delivered in one UDP
> > packet (or at least make it as likely as possible). Is there a way to
> > determine what's max buffer size that can be passed to libnice's
> > nice_agent_send function so that it would not divide the data while
> > sending it to the remote side?
> >
> >
> > Kind regards,
> > Radosław Kołodziejczyk.
> > _______________________________________________
> > nice mailing list
> > nice at lists.freedesktop.org
> > http://lists.freedesktop.org/mailman/listinfo/nice
> --
> Olivier Crête
> olivier.crete at collabora.com
> _______________________________________________
> nice mailing list
> nice at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/nice
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/nice/attachments/20140617/39d99198/attachment.html>

More information about the nice mailing list