Neutron/QoSforLinuxBridge

Introduction
QoS API is under development for icehouse release. There is an implementation for openvswitch plugin only now.

This page is intended to describe QoS implementation plan for linuxbridge.

Blueprint
Linuxbridge QoS support

Overview
It is often necessary to control outgoing traffic from a tenant port to a physical NIC, so that a tenant cannot occupy the bandwidth of the NIC.

This BP will allow to set traffic control parameters to a port (or a network) of linuxbridge by QoS API. On the agent side, a linuxbrige agent uses tc(8) function to apply the traffic control parameters to the physcial interface for the port.

API
The 'type' attribute accepts 'ratelimit'.

The 'policy' attribute has three keys, 'tc_rate', 'tc_latency' and 'tc_burst', which correspond to the 'rate', 'latency' and 'burst' parameters of tc(8) command, respectively.

example: 'qos': {'type': 'ratelimit', 'policy': {'tc_rate': '100mbit', 'tc_latency': '50ms', 'tc_burst': '3000k'}}

Implementation
The linuxbridge plugin was merged to the ML2 plugin.

The scope of this BP is the linuxbridge agent only. BP ml2-qos is expected to implement QoS extension into the ML2 plugin.

The strategy of implementation of the linuxbridge agent is simple:
 * When an interface for a port appears, get the QoS parameters of the port from the neutron-server via RPC and issue a tc command to the interface.
 * When a notification of update QoS (RPC) is received, does the corresponding action (ex. set or clear traffic control for the port).

Discussion
Although the QoS API allows to set QoS for a network, setting traffic control is per port basis for a linuxbridge port.


 * Rather than ignoring QoS for a network, I plan to use it for the default value for ports without QoS settings.


 * When a notification of network QoS update is received, the corresponding linuxbridge agent needs to get QoS policies of all the ports on the network on the host, in order to update settings of the ports with default values. This is a little complicated part for the linuxbridge implementation.


 * A linuxbridge agent needs to set QoS parameters to an interface when it appears on a host, so the information get by the 'get_device_details' RPC should include QoS policy parameters. In addition if a port has no QoS setting but the network of the port has QoS setting, 'get_device_details' should include QoS for the network for the complicated part mentioned above.