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

Duplicate ACK to same message id will cause receiver reject the message #7909

Closed
erjiaqing opened this issue Jun 25, 2021 · 2 comments · Fixed by #9875
Closed

Duplicate ACK to same message id will cause receiver reject the message #7909

erjiaqing opened this issue Jun 25, 2021 · 2 comments · Fixed by #9875

Comments

@erjiaqing
Copy link
Contributor

Problem

  1. Some coding issue results in the code sending two ACKs to one message id.
  2. The code might reject the message with payload if duplicate ACK is received.

Proposed Solution

Analysis the protocol and

  1. Avoid sending duplicate ACK to the same message
  2. Discuess whether to reject the message if duplicate ACK received.
@bzbarsky-apple
Copy link
Contributor

Avoid sending duplicate ACK to the same message

#7935 will mostly do that. We could still run into it in the following way, with events listed in the order they happen, with time passing between the steps:

  1. A sends a message to B.
  2. B receives message from A.
  3. B responds with an app-level response with a piggybacked ack (but this message is delayed in transit)
  4. A resends the message.
  5. B receives the resent message.
  6. B responds with a standalone ack (as we always do for duplicates using MRP).
  7. A receives the standalone ack.
  8. A receives the response from step 3, which got delayed in the network somewhere.

This is a perfectly legitimate sequence of events, albeit one that is not going to happen in our CI as things currently stand, because our CI does not test interesting complicated network scenarios so far... I keep hoping we'll re-enable the cirque tests and use those to test this sort of thing.

Anyway, given the scenario above it seems clear to me that a message with a piggyback ack that is not itself a duplicate has to be processed properly even if the ack is for a message id that we don't think we need an ack for.

@erjiaqing @yufengwangca @turon

@bzbarsky-apple
Copy link
Contributor

bzbarsky-apple commented Jun 29, 2021

Or another scenaraio where we have the same problem:

  1. A sends a message to B.
  2. B receives message from A.
  3. B responds with an app-level response with a piggybacked ack, but this response is lost.
  4. A resends the message.
  5. B receives the resent message.
  6. B responds with a standalone ack (as we always do for duplicates using MRP).
  7. A receives the standalone ack.
  8. B resends its response.
  9. A receives the resent response, which has an app-level message we need to process, and a piggybacked ack for a message id that has already been acked.

This scenario we could test in our existing CI, by just having our loopback-drops-messages stuff set up to strategically drop the right things (the message from step 3 in this case).

bzbarsky-apple added a commit to bzbarsky-apple/connectedhomeip that referenced this issue Sep 22, 2021
We can get a message with a piggybacked ack for a message we have
already gotten a standalone ack for.  In this case we should process
the message, not drop it.

Fixes project-chip#7909
bzbarsky-apple added a commit to bzbarsky-apple/connectedhomeip that referenced this issue Sep 22, 2021
We can get a message with a piggybacked ack for a message we have
already gotten a standalone ack for.  In this case we should process
the message, not drop it.

Fixes project-chip#7909
bzbarsky-apple added a commit to bzbarsky-apple/connectedhomeip that referenced this issue Sep 22, 2021
We can get a message with a piggybacked ack for a message we have
already gotten a standalone ack for.  In this case we should process
the message, not drop it.

Fixes project-chip#7909
bzbarsky-apple added a commit to bzbarsky-apple/connectedhomeip that referenced this issue Sep 22, 2021
We can get a message with a piggybacked ack for a message we have
already gotten a standalone ack for.  In this case we should process
the message, not drop it.

Fixes project-chip#7909
bzbarsky-apple added a commit that referenced this issue Sep 22, 2021
We can get a message with a piggybacked ack for a message we have
already gotten a standalone ack for.  In this case we should process
the message, not drop it.

Fixes #7909
doru91 pushed a commit to doru91/connectedhomeip that referenced this issue Sep 27, 2021
We can get a message with a piggybacked ack for a message we have
already gotten a standalone ack for.  In this case we should process
the message, not drop it.

Fixes project-chip#7909

Signed-off-by: Doru Gucea <doru-cristian.gucea@nxp.com>
doru91 pushed a commit to doru91/connectedhomeip that referenced this issue Oct 26, 2021
…chip#9875)

We can get a message with a piggybacked ack for a message we have
already gotten a standalone ack for.  In this case we should process
the message, not drop it.

Fixes project-chip#7909

Signed-off-by: Doru Gucea <doru-cristian.gucea@nxp.com>
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 a pull request may close this issue.

2 participants