Search code examples
network-programmingopenthread

Are there Performance Goals or Requirements for OpenThread?


I have been prototyping OpenThread on Windows and I noticed that with the current CSMA backoff logic that the Mac class has, it waits an average of ~9ms before every send even if there has been no contention seen. This seems to be quite a long time to wait, for ever 128 byte packet.

When I ping from one virtual (all software) device to another in my Windows prototype, I get something like the following for small packets:

Pinging fd00::e91b:775a:8cfd:bd05 from fd00::b98c:3fe5:44e1:3573 with 32 bytes of data:
  Reply from fd00::e91b:775a:8cfd:bd05: time=12ms
  Reply from fd00::e91b:775a:8cfd:bd05: time=2ms
  Reply from fd00::e91b:775a:8cfd:bd05: time=18ms
  Reply from fd00::e91b:775a:8cfd:bd05: time=19ms
  Reply from fd00::e91b:775a:8cfd:bd05: time=12ms

For larger packets, I get the following:

Pinging fd00::357c:a372:2734:344c from fd00::4392:ac8b:b7d1:631 with 1400 bytes of data:
  Reply from fd00::357c:a372:2734:344c: time=249ms
  Reply from fd00::357c:a372:2734:344c: time=273ms
  Reply from fd00::357c:a372:2734:344c: time=355ms
  Reply from fd00::357c:a372:2734:344c: time=231ms
  Reply from fd00::357c:a372:2734:344c: time=236ms
  Reply from fd00::357c:a372:2734:344c: time=281ms

Finally, I used iPerf across the two virtual interfaces, and I was never able to get better than ~77 Kbits/sec. According to RFC 6282 IPv6 Datagrams on IEEE 802.15.4 Section 1, 802.15.4 should theoretically have:

a wireless link with a link throughput of 250 kbps or less

I would expect that OpenThread should get closer than 77 kbps.

Is there a set requirement or goal on speed that the base OpenThread library should be able to achieve?

Should the back off times in the Mac class be smaller, at least initially?


Solution

  • As you noticed, we have not focused on performance yet with OpenThread. We are still working to ensure that we have the all of the necessary functional pieces implemented.

    The soft MAC implementation in OpenThread is one example and it should be optimized to better match the IEEE 802.15.4-2006 timing specs. IEEE 802.15.4-2006 specifies a default random minimum backoff window of 2.56ms and a maximum backoff window of 10.24ms for 2.4 GHz. Assuming the minimum default window of 2.56ms, you should have an average of around 1.28ms of inter-frame spacing between unacknowledged data frames. If we wanted to be precise, a little more time needs to be added to account for the mandatory IFS (12 symbols for short frames or 40 symbols for long frames).