How to test IPv6 with iperf

logo-ianaLately there has been yet again a big surge of interest in IPv6 and I did find to my surprise that even thought IPerf supports IPv6 for quite some time no-one actually has written how to actually do this rather trivial test.
First thing about IPv6 is that your interface on the end-point PCs will auto-assign a link-local address to itself. The link local address is in fe80::macaddress format (where one bit of the mac address can be changed depending on the implementation). So this looks fine – no problems. You should be able to ping between those ip addresses using ipv6 ping. so lets try to ping localhost’s ipv6 link-local address. In order to do this you need to specify the interface you are using as ping can’t lookup the address automatically as it can with IPv4.

$ ping -I eth0 fe80::7983:2bdc:4a2a:61b9
Pinging fe80::7983:2bdc:4a2a:61b9 with 32 bytes of data:
Reply from fe80::7983:2bdc:4a2a:61b9: time < 1ms
Reply from fe80::7983:2bdc:4a2a:61b9: time < 1ms
Reply from fe80::7983:2bdc:4a2a:61b9: time < 1ms
Reply from fe80::7983:2bdc:4a2a:61b9: time < 1ms

Ping statistics for fe80::7983:2bdc:4a2a:61b9:
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 0ms, Maximum = 0ms, Average = 0ms

OK so far so good – lets assign a public ip address to the eth0 interface as unfortunately we cannot use the link-local addresses for anything except ping. This is very important to note – as iperf will not work over link-local addresses (starting with fe80:). the testing machines I was using are running debian stable so the assignment of ip addresses is linux-style (but I think widows PCs would do the same thing through the GUI somehow).

$ ifconfig eth0 inet6 2012::1/64 up

Interesting thing to note that you need to specify the “inet6” ip address as ifconfig is not smart enough to recognize the IP address family from its syntax.
The next thing to do is obviously to bring the other PC’s interface up. So as before:

$ ifconfig eth0 inet6 2012::2/64 up

Yet again check the connectivity with ping:

$ ping -I eth0 2012::2
Pinging 2012::2 with 32 bytes of data:
Reply from 2012::2: time < 1ms
Reply from 2012::2: time < 1ms
Reply from 2012::2: time < 1ms
Reply from 2012::2: time < 1ms

Ping statistics for 2012::2:
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 1ms, Maximum = 1ms, Average = 1ms

Ok now we have a working connectivity over IPv6 so the last step is to actually configure and run iperf. The one thing to remember is to use -V switch which sets iperf to IPv6 mode. All the remaining parameters are used as in IPv4.

Server side:
iperf -V -s -u -B 2012::2

-s is for server, -u for udp, -B bind to specific, IP -V for IPv6

The Client side:
iperf -u -t 30 -i 1 -V -c 2012::2 -b 5M
-c is for client, -u for udp, -V for IPv6,t for 30 seconds duration, -i for 1 second reporting interval, -b 5M for 5mbps of test traffic

Well obviously you can tweak the parameters as much as you want and I haven’t noticed any significant difference in behavior between IPv4 and IPv6 iperf (and that includes dual test and TCP instead of UDP).

10 thoughts on “How to test IPv6 with iperf

  1. Thank you very much for the helpful information.

    For me my machine:
    “$ ifconfig eth0 inet6 2012::1/64 up”
    does not work but the following works:
    “$ ifconfig eth0 inet6 add 2012::1/64 up”


  2. Hi, from my observation, if you use -b 100Mbps (instead of 5Mbps) you will see a large difference between TCP and UDP. For some reasons, TCP with ipv6 iperf always has higher throughput than UDP; sometimes even 5 times higher. Have you seen something like that?

    • Hi,
      I have not noticed this behavior as I normally test with UDP, also as stated somewhere in the article I don’t believe that iperf is reliable at speeds above ~60Mbps.

    • Hi Ahiaba,
      iperf is to my knowledge not capable of doing multicast (don’t quite see any reason why it should). But for multicast testing over IPv6 you can use a free VLC player which I used many times for IPv4 igmp multicasting and I believe that it is capable of IPv6 as well – see the vlc website for some basic info

      • iperf can support multicast. use the -B option on the receiver to bind a multicast address. You may need a igmp/mld querier depending upon intermediate switches. I haven’t tried v6 multicast so can’t comment on if that works or not but have used v4 extensively.

        • Hi,
          I tried booth ipref and iperf3 to test IPv6 multicast but not success. When I bind my receiver to a multicast address:
          iperf3 -V -s -B ff15::1
          I got error:
          Linux localhost.localdomain 3.10.0-123.9.2.el7.x86_64 #1 SMP Tue Oct 28 18:05:26 UTC 2014 x86_64
          iperf3: error – unable to start listener for connections: Invalid argument
          iperf3: exiting

          Anyone can help?

          • Hi,
            this testing has been done ages ago on some fairly old iperf version (not iperf3 which is completely different software despite the same name). I was exclusively testing unicast at the time so I am afraid I won’t be much help here.

  3. Hi,

    I did the steps in here, but I got the response of “bind failed: Invalid argument”. I use two high gain antennas attached to the same computer. I connected them via wifi_p2p and IPv6 addresses are assigned automatically. When I use command ifconfig I that the inet6 addr: fe80::200:ff:fe01:1/64. I used the command “iperf -V -s -u -B fe80::200:ff:fe01:1”. Could you help me with that issue?

Leave a Reply

Your email address will not be published. Required fields are marked *