Skip to content
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

ice restart fail due to empty credential on libnice master #2672

Closed
michelepra opened this issue May 24, 2021 · 9 comments
Closed

ice restart fail due to empty credential on libnice master #2672

michelepra opened this issue May 24, 2021 · 9 comments

Comments

@michelepra
Copy link
Contributor

michelepra commented May 24, 2021

I've do some test to discover the reason why ice restart fail in janus 0.11.2 (nosip plugin) with libnice master on centos7.

Libnice log, after ice restart , always report that have empty credential (ufrag/pwd) when start connectivity check and the reason is on method nice_agent_restart that reset credential

The reason that libnice have empty credential is janus call nice_agent_set_remote_credentials with new credential before nice_agent_restart

By reverse the order when calling this methods ice restart always goes on

@lminiero
Copy link
Member

It seems to be working just fine for me (echotest demo).

michelepra added a commit to michelepra/janus-gateway that referenced this issue May 26, 2021
ice restart fail due to empty credential on libnice meetecho#2672
@michelepra
Copy link
Contributor Author

do you think that can be issue related to plugin?
Here ther's log before and after this patch.

Before patch when libnice try to send stun message to new candidate it log (line 1348)

Agent 0x7f69dc00a690: no credentials found, cancelling conncheck

After patch [STUN-CC REQ]/[STUN-CC RESP] with new pair and credential SUCCEEDED

@michelepra
Copy link
Contributor Author

So sorry, i reported the wrong version of libnice, this behaviour was with libnice master.
I try janus 0.11.2 without patch with libnice 0.1.18 and icerestart work

As you can see here master is different from 0.1.18 so i think that or libnice introduce bug/regression in master or latest janus is not compatible with libnice master (because with proposed patch ice restart work)

@michelepra michelepra changed the title ice restart fail due to empty credential on libnice ice restart fail due to empty credential on libnice master May 27, 2021
@lminiero
Copy link
Member

Got it, thanks for the heads up! We'll need to check what changes they may have made. We still don't advise using a version later than 0.1.18 as to my knowledge there are some issues with keepalives that may cause sessions to be torn out sooner than needed (I think @alexamirante or @atoppi know the details), so for the time being we're fine.

@michelepra
Copy link
Contributor Author

and here the commits of change of the functionality of ice restart in libnice master.
Interesting, from this commit i can think that previous version do wrong thing in ice restart phase, but it work and nobody complains 😅

Happy to help if i can.

@lminiero
Copy link
Member

Yeah, it looks like this is the commit that started resetting remote credentials on a restart. In that case I agree with you we should somehow ensure remote credentials are set after we call nice_agent_restart, which in our code though depends on how the negotiation is taking place.

When you say you had issues with NoSIP, who were ICE restarts not working for? Caller or callee? That's important because in the former it's the browser sending an offer to Janus and Janus answering, while it's the other way around for the latter, and the two cases are obviously handled differently as far as ICE restarts are concerned.

@michelepra
Copy link
Contributor Author

All test that i do are in same condition of network and direction. A(caller - jsep) B(callee - sdp)
After all webrtc stuff are done (ice/dtls) rtp transit from A to B and around. At this time A switching network and do ice restart phase. So, for answer your question, my test are always browser that sending offer to Janus ans Janus answering

@lminiero
Copy link
Member

lminiero commented Jul 7, 2021

@michelepra I prepared a small PR that you can find linked above. If possible, please test with both an older and newer version of libnice (especially the ones that broke for you), and possibly testing restarts originated both by NoSIP caller and callee to cover both perspectives. In case you make any test and have feedback to share, please add it to the PR and not here.

@michelepra
Copy link
Contributor Author

Nice, your pr is exactly the same that i do
With this change i've tested older and newer libnice version and icerestart works, good to know that is become official.

Thanks

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

No branches or pull requests

2 participants