This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Improve communication throughput changing conn_params and ATT MTU params

Hi everybody,

I am working with an UART example with multi-link and everythink working on coded_s8. The objective is keep 20 devices connected and every peripheral send always 50 bytes of data every 100 ms. This are my connection parameters:

//Parametros de conexion
struct bt_le_conn_param m_conn_param=
{
	.interval_min=60,//70*0.625ms
	.interval_max=60,
	.timeout=500,
        .latency=0,
      
};

//Parametros de scaneo
static struct bt_le_scan_param m_scan_param=
{
        .type = BT_LE_SCAN_TYPE_ACTIVE,
        .options = BT_LE_SCAN_OPT_CODED | BT_LE_SCAN_OPT_NO_1M,
        .interval = BT_GAP_SCAN_FAST_INTERVAL,//60ms
        .window = BT_GAP_SCAN_FAST_WINDOW,//30ms
};

I follow this entry: https://devzone.nordicsemi.com/f/nordic-q-a/47330/connection-and-scan-interval-in-multilink-application

Which recommend  set interval of conn=scan interval and a shorter scan window. I whish know if is possible see the packets on a connection with a sniffer to make an strategy and play with parameters, but i thing is only for advertising, isn't it?

Later i see this entry, where explain that increase MTU size and gap data lenght https://devzone.nordicsemi.com/f/nordic-q-a/67249/connection-interval-and-througput/276129#276129

But i am not able to find these parameters on my project, could you guide me on where find that configuration??

My actually throughput isn't enought, i achieve between 200 and 400 messages/second, whereas the objective is 600 messages/second, I write to the UART of every peripheral an array of data every 100 ms with and external uart device. Never a message is lost, every message is sended but not on time desireed, so i am convinced that is a BLE paramter/configuration.

Any suggest or idea to improve the throughput is very welcome!

Really i think that configuring the parameters of the second link seems to be enought, but i don't know how.

I am working with the last version of SDK, and with nrf52840 dongle.

Thank you for the support Nordic team,

regards.

Parents
  • Hi

    Which recommend  set interval of conn=scan interval and a shorter scan window. I whish know if is possible see the packets on a connection with a sniffer to make an strategy and play with parameters, but i thing is only for advertising, isn't it?

    With a professional sniffer, like the Ellisys Bluetooth Explorer, it is possible to sniff multiple connections and advertising at the same time. You can not see when the device is scanning, since a scanner doesn't transmit anything. 

    Later i see this entry, where explain that increase MTU size and gap data lenght https://devzone.nordicsemi.com/f/nordic-q-a/67249/connection-interval-and-througput/276129#276129

    But i am not able to find these parameters on my project, could you guide me on where find that configuration??

    I would recommend taking a look at the throughput sample in order to see how you can configure extended MTU. 

    My actually throughput isn't enought, i achieve between 200 and 400 messages/second, whereas the objective is 600 messages/second,

    You mean you want to send 600 messages, each 50 bytes long, over coded PHY (S8) each second?

    This is a mathematical impossibility, since each packet on air will be almost 4ms in length ((50 bytes + approx 10 byte for address, header, crc etc) * 8 bits * 8us pr bit) = 3840us pr packet

    Best regards
    Torbjørn

  • My actually throughput isn't enought, i achieve between 200 and 400 messages/second, whereas the objective is 600 messages/second,

    Sorry, I meant messages/minute.

    Okey, i will investigate throughput example to look on where and how to change the parameters, 

    thank you.

  • Ok, then I understand. 600 messages pr minute should be possible. 

    If you still have questions after looking at the throughput example just let me know. 

    Best regards
    Torbjørn

  • Hi,

    I take a look on throughput example on the sdk x1.7.0, where my project is maked, and is not possible to change the att_mtu with the commands, but yes the phy, data_len and conn_ interval. The documentation says that:

    But i am not able to find any kconfig or configuration on "Configure nRF Connect SDK Project". Please if you could show me where or how to find this option i would apreciate it.

    On another hand i see the ble_app_att_mtu_throughput on sdk v1.5.0, in this project the att_mtu si set with the function nrf_ble_gatt_att_mtu_periph_set and nrf_ble_gatt_att_mtu_central_set, functions included on nrf_ble_gatt.h. Unfortunately i am not be able to find these functions or similar on the actual sdk.

    If you could explain wich api or which kconfig or which function is used on this sdk to update the att_mtu i would appreciate it, i am stuck on this point.

    Thank you,

    regards.

  • Updating my last post,

    I find this Kconfig

    config BT_L2CAP_TX_MTU that i put up to 120
    I see this #define on att_internal.h
    #define BT_ATT_DEFAULT_LE_MTU 100
    which is used to define the att_mtu on the conexions, I verify that my devices connected take this parameter with bt_gatt_get_mtu().
    Playing with this value between 23,52 and 100 and interval_conn between 30,60,100 i can't achieve a throughput bigger than 15Kbyte/min or 2.2Kbps.
    I can't understand why there aren't changes.
    Thank you for the support,
    regards.
  • Hi another time,

    to summarize my proggress:

    config BT_L2CAP_TX_MTU that i put up to 120

    With the objective of send more bytes x packet.

    config BT_RX_STACK_SIZE
    

    I put up this value a little bit too.

    config BT_DATA_LEN_UPDATE
    

    To enable extended Data_len.

    config BT_CTLR_TX_BUFFER_SIZE
    

    To set the same value as BT_L2CAP_TX_MTU

    conn_interval set to number between 30-60ms.

    The objective is send 50 bytes every 100 ms for 20 devices to a central on coded_s8.

    My project is based on Uart example,

    On another words, after a timer o 100ms is trigger, an external device write on UART to the peripheral 50 bytes of data, and the periph send to central.

    Although i play with parameters changing conn interval, att_mtu_size, etc I am not able to see any changes on throughput. To measure the results i count bytes received by the central by one peripheral on a minute of connection one to one.

    could be some kconfig on stack sizes that i missed?

    Thank you, regards.

Reply
  • Hi another time,

    to summarize my proggress:

    config BT_L2CAP_TX_MTU that i put up to 120

    With the objective of send more bytes x packet.

    config BT_RX_STACK_SIZE
    

    I put up this value a little bit too.

    config BT_DATA_LEN_UPDATE
    

    To enable extended Data_len.

    config BT_CTLR_TX_BUFFER_SIZE
    

    To set the same value as BT_L2CAP_TX_MTU

    conn_interval set to number between 30-60ms.

    The objective is send 50 bytes every 100 ms for 20 devices to a central on coded_s8.

    My project is based on Uart example,

    On another words, after a timer o 100ms is trigger, an external device write on UART to the peripheral 50 bytes of data, and the periph send to central.

    Although i play with parameters changing conn interval, att_mtu_size, etc I am not able to see any changes on throughput. To measure the results i count bytes received by the central by one peripheral on a minute of connection one to one.

    could be some kconfig on stack sizes that i missed?

    Thank you, regards.

Children
  • The maximum data throughput that I achieve is with this method is 2.66Kbps

  • Hi

    Discussing this more with my colleagues I realized that increasing MTU size has little effect on coded phy mode. The reason for this is that it takes a very long time to send packets when using coded phy (just a standard 27 byte payload will take more than 2ms on air), and if the stack was to send even longer packets there would be a high risk of having a packet affected by interference. If you send a very long payload and get bit errors caused by interference you risk losing the entire packet, which would then have to be retransmitted. 

    In other words there is little to gain by increasing the MTU when using coded phy. 

    I can do some testing on my own to figure out what the expected throughput in coded phy mode should be. 

    Best regards
    Torbjørn

  • Hi another time,

    Finally I achieve the throughput desired, I want to apologice because of the cause of the low throughput was part of my implementation, I didn't have the limitation on BLE channel, in addition i had on UART chanel. It was an absurd error but is closed and i have had learn a little more about.

    Thank you another time, regards.

  • Hi 

    Good to hear you found the issue Slight smile

    I will consider the case closed then. 

    Best regards
    Torbjørn

  • Hi,

    Yes this case would be closed but, i have some doubts:

    The reason for this is that it takes a very long time to send packets when using coded phy (just a standard 27 byte payload will take more than 2ms on air), and if the stack was to send even longer packets there would be a high risk of having a packet affected by interference. If you send a very long payload and get bit errors caused by interference you risk losing the entire packet, which would then have to be retransmitted. 

    If I have understand correctly, if I am working with coded_s8 on an high noise envitronment, putting up the ATT_MTU would be perjudicial to the throughput, isn't it?

    My system is working on a noisy environment, do you recommend me to set as a default value the ATT_MTU? Or I put up to my data payload to reduce the quantity of packets?

    What about data_len? How it could affect to my context?

    On another hand, i receive all of the packets on central sended by three peripherals on a minute with conn_interval=conn_window=scan_interval=60, but if I connect four peripherals I miss packets on one of the peripheral, this is solved putting up more the conn_interval=conn_window=scan_interval.

    My question is, could I have some disadvantages on putting up too much the conn_interval with the objetive of manage more peripherals data receiving?

    Edit: on conn_interval , how affect put an interval_min equal to interval_max? Or on another words what is the better way or range to consider maximum and minimum interval of conexion?

    Thank you for the attention, i am near to complete my project and i want to understand really how to play with parameters depending on context,

    Thank you ovrebeckk,

    regards.

Related