-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Use exchange for session establishment and provisioning #5938
Use exchange for session establishment and provisioning #5938
Conversation
This is needed for time being, as ServiceProvisioning is used for opening pairing window.connectedhomeip/src/app/server/Server.cpp Lines 499 to 505 in 33af7ef
This comment was generated by todo based on a
|
Change this check to only include the protocol and message types that are allowedconnectedhomeip/src/messaging/ApplicationExchangeTransport.cpp Lines 44 to 54 in 33af7ef
This comment was generated by todo based on a
|
Figure out which channel to use for the received messageconnectedhomeip/src/messaging/ExchangeMgr.cpp Lines 286 to 289 in 33af7ef
This comment was generated by todo based on a
|
Register for specific message types, as CASE and PASE share the same protocol IDconnectedhomeip/src/messaging/MessageCounterSync.cpp Lines 45 to 49 in 33af7ef
This comment was generated by todo based on a
|
aa4c502
to
142a310
Compare
2972729
to
b84ebb7
Compare
rebased |
616802b
to
4426904
Compare
@pan-apple the im cirque test is faling after sending several im commands, in case you wanna locally reproduce it, you can use $ ./chip-im-responder $ ./chip-im-initiator <Server's IPv4 address> |
// TODO: Register for specific message types, as CASE and PASE share the same protocol ID | ||
return mExchangeMgr->RegisterUnsolicitedMessageHandlerForProtocol(Protocols::SecureChannel::Id, this); |
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 should use RegisterUnsolicitedMessageHandlerForType here now to register only MCSP messages, otherwise, all PASE/CASE messages will be received by MessageCounterSync class
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 existing code is registering for the protocol type. I tried changing to only MCSP messages, but some tests are failing. That's why I added TODO so this can be tracked in an issue and fixed in a separate PR.
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.
I think that indicates a problem, by design, each protocol should only have one protocol delegate, since the message is moved not copied.
Now, there are two entities both register to receive SecureChannel message, it is really depending on registration order, the first one will be overridden by the second one.
Registering by different message type is also a workaround, but it should works, ideally, we should use SecureChannel protocol delegate to dispatch the messages, but we can leave it later as TODO
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.
Lets have an issue ticket to follow up here if the PASE messages are consumed by MCSP first, then PASE protocol should not receive the message.
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.
Yes, TODO bot will file the ticket once this PR is merged.
I noticed there are more than 300 bytes increase on BSS after this refactor, I guess this is mainly caused by moving Transport to ExchangeContext, it should go back to normal if we keep the transport handling all within ExchangeMgr. |
src/messaging/ExchangeTransport.cpp
Outdated
#endif | ||
} | ||
|
||
if (!IsTransportReliable() && reliableMessageContext.AutoRequestAck() && mReliableMessageMgr != nullptr && |
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.
It looks isReliableTransmission is just translated from it is requested, we should also check the low level Transport type. CRMP is not needed for TCP
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 expectation is that IsTransportReliable()
method for TCP based exchange transport (e.g. SessionEstablishmentExchangeTransportTCP
) will return True
.
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.
ApplicationExchangeDispatch should support both TCP and UDP right? if I run chip-shell ping -t , the message should also go through ApplicationExchangeDispatch, right?
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.
ApplicationExchangeDispatch will be used by IM messages. Those should all be UDP only.
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.
Lets have a ticket to follow up here, since all of our examples still support TCP option now
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.
23288cd
to
dab0b68
Compare
Size increase report for "nrfconnect-example-build" from 6130e4a
Full report output
|
…ect-chip#5938)" This reverts commit 362c5f2.
…ect-chip#5938)" This reverts commit 362c5f2.
…ect-chip#5938)" This reverts commit 362c5f2.
Problem
Session establishment doesn't use exchange or reliable messaging.
Summary of Changes
and unencrypted message exchanges
Fixes #2240, Fixes #2243