Open thomaseizinger opened 8 months ago
It's not expected.
if let Some((idx, other)) =
self.local_candidates.iter_mut().enumerate().find(|(_, v)| {
v.addr() == c.addr() && v.base() == c.base() && v.proto() == c.proto()
})
{
if c.prio() < other.prio() {
// The new candidate is not better than what we already got.
debug!(
"Reject redundant candidate, current: {:?} rejected: {:?}",
other, c
);
return false;
}
If addr
, base
and proto
are the same, we might replace or reject, however for a discovered srflx I expect addr
to differ.
Candidate(host=192.168.193.95:54644/udp prio=2130705663)
Candidate(srflx=31.133.129.248:54644/udp base=192.168.193.95:54644 prio=1686109951)
I.e. for host, addr
should be 192.168.193.95:54644
and for the srflx
it should be 31.133.129.248:54644
which means the above code shouldn't kick in. Seems like a bug.
which means the above code shouldn't kick in. Seems like a bug.
The above code is for candidates. The candidate is accepted correctly, it is the candidate pair that is rejected as redundant and thus never tested.
Ah, got ya.
This behavior changed with 51acd55f46a48a8a416d1343c96fdad2bfd0a02e
https://datatracker.ietf.org/doc/html/rfc8445#section-5.1.3
Frequently, a server-reflexive candidate and a host candidate will be
redundant when the agent is not behind a NAT. A candidate is
redundant if and only if its transport address and base equal those
of another candidate. The agent SHOULD eliminate the redundant
candidate with the lower priority.
Is this what we see?
Ah, got ya.
This behavior changed with 51acd55
Yeah I had a hunch that we may have broken that in that commit.
Question is whether we broke it in a more spec compliant way? :)
https://datatracker.ietf.org/doc/html/rfc8445#section-5.1.3
Frequently, a server-reflexive candidate and a host candidate will be redundant when the agent is not behind a NAT. A candidate is redundant if and only if its transport address and base equal those of another candidate. The agent SHOULD eliminate the redundant candidate with the lower priority.
Is this what we see?
This is still about candidates though, right? If I read the logs correctly, the candidate isn't redundant but the generated pair is. I'll take a look at the code later.
We may have broken the redundancy check of pairs with the change of what base
means for srflx candidates.
The situation we are testing is:
Expectation
New pairs are formed for all candidates and str0m nominates a new pair if it is better
Reality
str0m forms new pairs for the host candidate but rejects all pairs for the srflx one based on redundancy
Logs
Is this expected? Is a srflx candidate with the same base as a host candidate always redundant? Unless the nodes are in the same network, the remote can never reply to the host candidate so this particular candidate pair can't succeed and the one they could reply to was eliminated for redundancy.