Commit Graph

22 Commits

Author SHA1 Message Date
Sean DuBois
e0db6d259e Don't drop Binding Requests in Controlled Agent
A controlled Agent would discard incoming Binding Requests if it didn't
cause the pair to be selected. For UDP Candidate this would be
interpreted as packet loss. For TCP Candidates not responding with a
Binding Success could be interpreted as a failure.

Firefox's ICE Agent would disconnect TCP Candidates because of this
behavior.

Resolves to pion/webrtc#2125
Resolves to pion/webrtc#1356
See https://bugzilla.mozilla.org/show_bug.cgi?id=1756460
2022-02-22 12:17:26 -05:00
Sean DuBois
6e4403794a Implement GetSelectedCandidatePair
Related to pion/webrtc#1713
2021-04-10 16:52:52 -07:00
Antoine Baché
0cbd8a80cb ICE-Lite ControlledSelector now validates pairs
Fixes #288
2020-10-12 13:08:56 -07:00
Pion
d3e1775d73 Update CI configs to v0.4.7
Update lint scripts and CI configs.
2020-09-26 08:54:24 -07:00
Sean DuBois
c6d945f65e Remove nominationRequestCount
Before then nominating a candidate pair we limited the
amount of requests we sent, and would set the connection
to failed.

This change removes that limit, and instead uses the Disconnected+Failed
timer to control this. I found this when debugging an unrelated thing,
and was surprised by the behavior. I didn't find anything in the spec
that mentioned this, and isn't a knob that users will understand how to
control easily.
2020-06-27 21:59:27 -07:00
Sean DuBois
f195edb4c1 Implement SetRemoteCredentials and Restart
Add simple tests that check it works E2E

Resolves #190
2020-06-25 00:16:58 -07:00
Sean DuBois
e264665676 Move Checking -> Failed handling out of Selection
Selection before was written in a way that wouldn't work for restarts.
This moves the code out and makes it stateless. In the future we will be
able to clear the candidates and update the ConnectionState and
everything will restart properly.

Relates to #190
2020-06-25 00:16:58 -07:00
Sean DuBois
f1bfc8fea1 Start Agent performance refactor
Remove taskChan and make .run just take an Agent wide mutex and run the
function. These is now a blocking operation so all channels used to
communicate from it must be buffered.

After this we will slowly remove usage of .run and make things more
thread safe.

Relates to #80, #67, #2
2020-03-01 20:25:45 -08:00
Sean DuBois
aa3fe7c6a3 Add error message when no pairs
Add error message if pingAllCandidates is called and we
have no candidate pairs. This may help users when debugging.
2020-02-21 16:45:15 -08:00
Sean DuBois
c571ca90fe Cancel selection timeout if Agent is closed
We would always wait 10 seconds even if the ICE Agent was closed,
instead return early right when the agent is closed.

Closes pion/webrtc#897
2019-10-24 00:02:59 -07:00
Aaron France
377e52e387 Fix Controlled agent candidate selection timeout
Before if Controlled side never got any candidates
it would never properly shut down. We never checked
the start time against candidateSelectionTimeout

Resolves pion/webrtc#854
2019-10-05 23:03:22 -07:00
Zizheng Tai
ae2f2877cb Fix typo
Change a few "Sucess" to "Success".
2019-09-07 02:46:01 -04:00
Sebastian Waisbrot
953f36f07f Add config to run Agent in Lite mode
Allow the agent to run in Lite mode. This is useful in
cases where you never want connectivity checks, and reduces
possible attacks surfaces when you have a public IP.
2019-09-02 16:13:08 -07:00
Hugo Arregui
d2d97a6293 Add nominated flag to candidate pair stats
This way we can identify, between the valid candidate, which one has
been nominated.
2019-06-28 04:05:21 +00:00
Hugo Arregui
da599f54ff CandidatePairState is public now
Use more appropiate naming
2019-06-22 11:55:06 +00:00
Aleksandr Razumov
3183920f01 Update bad transaction ID handling for response
Receiving the messages with transaction ID that is currently not in
progress is expected.

* Change output format to hexademical to improve readability
* Change log severity to warning
* Update wording (invalid -> unknown)

Relates to #59
2019-06-04 08:40:40 -07:00
Hugo Arregui
bf57064619 Improve nomination
This implements a basic validation schema using a checklist. We try
every pair at least maxTries, and mark it as failed if we don't get a
success response after that many requests. Once we get a success
response, we check if it belongs to the best candidate available so far,
if it does we nominate it, otherwise we continue.

Also, after a given timeout, if no candidate has been nominated, we
simply choose the best valid candidate we got so far (if no candidate is
valid, we mark the connection as failed).

Finally, the nomination request also has a maximum of maxTries, we mark
the connection as failed if after that many attempt we fail to get a
success response.
2019-06-01 00:54:16 -07:00
Sean DuBois
63b37975b6 Make Candidate an interface
This change will allow us to have custom logic and members
per interface type. Relay candidates will have a completely different
read loop, and candidate specific state.

Relates to #47
2019-05-24 15:55:42 -07:00
Aleksandr Razumov
35330ae9e7 Use merged pion/stun instead of gortc/stun
The only thing that should be changed after complete merge is version
2019-05-21 15:53:04 -07:00
Aleksandr Razumov
d895187fa4 Prepare for stun v2
Using github.com/gortc/stun for now.
Should be easy to change it later.
2019-05-21 15:53:04 -07:00
Hugo Arregui
695fb1a946 Select a pair once
Although we only nominate and select one candidate pair, since we retry
thre quest we can end up selecting the same candidate multiple times
2019-05-04 20:46:15 -03:00
Hugo Arregui
cafd8d7860 Implement regular nomination
In this first iteration we nominate the first valid pair we found.
2019-05-02 14:32:27 -03:00