Open vSwitch network namespace support for Linux

On Linux systems have basic support for Open vSwitch namespace network. Allow ovs-vswitchd daemon, the port moved to another network after the namespace can continue to track their status and statistical information.

how to work

Ovs-vswitchd daemon running in the so-called father network namespace. It listens for events netlink messages from all network namespace (netns), which requires a network namespace identifier is the parent namespace. Each message contains a network netlink namespace identifier (netnsid) as auxiliary data for matching events to the appropriate port.

ovs-vswitch using expanded openvswitch kernel API [1] _ Gets the current specified port netnsid (netdev_linux stored in the structure), and statistical information. Before changing event occurs, e.g., when the receiving port is moved to another network namespace. netnsid been cached in the user space.

When the port move to another namespace, ovs-vswitchd using another extension kernel API [2] _, to obtain information from a port name space, e.g., flags, MTU, MAC address and ifindex.

4.15 upstream kernel and the necessary changes to include namespace basic support. If you are running kernel does not provide such API, then the daemon will rollback behavior before the meeting.

... [1] request command: OVS_VPORT_CMD_GET, attributes: OVS_VPORT_ATTR_NETNSID
... [2] request command: RTM_GETLINK incoming IFLA_IF_NETNSID properties.

limit

Currently only obtain port information listed above section. Most other operations, such as query MII or set MTU, due to the lack of proper kernel API, so they are still not supported.

In most cases a need to move to other network port name space, should be used instead of veth, because it provides a cleaner and more robust without significant performance loss solution.

Guess you like

Origin blog.csdn.net/sinat_20184565/article/details/94590390