Hi,

I'm wondering if anyone can help me with this. I am having trouble
inserting raw vlan tagged packets into the vswitch using an AF_PACKET
socket. I have the following simple bridge:

# ovs-vsctl show
9c4e5d06-31c5-4d65-a5c0-3f16a4f08cac
    Bridge "nvstub0"
        Port "vnic20"
            tag: 20
            Interface "vnic20"
                type: internal
        Port "nvstub0"
            Interface "nvstub0"
                type: internal
        Port "vdata0"
            Interface "vdata0"
                type: internal

I have an AF_PACKET socket in SOCK_RAW, protocol ETH_P_ALL open and bound
on nvstub0. I am inserting vlan 20 tagged ICMP request packets into the
vswitch, destined for vnic20:

# ifconfig vnic20
vnic20    Link encap:Ethernet  HWaddr 56:f2:01:aa:fd:d7
          inet addr:12.12.12.2  Bcast:12.12.12.255  Mask:255.255.255.0
          inet6 addr: fe80::54f2:1ff:feaa:fdd7/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:1713 errors:0 dropped:1 overruns:0 frame:0
          TX packets:26 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:110446 (110.4 KB)  TX bytes:2188 (2.1 KB)

What I see is sometimes, the first few packets make it ok, but subsequent
packets always have the vlan header still on the packet when it is sent to
vnic20, so they are dropped, and linux does not respond to the ping. Note
the first few packets are working as I hope/expect, but later packets are
not.

# tcpdump -e -i vnic20
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on vnic20, link-type EN10MB (Ethernet), capture size 65535 bytes
13:26:28.315783 02:08:20:74:fe:3b (oui Unknown) > 56:f2:01:aa:fd:d7 (oui
Unknown), ethertype IPv4 (0x0800), length 98: 12.12.12.12 > 12.12.12.2:
ICMP echo request, id 27883, seq 0, length 64
13:26:28.315808 56:f2:01:aa:fd:d7 (oui Unknown) > 02:08:20:74:fe:3b (oui
Unknown), ethertype IPv4 (0x0800), length 98: 12.12.12.2 > 12.12.12.12:
ICMP echo reply, id 27883, seq 0, length 64
13:26:29.308271 02:08:20:74:fe:3b (oui Unknown) > 56:f2:01:aa:fd:d7 (oui
Unknown), ethertype 802.1Q (0x8100), length 102: vlan 20, p 0, ethertype
IPv4, 12.12.12.12 > 12.12.12.2: ICMP echo request, id 27883, seq 1, length
64
13:26:30.308261 02:08:20:74:fe:3b (oui Unknown) > 56:f2:01:aa:fd:d7 (oui
Unknown), ethertype 802.1Q (0x8100), length 102: vlan 20, p 0, ethertype
IPv4, 12.12.12.12 > 12.12.12.2: ICMP echo request, id 27883, seq 2, length
64
13:26:31.308167 02:08:20:74:fe:3b (oui Unknown) > 56:f2:01:aa:fd:d7 (oui
Unknown), ethertype 802.1Q (0x8100), length 102: vlan 20, p 0, ethertype
IPv4, 12.12.12.12 > 12.12.12.2: ICMP echo request, id 27883, seq 3, length
64

It seems like the first few packets are taking a different path through the
kernel than the later packets, since the first few packets correctly have
the vlan tag removed, while later packets do not.

This looks related to this post:
http://comments.gmane.org/gmane.network.openvswitch.devel/7289

But that's an old post and I am using recent software, so I don't know if
it's still relevant.

# uname -a
Linux jon-leo3 3.16.0-38-generic #52~14.04.1-Ubuntu SMP Fri May 8 09:43:57
UTC 2015 x86_64 x86_64 x86_64 GNU/Linux

I've tried openvswitch 2.0.2 (that came with Ubuntu), and also compiled
from git (also compiling and loading the kernel module):

Right now I'm using the built version:
# ovs-vsctl -V
ovs-vsctl (Open vSwitch) 2.3.90
Compiled May 20 2015 12:42:23
DB Schema 7.12.1

I have also tried:
- changing the tx/txvlan offload settings on both nvstub0 and vnic20 using
ethtool
- setting trunks=20 on nvstub0 and trying all possible vlan_mode values.

My intent is that whatever is on vnic20 does not have to understand vlans.
It should only get untagged packets. I just want to isolate it on vlan 20
using the vswitch.

Based on that old post I'm hoping this is a known issue and hoping there is
some work-around, or a different way to inject raw packets that will work
properly.

Thanks in advance!
-Jon
_______________________________________________
discuss mailing list
[email protected]
http://openvswitch.org/mailman/listinfo/discuss

Reply via email to