How to test IPv6 with iperf

Lately 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 riight? 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 < 1msPing 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 at the time of writing iperf does 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.

$ 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).

2 Replies to “How to test IPv6 with iperf”

  1. A few more notes when using iperf 2.0.11. For link local, the client needs to specify the local interface to use, e.g. iperf -c fe80::d03a:d127:75d2:4112%eno1, where the % is the delimeter between the link local address and the device.

    For -V on the server, it will accept either a v4 or v6 address. On the client the -V will only use a v6 address.

    Finally, iperf 2.0.11 supports v6 and source specific multicast.

    https://sourceforge.net/projects/iperf2/

Leave a Reply

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