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

Read Segmentation Robustness #149

Open
NateZimmer opened this issue Jul 1, 2020 · 0 comments
Open

Read Segmentation Robustness #149

NateZimmer opened this issue Jul 1, 2020 · 0 comments

Comments

@NateZimmer
Copy link

Node BACstack Version: xxx.13 / PR131

Issue: Segmentation handling could use some TLC

How it currently works: There is 1 segmentation array per instance of this library. If a segment is missed, _lastSequenceNumber can get stuck at a non-zero value and subsequent segment ACKs will NACK due to a mis-match in state. Also, if multiple segments are being received at the same time, the library can get confused

Minor fix: Reset _lastSequenceNumber based upon APDU timeout expiring on the last received segment. This avoids the library getting stuck in a bad state

Proper fix: Each segmented/fragmented response should be stored in a temporary array indexed on the following :

  • per device address (ideally w/ routing support)
    • per device invoke id / sequence number

Array should be cleaned up either on successful reassembly or APDU timeout of the first request and/or of the last valid segment

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

1 participant