Tuesday, January 11, 2011

How do you test the network speed betwen two boxes?

I have gigabit network setup in my house and few Ubuntu based boxes. Out of complete curiosity I would like to check the speed between the two boxes. I am not having any problems with speed or anything, it really is just the geek in me that is curious. Plus maybe the results will let me know if there is room for improvement, or that I have something configured wrong.

So how do you properly test the network speed between Ubuntu boexs?

  • I use iperf. It's a client server arrangement in that you run it in server mode at one end and connect to its from another computer on the other side of the network.

    One both machines run:

    sudo apt-get install iperf
    

    Then on Computer A:

    iperf -s
    

    And on Computer B:

    iperf -c <address of Computer A>
    

    On the client machine, you'll see something like this:

    oli@bert:~$ iperf -c tim
    ------------------------------------------------------------
    Client connecting to tim, TCP port 5001
    TCP window size: 16.0 KByte (default)
    ------------------------------------------------------------
    [  3] local 192.168.0.4 port 37248 connected with 192.168.0.5 port 5001
    [ ID] Interval       Transfer     Bandwidth
    [  3]  0.0-10.0 sec  1.04 GBytes    893 Mbits/sec
    

    Of course, if you're running a firewall on the server machine, you'll need to allow connections on port 5001 or change the port with the -p flag.

    jschoen : @Oli Man you have all the answers to my questions! My network apparently is not set up as well as yours only transfer at 714 MBytes and bandwith of 598 Mbits/sec. Dunno may look into that in the future. Thanks.
    Oli : In fairness the other box is only one switch (and 20meters of cat5e) away and there's no congestion. 600mbps is still pretty fast.
    From Oli
  • It's easy plug your computer on the first box, plug the other box to the first box. Then from your computer ping the first box save the result, ping the other box and do the substraction.

    Oli : That shows network latency which is only one part of speed. For example my phone's 3G connection has huge latency (100-300ms) but it can still manage a throughput of 5mbps.

0 comments:

Post a Comment