[ovs-discuss] VLAN tag being removed from OVS to VM

Lucas Brasilino lucas.brasilino at gmail.com
Tue Jun 26 18:01:20 UTC 2012


Hi All:

I'm trying to setup a trunk port to send  VLAN's tagged frames from
OVS to a VM, so inside the VM I gonna use
VLAN Linux support (8021q kernel module along with vconfig tool).

I'm facing a very strange behaviour which I'm investigating without
much success, even after a lot of googling.
I really don't know if it's a OVS issue or a VirtualBox issue.

My host machine is a Ubuntu 11.10 and my VM is a CentOS 6.2. I'm using
OVS 1.5.0 (in kernel space, self compiled)
and VirtualBox 4.1.4-74291~Ubuntu~maverick (from Oracle).

At host machine, I've created a 'sw0' switch with 16 ports where each
interface are named as 'sw0pX' with X from 0 to 15:

for INT in `seq 0 15`; do
        ip tuntap add mode tap sw0p$INT
        ip link set sw0p$INT up
done

I've created (access) ports on VLAN 10 and 20, added switch ports (tap
interfaces) to it. So I've got others VM's using those ports as
'access' ports with no problem.
The interface 'sw0p8' was choosed to be used by the VM as a trunk
port. There's traffic from VLAN 10 and 20. When a run
on the host machine:

$ sudo tcpdump  -nnei sw0p8
12:05:35.382770 08:00:27:28:5f:20 > ff:ff:ff:ff:ff:ff, ethertype
802.1Q (0x8100), length 46: vlan 20, p 0, ethertype ARP, Request
who-has 192.168.20.1 tell 192.168.20.2, length 28
12:09:04.913699 08:00:27:64:a3:1c > ff:ff:ff:ff:ff:ff, ethertype
802.1Q (0x8100), length 293: vlan 10, p 0, ethertype IPv4,
192.168.10.1.138 > 192.168.10.255.138: NBT UDP PACKET(138)

'sw0p8' configuration:

$ ovs-vsctl list Port sw0p8
_uuid               : 642ef46d-247e-4f47-813c-abba3d62ac03
bond_downdelay      : 0
bond_fake_iface     : false
bond_mode           : []
bond_updelay        : 0
external_ids        : {}
fake_bridge         : false
interfaces          : [6db74355-948d-4868-b60a-926a08a619a5]
lacp                : []
mac                 : []
name                : "sw0p8"
other_config        : {}
qos                 : []
statistics          : {}
status              : {}
tag                 : []
trunks              : []
vlan_mode           : []

I found that trunk mode is the 'vlan_mode' default. It's true :)

My VM attaches the second adapter to the 'sw0p8' interface, as you can see:

$ VBoxManage showvminfo CentOS6VPS
[...]
NIC 1:           MAC: 080027A00F40, Attachment: Bridged Interface
'eth0', Cable connected: on, Trace: off (file: none), Type: Am79C973,
Reported speed: 0 Mbps, Boot priority: 0, Promisc Policy: deny
NIC 2:           MAC: 08002710033C, Attachment: Bridged Interface
'sw0p8', Cable connected: on, Trace: off (file: none), Type: Am79C973,
Reported speed: 0 Mbps, Boot priority: 0, Promisc Policy: deny
[...]

I'm not using 'Intel' cards due this issue[1]. The 'eth1' interface
within VM (NIC 2) is the one attached to 'sw0p8' interface.

At VM I do:

# modprobe 8021q
# vconfig set_name_type VLAN_PLUS_VID_NO_PAD
# vconfig add eth1 10
# ip addr add 192.168.10.10/24 broadcast + dev vlan10
# ip link set eth1 up
# ip link set vlan10 up
# ip link show
[...]
3: eth1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast
state UNKNOWN qlen 1000
    link/ether 08:00:27:10:03:3c brd ff:ff:ff:ff:ff:ff
4: vlan10 at eth1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc
noqueue state UP
    link/ether 08:00:27:10:03:3c brd ff:ff:ff:ff:ff:ff
    inet 192.168.10.10/24 brd 192.168.10.255 scope global vlan10
[...]

At host machine, when I ping 192.168.10.1, which is other VM  on VLAN
10,  I got:

$ sudo tcpdump  -nnei sw0p8
listening on sw0p8, link-type EN10MB (Ethernet), capture size 65535 bytes
14:06:26.006278 08:00:27:10:03:3c > ff:ff:ff:ff:ff:ff, ethertype
802.1Q (0x8100), length 46: vlan 10, p 0, ethertype ARP, Request
who-has 192.168.10.1 tell 192.168.10.10, length 28
[...]
14:06:26.006752 08:00:27:64:a3:1c > 08:00:27:10:03:3c, ethertype
802.1Q (0x8100), length 46: vlan 10, p 0, ethertype ARP, Reply
192.168.10.1 is-at 08:00:27:64:a3:1c, length 28

So I got both ARP request and ARP reply on VLAN 10 just fine!!!

The problem occur when I 'tcpdump' the interface 'eth1' within the VM
(which is attached to host's sw0p8 interface):

# tcpdump -nnei eth1
listening on eth1, link-type EN10MB (Ethernet), capture size 65535 bytes
14:16:55.412255 08:00:27:10:03:3c > ff:ff:ff:ff:ff:ff, ethertype
802.1Q (0x8100), length 46: vlan 10, p 0, ethertype ARP, Request
who-has 192.168.10.1 tell 192.168.10.10, length 28
14:16:55.412732 08:00:27:64:a3:1c > 08:00:27:10:03:3c, ethertype ARP
(0x0806), length 60: Reply 192.168.10.1 is-at 08:00:27:64:a3:1c,
length 46

So! The ARP request frame is tagged as VLAN 10 (just right), but on
the ARP reply frame the VLAN tag
is stripped... is removed!!!  I mean, there's an unwanted tagging to
untagging conversion....

I also tried to configure 'sw0p8' as following:

$ ovs-vsctl add-port sw0 sw0p8 -- set Port sw0p8 trunks=10,20 vlan_mode=trunk

with no success (although I know trunk mode is default).

I'm trying to discover if it's a OVS problem (or feature) or a
VirtualBox problem (or feature). I'm not sure for now. Any help ? Any
insight ?
Any guidance ? Am I messing things up ??

Thanks a lot in advance.

Regards
Lucas Brasilino

[1] http://humbledown.org/virtualbox-intel-vlan-tag-stripping.xhtml



More information about the discuss mailing list