-
Notifications
You must be signed in to change notification settings - Fork 51
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
Standalone ICE agent? #413
Comments
Hi @thomaseizinger! Interesting idea! I'm not against it, and I have a couple of thoughts. First is about the quality of str0m's ICE implementation. I implemented it by reading the RFC, and it certainly seems to serve the purpose we use it for, which is client-server. There is however a blind spot for peer-peer (see #405). @pthatcher has mentioned that libWebRTC ICE implementation is top of the class, and that str0m may be better off porting that. Related to that, str0m's ICE isn't strictly RFC compliant – it's compatible. A simplifying assumption is that there is one agent instance per peer connection, and there is only a single stream/component to negotiate. A fully compliant implementation would be able to use one agent for multiple sessions supporting many streams. How much this matters for crate-ifying the code, I don't know, but it should at least be a conscious choice that isolating the code out from str0m does not make a full ICE agent. We should consider the long term goals of such crate. Full RFC compliance? Line-by-line translation of libWebRTC? Nothing more than we have? I don't think refactoring it out would be that hard. We could keep it in the str0m git project, and release a separate crate. The majority of the work is likely to be the API documentation, README, examples etc. I don't have the time to do that myself right now, but I also don't think it's right to release something half baked. A first step could be to land some patches to export some APIs from the ice module under a feature flag, with the intention to make a separate crate once we ironed out the details of this ICE implementation. @morajabi might have thoughts too. |
Thank you for the comment!
This is okay for us. We don't even want any streams, I just want to use ICE to hole-punch a connection!
I'd be pragmatic here and suggest that to begin with, it can be whatever is useful to you and whichever other projects come along. Full RFC compliance could be a novel goal although I'd favor compatibility over it. Most notably for our usecase, only str0m <> str0m needs to be compatible!
I've done this in my fork but hit a roadblock when it came to openssl. I think it would be great if we don't have to extract a crate to start with. To make The problem with openssl is that we are going to deploy this to all sorts of targets (Android, iOS, Windows, Linux, MacOS) and requiring openssl as a dependency even we don't actually use it is something I'd like to avoid. |
I agree. Based on @thomaseizinger's comment, the goal would be to feature flag openssl (and maybe like how reqwest allows rustls as an option? not sure if it's similar). Seems like doable within the str0m git repo and with feature flags. @algesten what do you think, is this something generally useful longterm? |
Oh, interesting that openssl is the problem!
Because I favor a pure Rust library, my long term goal for str0m is to use rustls as default and openssl as an optional alternative. However rustls isn't ready for that (yet).
Yes and no! Let's do feature flags, but before that, let's refactor the crypto stuff out to an abstraction so we don't get feature flags everywhere. openssl is a bit all over the place because it exposes API for both higher level crypto stuff like DTLS as well as lower level AES primitives. In a pure Rust solution, this would require more libraries – some combo of rustls + ring + sha1 + … From the top of my head we use openssl in some capacity for this:
I think we should refactor out these into a number of traits, make str0m use It's time for |
Okay thank you for your input! I'll see what I can come up with :) |
Sorry for being late to the conversation. A few thoughts:
|
Just as a heads-up, I've now started work on our connectivity layer that is based on |
Cool project! |
After #446 is merged, I would start on making
This would be minimal disruption for existing users. Some alternatives (not necessarily mutually exclusive with each other):
Thoughts? |
Sounds good!
Yep.
Generally in str0m we've favored static dispatch. It probably doesn't make a huge difference, See for instance how we handle packetizer where a containing enum implements the same type as the enum variants: https://github.com/lolgesten/str0m/blob/main/src/packet/mod.rs#L239
I think feature flags should enable config options, rather than change behavior. I.e. we will have the feature The reason for this is that feature flags are additive, and although it's unlikely str0m will ever be used in a way that pulls it in with different feature flags enabled, I think it's least surprising if behavior stays the same regardless. If the user disables Sound ok? |
Fully agreed! I didn't mean to suggest that feature flags should change behviour. It is just that in the absence of another DTLS impl, having a ctor like Say a rustls-backed implementation comes along, we could then remove |
I've submitted a draft here: #447, please have a look. |
This is resolved, thank you! |
I am back with another inquiry! :)
Currently, I am trailing usage of str0m's
IceAgent
in a project that just needs ICE but nothing else around WebRTC. In particular, we don't want to pull in openssl as a dependency. I have a few small patches locally that publicly export a handful APIs around theice
module. However, I also have one that pretty much comments out everything that deals withopenssl
which is just a hack for now.I would like to get some opinions on what a collaborative and useful way forward is. I think a SANS-IO & compliant ICE implementation is something really useful so I don't really want to fork
str0m
longterm. Theice
module also depends on theio
andparser
module which makes extracting it not quite straight-forward. Additionally, splitting upstr0m
into multiple crates creates an additional maintenance burden.I think extracting a dedicated
str0m-ice
crate (name to be bike-shedded) would make the most sense:parser
could be avoided by removingCandidate::from_sdp_string
. This one is actually a circular dependency so could be argued shouldn't exist in the first place.io
is a bit trickier. To do message parsing,stun_codec
could be used. I've had good experiences with it. Alternatively, something likestr0m-stun
would have to be introduced that handles message parsing.str0m-ice
?Curious to hear your thoughts!
The text was updated successfully, but these errors were encountered: