Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve latency performance with better retransmittion mechanism #1925

Open
sada45 opened this issue Nov 25, 2024 · 5 comments
Open

Improve latency performance with better retransmittion mechanism #1925

sada45 opened this issue Nov 25, 2024 · 5 comments

Comments

@sada45
Copy link
Contributor

sada45 commented Nov 25, 2024

Hi!

I think there is a possible method to improve the uploading (Peripheral to Central) transmission latency.
BLE specification set if there are two continue packet loss then the connection event should be terminated.
However, consider that while the Peripheral sending multiple PDUs to the Central while the Central has no data to transit.
If one packet (expect the last one) is lost, the Central will not reply an empty PDU and terminate the connection event. (Line 3741 in ble_ll_conn.c), which can cause a larger transmission latency.
So, I think this can be easily improved. Specifically, the Central can still transmit an empty PDU to ask the Peripheral to immediately retransmit the packet.

@andrzej-kaczmarek
Copy link
Contributor

The connection event is terminated if one packet is lost or two consecutive packets are received with an invalid CRC (vol 6, part B, 4.5.6). We cannot reply to a packet that we did not receive.

@sada45
Copy link
Contributor Author

sada45 commented Nov 25, 2024

To my understanding, the line 3741 in ble_ll_conn.c shows the cases that the packet is received but with invalid CRC. If there is only one invalid CRC, the Central can still reply.
image

@andrzej-kaczmarek
Copy link
Contributor

We do accept single CRC error in a connection event:

if (connsm->cons_rxd_bad_crc >= 2) {

Not sure which line in the code you point to since I don't know the exact revision of mynewt-nimble repo you use.

@sada45
Copy link
Contributor Author

sada45 commented Nov 25, 2024

The Line 3735 is correct. But the the question is in the else block.
If there is only one CRC error and the Centeral has no data to send connsm->flags.last_txd_md=0, the Central still don't reply the peripheral.

#if MYNEWT_VAL(BLE_LL_ROLE_CENTRAL)
            case BLE_LL_CONN_ROLE_CENTRAL:
                reply = connsm->flags.last_txd_md;
                break;
#endif

@andrzej-kaczmarek
Copy link
Contributor

Ok, now it's clear. This should fix the issue: #1926

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants