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

where is duplicate frame detection implemented? #197

Closed
2bndy5 opened this issue Aug 4, 2021 · 9 comments
Closed

where is duplicate frame detection implemented? #197

2bndy5 opened this issue Aug 4, 2021 · 9 comments
Labels

Comments

@2bndy5
Copy link
Member

2bndy5 commented Aug 4, 2021

In testing my pure python port, I noticed that sequentially multicasted NETWORK_POLL messages using the same frame.id were ignored (actually only the first one was handled). I can't find where this condition (to discard duplicate frames) is checked. So, I'm asking to make sure I ported it correctly.

At first I thought it lived in the network.enqueue() method, but that only accounts for fragmentation re-assembly. I don't see anything in network.update() or mesh.update() that discards frames with a duplicate ID number.

@2bndy5 2bndy5 added the question label Aug 4, 2021
@TMRh20
Copy link
Member

TMRh20 commented Aug 4, 2021 via email

@2bndy5
Copy link
Member Author

2bndy5 commented Aug 4, 2021

Yes, I was running a C++ master node on RPi and trying to get CirPy non-master node on RP2040 MCU to connect to it.

At the time, my lib was only incrementing the frame ID number for user payloads. The master node on RPi would only respond to the first Poll, then ignore all subsequent frame's with the same ID. As soon as I started incrementing the frame's ID (from the CirPy node), the C++ master node started responding to each Poll message.

This would take a bit of work to reproduce...

@2bndy5
Copy link
Member Author

2bndy5 commented Aug 4, 2021

This behavior is also noted in the muticastRelay docs

@TMRh20
Copy link
Member

TMRh20 commented Aug 4, 2021 via email

@2bndy5
Copy link
Member Author

2bndy5 commented Aug 5, 2021

Nevermind, I tried to reproduce this, and the C++ master node responded to each Poll message when the frame's id number remained consistent. When I first noticed the above scenario, I was trying to use a python version of writeFast() and txStandby()... I've since reverted back to only using 1 level of the TX FIFO for reliability reasons. So, the duplicate frame's may actually have never been properly transmitted at the time.

I'm still curious how multicastRelay filters out duplicate frames though. Is it only done on the receiving nodes?

@TMRh20
Copy link
Member

TMRh20 commented Aug 5, 2021 via email

@2bndy5
Copy link
Member Author

2bndy5 commented Aug 5, 2021

Could it be referring to inherent collision during multicasting? This would make a little more sense if the docs were written prior to your intuitive fragmentation feature (maniacbug days). @TMRh20 you wrote this 7 years ago 😆 . I can remove the part about duplicate frames on the CMake-4-Linux branch, if you agree that it's inaccurate.

@TMRh20
Copy link
Member

TMRh20 commented Aug 5, 2021 via email

@2bndy5
Copy link
Member Author

2bndy5 commented Aug 5, 2021

It may be too much trying for too little benefit... You'd have to keep a cache of the last handled header separate from the frame_buffer; and that only solves sequential duplicate frames.

I'll take that part out of the docs.

2bndy5 added a commit to nRF24/RF24Network that referenced this issue Aug 5, 2021
@2bndy5 2bndy5 closed this as completed Aug 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants