Search code examples
pythonopenstackbandwidthopenstack-neutron

OpenStack neutron bandwidth limit method


now I am learning the neutron QoS service in the OpenStack. Here is a rule namely "bandwidth limit". With the user guide of OpenStack Doucumentation, I can limit the bandwidth of the network and after using by Iperf, I have verified that the limit of bandwidth is working.

------------------------------------------------------------
Server listening on TCP port 5001
TCP window size: 85.3 KByte (default)
------------------------------------------------------------
[  4] local 10.30.0.7 port 5001 connected with 192.168.115.105 port
42726
[ ID] Interval       Transfer     Bandwidth
[  4]  0.0- 6.5 sec  1.25 MBytes  1.62 Mbits/sec

Now I am confused what is the method in neutron that could limit the bandwidth of the network or port. By checking the source codes I have not found the method of the bandwidth limit.

Is anybody who knows the method in neutron? And which parts play the important role in limiting the bandwidth?

Thanks for your help:)


Solution

  • Bandwidth limits in Neutron are implemented using a "QoS" ("quality of service") driver. The particular driver in use depends on your configuration, but one example is the OVS (Open vSwitch) driver in neutron/plugins/ml2/drivers/openvswitch/agent/extension_drivers/qos_driver.py.

    This code takes advantage of qos features in OVS to perform bandwidth shaping (packet queing and output rate control) on egress (packets leaving the switch) and policing (dropping packets) on ingress (packets entering the switch).

    QoS for the linuxbridge plugin is in neutron/plugins/ml2/drivers/linuxbridge/agent/extension_drivers/qos_driver.py, and that uses standard Linux traffic control command (tc) via the wrapper in neutron/agent/linux/tc_lib.py.