Re: UDP send costs in Linux

Phillip Hallam-Baker <> Wed, 04 April 2018 16:28 UTC

Return-Path: <>
Received: from localhost (localhost []) by (Postfix) with ESMTP id 555AD127978 for <>; Wed, 4 Apr 2018 09:28:51 -0700 (PDT)
X-Virus-Scanned: amavisd-new at
X-Spam-Flag: NO
X-Spam-Score: 0.589
X-Spam-Status: No, score=0.589 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.25, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.249, HTML_MESSAGE=0.001, HTTPS_HTTP_MISMATCH=1.989, RCVD_IN_DNSWL_NONE=-0.0001, SPF_PASS=-0.001] autolearn=no autolearn_force=no
Authentication-Results: (amavisd-new); dkim=pass (2048-bit key)
Received: from ([]) by localhost ( []) (amavisd-new, port 10024) with ESMTP id mOXfjqRfoaej for <>; Wed, 4 Apr 2018 09:28:49 -0700 (PDT)
Received: from ( [IPv6:2607:f8b0:4003:c0f::234]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by (Postfix) with ESMTPS id CF025120724 for <>; Wed, 4 Apr 2018 09:28:48 -0700 (PDT)
Received: by with SMTP id m22-v6so23974592otf.10 for <>; Wed, 04 Apr 2018 09:28:48 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=o/UKnXq8LGgjByp3g7WRuBhEDe+BTRj+KwyoaArl/+o=; b=u7iknLhy5RCkW2HQJa30NFclDyMEVwqeXMDN18D+XebBKeDBSI+B0dhiauRO5El5m7 1gLBp+TGd8GtN0KeWNnnRXSpbryuEvHr8/TgTQ8qN0K0T3iognz7XH562OqSmnXxv14D Xf5dcYewixAUK6olfFupXzdo9xU57Bg0CUpCCra481vrgBwlWcPEsQtCi8qA4OmxDvOa I5J6d63JrQz3LOd8SJGleE/3o0veAqkv8OH1WuFJV/t2aEb/XgMraEML15IRURqFoh3z 0dSYuZM3mwVpp8vuyjdGN0rHzZo+vnmcAXgFuiUmkeUMP3y++m/gxJuXcR3aw6zc2gnS vIuQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=o/UKnXq8LGgjByp3g7WRuBhEDe+BTRj+KwyoaArl/+o=; b=nRgpubTIW5Hek/zskzQhpNux65i9FXK9r8OHPieUVaAo57NlP8Co/WtkPz6djoeUrD rOzWmVnYpqb9gXWQrulTTnWzUTO7Qj2qOJaTln68PkdnhPJMoB+8GNA9kDHHfjvMZP4H vQ1tgN/Ym6lXMj9/edcTbgd3qe/Lrk56vg6h7fuRtqSq9mkjOdgDBcYtzOZQsIvrXVAo CO9aSg549fzS7lQcJcZRSSQrjG6/ASZVfGBSWZ49dkbDdVrJeBq/mND6aGnyYoji7sKs ijl4bNUt10nkPj63k1r3Nm1kSgmSUdjreAa1aOq8bfjHzEq4ojiturGRUr+K0/JRmmJj thcA==
X-Gm-Message-State: AElRT7GDchIz2GQAabGPNSsx2pBgkZ5gJJ9OxQdZI2U0IiItbZ6ITbIr Y3AEe6BVc4oLcK2epme0kNR71TrG1CG3YjpRBNE=
X-Google-Smtp-Source: AIpwx49YJTNM+HGE9ttmaCRPaKidPEdT6a7CfVbfcD0jOht5rcA7/hz3nRM1anINdqusYeDfUx53BIr5Z1kbE/66WgY=
X-Received: by 2002:a9d:4a52:: with SMTP id d18-v6mr11962675otj.380.1522859328227; Wed, 04 Apr 2018 09:28:48 -0700 (PDT)
MIME-Version: 1.0
Received: by 2002:a9d:233c:0:0:0:0:0 with HTTP; Wed, 4 Apr 2018 09:28:47 -0700 (PDT)
In-Reply-To: <>
References: <> <> <> <>
From: Phillip Hallam-Baker <>
Date: Wed, 04 Apr 2018 12:28:47 -0400
X-Google-Sender-Auth: A7-t4T3n-A-3qZPwIkhvgklotpo
Message-ID: <>
Subject: Re: UDP send costs in Linux
To: Mikkel Fahnøe Jørgensen <>
Cc: Ian Swett <>, Subodh Iyengar <>, IETF QUIC WG <>
Content-Type: multipart/alternative; boundary="0000000000004d4ca20569085173"
Archived-At: <>
X-Mailman-Version: 2.1.22
Precedence: list
List-Id: Main mailing list of the IETF QUIC working group <>
List-Unsubscribe: <>, <>
List-Archive: <>
List-Post: <>
List-Help: <>
List-Subscribe: <>, <>
X-List-Received-Date: Wed, 04 Apr 2018 16:28:51 -0000

I would not worry too much at this point.

The reason we want to be able to work at the application level is backwards
compatibility. It has to be possible to deploy QUIC on any machine even
without OS support or it won't be deployable.

It does not have to be performant on every platform. If people are using
QUIC, whatever needs to be moved into the kernel for performance reasons
will move there.

On Wed, Apr 4, 2018 at 11:32 AM, Mikkel Fahnøe Jørgensen <
> wrote:

> I have no data to add on the Linux UDP stack, but another issue is the
> lack of netmap support in cloud hosting environments.
> I have not yet been working with this, but have looked into the problem
> and asked around.
> netmap is default in FreeBSD and optional in Linux. But neither works
> efficiently without a hypervisor patch that is also available for netmap.
> With support for netmap, the user space application can send directly to
> the network adapter with very little overhead. There is also dpdk and some
> other interfaces that might be slightly faster but more vendor specific.
> Assuming an application has access to optimized netmap, the only hurdle is
> address lookup, but if the application also manages that, or at least does
> the caching, there shouldn’t be much in the way of OS interference.
> Of course, netmap blocks the entire network stack, so no PING or SSH.
> CloudFlare added a netmap patch so only some traffic would be routed fra
> the network interface to netmap, and netmap also supports efficient packet
> forwarding to the OS or other applications.
> None of this works well in general, but for a cloud host that can be
> bootet automatically and destroyed rather than serviced, there is some
> opportunity.
> but only if cloud service providers starts adding support their supported
> images and hypervisors. Not sure if any are working on this now.
> Mikkel
> On 4 April 2018 at 15.11.17, Ian Swett (
> wrote:
> I hope some of these patches will be available soon, but I'm not sure if
> soon is a month or 6.
> On Tue, Apr 3, 2018 at 10:50 PM Subodh Iyengar <> wrote:
>> Thanks for sharing this Ian.
>> This definitely matches some of the observations we've seen as well in
>> the UDP write path. Some of the other paths that we saw that added overhead
>> was the route table lookup in linux udp stack. Connected UDP sockets did
>> amortize that.
>> I'm looking forward to a smarter sendmmsg with GSO and zero copy. Is
>> there any indication of the timeline for these patches to make it to linux?
>> Would be happy to try any of these out to help iron out the API.
>> Subodh
>> ------------------------------
>> *From:* QUIC <> on behalf of Ian Swett
>> <>
>> *Sent:* Tuesday, April 3, 2018 5:20:08 PM
>> *Subject:* UDP send costs in Linux
>> One challenge with QUIC at the moment is the increased CPU cost of
>> sending UDP packets vs TCP payloads.  I've seen this across every platform
>> Google has deployed QUIC on, so it's a widespread issue.
>> Here's an excellent presentation on what's causing the increased CPU
>> consumption on Linux from Willem de Bruijn(UDP starts on slide 9).
>> And while you're thinking of CPU usage, it's worth looking at the
>> presentation on timing wheel based packet pacing(which is minimum release
>> time based) and is ideal for QUIC(and TCP for that matter):
>> files/program/ts-9-4-carousel.pdf
>> <>
>> -Ian