How does VBoxManage bandwidthctl work?

Discussions about using Linux guests in VirtualBox.
Post Reply
jjulianf
Posts: 9
Joined: 24. Jul 2018, 17:15
Primary OS: Ubuntu other
VBox Version: PUEL
Guest OSses: Ubuntu 18.04

How does VBoxManage bandwidthctl work?

Post by jjulianf »

I have two Ubuntu 18.04 VMs which are running in the same internal network (network adapter mode 'internal', same subnet mask).

Now, I limit the maximum bandwidth between them with VBoxManage bandwidhtctl

Now I run an IPerf session from VM3 to VM1 and I tell IPerf to send 100Mbit/s permanently:

Code: Select all

iperf -c 192.168.0.2 -t 60 -b 100m
With a bash-script running on the host machine, I control the maximum bandwidth from 1000Mbit/s to 10MBit/s (for 3 seconds) and back to 1000Mbit/s as the IPerf session is running.

Code: Select all

VBoxManage bandwidthctl "VM1 - Server" set LimitServer --limit 1000m
VBoxManage bandwidthctl "VM3 - Client" set LimitClient --limit 1000m
sleep 10s
VBoxManage bandwidthctl "VM1 - Server" set LimitServer --limit 10m
VBoxManage bandwidthctl "VM3 - Client" set LimitClient --limit 10m
sleep 3s
VBoxManage bandwidthctl "VM1 - Server" set LimitServer --limit 1000m
VBoxManage bandwidthctl "VM3 - Client" set LimitClient --limit 1000m
Note that for 3 seconds, the bandwidth (10Mbit/s) is lower than the amount what IPerf (100Mbit/s) is trying to send.

Now the IPerf output looks like:

Code: Select all

[  3]  0.0- 1.0 sec  12.1 MBytes   102 Mbits/sec
...
[  3]  7.0- 8.0 sec  11.9 MBytes  99.6 Mbits/sec
[  3]  8.0- 9.0 sec  12.0 MBytes   101 Mbits/sec
[  3]  9.0-10.0 sec  11.9 MBytes  99.6 Mbits/sec
[  3] 10.0-11.0 sec  12.0 MBytes   101 Mbits/sec
[  3] 11.0-12.0 sec  8.62 MBytes  72.4 Mbits/sec
[  3] 12.0-13.0 sec  1.25 MBytes  10.5 Mbits/sec
[  3] 13.0-14.0 sec  1.25 MBytes  10.5 Mbits/sec
[  3] 14.0-15.0 sec  36.5 MBytes   306 Mbits/sec
[  3] 15.0-16.0 sec  11.9 MBytes  99.6 Mbits/sec
[  3] 16.0-17.0 sec  12.0 MBytes   101 Mbits/sec
[  3] 17.0-18.0 sec  11.9 MBytes  99.6 Mbits/sec
[  3] 18.0-19.0 sec  11.9 MBytes  99.6 Mbits/sec
How is it possible that I got 306Mbit/s from 14-15sec?

Note that this is 206Mbit/s more, than IPerf should be sending normally. Also, this is the same amount of data, which IPerf would have sent if there was no bandwidth limitation from 11-14sec! (100-72,4)+(100-10,5)+(100-10,5) = 206,6!

With the bandwidthctl command, is there just some kind of send buffer (storing all the data which is bigger than 10Mbit/s)? And this buffer is emptying out as soon as there is enough bandwidth available??
Post Reply