mesh: prioritize ACK/PATH/CONTROL in outbound scheduling#1957
mesh: prioritize ACK/PATH/CONTROL in outbound scheduling#1957robekl wants to merge 1 commit intomeshcore-dev:devfrom
Conversation
weebl2000
left a comment
There was a problem hiding this comment.
I like it. Let's test this. I think it makes sense.
Only thing to consider is if we might still want hop-count ordering for flood messages as a second priority.
It's already preserved right? The clamping is hop < 2 ? 2 : hop, so:
EDIT:
|
|
Yeah true. I think the ACK always having priority 0 is too high of a prio, we should mabye give 10 hop ack higher priority than 10, but I think 0 is too high. Perhaps hop count / 3 might be a good starting point. Same for PATH/control? Higher priority is good, but having everything highest priority can lead to abuse/unwanted congestion. |
|
@weebl2000 My original comment was about an off-by-one bug in the code, I clarified it a bit so there is no more confusion. I think the proposal is still an improvement over the current status quo but your point is valid: We could also do something like Hop-based offsets per type: uint8_t hops = packet->getPathHashCount();
if (payload_type == PAYLOAD_TYPE_ACK) return hops;
if (payload_type == PAYLOAD_TYPE_PATH || payload_type == PAYLOAD_TYPE_CONTROL) return hops + 1;
return hops + 3;
|
Summary
This PR updates outbound packet scheduling priority in
Meshso reliability-critical traffic gets a consistent fast lane.It prioritizes:
ACKfirstPATHandCONTROLnextADVERTlowest (unchanged intent)New centralized priority helpers
Added internal helpers to classify priority by payload type:
Behavior changes
Flood sends (
sendFlood+ transport variant)ACK -> pri 0PATH/CONTROL -> pri 1pri 2ADVERT -> pri 3Direct sends (
sendDirect, non-TRACE)ACK/CONTROL -> pri 0PATH -> pri 1pri 0pri 5(unchanged)Flood retransmit scheduling (
routeRecvPacket)ACK -> pri 0PATH/CONTROL -> pri 1pri 2(max(2, path_hash_count)), preserving lower urgency than ACK/PATH/CONTROLWhy This Improves Current Implementation
Current implementation used mixed ad-hoc priority assignments (and hop-count-driven flood priority) that could let bulk flood traffic compete with reliability-critical control/feedback packets.
This change improves that by:
Net Benefit