Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I'm developing some network applications on both linux (server) and windows 7 (client).

However, I'm wondering if virtual box is to blame for the slow network.

I thought I'd try using iperf to see if my app was the problem and to see the real throughput.

C:\Users\XEN\Downloads>iperf.exe -c 192.168.2.104 -u -p 3000 -w 16000
------------------------------------------------------------
Client connecting to 192.168.2.104, UDP port 3000
Sending 1470 byte datagrams
UDP buffer size: 15.6 KByte
------------------------------------------------------------
[148] local 192.168.2.105 port 58801 connected with 192.168.2.104 port 3000
[ ID] Interval       Transfer     Bandwidth
[148]  0.0-10.0 sec  1.25 MBytes  1.05 Mbits/sec
[148] Server Report:
[148]  0.0-10.0 sec  1.25 MBytes  1.05 Mbits/sec  3.086 ms    0/  892 (0%)
[148] Sent 892 datagrams

Linux side:

matt@blaze:~/dev$ iperf -s -p 3000 -u
------------------------------------------------------------
Server listening on UDP port 3000
Receiving 1470 byte datagrams
UDP buffer size:   122 KByte (default)
------------------------------------------------------------
[  3] local 192.168.2.104 port 3000 connected with 192.168.2.105 port 58800
[ ID] Interval       Transfer     Bandwidth       Jitter   Lost/Total Datagrams
[  3]  0.0-10.0 sec  1.25 MBytes  1.05 Mbits/sec  3.625 ms    0/  894 (0%)
[  4] local 192.168.2.104 port 3000 connected with 192.168.2.105 port 58801
[  4]  0.0-10.0 sec  1.25 MBytes  1.05 Mbits/sec  3.086 ms    0/  892 (0%)

That seems awefully slow! am I using iperf correctly? Is this a problem with virtualbox?

UPDATE: It seems that TCP fares rather better. I get 460Mbits/s. UPDATE2: 1.05Mbit/s over the linux loopback interface with UDP! is Linux kernel the culprit or is iperf just broken for UDP?

Any ideas?

share|improve this question

3 Answers 3

up vote 0 down vote accepted

To answer my own question.

Tried this on the client side.

iperf.exe -c 192.168.2.104 -b 1g

Heres the results

C:\Users\XEN\Downloads>iperf.exe -c 192.168.2.104 -b 400m
WARNING: option -b implies udp testing
------------------------------------------------------------
Client connecting to 192.168.2.104, UDP port 5001
Sending 1470 byte datagrams
UDP buffer size: 8.00 KByte (default)
------------------------------------------------------------
[148] local 192.168.2.105 port 50973 connected with 192.168.2.104 port 5001
[ ID] Interval       Transfer     Bandwidth
[148]  0.0- 4.5 sec  52.9 MBytes  99.6 Mbits/sec
[148] Server Report:
[148]  0.0- 4.4 sec  52.9 MBytes  99.8 Mbits/sec  0.864 ms    0/37719 (0%)
[148] Sent 37719 datagrams

It seems that either windows or virtualbox has some UDP limitations. I can't get it to run past 100Mbit. On linux, I actually exceeded 1Gbit with the same command. I notice that the windows buffer size is only 8Kb. On linux it is 122Kb. So I'll try increasing it.

EDIT: In summary, yes it's a little slow. I'll compare with VMWare or try NAT network instead.

share|improve this answer
    
There's nothing inherently slow about UDP. However, iperf implements a very simple ping-pong UDP protocol with no concept of multiple packets in flight (sliding window), which is required for a protocol to saturate a link with non-zero latency. It is quite possible to implement such a protocol on top of UDP, but iperf doesn't. For optimized data transfer handled by the OS networking stack, use TCP. –  Michael Fenn Feb 11 at 5:41

On old question, but read the help info. If you want UDP to send faster, use the -b option:

-b, --bandwidth #[KM] for UDP, bandwidth to send at in bits/sec (default 1 Mbit/sec, implies -u)

share|improve this answer

I could trace bad throughput (even from the VirtualBox host to its own guest) to my switch. Try plugging into another switch if you can - or even unplug for testing.

And try the virtio NIC setting if you can. virtio reduced my udp packet drops from 'frequent' to 'zero'.

Update Judging from the OP's Update section (loopback as slow), my suggestions would seem unrelated. I'll leave them here though for the benefit of others who might come here with symptoms that match my prescription.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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