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

Flood ACKs on DM back to original sender #2069

Merged
merged 4 commits into from
Dec 28, 2022

Conversation

GUVWAF
Copy link
Member

@GUVWAF GUVWAF commented Dec 28, 2022

This changes the hopLimit for real ACKs (only sent when receiving a DM) from 0 to the configured one, like normal packets. This way the ACK will be flooded back to the original sender, such that can be guaranteed that the packet arrived at the intended receiver.
When a client now gets an ACK, if the ‘from’ field is your nodeNum, then it is an implicit ACK (meaning a rebroadcast on the mesh), if it is the nodeNum of the intended receiver, successful reception is confirmed.

Based on what I saw using the simulator, I now removed resending ACKs for repeated incoming messages (introduced in #924), as this may happen due to flooding and then you will send another ACK each time. Since the ACKs are now flooded back, there is already some redundancy for lost ACKs.

@@ -34,7 +34,8 @@ void FloodingRouter::sniffReceived(const MeshPacket *p, const Routing *c)
// do not flood direct message that is ACKed
DEBUG_MSG("Receiving an ACK not for me, but don't need to rebroadcast this direct message anymore.\n");
Router::cancelSending(p->to, p->decoded.request_id); // cancel rebroadcast for this DM
} else if ((p->to != getNodeNum()) && (p->hop_limit > 0) && (getFrom(p) != getNodeNum())) {
}
if ((p->to != getNodeNum()) && (p->hop_limit > 0) && (getFrom(p) != getNodeNum())) {
Copy link
Member Author

Choose a reason for hiding this comment

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

Needed as otherwise ACKs will not be flooded.

@@ -17,7 +17,7 @@ ErrorCode FloodingRouter::send(MeshPacket *p)
return Router::send(p);
}

bool FloodingRouter::shouldFilterReceived(MeshPacket *p)
bool FloodingRouter::shouldFilterReceived(const MeshPacket *p)
Copy link
Member Author

Choose a reason for hiding this comment

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

'const' was removed in #924, but this can now be reverted, since I removed ACK-ing repeated incoming messages.

@thebentern thebentern merged commit f632933 into meshtastic:develop Dec 28, 2022
@GUVWAF GUVWAF deleted the wantAckDM branch January 12, 2023 19:00
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

Successfully merging this pull request may close these issues.

2 participants