Beware that this post is related to an SDK in maintenance mode
More Info: Consider nRF Connect SDK for new designs
This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

How to increase throughput of TCP connection?

Hi,

I used IOT TCP Server example of nRF5 SDK(Ver.15.0) to complete the communication

between the Raspberry Pi and the PCA10040.

But I found that the communication speed is too slow,only about 1000 bytes per second.

Far less than the optimized NORDIC UART with about 8000 bytes per second.

I refer to ‘ATT_MTU Throughput Example’ for various attempts but have no effect.

Can I increase the throughput of TCP connection same to  the optimized NORDIC UART?

Parents
  • Hi,Bjorn
    Thank you for your reply!
    I tried to set NRF_SDH_BLE_GATT_MAX_MTU_SIZE=251 and MAX_CONN_INTERVAL=6(7.5ms),
    and found no improvement of communication speed. And I tried to change the Border Router(Pi)
    parameters of BLE connection, the communication speed increased to more than 5K bytes per
    second. But still less than the optimized NORDIC UART with about 8K bytes per second.
    In the TCP Server example, I found the BLE_GAP_PHY_2MBPS can't be used according to
    the following code comment of struct ble_gap_adv_params_t in ble_gap.h:

    uint8_t primary_phy;
    /**< Indicates the PHY on which the primary advertising channel packets
    are transmitted. If set to @ref BLE_GAP_PHY_AUTO, @ref BLE_GAP_PHY_1MBPS
    will be used.The only supported value by this SoftDevice is @ref BLE_GAP_PHY_1MBPS. */

    I want to get higher communication speed, so I want to discuss the following questions.
        1. Does this mean that BLE 6LoWPAN can only work at 1M PHY?
        2. Why can't set it to 2M PHY, is it a specification limit, or a softdvice limit?
        3. Is there a way to set it to 2M PHY?

    Best regards
    Michael

Reply
  • Hi,Bjorn
    Thank you for your reply!
    I tried to set NRF_SDH_BLE_GATT_MAX_MTU_SIZE=251 and MAX_CONN_INTERVAL=6(7.5ms),
    and found no improvement of communication speed. And I tried to change the Border Router(Pi)
    parameters of BLE connection, the communication speed increased to more than 5K bytes per
    second. But still less than the optimized NORDIC UART with about 8K bytes per second.
    In the TCP Server example, I found the BLE_GAP_PHY_2MBPS can't be used according to
    the following code comment of struct ble_gap_adv_params_t in ble_gap.h:

    uint8_t primary_phy;
    /**< Indicates the PHY on which the primary advertising channel packets
    are transmitted. If set to @ref BLE_GAP_PHY_AUTO, @ref BLE_GAP_PHY_1MBPS
    will be used.The only supported value by this SoftDevice is @ref BLE_GAP_PHY_1MBPS. */

    I want to get higher communication speed, so I want to discuss the following questions.
        1. Does this mean that BLE 6LoWPAN can only work at 1M PHY?
        2. Why can't set it to 2M PHY, is it a specification limit, or a softdvice limit?
        3. Is there a way to set it to 2M PHY?

    Best regards
    Michael

Children
  • HI Michael, 

    Q1: No, it just means that you cannot perform advertising on the 2M PHY, you can advertise and initiate a connection using the 1M PHY and then switch to the 2M PHY once the connection is established.

    Q2: It is possible, see Q1, but this at the GAP layer of the Bluetooth Stack, the IoT examples sets up a  L2CAP channel layer, hence we cannot use any of the GAP related APIs. This also explains why increasing the  NRF_SDH_BLE_GATT_MAX_MTU_SIZE did not lead to any increased throughput as GATT is also above the L2CAP layer. 

    Q3: As far as I can see there are no L2CAP functions in the SoftDevice API that allows you to select which PHY layer youre using. I will have to ask the IoT SDK devs regarding this

    Meanwhile, could you try to increase the payload sizes used by the IPSP service, i.e.  BLE_IPSP_TX_MPS and the BLE_IPSP_RX_MPS in ble_ipsp.h?

    Best regards

    Bjørn 

Related