netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH RFC 0/7] Generic UDP Encapsulation
@ 2014-01-02 22:12 Tom Herbert
  2014-01-04 22:33 ` Stephen Hemminger
  0 siblings, 1 reply; 3+ messages in thread
From: Tom Herbert @ 2014-01-02 22:12 UTC (permalink / raw)
  To: davem, netdev; +Cc: hkchu

This patch series implements Generic UDP Encapsulation (GUE).
Intelligently encapsulating packets in UDP leverages device
support for UDP flows. The 5-tuple hash can be computed for UDP
to provide good ECMP, RSS, or link aggregation port selection.

Generic UDP encapsulation refers to encapsulating packets of
arbitray IP protocols in UDP packets. Two flavors of GUE
are implemented in these patches:

1) Direct protocol encapsulation
2) Encapsualtion in generic UDP encapsulation 

---------------------------------
Direct protocol encapsualation

Direct protocol encapsulation is done by encapsulating a
packet directly as the payload of UDP packet. The protocol
of the packet is implied by the destination port. Source port
is a hash value for the inner packet.

+-------------+
|   UDP/IP    |
+-------------+
|   Packet    |
+-------------+

The packet can be of any IP protocol (L2, L3, or L4). The protocol
is transparent to the encapsulation, there are no per protocol
semantics in the encapsulation.

These should implement GRE in UDP encapsulation:
http://tools.ietf.org/html/draft-yong-tsvwg-gre-in-udp-encap-02

---------------------------------
Encapsulation in generic UDP encapsulation

http://tools.ietf.org/html/draft-herbert-gue-00 defines an extensible
method for generic UDP encapsulation of IP protocols. In this
case a GUE header is between the UDP header and encapsulated packet.

+-------------+
|   UDP/IP    |
+-------------+
|    GUE      |
+-------------+
|   Packet    |
+-------------+

The GUE header provides the protocol number of the encapsulated packet
so encapsulation of verious IP protocols can be multiplexed over a
single UDP socket. Again, we assume there are no per protocol
semantics in the encapsulation.

---------------------------------
Implementation

There are three potential uses for GUE
1) Encapsulate L2, L3 protocols for network tunnels (IPIP, SIT,
   GRE, ...).
2) Layer 4 protocols other than TCP UDP (AH, experimental, ...)
3) Encapsulation for network virtualization

For case 1) and case 2), these patches support the RX path using the
xfrm encap_recv function. On receive the encapsulation headers are
removed, and the protocol of the encapsulated packet is returned. The
protocol is deduced from the destination port in the case of direct
protocol encapsulation, or the protocol in the GUE header.

For the TX path in case 1), I modified ip_tunnel code to optionally
provide UDP encapsulation. This covers support for IPIP, SIT, and GRE.
An ioctl enables UDP encapsulation, parameters include the destination
port to send on. The source port is simple the lower order bytes of
the TX hash (sk_hash) of the packet being tunneled.

For TX case in case 2, I beleive TX xfrm can be done (similar to ESP).

For case 3, the GUE header would be used with a virtual network
identifier (VNID). It should be possible to simple enough to divert
packets with a VNID in the network virtualization path (like OVS).

---------------------------------
Configuration

A new module gue implements RX GUE header encapsulation. This takes
a module parameter which is the UDP port to listen on for GUE
encapsulated packets.

The GRE module was modified to take a port to listen on RX for direct
encapsulation of GRE/UDP.

Configuring tunnel (IPIP, SIT, or GRE) to use UDP encapsulation should
be new options to iptunnel. I haven't implemented that yet, just used
a simple program for testing.

---------------------------------
Test results

Running on 32 CPU system with bnx2x, this is configured with four
queues. Using 'ethtool -N eth0 rx-flow-hash udp4 sdfn' to enable UDP
RSS.

Native (no tunnel)
68.78% CPU utilization
4 interrupting CPUs ~95% utilized
113/155/223 90/95/99% latencies
1.66547e+06 tps
24214 tps/CPU

IPIP
51.17% CPU utilization
1 interrpting CPU ~95%
171/248/365 90/95/99% latencies
1.10803e+06
21653 tps/CPU

IPIP in GUE
75.20% CPU utilization
145/197/273 90/95/99% latencies
1.315e+06
17486 tps/CPU

GRE (with bnx2x RSS support)
71.22% CPU utilization
138/180/244 90/95/99% latencies 
1.30465e+06 CPU/tps
18318 tps/CPU

GRE-GUE
75.96% CPU utilization
145/196/271 90/95/99% latencies
1.31427e+06
17302 CPU/tps

---------------------------------
Continuing work

I have not yet looked at the interactions with the common offloads
(except the RSS). I think we'll want a generalized implementation of GRO
and GSO for UDP encapsulation. I'm hoping that the csum offloads
is general enough to work with GUE, and possibly the same story for
TSO (LRO still seems like the hardest to generalize). The appendix
in the Generic UDP Encapsulation I-D has a description of how NIC
offloads may be supported with GUE.

I believe there is a good chance that UDP encapsulation (like GUE)
could become common place within a data center (driven by requirements
for security and for increased use of non-TCP protocols). In light of
this, the overhead of processing UDP becomes significant. In the
testing above, the cost of UDP encapsulation is demonstrated in the
GRE vs. GUE-GRE cases (about a 6% increase in CPU utilization for same
packet throughput). I suspect nearly all of this additional cost is on
is on the receive side, we may want to consider a fast path for
UDP encapsulation in the receve path.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH RFC 0/7] Generic UDP Encapsulation
  2014-01-02 22:12 [PATCH RFC 0/7] Generic UDP Encapsulation Tom Herbert
@ 2014-01-04 22:33 ` Stephen Hemminger
  2014-01-04 23:13   ` Tom Herbert
  0 siblings, 1 reply; 3+ messages in thread
From: Stephen Hemminger @ 2014-01-04 22:33 UTC (permalink / raw)
  To: Tom Herbert; +Cc: davem, netdev, hkchu

On Thu, 2 Jan 2014 14:12:06 -0800 (PST)
Tom Herbert <therbert@google.com> wrote:

> This patch series implements Generic UDP Encapsulation (GUE).
> Intelligently encapsulating packets in UDP leverages device
> support for UDP flows. The 5-tuple hash can be computed for UDP
> to provide good ECMP, RSS, or link aggregation port selection.
> 
> Generic UDP encapsulation refers to encapsulating packets of
> arbitray IP protocols in UDP packets. Two flavors of GUE
> are implemented in these patches:
> 
> 1) Direct protocol encapsulation
> 2) Encapsualtion in generic UDP encapsulation 

Is this a new wire protocol, or a simplification of existing
tunnel code? It seems to be VXLAN without the VNI header.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH RFC 0/7] Generic UDP Encapsulation
  2014-01-04 22:33 ` Stephen Hemminger
@ 2014-01-04 23:13   ` Tom Herbert
  0 siblings, 0 replies; 3+ messages in thread
From: Tom Herbert @ 2014-01-04 23:13 UTC (permalink / raw)
  To: Stephen Hemminger; +Cc: David Miller, Linux Netdev List, Jerry Chu

On Sat, Jan 4, 2014 at 2:33 PM, Stephen Hemminger
<stephen@networkplumber.org> wrote:
> On Thu, 2 Jan 2014 14:12:06 -0800 (PST)
> Tom Herbert <therbert@google.com> wrote:
>
>> This patch series implements Generic UDP Encapsulation (GUE).
>> Intelligently encapsulating packets in UDP leverages device
>> support for UDP flows. The 5-tuple hash can be computed for UDP
>> to provide good ECMP, RSS, or link aggregation port selection.
>>
>> Generic UDP encapsulation refers to encapsulating packets of
>> arbitray IP protocols in UDP packets. Two flavors of GUE
>> are implemented in these patches:
>>
>> 1) Direct protocol encapsulation
>> 2) Encapsualtion in generic UDP encapsulation
>
> Is this a new wire protocol, or a simplification of existing
> tunnel code? It seems to be VXLAN without the VNI header.

It is a new protocol. See
http://tools.ietf.org/html/draft-herbert-gue-00. GUE is different from
VXLAN in that it includes a protocol type (L2, L3, L4 packets can be
encapsulated), header length and more flag bits (for extensibility),
and is not specific to the virtualization use case.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2014-01-04 23:13 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-01-02 22:12 [PATCH RFC 0/7] Generic UDP Encapsulation Tom Herbert
2014-01-04 22:33 ` Stephen Hemminger
2014-01-04 23:13   ` Tom Herbert

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).