[ovs-discuss] udp checksum issue with openvswitch

Rakesh B.K bk.rakesh at ymail.com
Sat Aug 24 15:15:51 UTC 2013


Hello,

Here is another addition to my previous comment.

I had a walk-through on some parts of openVSwitch datapath code. Here is my analysis on why the checksum is being set to 0x0000 instead of 0xFFFF:
    1. when the flow look-up table entry does not match with the key(when the function ovs_flow_tbl_lookup() returns false).
    2. During no flow entry, a new netlink message will be created and the packet received from vnetX(guest interface netdev_port) is copied 
       using the function skb_copy_and_csum_dev(). After this, the skb->ip_summed bit field is set to CHECKSUM_NONE.

For the checksum to be correct, the flow table lookup returns true and forwards the packet from vnetX(Guest interfce netdev_port) to ethX(Host) interface.

Please let me know if my observations are correct.

Thanks & Regards,
Rakesh




________________________________
 From: Rakesh B.K <bk.rakesh at ymail.com>
To: Jesse Gross <jesse at nicira.com> 
Cc: "bugs at openvswitch.org" <bugs at openvswitch.org>; "discuss at openvswitch.org" <discuss at openvswitch.org>; "sshukla82 at hotmail.com" <sshukla82 at hotmail.com> 
Sent: Saturday, August 24, 2013 7:21 PM
Subject: Re: [ovs-discuss] udp checksum issue with openvswitch
 


Hello,

Yes I agree with your observation. 

I am currently looking into the problematic scenario when both the host as well as guest checksum offloading are enabled. 
What seems strange here is on the Rx side, the tcpdump log shows that the first two UDP packets come with wrong checksum (0x0000). 
From the third instance, the checksum is correct (0xffff). I am showing this in the log again (which I had shared earlier):

    Tcpdump from Rx Log captured from PM2 running ubuntu-11.10,
        root at user-desktop:~/kernel_sources/linux-2.6# tcpdump  -i eth0 udp and src 198.162.0.4 -x
        tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
        listening on eth0, link-type
 EN10MB (Ethernet), capture size 65535 bytes
        19:17:03.932414 IP 198.162.0.4.44467 > user-desktop.local.6895: UDP, length 2
            0x0000:  4500 001e 0000 4000 4011 ad81 c6a2 0004
            0x0010:  c6a2 0005 adb3 1aef 000a a9e9 0000 0000
                                                           <csum,data>
            0x0020:  0000 0000 0000 0000 0000 0000 0000
        19:17:15.581176 IP 198.162.0.4.44467 > user-desktop.local.6895: UDP, length
 2
            0x0000:  4500 001e 0000 4000 4011 ad81 c6a2 0004
            0x0010:  c6a2 0005 adb3 1aef 000a 0000 a9e9 0000
                                                          <csum,data> (This should be 0xffff, here checksum recieved as 0000)
            0x0020:  0000 0000 0000 0000 0000 0000 0000
        19:17:16.581620 IP 198.162.0.4.44467 > user-desktop.local.6895: UDP, length 2
            0x0000:  4500 001e 0000 4000 4011 ad81 c6a2 0004
            0x0010:  c6a2
 0005 adb3 1aef 000a ffff a9e9 0000
                                                          <csum,data> (This seems to be fine)
            0x0020:  0000 0000 0000 0000 0000 0000 0000
        19:17:17.581817 IP 198.162.0.4.44467 > user-desktop.local.6895: UDP, length 2c
            0x0000:  4500 001e 0000 4000 4011 ad81 c6a2 0004
            0x0010:  c6a2 0005 adb3 1aef 000a ffff a9e9 0000
                              
                           <csum,data> (This seems to be fine)
            0x0020:  0000 0000 0000 0000 0000 0000 0000
        
        4 packets captured
        4 packets received by filter
        0 packets dropped by kernel

Please see that from the third packet, the checksum value is correct. Can you please throw some light on this behaviour?

Thanks & Regards,
Rakesh




________________________________
 From: Jesse Gross <jesse at nicira.com>
To: Rakesh B.K <bk.rakesh at ymail.com> 
Cc: "bugs at openvswitch.org" <bugs at openvswitch.org>; "discuss at openvswitch.org" <discuss at openvswitch.org>; "sshukla82 at hotmail.com" <sshukla82 at hotmail.com> 
Sent: Saturday, August 24, 2013 6:20 AM
Subject: Re: [ovs-discuss] udp checksum issue with openvswitch
 

On Thu, Aug 22, 2013 at 4:06 AM, Rakesh B.K <bk.rakesh at ymail.com> wrote:
> Hello,
>
> When I disable the checksum offload of ethx (both in guest and host)I am not
> able to reproduce the problem(received correct checksum 0xffff).
> When using normal linux bridge instead of OVS, the issue is not reproducible
> (I am getting proper 0xffff checksum) when I either enable or disable tx
> checksum offload on guest/host eth interfaces.

I reproduced this and it is a general problem with Linux software
emulation of UDP checksum offloading. If you keep checksum offloading
on in the guest and off in the host then you should see the problem at
all times. The issue is that when the UDP stack directly computes the
checksum it takes this into account as does the NIC. However, if it
hits the offload emulation code then
 nothing special is done.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://openvswitch.org/pipermail/ovs-discuss/attachments/20130824/852c7c0f/attachment-0001.html>


More information about the discuss mailing list