This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Connection Interval and Througput

Hi, 

I am a bit confused about the effect the Connection Interval has on BLE throughput. 

SoftDevice documentation :

https://infocenter.nordicsemi.com/index.jsp?topic=%2Fsds_s140%2FSDS%2Fs1xx%2Fmultilink_scheduling%2Fextend_connection_event.html

Claims that higher connection interval increases throughput 

Other have claimed just the opposite 

https://punchthrough.com/maximizing-ble-throughput-on-ios-and-android/

which claims 
" BLE throughput requires context for it to be meaningful and the context starts by determining the connection interval (the smaller generally gets you faster throughput, though there are some interesting exceptions)

my logic is the if device communicate more oftern ( lower connection interval ) we achieve higher throughput. 

So - what is it  ? 

Thanks, 

Ran 

  • Also - what about switching to 2Mb PHY ? I know not all phone supports this , but I can send a request and check if it was granted . right ? 

    Ran

  • Yes, you can enable 2M PHY, and also increase MTU and maximum packet length (both NRF_SDH_BLE_GAP_DATA_LENGTH and NRF_SDH_BLE_GATT_MAX_MTU_SIZE) - in combination with shortest connection interval, you should get a throughput close to phone's limit.

  • Thanks, another questions :

    1.I am using NUS service, so each call to "ble_nus_data_send" ( which calls sd_ble_gatts_hvx ) equals a "packet" ? 

    2.if maximum data buffer I'm sending over NUS is ~160 Bytes, is it still better to set NRF_SDH_BLE_GATT_MAX_MTU_SIZE=247 and  NRF_SDH_BLE_GAP_DATA_LENGTH =251 ? 

    3.Having done all the suggested above, how do I handle NRF_ERROR_RESOURCE if and when calling sd_ble_gatts_hvx ? wait for HVN_TX_COMPLETE_EVENTS as suggested in other posts ? 

    4. Is there any reason to change HVN Q size ? I remember reading it will be automatically calculate based on connection params ? 

    Thanks Again - Much appreciated 

  • Hi 

    wrani said:
    1.I am using NUS service, so each call to "ble_nus_data_send" ( which calls sd_ble_gatts_hvx ) equals a "packet" ? 

    Each call to ble_nus_data_send constitutes one attribute (host) packet, but the link layer might split this packet into multiple on air packets if the data length is not large enough to send the entire packet in one go. 

    Assuming the data length is larger than your NUS packet + 7 bytes it will be sent in one packet over the air (the 7 bytes is used for the L2CAP and attribute headers). 

    wrani said:

    2.if maximum data buffer I'm sending over NUS is ~160 Bytes, is it still better to set NRF_SDH_BLE_GATT_MAX_MTU_SIZE=247 and  NRF_SDH_BLE_GAP_DATA_LENGTH =251 ? 

    In general there is no drawback having a GATT MTU and data length larger than what you need, but it does increase the RAM consumption of the SoftDevice a bit, so if you are running out of RAM you might consider optimizing this. 

    A GATT MTU of 163 and a data length of 167 is the minimum needed to support 160 bytes of user data in a single on air packet. 

    Regarding question 3, it is correct that waiting for the HVN_TX_COMPLETE_EVENT is the correct way to handle the NRF_ERROR_RESOURCE error. Then you ensure that the SoftDevice buffers are full at all times, which ensures optimal data transfer. 

    wrani said:

    other posts ? 

    4. Is there any reason to change HVN Q size ? I remember reading it will be automatically calculate based on connection params ? 

    In order to maximize data throughput you can increase the SoftDevice buffers through the NRF_SDH_BLE_GAP_DATA_LENGTH parameter in sdk_config.h

    This parameters determines how long you can keep transmitting packets back to back in a single connection event. 

    Best regards
    Torbjørn

  • Thanks. 

    Does any of what we've discussed changes if I am running a multilink setup ? 

    for ex , aggregator for 15 devices, all NRF's .

    What special attention\calculation in need to consider in such case ? 

Related