[ovs-dev] [PATCH] sFlow export: include standard tunnel structures (for GRE, VXLAN etc.)

Jesse Gross jesse at nicira.com
Sat Oct 19 00:50:05 UTC 2013


On Fri, Oct 18, 2013 at 5:43 PM, Romain Lenglet <rlenglet at vmware.com> wrote:
> ----- Original Message -----
>> From: "Romain Lenglet" <rlenglet at vmware.com>
>> To: "Neil Mckee" <neil.mckee at inmon.com>
>> Cc: dev at openvswitch.org
>> Sent: Wednesday, October 9, 2013 10:30:17 AM
>> Subject: Re: [ovs-dev] [PATCH] sFlow export: include standard tunnel  structures (for GRE, VXLAN etc.)
>>
>> On Oct 8, 2013, at 10:09 PM, Neil Mckee <neil.mckee at inmon.com> wrote:
>> > +    /* Indicate 0==unknown for the src_port. It may be set to a random
>> > +       number on a flow-by-flow basis to increase entropy for ECMP
>> > fabrics.
>> > +       The assumption being made here is that it is not so important to
>> > +       report this.  At least not important enough to justify the effort
>> > +       of making it accessible here. */
>>
>> Exporting the source UDP source port is essential.
>> You also have to export the tunnel key: GRE key (32- or 64-bit), VNI
>> (24-bit), etc.
>> I don't see how this feature could be useful without the UDP source port and
>> tunnel key.
>
> I thought more about this. Exporting the source UDP port is really important. Since the source port is calculated in the tunnel port at egress during encapsulation and is lost at ingress during decapsulation, and the sampling here is done before encapsulation or after decapsulation, the easiest way I can imagine to determine the source port is to redo the hashing here. This would require factorizing the hashing code into a function that can be used in userspace in this code.

I don't think that it's really viable to regenerate the hash used to
compute the source port. In the best case, we are the ones generating
it but the kernel hash function might change or the hash might come
from the NIC. In the worst case, when we receive a packet the hash
could have been generated by a non-OVS device with an unknown hash
algorithm.



More information about the dev mailing list