User: Password:
Subscribe / Log in / New account

UDP merging vs VoIP

UDP merging vs VoIP

Posted Oct 31, 2009 18:31 UTC (Sat) by NAR (subscriber, #1313)
Parent article: JLS2009: Generic receive offload

Is this a good idea to wait for UDP packets to be merged if these packets contain voice data? It could create noticable jitter...

(Log in to post comments)

UDP merging vs VoIP

Posted Nov 1, 2009 1:02 UTC (Sun) by intgr (subscriber, #39733) [Link]

> to wait for UDP packets to be merged

The article partly answers your question:
> How does the kernel decide how long to wait for incoming packets before
> merging them? It turns out that there is no real need for any special
> waiting code: the NAPI API already has the driver polling for new packets
> occasionally and processing them in batches. GRO can simply be performed
> at NAPI poll time.

In a low-throughput setting, the kernel uses the normal interrupt-driven networking mode. Individual packets are processed as quickly as they come in over the wire.

Only when the CPU is too pegged to keep up with the interrupt load, does NAPI revert to the polling mode. At this point, without NAPI, the CPU would already be thrashing -- spending time to receive packets that it has no time to process. GRO merely increases the throughput that can be handled in polling mode.

How many packets are grabbed in each polling cycle can be changed with /proc/sys/net/core/netdev_budget (the default 300 is quite modest IMHO)

UDP merging vs VoIP

Posted Nov 1, 2009 11:00 UTC (Sun) by NAR (subscriber, #1313) [Link]

I think VoIP doesn't mind if a couple of packets is lost (that's why it uses UDP in the first place), the jitter is more problematic. Buffering doesn't really help, because in a phone conversation one might want to interrupt what the other says and seconds of buffering kind of breaks this.

I'm not quite sure where this merging could be done. Only at the endpoints or in routers between?

UDP merging vs VoIP

Posted Nov 1, 2009 16:58 UTC (Sun) by intgr (subscriber, #39733) [Link]

From the article:
> If a system is serving as a router, it really should not be changing the
> headers on packets as they pass through.

Also, VOIP uses UDP simply because TCP would add additional delay when it attempts to retransmit packets that already missed their deadline.

But VOIP is still affected by packet loss. A UDP packet that missed its deadline is never way any worse than a UDP packet that got dropped.

Copyright © 2017, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds