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

General questions about notifications, low level BLE packets and SoftDevice (PHY, connection interval, connection event length, ATT MTU and DLE)

Hi,

I have a couple of general questions regarding BLE packets, things that are not completely clear to me. I'm using SD S140 v6.1.0. I hope this doesn't end up in too many questions in one thread. For all the questions, assume a SoftDevice handling a single peripheral link.

First thing: I know that it is possible to send up to 6 notifications in a single connection interval. What if I increase the connection interval and the connection event length? Would it be possible to send more than 6? Or what is the purpose of increasing the connection event length?

I'm guessing it is also possible that the SD sometimes cannot send all 6 notifications in a single connection interval (assume that 6 notifications were already queued using sd_ble_gatts_hvx), depending on the connection parameters. Is this true (assuming a good quality link with no packet losses)? Or is it always possible to send 6? What if you set up something like connection interval of 7.5 ms, with maximum data length and ATT MTU? What if you set up the Coded PHY?

Assuming that the link quality is bad: If a notification can't be sent due to interference, will the SD try to send the same notification 6 times within the same connection interval?

Regarding the Coded PHY: I've read that when you use the Coded PHY, the maximum data length possible is 27 in order to avoid interference. However, it still looks like the nrf_ble_gatt module is accepting the max data length of 251 even when the Coded PHY has already been set up. Does the SoftDevice use a data length of 27 internally anyway?

I know that when the ATT MTU is larger than the supported data length, the data will be broken down in multiple packets. Does this still give better throughput or is it better to always keep the ATT MTU smaller than the data length? I'm not exactly sure whether having ATT MTU > DL introduces more overhead or not.

What happens if the connection event length is set up to be longer than the connection interval? I ask this because the event length must be set up during SD initialization and the connection interval is negotiable at runtime. It looks like the SoftDevice is smart enough to handle this but I just want to be sure and ask this.

I'm asking all these questions because I'm trying to get as much throughput as possible using the Coded PHY, but even following all the threads I could find on this I couldn't manage to achieve a high enough throughput. I need to get around 24 Kbps which is supposedly achievable, but I'm having trouble with that. Any input on that will also be deeply appreciated!

Thanks and sorry for all the questions at once!

Parents
  • Hi Andy,

    First thing: I know that it is possible to send up to 6 notifications in a single connection interval. What if I increase the connection interval and the connection event length? Would it be possible to send more than 6? Or what is the purpose of increasing the connection event length?

     Yes, you can send more than 6 packets per connection event. If you set event length == connection interval, you should be able to fill the time between connection events sending/receiving notification packets. 

    I'm guessing it is also possible that the SD sometimes cannot send all 6 notifications in a single connection interval (assume that 6 notifications were already queued using sd_ble_gatts_hvx), depending on the connection parameters. Is this true (assuming a good quality link with no packet losses)? Or is it always possible to send 6? What if you set up something like connection interval of 7.5 ms, with maximum data length and ATT MTU? What if you set up the Coded PHY?

    There is not enough time to send 6 packets with coded PHY at 7.5 ms intervals as the transmission of each packet requires longer time compared to 1M PHY. I guess that you may be able to send 2 at this interval. 

    Assuming that the link quality is bad: If a notification can't be sent due to interference, will the SD try to send the same notification 6 times within the same connection interval?

     No, the re-transmits will be attempted on the following connection event. So the throughput will be heavily impacted by the link quality, especially if you're using long connection intervals. 

    Regarding the Coded PHY: I've read that when you use the Coded PHY, the maximum data length possible is 27 in order to avoid interference. However, it still looks like the nrf_ble_gatt module is accepting the max data length of 251 even when the Coded PHY has already been set up. Does the SoftDevice use a data length of 27 internally anyway?

     Yes, this is a bit confusing. The Softdevice support 251 bytes with coded PHY, but the MaxRXTime/MaxTXTime is 2700 uS (=27 bytes with S=8 encoding). 

    I know that when the ATT MTU is larger than the supported data length, the data will be broken down in multiple packets. Does this still give better throughput or is it better to always keep the ATT MTU smaller than the data length? I'm not exactly sure whether having ATT MTU > DL introduces more overhead or not.

    Larger MTU gives a slightly smaller overhead due to packet encapsulation. The SDS shows the difference in terms of throughput ( under ideal conditions): https://infocenter.nordicsemi.com/topic/sds_s132/SDS/s1xx/ble_data_throughput/ble_data_throughput.html?cp=3_4_1_0_16. The data will still be split into smaller link layer packets. 

    What happens if the connection event length is set up to be longer than the connection interval? I ask this because the event length must be set up during SD initialization and the connection interval is negotiable at runtime. It looks like the SoftDevice is smart enough to handle this but I just want to be sure and ask this.

     The Softdevice is smart enough to handle this:) 

    I'm asking all these questions because I'm trying to get as much throughput as possible using the Coded PHY, but even following all the threads I could find on this I couldn't manage to achieve a high enough throughput. I need to get around 24 Kbps which is supposedly achievable, but I'm having trouble with that. Any input on that will also be deeply appreciated!

     I think 24kbps should be achievable, but only if the link quality is good. I have modified the ble_app_uart and ble_app_uart_c example in SDK 15.2.0 to test this, see attached zip below. Can you try this example and see what you get? 

    nRF5_SDK_15.2.0_mod.zip

    Test with 400 ms interval

  • Yes, this is a bit confusing. The Softdevice support 251 bytes with coded PHY, but the MaxRXTime/MaxTXTime is 2700 uS (=27 bytes with S=8 encoding). 

    Hello Vidar, thank you for the useful information. I have a question about using coded PHY with large packages.

    Situation
    I want to develop systems that can communicate over a long range (around 500 meters, festival/event environment) with messages of around 250 bytes long. Latency up to 500ms is acceptable. I don't have a development kit yet, but I was thinking about using the nRF5340 PDK and nRF52840 Dongle (for testing)

    Question
    Why are the MaxRXTime and MaxTXTime set to 2700 uS? Is there a possibility to set it to 16656 uS (251 bytes) or 17040 uS (257 bytes)? And should that be better in this case?

    If I split a big message over 10 smaller messages, there's a higher chance that the complete message will not arrive, right? Will only the lost messages be resend in that case or all of them?

    Why am I asking this
    I see in your answer and vaguely in other sites that this coded PHY and long packages (DPL) are never used together. However, the Bluetooth specification shows that it is possible. See attached spreadsheet for a simple overview of sources, images and calculations. So everything I find online contradicts the specification.

    I'm asking you, because I have come to a dead end. You help will be very appreciated.

Reply
  • Yes, this is a bit confusing. The Softdevice support 251 bytes with coded PHY, but the MaxRXTime/MaxTXTime is 2700 uS (=27 bytes with S=8 encoding). 

    Hello Vidar, thank you for the useful information. I have a question about using coded PHY with large packages.

    Situation
    I want to develop systems that can communicate over a long range (around 500 meters, festival/event environment) with messages of around 250 bytes long. Latency up to 500ms is acceptable. I don't have a development kit yet, but I was thinking about using the nRF5340 PDK and nRF52840 Dongle (for testing)

    Question
    Why are the MaxRXTime and MaxTXTime set to 2700 uS? Is there a possibility to set it to 16656 uS (251 bytes) or 17040 uS (257 bytes)? And should that be better in this case?

    If I split a big message over 10 smaller messages, there's a higher chance that the complete message will not arrive, right? Will only the lost messages be resend in that case or all of them?

    Why am I asking this
    I see in your answer and vaguely in other sites that this coded PHY and long packages (DPL) are never used together. However, the Bluetooth specification shows that it is possible. See attached spreadsheet for a simple overview of sources, images and calculations. So everything I find online contradicts the specification.

    I'm asking you, because I have come to a dead end. You help will be very appreciated.

Children
Related