No constant Bandwidth despite Bandwidth Limitation

This is for discussing general topics about how to use VirtualBox.
Post Reply
jjulianf
Posts: 9
Joined: 24. Jul 2018, 17:15
Primary OS: Ubuntu other
VBox Version: PUEL
Guest OSses: Ubuntu 18.04

No constant Bandwidth despite Bandwidth Limitation

Post by jjulianf »

I have two Ubuntu 18.04 VMs running on an Ubuntu 18.04 host. My target is to simulate network traffic between the two VMs (one as a Server, one as a Client). Therefore I set the adapter settings as an Internal Network. So basically, there are just these two VMs on two different static IP addresses and that's it.

Now I want to limit the available bandwidth for that connection. Therefore I used bandwidthctl in the Host terminal to limit the available bandwidth for both VMs to 300mbit/s:

Code: Select all

VBoxManage bandwidthctl "VM" add Limit --type network --limit 300m
Then I used iPerf to check the maximum bandwidth. After starting it on the Server-VM (iPerf -s) I tried the following on the Client-VM:

Code: Select all

iperf -c 192.168.0.2 -t 20  -i 10 
what leads to a duration time of 20 seconds (-t 20) and an interval of 10 seconds (-i 10) between each bandwidth report.

The result was an average bandwidth of 302mbit/s in the interval of 0-10seconds and 298mbit/s in the interval of 10-20seconds .

Now I changed the interval time from 10 seconds to 0.5 seconds.
The result was a very inconstant bandwidth from e.g 287mbit/s in the interval of 6.0-6.5 seconds or 319mbit/s in the interval of 3.5-4.0seconds .

Changing the interval time to 0.1 seconds made it even worse and the result was 161mbit/s from 1.4-1.5 seconds and then 412mbit/s from 1.5-1.6 seconds.

The average bandwidth over the whole duration time of 20 seconds was always something about 300mbit/s but my question is:

Why do I have an inconstant bandwidth in the intervals between despite adjusting a limitation of 300mbit/s?
mpack
Site Moderator
Posts: 39134
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: No constant Bandwidth despite Bandwidth Limitation

Post by mpack »

Perhaps I'm reading too quickly, but I'm missing where you add those VMs to the bandwidth group you created using "VBoxManage bandwidthctl"?
jjulianf
Posts: 9
Joined: 24. Jul 2018, 17:15
Primary OS: Ubuntu other
VBox Version: PUEL
Guest OSses: Ubuntu 18.04

Re: No constant Bandwidth despite Bandwidth Limitation

Post by jjulianf »

mpack wrote:Perhaps I'm reading too quickly, but I'm missing where you add those VMs to the bandwidth group you created using "VBoxManage bandwidthctl"?
Sorry, I did add the VMs to the bandwidth group, I just skipped that step in my previous post.

Code: Select all

VBoxManage bandwidthctl "VM-Server" add LimitServer --type network --limit 300m
VBoxManage bandwidthctl "VM-Client" add LimitClient --type network --limit 300m

VBoxManage bandwidthctl "VM-Server" --nicbandwidthgroup1 LimitServer
VBoxManage bandwidthctl "VM-Client" --nicbandwidthgroup1 LimitClient
As I said, the bandwidth between the two VM s is limited to 300mbit/s indeed.

The problem is, that the more I reduce the interval between each bandwidth report, the more you can see how the bandwidth is changing and it even takes values bigger than my maximum value.
The average bandwidth is still 300mbit/s (over the time of 1sec) but it is inconstant when you look at it every 0.1 seconds.
Post Reply