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
[mpl] remove mpl entry from forwarding queue if the address query matches the host or one of its children #9999
base: main
Are you sure you want to change the base?
[mpl] remove mpl entry from forwarding queue if the address query matches the host or one of its children #9999
Conversation
b35afc6
to
16d541a
Compare
Size Report of OpenThread
|
{ | ||
if (message.GetLength() - sizeof(Metadata) >= len) | ||
{ | ||
if (aMessage.CompareBytes(0, message, message.GetLength() - sizeof(Metadata) - len, len)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The aMessage
we get here is already gone through IPv6 and UDP layers and all those header are stripped/removed from it. It contains the UDP payload.
I see that you are accounting for this and compare byte in message
accordingly from offset message.GetLength() - sizeof(Metadata) - len
(practically checking if bytes at the end of message
match bytes in aMessage
).
I wonder if this is always safe/correct to do. Can we have an unintended match here?
If we could be sure that both message are TMF (using TMF port), I feel it may be safer then to compare the UDP payloads. Thoughts?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We are comparing around 30 bytes, for the entire TMF payload, do you think it can still have a risk of false match? I was trying to keep it generic and avoid any specific flags passed to the MPL module, but sure we can add that if you think it is unsafe.
The approach I was thinking of, is to pass a boolean to indicate it is a TMF message in the method RemoveMplEntry and then use than that to compare the port information in MPL module ( Mpl::RemoveMatchedMessage)to check if it matches TMF port. The challenge here is, we wouldn't have parsed the UDP header yet while adding the MPL message to the buffered set (in HandleExtensionHeaders-> Ip6::HandleOptions) and may need to parse it now, and do that again while HandleDatagram which becomes a bit messy?
The optimization in this PR seems to only address a very specific scenario. In particular, any neighboring active routers will continue to forward the MPL message. |
2498e59
to
e8eac14
Compare
…ches the host or one of its children
Sure @jwhui, the gains may not be much but can vary depending on topology right? In the best case, if there are 2 partitions fragments merged via single node, then we can avoid forwarding this message into one of the partition fragment? If there are N routers, we could avoid 2(N-1) messages? |
Remove the additional forwarding of AddressQuery messages if the current host or one of the children responds with AddressNotify