openvswitch / ovs-issues

Issue tracker repo for Open vSwitch
10 stars 3 forks source link

On Windows, normal-port(port that bind to physical network card) do not work when it is seted as trunk with tags. #291

Closed xx2211 closed 11 months ago

xx2211 commented 12 months ago

The scenario where this issue is triggered is as follows:

ovs A run on host A, ovs B run on host B. ovs A has a bridge named br-A, ovs B has a bridge named br-B.

host A has a physical network card named phy-A, host B has a physical network card named phy-B. phy-A and phy-B are connected by a network cable. phy-A is seted as port of br-A, phy-B is seted as port of br-B.

br-A has a intrenal port named vir-A, br-B has a intrenal port named vir-B, and host A generate a virtual interface named vir-A and host B generate a virtual interface named vir-B.

Port phy-A and phy-B are seted as trunks=[3,4]. Port vir-A and vir-B are seted as tag=3.

Address of vir-A is seted as 192.168.1.10/24, Address of vir-B is seted as 192.168.1.20/24.

When both of host A and host B are Linux, interfaces vir-A and vir-B can communicate normally. But when one of host A or host B is Windows, vir-A and vir-B can not communicate. When one of host A or host B is Windows, if port phy-A and phy-B are seted as tag=3, vir-A and vir-B can again communicate normally.

Command that execute these opreations are as follows:

# on Host A
ovs-vsctl add-br br-A
ovs-vsctl add-port br-A phy-A
ovs-vsctl add-port br-A vir-A -- set interface vir-A type=internal
ovs-vsctl set port phy-A trunks=[3,4]
ovs-vsctl set port vir-A tag=3

# set address of vir-A

# and so on on Host B

# If on Windows, set hyper-v before create bridge.

I tried 2 verions 3.1.2 and 2.7.0, both of them triggered this issue, where 3.1.2 is built form https://github.com/openvswitch/ovs/releases/tag/v3.1.2 and 2.7.0 is downloaded from https://cloudbase.it/downloads/openvswitch-hyperv-2.7.0-certified.msi

xx2211 commented 12 months ago

I tried to grab the packet on the physical NIC bound to ovs on Windows, it should contain the vlan tag, but it doesn't.

xx2211 commented 11 months ago

On windows platform, a internal port is seted as tag=3, a physical port is seted as trunks=3,4. In theory, a frame without a tag enters the bridge from this internal port, is labeled as tag3, and then exits the bridge through physical port. At this point, this frame should still carry tag3, but in reality, it does not. I don't know when tag is losted, maybe tag is not seted when frame enter bridge, maybe tag is losted in bridge, maybe tag is losted in physical port.

xx2211 commented 11 months ago

It seems that NIC of windows will lose tag of frame

xx2211 commented 11 months ago

I solved this issue. I updated driver of NIC to newest, and Enable "Priority & VLAN" option in NIC properties, so that NIC do not remove tag of frame. Old driver of NIC has also this option " Priority & VLAN", but it don't effect.

xx2211 commented 11 months ago

I solved this issue. I updated driver of NIC to newest, and Enable "Priority & VLAN" option in NIC properties, so that NIC do not remove tag of frame. Old driver of NIC has also this option " Priority & VLAN", but it don't effect