IPv6 UDP iperf Testing#

It is possible to test iperf throughput in both direction:

Using iperf client, the Wi-SUN node is the client sending Datagrams to an iperf server which needs to be started on another IPv6 address.

Using iperf server, the Wi-SUN node is the server and is waiting for datagrams coming from another IPv6 address on the defined options.port (default 5001, the usual iperf port).

In both cases:

  • The Border Router must be started

  • The Wi-SUN node(s) need to be connected to the Wi-SUN network

  • We test using nodes directly connected to the Border Router (single hop). With multiple hops, the throughput is to be divided by the number of hops.

  • The iperf server must be started before the client

Add IPv6 address to Border Router tun0#

To allow using Linux regular iperf (iperf2) on the Border Router, the tun0 interface needs to have a known IPv6 address.

We use the IPv6_prefix set for wsbrd with suffix ::1. It is visible in the tun0 Iv6 address or in the wsbrd configuration file.

Retrieving the tun0 IPv6 prefix:

ip address show tun0 | grep global

inet6 **fd00:6172:6d00**:0:4de2:8ac8:d8cb:780f/64 scope global dynamic mngtmpaddr stable-privacy

Adding a fixed/known IPv6 address to tun0:

sudo ip -6 address add \<IPv6\_prefix[0:14]\>::1 dev tun0

example:

sudo ip -6 address add **fd00:6172:6d00**::1 dev tun0

Check:

ip address show tun0 | grep global | grep ::1

inet6 **fd00:6172:6d00::1**/64 scope global

Using this method, it is possible for any Wi-SUN node to know what this address is, checking its own global IPv6 address and replacing the last digits with ::1.

Wi-SUN Node as client#

We test the Wi-SUN node as a client (sending Datagrams to the server) using the Raspberry Pi supporting the Border Router application, wsbrd. The iperf server must be started first, then the client.

On the Linux Border Router:

  • (One time) Install iperf2 (apt-get install iperf) if not already installed.

  • (After each restart of wsbrd) Add a fixed/known IPv6 address to tun0 as described above.

    • Note: You will need to set this IPv6 address on the client as options.remote_addr.

  • Start iperf2 as a UDP IPv6 server:

    iperf --server --udp --ipv6\_domain --interval 1 –-format KBytes

    • or (using short arguments)

    iperf -s -u -V -i 1 -f KBytes

  • The iperf server will start waiting for incoming data:

------------------------------------------------------------
Server listening on UDP port 5001
UDP buffer size:  176 KByte (default)
------------------------------------------------------------

On the Wi-SUN Node:

Note: Apart from the server’s IPV6 address, all default values should match a typical iperf test and can keep their default values.

  • Check that the Wi-SUN Node is connected to the Wi-SUN network:

    > wisun get wisun.connection_state

    wisun.join_state = Operational (5)

  • Check that the parent is the Border Router (to make sure we’re testing on a single hop):

    TBD (not available in current iperf app)

  • Set the IPv6 address to match the fixed server’s IPV6 address set above:

    wisun get wisun.ip_address_global

    wisun.ip_address_global = **fd00:6172:6d00**:fe6d:5a15

    (where the IPV6 prefix is the 14 first characters)

    iperf set options.remote_addr <server’s IPV6 address>

    example:

    iperf set options.remote_addr* **fd00:6172:6d00::1**

  • (optionally) Set the bandwidth format. This is the unit used by options.bandwidth. we recommend setting it to bits/s.

    iperf set options.bw_format bits/s

  • (optionally) Set the number of payload bytes to the maximum before fragmentation occurs using UDP, i.e.1234. This is to maximize the throughput.

    iperf set options.buffer_length 1234

  • (optionally) Set the test duration in seconds (default = 10)

    iperf set options.duration 60

  • (optionally) Set the iperf port (default = 5001)

    iperf set options.port 5001

  • (optionally) Set the iperf bandwidth (default = 20000). The bandwidth should be in a range attainable by the selected Wi-SUN PHY. In our initial tests, we’re using Wi-SUN FAN, NA-915MHz, 1b (2FSK 50kbps mi=1.0), so 50 kbits/sec is the maximum we could expect if using 100% of the link as a permanent link (which is not the case, according to Wi-SUN specification). Half this is what we will reasonably expect to achieve.

    iperf set options.bandwidth 20000

  • (optionally) Set the display interval in seconds (default = 1):

    iperf set options.interval 1

  • (optionally) Set the number of packets to transmit (default = 0/unset).

    • Set this only if you want to set an exact number of packets instead of options.bandwidth for options.duration seconds.

    iperf set options.packet_number 10

  • Check your options settings (only checking relevant options, marked with [c.u.])

   iperf get options
   [csu ] options.port = 5001
   [c u ] options.remote_addr = "**fd00:6172:6d00::1**"
   [c u ] options.bandwidth = 20000
   [csu ] options.bw_format = bits/s
   [c u ] options.packet_number = 0
   [c u ] options.buffer_length = 1234 bytes
   [c u ] options.duration = 60 s
   [csu ] options.interval = 1 s
  • Start the iperf client test:

    iperf client

Note: In this setup, the iperf server being run on a Linux machine doesn’t need to be restarted upon each test. It can be left running.

Test results are displayed in the Wi-SUN Node’s console (Client) and in the Linux (Server) console in a format very similar to regular iperf2.

Wi-Sun Node as Server#

Here we test the Wi-SUN node as an iperf server (receiving Datagrams from clients) using the Raspberry Pi supporting the Border Router application, wsbrd as the client. As before, the iperf server must be started first, then the client. The difference with regular iperf is that iperf server must be called once per test.

On the Wi-SUN Node:

Note: Apart from the server’s IPV6 address, all default values should match a typical iperf test and can keep their default values.

  • Check that the Wi-SUN Node is connected to the Wi-SUN network:

    > wisun get wisun.connection_state

    wisun.connection_state = Operational (5)

  • Check that the parent is the Border Router (to make sure we’re testing on a single hop):

    TBD (not available in current iperf app)

  • (optionally) Set the bandwidth display format.

    iperf set options.bw_format bits/s

  • (optionally) Set the iperf port (default = 5001)

    iperf set options.port 5001

  • (optionally) Set the display interval in seconds (default = 1)

    iperf set options.interval 1

  • Check your options settings (only checking relevant options, marked with [.su.]):

   iperf get options
   [csu ] options.port = 5001
   [csu ] options.bw_format = bits/s
   [csu ] options.interval = 1 s
  • Display the global IPv6 address:

    wisun get wisun.ip_address_global

    wisun.ip_address_global = **fd00:6172:6d00:0:5e02:72ff:fe96:c6a3**

  • Start the iperf server test:

    iperf server

Note: In this setup, the iperf server is running on the Wi-SUN node and only accepts one test. iperf server needs to be relaunched for each test.

On the Linux Border Router:

  • (One time) Install iperf2 (apt-get install iperf) if not already installed.

  • Start iperf2 as a UDP IPv6 client using the Wi-SUN node’s global IPv6 address.

    iperf --client* **fd00:6172:6d00:0:5e02:72ff:fe96:c6a3** *--udp --ipv6_domain --interval 1 --time 10 --bandwidth 20 --format k

    • or (using short arguments)

    iperf -c **fd00:6172:6d00:0:5e02:72ff:fe96:c6a3** -u -V -i 1 -t 10 -b 20 -f k

    Test results are displayed in the Wi-SUN Node’s console (Client) and in the Linux (Server) console in a format very similar to regular iperf2.

Wi-SUN Throughput Measurement#

Maximizing Throughput#

To maximize the iperf throughput, we set on the Wi-SUN node options.buffer_length to the maximum size before fragmentation occurs of 1234 bytes. In this case, the Wi-SUN overhead (on top of UDP) is minimal, and user throughput is maximum.

Again, to maximize the iperf throughput, the iperf implementation in the Wi-SUN Network Measurement application uses the UDP protocol (TCP would require acknowledges which would negatively impact the throughput).

Finding the Throughput Limit#

Due to the characteristics of a Wi-SUN network, where PAN advertising can take a certain time (it requires sending a PAN Advertisement on each channel, and there are often as much as 129 channels), using an iperf test to measure network throughput needs to be taken cautiously.

During the iperf test there will be periods of time when iperf data flows without interruption, leading to a momentary 'best case' throughput.

There will also be periods when network signaling takes precedence over data transmission. When network signaling occurs, the iperf throughput will be negatively impacted.

To get a valid throughput value to compare between PHY configurations, we look for the max sustainable throughput without packet loss on a long duration iperf test of at least 60 seconds. The idea is that a 60 second test with a given bandwidth will fill up the buffers up to overflowing if the stack is unable to cope with the requested throughput.

The effect of such overflowing is regularly lost packets during the duration of the test, reflecting in the final server report as a non-zero lost packets count.

The test consists in finding the maximum options.bandwidth which allows 0 lost packet over 60 sec. We approach this limit through several consecutive iperf client tests. The figure we look for is the number of lost packets on the server side (since we’re using UDP, the client doesn’t know if the data passes through).

  • If the number of lost packets is 0, the Wi-SUN PHY can withstand such a throughput. Increase the options.bandwidth and retest.

  • If the number of lost packets is NOT 0, the Wi-SUN PHY is unable to withstand such a throughput. Decrease the options.bandwidth and retest.

Do this in decreasing steps until you have a small enough options.bandwidth step (we used a 1000 bit step in our tests).

The value we keep is the maximum options.bandwidth without packet loss.

Below is an illustration of such a limit search, where the limit is 42000 bit/s:

Limit search illustrationLimit search illustration