-
Notifications
You must be signed in to change notification settings - Fork 148
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
Select links based on message Priority & Reliability #1360
base: main
Are you sure you want to change the base?
Conversation
f873bc9
to
91ee110
Compare
Preliminary throughput measurements for 743c199 and db099c1
|
91ee110
to
743c199
Compare
/// 3. QoS is enabled and priority range is available but reliability is unavailable | ||
/// 4. QoS is enabled and reliability is available but priority range is unavailable | ||
/// 5. QoS is enabled and both priority range and reliability are available | ||
fn to_u64(&self) -> u64 { |
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.
Should not this be in zenoh-codec/zenoh-protocol cartes ?
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.
According to @Mallets only StateAccept
could have a codec implementation as it's serialized on the wire. Otherwise this function is used for creating the ZExtZ64
and ZExtUnit
extensions.
Other establishment
extensions also just put their codec implementations in the same file. Even if everything were to have a codec I would still keep the try_from_64
/to_u64
functions because it's the same logic.
tracing::trace!("Scheduled: {:?}", $msg); | ||
return pl.push_network_message($msg); | ||
}; | ||
/// Returns the index of the best matching [`Reliability`]-[`PriorityRange`] pair. |
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 'smaller range' rule prevents us from returning as soon as we find a matching range. Is it worth it ?
Even with this rule we could return as soon as we find a full match with a range of 1 (cannot find a smaller range later).
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.
Sorry to disappoint but the search isn't even short-circuiting. It searches for three kinds of matches at the same time.
You could do search for link matching Priority and Reliability and early return on a result, but if you don't find any result you need to search by Reliability only. And if you don't find any result either you pick any link.
The search uses a fold to keep track of all three kinds of matches.
@@ -311,6 +326,10 @@ where | |||
n_exts -= 1; | |||
self.write(&mut *writer, (qos, n_exts != 0))?; | |||
} | |||
if let Some(qos_optimized) = ext_qos_optimized.as_ref() { |
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.
Same comment as above: both ext_qos
and ext_qos_optimized
could be sent on the network.
If ext_qos_optimized
then I don't see much the need of sending as well ext_qos
.
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 above.
/// | ||
/// ## Metadata | ||
/// | ||
/// - **`priorities`**: a range bounded inclusively below and above (e.g. `2..=4` signifies |
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'd use some easier format, e.g.
priorities=1-4
would mean all priorities from 1 to 4 both included
.
priorities=1
would mean only priority 1
.
This is more efficient in terms of network overhead compared to 2..=4
where we need 3 characters ..=
to express the same meaning of -
.
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 understand. Although -
is a questionable choice since it looks like substraction in this context. I suggest :
(what Python uses for slicing sequences).
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.
Well not so questionable in terms of network overhead. I'd even suggest having something like prio=1-4
to save a few bytes more during scouting and discovery.
The goal of this pull request is to enable users to choose the link on which a message is sent as a function of the message's Priority & Reliability.
Supersedes #1324 and #1356.