How can I calculate the maximum throughput for an application running on the nRF51822 and the S110, when connecting to different kind of Central devices?
How can I calculate the maximum throughput for an application running on the nRF51822 and the S110, when connecting to different kind of Central devices?
There are primarily 3 factors that determine maximum throughput with BLE:
Operation For high-throughput applications, you should make sure to use either Write Commands (Write without response) or Notification. In each such Write Command or Notification, you can have 20 B data. These packets are link-level ACK-ed, but does not provide any application level ACK-ing, and can hence be queued. If you instead use Write Requests or Indications, you can by spec not queue packets and must wait for an ACK to the first packet before sending the next. This significantly reduces throughput (perhaps 10-fold).
Connection interval Both the nRF8001 and the nRF51822 supports the lowest connection interval allowed by spec, 7.5 ms. This is also supported by some Android devices, while others does not seem to allow intervals below 37.5 ms. The latest versions of iOS seems to have 30 ms as the lowest documented interval supported.
Number of packets per event With regard to number of packets per connection event, the nRF8001 will be able to receive 2-3 but can transmit only 1. The nRF51822 on the other hand can both send or transmit up to 6 packets per interval. It seems that most Android devices supports ~4 packets per interval, while most iOS devices supports up to 6 packets.
Calculation As you can see from the above, throughput with BLE isn't quite straightforward, but given a number of packets per interval n and a connection interval T, the maxiumum throughput can be calculated like this:
n * 20 B * 1/T
Some examples:
How to receive BLE packets via nRF51822/nRF51422 and Master Emulator Firmware is described in this tutorial, section "Using the nRF51 Dongle". Further discussion on BLE throughput test is on this thread. Also different BLE packet types heavily influence the maximum throughput, as described in this blog.
There are primarily 3 factors that determine maximum throughput with BLE:
Operation For high-throughput applications, you should make sure to use either Write Commands (Write without response) or Notification. In each such Write Command or Notification, you can have 20 B data. These packets are link-level ACK-ed, but does not provide any application level ACK-ing, and can hence be queued. If you instead use Write Requests or Indications, you can by spec not queue packets and must wait for an ACK to the first packet before sending the next. This significantly reduces throughput (perhaps 10-fold).
Connection interval Both the nRF8001 and the nRF51822 supports the lowest connection interval allowed by spec, 7.5 ms. This is also supported by some Android devices, while others does not seem to allow intervals below 37.5 ms. The latest versions of iOS seems to have 30 ms as the lowest documented interval supported.
Number of packets per event With regard to number of packets per connection event, the nRF8001 will be able to receive 2-3 but can transmit only 1. The nRF51822 on the other hand can both send or transmit up to 6 packets per interval. It seems that most Android devices supports ~4 packets per interval, while most iOS devices supports up to 6 packets.
Calculation As you can see from the above, throughput with BLE isn't quite straightforward, but given a number of packets per interval n and a connection interval T, the maxiumum throughput can be calculated like this:
n * 20 B * 1/T
Some examples:
How to receive BLE packets via nRF51822/nRF51422 and Master Emulator Firmware is described in this tutorial, section "Using the nRF51 Dongle". Further discussion on BLE throughput test is on this thread. Also different BLE packet types heavily influence the maximum throughput, as described in this blog.
Also, for a suggestion of an application algorithm to get high throughput, take a look at this: https://devzone.nordicsemi.com/index.php/dealing-large-data-packet-s-through-ble
This application on GitHub shows a full example demonstrating max throughput: https://github.com/NordicSemiconductor/nrf51-ble-app-lbs/tree/throughput-test-5.1.0
Hi Ole and Stefan,
There is actually 4th parameter and that's MTU size. In case of nRF51 it's constant so you do not count it as variable but for general/theoretical discussion it's worth mentioning. We also secretly hope that Nordic stacks will support larger MTUs one day...;) Otherwise great post and great work on the forum!
Cheers Jan
Does anyone know why higher version of iOS result in lower packets per connection interval? Is this an error in the answer, or truly what happens (going from 6 to 3)?
Worth noting that it seems like S130 only supports 2/3 packets per connection interval (depending on the operation). So if you want max throughput you have to use S110. See: infocenter.nordicsemi.com/index.jsp