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

Max. throughput on BLE UART using coded phy

Hi!

I am evaluating BLE UART Demo with longe range (BLE_GAP_PHY_CODED). 

Max. data throughput (using different parameters for ATT_MTU size and connection inverval) seems to be aroung 3 KB/s. 

Can anyone confirm this? Shouldn't there be a higher throughput possible under good conditions?

Thanks!

Andreas

  • The differences are the connection settings that you use in the throughput example. 

    There are four BLE connection settings that you want to tweak:

    1. Connection interval

    I belive the minimum connection interval for BLE is 7.5ms at the moment. For standard packet sizes of 23 byte payload the Connection Interval is the determining factor for throughput, other than your Link Budget that is (who's determined by the physical RF link quality). 
    This is because you will only send one packet per Connection Interval. 
    You can request to update the Connection Interval by calling sd_ble_gap_conn_param_update with the wanted settings.

    When using the lowest possible connection interval it might be difficult for your devices to maintain multiple connections (larger networks). If you want the device to be able to connect to multiple devices I suggest you choose a longer Connection Interval of approx 20-30ms and use Extended MTU. 


    2. Extended MTU

    The MTU is the payload that is sendt between the application layers and the BLE Host layers (L2CAP) in each peer. By increasing the MTU from the standard 23bytes to 247bytes you can send longer packets and this reduces the overall overhead. 
    There's a caveat thought, a 247byte MTU packet will be split into 23 byte packets in the BLE Controllers unless your Link Layers have enabled Data Length Extension. 

    This can be set by first calling sd_ble_cfg_set with a cfg_id of  BLE_CONN_CFGS, a p_cfg pointer that points to a ble_conn_cfg_t that contains a ble_gatt_conn_cfg_t with a att_mtu of 23-247 bytes. This configuration must be set prior to calling sd_ble_enable.

    Then you can start negotiating for new MTU sizes with a call to sd_ble_gattc_exchange_mtu_request. This is done upon connection establishment by our GATT library in our SDK by a call to  sd_ble_gattc_exchange_mtu_request


    3. Data Length Extension

    In order for the two Link Layers to use larger packet sizes they have to request the use of DLE. 

    This can be enabled by calling sd_ble_opt_set with a  ble_opt_t of common_opt where conn_evt_ext is set to 1/true. 

    After this is done the SoftDevice will negotiate the use of DLE automatically. 

    4. Connection Event Length Extension

    At this point you're still limited to one packet per Connection Event. Connection Event Length Extensions enables the Link Layers to continuously transmit packets throughout each Connection Interval, limited by the time set aside with a call to sd_ble_cfg_set with a cfg_id of  BLE_CONN_CFGS, a p_cfg pointer that points to a ble_conn_cfg_t that contains a ble_gap_conn_cfg_t with an event_length of x multiple of 1.25ms units

    If you have a 20ms Connection Interval you'll want to set an event_length of 20ms / 1.25ms = 16. 


    Summary
    There's a trade-off between low Connection Intervals and BLE coexistence, shorter intervals will make it more difficult for the  BLE Controller to establish connections to other devices. 

    There's also a trade-off between packet sizes and packet loss, because lost packets are re-transmitted, longer packets are more susceptible to noise, and longer packets takes more time to transmit, you might not want to use the maximum packet size available in noisy environments as you will spend more time re-transmitting lost packets.

  • https://devzone.nordicsemi.com/f/nordic-q-a/47010/support-for-coded-phy-and-data-length-extension-together

    HI i found this which is telling Data length Extension is not working which explains why the data throughput is so low. I can not manage to geht the 32Kbs which should be possible too so this are my calc perhaps there is something wrong:

    1sec/connection interval*packnumber per interval/(6)phycodedslow down factor*20bytes of data use*8bit

    1000ms/7.5ms*6/4*20*8=32000bit

    with mtu i would expect a little bit more but i can not reach 20Kbs perhaps the max number off pack per interval is wrong. i m using on both sides the NRF52840 but on the one side with Zephyre which should can handle that too. 

    Can you please provide the setting you are using to get a rate over 24Kbs? 

    Interval 7,5ms

    Data Length extension Yes but not working?

    extended MTU 247

    connection event Length extension 7.5ms?

    latency 5

    supervision timeout 4sec

    Edit 

    I found that if i start a scanner for BLE to get the advertisement while i m connected the connection is dropped 

    so what is there the relation ship? i guess it is sharing the time so that's why it is disconnected

    If i plan to connect to devices i guess my max data throughput is just the half of the total?

  • That is interesting. I also would like to know if data length extension is not working with coded phy. As far as I can see it sdk does not return with an error if set. I have no sniffer so I cannot tell if it is used.

  • Hi!

    Does anybody know if the sniffer will support coded PHY in future? And maybe when?

Related