Skip to content

Retry confirmed class C downlink on timeout#7731

Merged
halimi merged 7 commits into
v3.34from
feature/confirmed-class-c-retry
Oct 6, 2025
Merged

Retry confirmed class C downlink on timeout#7731
halimi merged 7 commits into
v3.34from
feature/confirmed-class-c-retry

Conversation

@halimi
Copy link
Copy Markdown
Contributor

@halimi halimi commented Oct 1, 2025

Summary

The NS resends the class C confirmed downlink after the mac_settings.class_c_timeout time.

When the NS sends a confirmed downlink to a class C device then the device should send an uplink within the mac_settings.class_c_timeout. If no uplink has arrived within the timeout then the NS sends a NACK to the AS and the AS resends the downlink message again maximum 8 times and after that drops it.

Changes

  • Add a new task runner for the pending downlink messages.
  • NS adds a task to the pending downlink queue if there is a pending downlink.
  • The pending downlink task reschedules the pending downlink message after the timeout.

Testing

Steps

Set a short value for the mac_settings.class_c_timeout (e.g. 30 sec), it should be less than the period how the end device sends the uplinks (e.g. 5 min).

Send a confirmed downlink message to a class C device.

  • If the end device doesn't send an uplink within the timeout then the NS should resend the pending downlink again until either it reaches the maximum retry number, which is 8 or the end device sends an uplink with an ACK.
  • If the end device sends an uplink within the timeout but without an ACK then the NS should resend the pending downlink.
  • If the end device sends an uplink within the timeout with an ACK then the NS shouldn't resend the pending downlink.

Send more than one confirmed downlink to a class C device.

  • The NS should put back the pending downlink to the downlink queue for resending.
Results

I've tested it on my test env and it works as expected.


  • If the end device doesn't send an uplink within the timeout then the NS should resend the pending downlink again until either it reaches the maximum retry number, which is 8 or the end device sends an uplink with an ACK.
image image
  • If the end device sends an uplink within the timeout but without an ACK then the NS should resend the pending downlink. (The class_c_timeout was set to 7 min)
image
  • If the end device sends an uplink within the timeout with an ACK then the NS shouldn't resend the pending downlink. (The class_c_timeout was set to 7 min)
image

Send more than one confirmed downlink to a class C device.

  • The NS should put back the pending downlink to the downlink queue for resending.
image
Regressions

...

Notes for Reviewers

@PavelJankoski @ryaplots The mjml node package has been updated #7720 and now it generates a different file for the email templates base.html.tmpl. I had to regenerate the golden files otherwise the go tests are failing. Could you please review the new template file changes?

Checklist

  • Scope: The referenced issue is addressed, there are no unrelated changes.
  • Compatibility: The changes are backwards compatible with existing API, storage, configuration and CLI, according to the compatibility commitments in README.md for the chosen target branch.
  • Documentation: Relevant documentation is added or updated.
  • Testing: The steps/process to test this feature are clearly explained including testing for regressions.
  • Infrastructure: If infrastructural changes (e.g., new RPC, configuration) are needed, a separate issue is created in the infrastructural repositories.
  • Changelog: Significant features, behavior changes, deprecations and fixes are added to CHANGELOG.md.
  • Commits: Commit messages follow guidelines in CONTRIBUTING.md, there are no fixup commits left.

@github-actions github-actions Bot added c/network server This is related to the Network Server compat/db This could affect Database compatibility compat/config This could affect Configuration compatibility labels Oct 1, 2025
@halimi halimi force-pushed the feature/confirmed-class-c-retry branch from db917c9 to 72efec3 Compare October 2, 2025 09:10
@halimi halimi force-pushed the feature/confirmed-class-c-retry branch from c6de893 to 2d2c6e0 Compare October 2, 2025 09:43
@halimi halimi force-pushed the feature/confirmed-class-c-retry branch from 2d2c6e0 to b3c1d2e Compare October 2, 2025 10:05
@halimi halimi marked this pull request as ready for review October 2, 2025 13:05
@halimi halimi requested review from a team as code owners October 2, 2025 13:05
Comment thread pkg/email/templates/base.html.tmpl
@halimi halimi self-assigned this Oct 2, 2025
@halimi halimi added this to the v3.35.0 milestone Oct 2, 2025
Comment thread pkg/networkserver/downlink.go Outdated
@halimi halimi requested a review from johanstokking October 3, 2025 11:32
Copy link
Copy Markdown
Member

@johanstokking johanstokking left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay this is great stuff. Can you confirm this works well locally after the last commit too?

@halimi
Copy link
Copy Markdown
Contributor Author

halimi commented Oct 3, 2025

Okay this is great stuff. Can you confirm this works well locally after the last commit too?

I pushed one more cleanup commit, it was a leftover from the previous implementation. I'm running the tests on this last commit and it looks good until so far. I will update the test results.

@halimi
Copy link
Copy Markdown
Contributor Author

halimi commented Oct 3, 2025

I've tested it on my local test env and it works as expected. I've updated the test results images.

@ryaplots
Copy link
Copy Markdown
Contributor

ryaplots commented Oct 6, 2025

template file changes look good

Copy link
Copy Markdown
Contributor

@nicholaspcr nicholaspcr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Comment thread pkg/networkserver/downlink.go Outdated
@halimi halimi merged commit 14e3f59 into v3.34 Oct 6, 2025
13 checks passed
@halimi halimi deleted the feature/confirmed-class-c-retry branch October 6, 2025 11:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

c/network server This is related to the Network Server compat/config This could affect Configuration compatibility compat/db This could affect Database compatibility

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants