Bandwidth is larger than VM-Network Card max. Bandwidth?

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

Bandwidth is larger than VM-Network Card max. Bandwidth?

Post by jjulianf »

I got two Ubuntu 18.04 VMs running on an Ubuntu 18.04 host system.

On both VMs, I set the network adapter settings to 'Internal' and chose the default network card Intel Pro/1000 MT Desktop , which has a maximum bandwidth of 1Gbit/s.

Both VMs are in the same subnet so they can communicate with each other.

When I run an iPerf test, the result is a maximum bandwidth of 4.2Gbit/s.

How can that be possible?
mpack
Site Moderator
Posts: 39134
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: Bandwidth is larger than VM-Network Card max. Bandwidth?

Post by mpack »

If you want to time things in a VM, use an independant timer. Do not use a virtual timer whose behaviour is subject to the performance of the thing you are timing. Automated benchmarks run inside a VM are pretty useless.

If you want to continue this conversation then please provide a VM log. With the VM fully shut down, right click and "Show Log" in the GUI, save "VBox.log" (no other file) to a zip, and attach the zip here.
jjulianf
Posts: 9
Joined: 24. Jul 2018, 17:15
Primary OS: Ubuntu other
VBox Version: PUEL
Guest OSses: Ubuntu 18.04

Re: Bandwidth is larger than VM-Network Card max. Bandwidth?

Post by jjulianf »

I attached the VM.log file to this comment.

It would help me a lot to understand this issue, if you could explain the context between the virtual timer and the bandwidth measurement more in detail.
I used Wireshark to measure my bandwidth.
Attachments
VM-Server.zip
(28.92 KiB) Downloaded 16 times
Last edited by socratis on 7. Aug 2018, 16:11, edited 1 time in total.
Reason: Removed unnecessary verbatim quote of the whole previous message.
mpack
Site Moderator
Posts: 39134
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: Bandwidth is larger than VM-Network Card max. Bandwidth?

Post by mpack »

Topic moved to Linux Guests.

I don't see that I can add much to my previous comment. The timer in the VM is virtual, and the VM will be suspended when it isn't doing work (waiting for a network transmission does not require work). Suspended obviously means that no time passes for the VM while things are still happening in the physical world. It is surely obvious what effect this would have on time benchmarks.

Incidentally, I see that you are not running VirtualBox, you are running the Ubuntu fork. These forums are only for the real VirtualBox, if you want to use a fork you need to look for support from whomever created the fork.
jjulianf
Posts: 9
Joined: 24. Jul 2018, 17:15
Primary OS: Ubuntu other
VBox Version: PUEL
Guest OSses: Ubuntu 18.04

Re: Bandwidth is larger than VM-Network Card max. Bandwidth?

Post by jjulianf »

But the network traffic that I am trying to measure is also just virtual. I got an internal network with another VM and both VMs are running on the same host.
The program for measuring the used bandwidth (Wireshark) is also running on the VM.
Why do I have to care about what is happening in the physical world?

I would be glad about further explanation! :-)
mpack
Site Moderator
Posts: 39134
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: Bandwidth is larger than VM-Network Card max. Bandwidth?

Post by mpack »

Ah, I see. I missed that you were talking about internal networking.

Internal network bandwidth is not artificially throttled. I.e. it is not claimed that the simulation of any NIC extends to accurate time behaviour. The network transaction takes place as fast as the host can do it.
jjulianf
Posts: 9
Joined: 24. Jul 2018, 17:15
Primary OS: Ubuntu other
VBox Version: PUEL
Guest OSses: Ubuntu 18.04

Re: Bandwidth is larger than VM-Network Card max. Bandwidth?

Post by jjulianf »

Okay that makes sense, thank you for your answer.

So what you are saying is, that the maximum datarate of my virtual network adapter (1Gbit/s) is not throttling the internal network transaction? (Because it is an internal transaction and not going out to the physical world?)

When it is taking place as fast as the host can do it, what is throttling the host to handle the network transaction even faster?
Not that 4.2Gbit/s isn't enough, but I am just curious about the reason for that specific bandwidth.
mpack
Site Moderator
Posts: 39134
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: Bandwidth is larger than VM-Network Card max. Bandwidth?

Post by mpack »

jjulianf wrote:Not that 4.2Gbit/s isn't enough, but I am just curious about the reason for that specific bandwidth.
Which takes us back to virtual timers. My original point still remains: do not run automated benchmarks inside a VM. If you want to know how fast something was, use a physical stopwatch.
jjulianf
Posts: 9
Joined: 24. Jul 2018, 17:15
Primary OS: Ubuntu other
VBox Version: PUEL
Guest OSses: Ubuntu 18.04

Re: Bandwidth is larger than VM-Network Card max. Bandwidth?

Post by jjulianf »

Ok so what would you suggest for doing so?
How can I measure the correct maximum bandwidth of the internal network between the two VMs ?

When I limit the bandwidth with VBoxManage bandwidthctl "VM.." to 300Mbit/s, then my Wireshark measurement running ON the VM is delivering correct values. (even though the bandwidth is not constant at 300Mbit/s but differs between 250-320 Mbit/s for some reason)
mpack
Site Moderator
Posts: 39134
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: Bandwidth is larger than VM-Network Card max. Bandwidth?

Post by mpack »

jjulianf wrote:Ok so what would you suggest for doing so?
I already gave you a suggestion - use a stopwatch. I meant that literally: pipe a whole bunch of data, then divide length by elapsed time. The larger the block of data, the more accurate the result will be.
jjulianf wrote:How can I measure the correct maximum bandwidth of the internal network between the two VMs ?
That test would be entirely meaningless IMHO, since you're only measuring how fast the host PC can copy RAM, which will depend on many things, such as the PC spec and how busy it is. It tells you nothing much about the VM.
jjulianf
Posts: 9
Joined: 24. Jul 2018, 17:15
Primary OS: Ubuntu other
VBox Version: PUEL
Guest OSses: Ubuntu 18.04

Re: Bandwidth is larger than VM-Network Card max. Bandwidth?

Post by jjulianf »

Ok so if I understand this correctly:

The bandwidth of an internal network of two VMs has nothing to do with their virtual network adapter?

Is the virtual network adapter only important for connecting to physical networks?
mpack
Site Moderator
Posts: 39134
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: Bandwidth is larger than VM-Network Card max. Bandwidth?

Post by mpack »

VirtualBox has a feature which can cap the bandwith used on a physical network (so not applicable to internal networking), otherwise bandwidth is only limited by the host capabilities. That doesn't mean it will be the same as the host, since simulating a network card at register level does carry a small overhead. You can minimize the latter by using VirtIO-net drivers inside the guest instead of a virtual NIC.
Post Reply