2

As part of a networking project I have used VirtualBox 5.2.20 to model a "mini-Internet" with seven VMs. My host machine is running Linux Mint 18.3, all of the guests are running Ubuntu Server 16.04 LTS. The host CPU is a Ryzen R7 1700.

Two of the guests use the Intel Pro/1000 MT Desktop (a 1Gb/s NIC) bridged onto the host NIC. As a basic test, I decided to do an iperf test between these two guests.

The command I used is iperf -c 192.168.1.50 -i 1. The result is:

------------------------------------------------------------
Client connecting to 192.168.1.50, TCP port 5001
TCP window size: 85.0 KByte (default)
------------------------------------------------------------
[  3] local 192.168.1.35 port 58752 connected with 192.168.1.50 port 5001
[ ID] Interval       Transfer     Bandwidth
[  3]  0.0- 1.0 sec   243 MBytes  2.04 Gbits/sec
[  3]  1.0- 2.0 sec   236 MBytes  1.98 Gbits/sec
[  3]  2.0- 3.0 sec   210 MBytes  1.76 Gbits/sec
[  3]  3.0- 4.0 sec   207 MBytes  1.74 Gbits/sec
[  3]  4.0- 5.0 sec   216 MBytes  1.81 Gbits/sec
[  3]  5.0- 6.0 sec   202 MBytes  1.70 Gbits/sec
[  3]  6.0- 7.0 sec   216 MBytes  1.81 Gbits/sec
[  3]  7.0- 8.0 sec   210 MBytes  1.76 Gbits/sec
[  3]  8.0- 9.0 sec   206 MBytes  1.72 Gbits/sec
[  3]  9.0-10.0 sec   223 MBytes  1.87 Gbits/sec
[  3]  0.0-10.0 sec  2.12 GBytes  1.82 Gbits/sec

How does throughput of well over 1Gbit/s happen on a 1Gbit line, without specifying full duplex to iperf? Is this a quirk of VirtualBox or something else?

Many thanks.

  • 1
    Are you measuring from VM to VM? if so, you're not really using the NIC's bandwidth, since it's not leaving your host PC. – essjae Nov 8 '18 at 20:07
  • Yep, it's VM-to-VM. – uvdevops Nov 11 '18 at 18:54
0

VirtualBox is apparently clever enough to use the localhost interface for communications between guests.

The clever part in not using the network adapter is that in most cases this would not work. Only advanced routers support loopbacks, meaning sending from the computer through the router and back to the same computer. Most commercial routers do not support this feature.

Since the localhost interface works through memory buffers and not through an adapter, it is capable of much higher speeds. In your case it approaches the 2 Gbits/second, higher than the capacity of your physical network adapter.

For more information see Wikipedia Localhost.

| improve this answer | |
  • This would explain a lot. I tried a transfer between two guests on a host-only network. The guests were configured with 100Mb/s AMD PCnet-FAST III adapters, yet somehow I was seeing 40MB/s (320Mb/s) transfers with wget. – uvdevops Nov 11 '18 at 18:57
  • It's actually a tick, you had me confused for a moment. :) – uvdevops Nov 11 '18 at 19:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.