Skip to content

Conversation

@achingbrain
Copy link
Contributor

RFC 8445 6.1.1 says:

The initiating agent that started the ICE processing MUST take the controlling role, and the other MUST take the controlled role.

The spec also shows how to resolve conflicts when both agents are in the controlling role.

From what I can see here, libjuice will always start in controlling mode and try to resolve the conflict before contining but it appears some implementations don't support that so one agent has to start in controlled role.

The change here is to allow passing the role to juice_set_local_ice_attributes in order to start the receiving agent off in the controlled role.

RFC 8445 6.1.1 says:

> The initiating agent that started the ICE processing MUST take the controlling role, and the other MUST take the controlled role.

The spec also shows how to resolve conflicts when both agents are
in the controlling role.

From what I can see here, libjuice will always start in controlling
mode and try to resolve the conflict before contining but it appears
some implementations [don't support that](pion/ice#359 (comment))
so one agent has to start in controlled role.

The change here is to allow passing the role to `juice_set_local_ice_attributes`
in order to start the receiving agent off in the controlled role.
@paullouisageneau
Copy link
Owner

RFC 8445 6.1.1 says:

The initiating agent that started the ICE processing MUST take the controlling role, and the other MUST take the controlled role.

The spec also shows how to resolve conflicts when both agents are in the controlling role.

From what I can see here, libjuice will always start in controlling mode and try to resolve the conflict before contining but it appears some implementations don't support that so one agent has to start in controlled role.

This is not correct, libjuice actually follows the rules specified in RFC 8445 6.1.1. It starts in controlling or controlled mode depending on whether it is the initiator or not and whether the remote agent is lite or not. In practice, if both agents are full, the side which sets the remote description before the local one will be controlled.

Such an API already was already suggested in #282, but I think the existence of mandatory rules in the spec means the application should not be able to change the role arbitrarily.

ICE conflicts are often symptoms of deeper signaling issues. Are you sure you don't try to offer on both sides with libdatachannel?

@achingbrain
Copy link
Contributor Author

if both agents are full, the side which sets the remote description before the local one will be controlled.

Aha, I think this was the magic I was looking for.

Really I think I wanted the responder to be a lite agent, is this possible with libdatachannel or are they only ever full agents?

@achingbrain achingbrain closed this Feb 7, 2025
@achingbrain achingbrain deleted the feat/allow-specifying-initial-ice-mode branch February 7, 2025 06:31
@paullouisageneau
Copy link
Owner

Really I think I wanted the responder to be a lite agent, is this possible with libdatachannel or are they only ever full agents?

No, libjuice implements a full agent and there is no option to force it to be lite. It could be added, but a full agent should work fine (i.e. without conflict) in any situation. Lite mode exists only to make the implementations lighter on servers with public IP addresses.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants