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

Fixed packets not being sent up by CSMA ALOHA on listen state #21

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

dcostan
Copy link

@dcostan dcostan commented Sep 1, 2024

While using an Evologics physical layer with CSMA ALOHA on the top, the later blocked incoming packets from a bidirectional communication from being processed. The problem is that the state CSMA_STATE_LISTEN was not handled and so all the incoming packets were discarded.

@fedefava86 fedefava86 self-assigned this Sep 16, 2024
@@ -982,6 +982,18 @@ CsmaAloha::stateRxData(Packet *data_pkt)
stateCheckListenExpired();
} break;

case CSMA_STATE_LISTEN: {
Copy link
Contributor

Choose a reason for hiding this comment

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

This should not be the case. The case you are mentioning, should be handled by the state "RX_LISTEN". In fact, during Phy2MacStartRx, if state is LISTEN, state is moved to RX_LISTEN, which is then handled in stateRxData method. Could you please verify this?

@dcostan
Copy link
Author

dcostan commented Oct 10, 2024

Probably my solution is not the right one, but for sure a problem exists.
unnamed
As it can be seen in the screenshot it happens that all the times in a bidirectional communication the Phy2MacStartRx function detects a Transmit data state so it never changes the state to CSMA_STATE_RX_LISTEN and all the incoming packets are so discarded.

@fedefava86
Copy link
Contributor

No one said the problem does not exists, but we need to carefully debug it and my feeling is that your solution is a work-around. If you are receiving, this means that the previous transmission ended right? So someone should have called endTx and state should have gone to idle or wait_ack if you enabled acknowledgement.
My suggestion is to do the same test and enable the CSMA ALOHA debugging, checking carefully the state change to spot where the FSM is actually breaking.

@dcostan
Copy link
Author

dcostan commented Oct 10, 2024

At this node there is no reception but the transmission works fine, below I am attaching a screenshot with CSMA ALOHA debug enabled. In any case I agree with you about the fact that my correction is a workaround, I have not analyzed the entire module yet.
immagine
I think there is a problem when the node is sending a packet but at the same time another one is arriving, in fact if the Phy2MacStartRx would work correctly the issue could be solved.

@fedefava86
Copy link
Contributor

At this node there is no reception but the transmission works fine, below I am attaching a screenshot with CSMA ALOHA debug enabled. In any case I agree with you about the fact that my correction is a workaround, I have not analyzed the entire module yet. immagine I think there is a problem when the node is sending a packet but at the same time another one is arriving, in fact if the Phy2MacStartRx would work correctly the issue could be solved.

got it, you are 100% right there's a problem, that probably is strictly related with the interaction with EvoLogics itself. I'll open an internal ticket for this. Your solution might be ok, but we'll need to validate it. If this is the case, we'll merge this first. Thanks for pointing out.

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