-
Notifications
You must be signed in to change notification settings - Fork 26
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
Conform Zenoh spec to 1.5.8 #103
Conform Zenoh spec to 1.5.8 #103
Conversation
I've also updated the workflow and added the requirement of arguments in constructors. |
@gregmedd Thanks for your review. Feel free to advise me on how to make the spec clearer. Sometimes I might ignore some premise while writing down the spec. |
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.
see comments
Hey @evshary -- today in the MQTT meeting when discussing @sophokles73's proposal for MQTT, I thought this could also serve a nice purpose for Zenoh as well. The idea is to include both the source and the destination UAuthorities s.t. we can easily determine when a message is a publish vs notification message and bring the message through. I think we'd also modify s.t. when we say we want to "subscribe to all", what we really mean is we'd like to subscribe to all Request, Response, and Notification messages, and none of Publish messages. Publish messages will be handled on a topic-by-topic basis based on what uSubscription tells us to forward, so we do not have a need to get "all" Publish messages. Essentially, I think that if we modify the Zenoh KeyExpr from: So based on the issue I raised in this PR, I have a proposal: SetupA uEntity (origin-authority/origin-entity) creates a message with
Subscribing uERegisters a listener on origin UUri
which
The MQTT proposal would have the destination as Subscribing uStreamerRegisters a listener on special origin-authority UUri to catch out-going messages coming from Zenoh, intended for SOME/IP
which
uStreamer receives messages and forwardsuStreamer catches the following message on SOME/IP UTransport:
uStreamer then uses
which would now not match for the uStreamer's
Overall WDYT? |
@PLeVasseur I guess it would help if, in your example, you would use terms other than |
@PLeVasseur I guess I missed some context. I still can't understand why we need to have both the source and sink authority in the Zenoh key. If we don't use this way to discriminate between Publish and Notification, will we face any problems in uStreamer? Another question is that if we use
Or maybe I mistake something? ---Edit--- I'm thinking of whether using allowed_origin in subscriber can solve the problem or not. |
Not sure if you are talking about a UUri here or the Zenoh key created from a UUri? In any case, a Notification message would contain a source UUri like The Zenoh uTransport might turn that into Zenoh key On the receiving side, a uEntity would subscribe to |
The problem with all of this is that UTransport.register_listener currently does not support indicating if I want to register a listener for Publish or other types of messages. This, however, would be necessary in order for the transport impl to be able to create the proper Zenoh key to match on, i.e. whether to fill the authority into the We had this discussion weeks ago already but never really came to a conclusion. Maybe it is time to create a corresponding PR in up-rust to add that flexibility to UTransport. WDYT? @PLeVasseur @evshary |
Yeah I like the idea of being action-oriented here in some feature branches:
WDYT @sophokles73, @evshary? If sounds good, who would like to take 1. and do some API design? |
Yes, exactly.
There may be a Zenoh-specific way to solve this, but AFAIK this will also pose an issue to MQTT5, will it not @sophokles73? And if so, it feels cleaner to be explicit in the implementation of |
OK, it makes sense to use
I always support the idea of introducing type while calling register_listener, just as we discussed it in the infamous #73
We can also have something like
WDYT, @sophokles73 @PLeVasseur
I know little about MQTT, but it seems possible. |
@evshary we are currently discussing to get rid of the long form completely and use numeric identifiers for the resource only. So, using such a naming convention would not really work. I also do not see, why we would need to introduce the message type into the UUri, given that a message already has the type in the UAttributes. I'd rather extend the UTransport interface to support specifying the message type. I'll give it a shot and create a corresponding PR in up-rust. |
I have created eclipse-uprotocol/up-rust#92 in the hope that this would allow the Zenoh client to use the source and sink in the Zenoh key ... |
3d0ef34
to
388a24d
Compare
Hi @PLeVasseur @gregmedd Hi @sophokles73 To confirm some questions:
|
Ah, I hadn't considered that yet. Let me check again ... |
Sorry, I do not understand your point. Can you elaborate? |
@evshary is asking this because it is disallowed in a Zenoh key expression to have two slashes following one another, i.e. if it were a publish and in say, MQTT So I think the ask is -- is there some reserved or disallowed character or word in uProtocol that we could use instead? If say |
Ok, the question is: how does the zenoh key look like for subscribing to Publish messages from Based on the proposal from a previous comment on this thread, it would be something like: But |
Yes, exactly. Thanks for wording it much better 😅 |
@PLeVasseur Thank you for the clarification. This is exactly what I'm asking 😆
|
We only allow the authority to be a
which means that you should be able to use any character from
What about |
My understanding is that
production and might be mistaken for a malformed IPv6 address? However, the |
Oops, you're right. But IPv6 also uses |
A corresponding IPv6 address would still look like |
I'm fine with that. It's also easier to me.
Great! I'll use Here is the initial proposal on how to escape special characters. I'll update it if we decide to restrict the reg-name. |
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.
In general, I wonder if you could simply use standard URL/Percent-Encoding for special characters?
up-l1/zenoh.adoc
Outdated
The TTL only takes effect while sending RPC in the Zenoh implementation. | ||
TTL **MUST** be mapped to the timeout configuration in Zenoh query. |
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.
what about other messages that have timed out already on arrival? Would you still deliver those to registered listeners? Or send out messages in send()
that have already timed out?
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.
Maybe I missed something, but is there any way for us to know when the message is sent? How does the receiver side know the message is timed out only with TTL?
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 UUIDv8 defined in the specifications includes the timestamp from when the request message was generated.
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.
OK, I missed that.
what about other messages that have timed out already on arrival? Would you still deliver those to registered listeners? Or send out messages in send() that have already timed out?
Then we should check whether messages time out or not on arrival in the transport implementation. Let me update it.
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.
Hmm... do you think we should drop the expired messages on the transport layer (Zenoh, MQTT..), or just passed to users and leave the decisions to them?
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.
Thanks for continuing to pull this together @evshary!
Want to hear your feedback on a few points 🙂
up-l1/zenoh.adoc
Outdated
@@ -253,7 +240,8 @@ The way to transfer Response message is different from others, because Zenoh can | |||
==== Message routing | |||
|
|||
1. A streamer that is interested in all incoming messages for dest-authority registers a listener for | |||
* `up://dest-authority////` | |||
* source: `-` |
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.
Can't leave the comment high up enough. I'm referring to this line.
With the separation coming between uP-L1 and uP-L2, I have a question: would the up-client-foo-rust
libraries be responsible for / be expected to implement uP-L2? Or would they optionally implement uP-L2, but allow for the posibility of plugging in the UTransport implementation they made into e.g. the RpcClient "default" implementation we'd have in up-rust
?
Tagging @sophokles73 in for this one as well to hear his thoughts.
up-l1/zenoh.adoc
Outdated
|
||
4. which `UTransport.registerListener` maps to Zenoh key | ||
* local (w/o dest-authority): `upl/` + `dest-resource-id + dest-entity-id + dest-version` | ||
* remote (with dest-authority): `upr/` + `dest-authority-id/` + `dest-resource-id + dest-entity-id + dest-version` | ||
* `up/` + `+++*+++/dest-authority/dest-entity/dest-version/dest-resource` |
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 feel like this has been settled at this point, I just don't recall the conversation...
So for Notification messages, the latter parts of the Zenoh key (entity, version, resource) are pulled from the destination, not the source?
Would we want the ability to discriminate at the registerListener
level as to which source the Notification is coming from? If that were the case, I suppose we'd have to put the latter parts (entity, version, resource) from the source and modify the registerListener
example to show us using the source
field.
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.
So for Notification messages, the latter parts of the Zenoh key (entity, version, resource) are pulled from the destination, not the source?
Only Publish messages use source as the latter part of Zenoh key. Notification and Request only care about the destination.
Would we want the ability to discriminate at the registerListener level as to which source the Notification is coming from? If that were the case, I suppose we'd have to put the latter parts (entity, version, resource) from the source and modify the registerListener example to show us using the source field.
I don't quite get your point. Maybe retrieving the source information from uAttributes is enough?
@evshary today on the MQTT call we concluded that we need to construct the MQTT topic including the full source and sink URI information so that we can register for notifications that require sink and source. We register a listener for notifications passing the source UUri and the destination UUri (sink) so that the message is routed directly to the uE that consumes the notification message. Here is more information:
|
Signed-off-by: ChenYing Kuo <evshary@gmail.com>
b40b30d
to
5c8f685
Compare
Signed-off-by: ChenYing Kuo <evshary@gmail.com>
@stevenhartley Updated. TBH, I'm not in favor of the complexity of Zenoh key or MQTT topic, but the majority rules. I also tidied up the examples of Publish, Notification, and Request UUri mapping after referring to the MQTT spec. |
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.
LGTM
The PR is to deal with
Still need to wait for #92 before merging (I need to add some changes)