We now use a single rule to determine connection switch on the controlled side. The rule is to select the new best connection based on the following order:
1. writable/receiving/connected state.
2. nominated
3. last time receiving data packet.
4. priority.
5. latency (rtt)
BUG=
R=deadbeef@webrtc.org, pthatcher@webrtc.org
Review URL: https://codereview.webrtc.org/2069493002 .
Cr-Commit-Position: refs/heads/master@{#13274}
When creating connections on turn port, check whether the local and remote candidates have the same IP address family, instead of checking the address family of the local socket against the remote candidate.
BUG=5871
R=deadbeef@webrtc.org, pthatcher@webrtc.org
Review URL: https://codereview.webrtc.org/2083803002 .
Cr-Commit-Position: refs/heads/master@{#13269}
This will allow media to be sent on these pairs before a binding
response is received, shortening call setup time. However, this is only
possible if the TURN servers don't require CreatePermission when
communicating with each other.
R=honghaiz@webrtc.org, pthatcher@webrtc.org
NOTRY=True
Review-Url: https://codereview.webrtc.org/2063823008
Cr-Commit-Position: refs/heads/master@{#13268}
Reason for revert:
The Webrtc waterfall indicates that this revert is not necessary.
Original issue's description:
> Revert of Do not delete a connection in the turn port with permission error or refresh error. (patchset #6 id:260001 of https://codereview.webrtc.org/2068263003/ )
>
> Reason for revert:
> It broke webrtc builds.
>
> Original issue's description:
> > Do not delete a connection in the turn port with permission error, refresh error, or binding error.
> >
> > Even if those error happened, the connection may still be able to receive packets for a while.
> > If we delete the connections, all packets arriving will be dropped.
> >
> > BUG=webrtc:6007
> > R=deadbeef@webrtc.org, pthatcher@webrtc.org
> >
> > Committed: https://crrev.com/3d77deb29c15bfb8f794ef3413837a0ec0f0c131
> > Cr-Commit-Position: refs/heads/master@{#13262}
>
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> TBR=pthatcher@webrtc.org,deadbeef@webrtc.org
> # Not skipping CQ checks because original CL landed more than 1 days ago.
> BUG=webrtc:6007
>
> Committed: https://crrev.com/3159ffae6b1d5cba2ad972bd3d8074ac85f2c7f9
> Cr-Commit-Position: refs/heads/master@{#13265}
TBR=pthatcher@webrtc.org,deadbeef@webrtc.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=webrtc:6007
Review-Url: https://codereview.webrtc.org/2090073003
Cr-Commit-Position: refs/heads/master@{#13266}
Reason for revert:
It broke webrtc builds.
Original issue's description:
> Do not delete a connection in the turn port with permission error, refresh error, or binding error.
>
> Even if those error happened, the connection may still be able to receive packets for a while.
> If we delete the connections, all packets arriving will be dropped.
>
> BUG=webrtc:6007
> R=deadbeef@webrtc.org, pthatcher@webrtc.org
>
> Committed: https://crrev.com/3d77deb29c15bfb8f794ef3413837a0ec0f0c131
> Cr-Commit-Position: refs/heads/master@{#13262}
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
TBR=pthatcher@webrtc.org,deadbeef@webrtc.org
# Not skipping CQ checks because original CL landed more than 1 days ago.
BUG=webrtc:6007
Review-Url: https://codereview.webrtc.org/2090833002
Cr-Commit-Position: refs/heads/master@{#13265}
Reason for revert:
Breaking webrtc builder.
Original issue's description:
> Adding IceConfig option to assume TURN/TURN candidate pairs will work.
>
> This will allow media to be sent on these pairs before a binding
> response is received, shortening call setup time. However, this is only
> possible if the TURN servers don't require CreatePermission when
> communicating with each other.
>
> R=honghaiz@webrtc.org, pthatcher@webrtc.org
>
> Committed: https://crrev.com/8e6134eae4117a239de67c9a9dae8f5e3235d803
> Cr-Commit-Position: refs/heads/master@{#13263}
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
TBR=pthatcher@webrtc.org,deadbeef@webrtc.org
# Not skipping CQ checks because original CL landed more than 1 days ago.
Review-Url: https://codereview.webrtc.org/2090823002
Cr-Commit-Position: refs/heads/master@{#13264}
This will allow media to be sent on these pairs before a binding
response is received, shortening call setup time. However, this is only
possible if the TURN servers don't require CreatePermission when
communicating with each other.
R=honghaiz@webrtc.org, pthatcher@webrtc.org
Review URL: https://codereview.webrtc.org/2063823008 .
Cr-Commit-Position: refs/heads/master@{#13263}
Even if those error happened, the connection may still be able to receive packets for a while.
If we delete the connections, all packets arriving will be dropped.
BUG=webrtc:6007
R=deadbeef@webrtc.org, pthatcher@webrtc.org
Review URL: https://codereview.webrtc.org/2068263003 .
Cr-Commit-Position: refs/heads/master@{#13262}
If an actual peer reflexive candidate was created (and not one that
would just be replaced by a different candidate later), we weren't
setting the generation value. This means that new-generation prflx
candidate pairs weren't being prioritized above the cross-generation
pairs, or above relay<->relay pairs.
R=honghaiz@webrtc.org, pthatcher@webrtc.org
Review URL: https://codereview.webrtc.org/2086793002 .
Cr-Commit-Position: refs/heads/master@{#13259}
Previously, if the ICE role changed, SetIceRole was only called on
the ports from the most recent ICE generation. However, STUN pings
may still be sent and received by older generation ports, so they
should receive an updated role as well.
This was previously triggering an ASSERT, because a P2PTransportChannel
expects the ICE role of each of its ports to match its own role.
Committed: https://crrev.com/370544594e18deb7f560f961295c8cf3f0a679f1
Review-Url: https://codereview.webrtc.org/2053043003
Cr-Original-Commit-Position: refs/heads/master@{#13226}
Cr-Commit-Position: refs/heads/master@{#13247}
Previously they were only being updated for connections using the
most current "generation" of ports. This results in the older-
generation prflx candidate pair being prioritized above newer-
generation candidate pairs.
Review-Url: https://codereview.webrtc.org/2087713002
Cr-Commit-Position: refs/heads/master@{#13245}
Writable connections are pinged at a slower rate.
The function IsPingable will filter out the writable connections.
The interval for slower ping rate by default is WRITABLE_CONNECTION_PING_INTERVAL(2500ms) and can be set with the configuration.
BUG=webrtc:1161
Committed: https://crrev.com/8f7a5aad55a64f0d81b6436a22ffbdfcdcde91e0
Review-Url: https://codereview.webrtc.org/1944003002
Cr-Original-Commit-Position: refs/heads/master@{#12736}
Cr-Commit-Position: refs/heads/master@{#13241}
Reason for revert:
Speculative revert: breaks video quality tests on Win and Mac (???): https://build.chromium.org/p/chromium.webrtc.fyi/builders/Mac%20Tester/builds/31209
Original issue's description:
> Update ICE role on all ports, not just ones used for new connections.
>
> Previously, if the ICE role changed, SetIceRole was only called on
> the ports from the most recent ICE generation. However, STUN pings
> may still be sent and received by older generation ports, so they
> should receive an updated role as well.
>
> This was previously triggering an ASSERT, because a P2PTransportChannel
> expects the ICE role of each of its ports to match its own role.
>
> Committed: https://crrev.com/370544594e18deb7f560f961295c8cf3f0a679f1
> Cr-Commit-Position: refs/heads/master@{#13226}
TBR=pthatcher@webrtc.org,honghaiz@webrtc.org,deadbeef@webrtc.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
Review-Url: https://codereview.webrtc.org/2078423004
Cr-Commit-Position: refs/heads/master@{#13240}
Previously, if the ICE role changed, SetIceRole was only called on
the ports from the most recent ICE generation. However, STUN pings
may still be sent and received by older generation ports, so they
should receive an updated role as well.
This was previously triggering an ASSERT, because a P2PTransportChannel
expects the ICE role of each of its ports to match its own role.
Review-Url: https://codereview.webrtc.org/2053043003
Cr-Commit-Position: refs/heads/master@{#13226}
Manual review shows that several more sources should be excluded for the
Chromium build. This is likely what's blocking
https://codereview.chromium.org/2022833002/
It was also discovered that the following were missing from GYP+GN:
webrtc/p2p/base/dtlstransport.h
webrtc/p2p/base/session.cc
webrtc/p2p/base/session.h
BUG=webrtc:4256
TBR=pthatcher@webrtc.org
NOTRY=True
NOPRESUBMIT=True
Review-Url: https://codereview.webrtc.org/2077883002
Cr-Commit-Position: refs/heads/master@{#13200}
Every message will now be traced with the location from which it was
posted, including function name, file and line number.
This CL also writes a normal LOG message when the dispatch took more
than a certain amount of time (currently 50ms).
This logging should help us identify messages that are taking
longer than expected to be dispatched.
R=pthatcher@webrtc.org, tommi@webrtc.org
Review URL: https://codereview.webrtc.org/2019423006 .
Cr-Commit-Position: refs/heads/master@{#13104}
Otherwise, we'll read out of bounds if the packet is too small.
NOTRY=true
Review-Url: https://codereview.webrtc.org/2040953003
Cr-Commit-Position: refs/heads/master@{#13093}
This only causes an increased likelihood of role conflicts as each peer
is picking a new role. It also means that if ICE is restarted for only
one media stream, roles can be different across media streams (which isn't
even allowed).
For more explanation of why this is unnecessary and should be changed,
see this discussion:
https://mailarchive.ietf.org/arch/msg/ice/C0_QRCTNcwtvUF12y28jQicPR10
Review-Url: https://codereview.webrtc.org/2046123003
Cr-Commit-Position: refs/heads/master@{#13077}
The only thing that differs from the previous attempt in
https://codereview.webrtc.org/1979933002/ is that none of
the new targets are not hooked up to the webrtc target in
webrtc/BUILD.gn, which should make it not break the
chromium.webrtc.fyi bots.
Add BUILD.gn files for webrtc/{api,media,libjingle,p2p,pc} in
preparation for removing src/third_party/libjingle in Chromium.
Changes between previous attempt and the one before that
(https://codereview.webrtc.org/1973313002) are:
* Added libstunprober target
* Adjusted warnings for Chromium's clang plugins
* webrtc/pc/externalhmac.{h,cc} added for Chromium builds.
BUG=webrtc:4256
NOTRY=True
NOPRESUBMIT=True
TBR=perkj@webrtc.org, tommi@webrtc.org
Review-Url: https://codereview.webrtc.org/2037983002
Cr-Commit-Position: refs/heads/master@{#13030}
Move the sources of rtc_unittests and xmllite_xmpp_unittests
into the actual targets instead of depending on none-targets.
This will make it easier to create GN targets matching them.
BUG=webrtc:5949
NOTRY=True
NOPRESUBMIT=True
Review-Url: https://codereview.webrtc.org/2029583002
Cr-Commit-Position: refs/heads/master@{#13008}
The connection delete message may be processed when a port is being deleted.
Calling LOG_J here needs to access the port object that may have been partially released.
This fixes the memcheck bot failure.
TBR=pthatcher@webrtc.org
BUG=
Review-Url: https://codereview.webrtc.org/2026403003
Cr-Commit-Position: refs/heads/master@{#13002}
Add sent_ping_requests, recv_ping_responses to ConnectionInfo.
recv_ping_responses_ will be incremented when OnConnectionRequestResponse() is called.
ent_ping_requests_ will be incremented when OnConnectionRequestSent() is called.
BUG=webrtc:5695
Review-Url: https://codereview.webrtc.org/1940493002
Cr-Commit-Position: refs/heads/master@{#13001}
If the remote side sends a candidate with the same address and port with an existing candidate,
but with a new ufrag and pwd, the local client will create a new connection from it
and destroy the old connection with the same remote address.
BUG=webrtc:5915
Review-Url: https://codereview.webrtc.org/2018693002
Cr-Commit-Position: refs/heads/master@{#13000}
FakePortAllocator is used with both virtual sockets and real sockets.
Thus it needs to work on a system with no IPv4 interface.
R=pthatcher@webrtc.org
Review URL: https://codereview.webrtc.org/2006423004 .
Cr-Commit-Position: refs/heads/master@{#12995}
Reason for revert:
Too many errors to address showed up when trying to land this with Chromium changes in https://codereview.chromium.org/2022833002/.
Will address them separately before relanding.
Original issue's description:
> Reland of GN: Add BUILD.gn files for webrtc/{api,media,libjingle,p2p,pc}
>
> Add BUILD.gn files for webrtc/{api,media,libjingle,p2p,pc} in
> preparation for removing src/third_party/libjingle in Chromium.
>
> Changes from previous attempt:
> * Added libstunprober target
> * Adjusted warnings for Chromium's clang plugins
> * webrtc/pc/externalhmac.{h,cc} added for Chromium builds.
>
> As soon this has landed a roll including the changes in
> https://codereview.chromium.org/2022833002/ is needed to make
> Chromium build cleanly.
>
> BUG=webrtc:4256
> NOTRY=True
> NOPRESUBMIT=True
>
> Committed: https://crrev.com/164e978f981c7810c4260c4184f41e26bae90230
> Cr-Commit-Position: refs/heads/master@{#12983}
TBR=perkj@webrtc.org,tommi@webrtc.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=webrtc:4256
Review-Url: https://codereview.webrtc.org/2023233002
Cr-Commit-Position: refs/heads/master@{#12988}
Add BUILD.gn files for webrtc/{api,media,libjingle,p2p,pc} in
preparation for removing src/third_party/libjingle in Chromium.
Changes from previous attempt:
* Added libstunprober target
* Adjusted warnings for Chromium's clang plugins
* webrtc/pc/externalhmac.{h,cc} added for Chromium builds.
As soon this has landed a roll including the changes in
https://codereview.chromium.org/2022833002/ is needed to make
Chromium build cleanly.
BUG=webrtc:4256
NOTRY=True
NOPRESUBMIT=True
Review-Url: https://codereview.webrtc.org/1979933002
Cr-Commit-Position: refs/heads/master@{#12983}
This allows webrtc to not gather on cellular networks if wifi or
other low cost networks are present.
BUG=
Review-Url: https://codereview.webrtc.org/1987833002
Cr-Commit-Position: refs/heads/master@{#12979}
I think the code that only allowed one role conflict was a workaround
for our old implementation (TransportChannelProxy, etc.). Not necessary
now, with TransportController.
BUG=webrtc:5470
Review-Url: https://codereview.webrtc.org/2004463003
Cr-Commit-Position: refs/heads/master@{#12949}
They don't really belong in PeerConnection because the state at that
level can change when a transport channel is removed. That makes almost
any state transition possible.
The asserts are now in P2PTransportChannel (the equivalent to
IceTransport in the spec). Currently it has a reduced set of states,
that don't even take into account writability, but I plan to change
that soon.
BUG=webrtc:4757
R=pthatcher@webrtc.org
Review URL: https://codereview.webrtc.org/2005573002 .
Cr-Commit-Position: refs/heads/master@{#12937}
The test doesn't really care about the order; the fact that it relied
on a specific order was just an implementation detail.
However, this made the test flaky since race conditions sometimes
determine the order. It also made it frustrating to add new tests.
BUG=webrtc:5930
R=pthatcher@webrtc.org
Review URL: https://codereview.webrtc.org/2006263004 .
Cr-Commit-Position: refs/heads/master@{#12936}
The local endpoint was given 4 seconds to converge but the remote
endpoint was only given 1 second. Now they both collectively
have 4 seconds.
Also fixed the ExpectCandidate2 method (used for verbose failure
logging) and removed a bunch of dead code.
TBR=pthatcher@webrtc.org
Review URL: https://codereview.webrtc.org/2018703002 .
Cr-Commit-Position: refs/heads/master@{#12934}
This is the minumum allowed size, and will allow STUN pings to be smaller.
The unit tests on the the Gturn are also modified. A username with length of 16 bytes will be generated for Gturn only.
Review-Url: https://codereview.webrtc.org/1848083002
Cr-Commit-Position: refs/heads/master@{#12876}
According to JSEP, the candidate filter does not affect pooled
candidates because they can be filtered once they're ready to be
surfaced to the application.
So, pooled port allocator sessions will use a filter of CF_ALL, with a
new filter applied when the session is taken by a P2PTransportChannel.
When the filter is applied:
* Some candidates may no longer be returned by ReadyCandidates()
* Some candidates may no longer have a "related address" (for privacy)
* Some ports may no longer be returned by ReadyPorts()
To simplify this, the candidate filtering logic is now moved up from
the Ports to the BasicPortAllocator, with some helper methods to perform
the filtering and stripping out of data.
R=honghaiz@webrtc.org, pthatcher@webrtc.org
Review URL: https://codereview.webrtc.org/1998813002 .
Cr-Commit-Position: refs/heads/master@{#12856}
The STUN timeout is 9500ms, and the tests are waiting for 10000ms.
The 500ms margin of error is not enough for some bots (such as UBSan).
R=pthatcher@webrtc.org
Review URL: https://codereview.webrtc.org/2001093003 .
Cr-Commit-Position: refs/heads/master@{#12854}
if the network monitor detects it after the native code does.
Also set the network cost for ethernet, wifi, unknown, cellular network type to be 0, 10, 50, 900,
so that unknown networks will have lower precedence than known networks with low cost (like Wifi) but higher precedence than known networks with high cost.
And third, infer network type based on limited name matching in Android if there is no network monitor or network monitor did not find the type.
BUG=webrtc:5890
R=pthatcher@chromium.org, pthatcher@webrtc.org
Review URL: https://codereview.webrtc.org/1976683003 .
Cr-Commit-Position: refs/heads/master@{#12833}
Reason for revert:
This will take longer time for the RTT to converge.
Need to update the RTT calculation algorithm if doing this.
Original issue's description:
> Increase the stun ping interval.
>
> Writable connections are pinged at a slower rate.
> The function IsPingable will filter out the writable connections.
> The interval for slower ping rate by default is WRITABLE_CONNECTION_PING_INTERVAL(2500ms) and can be set with the configuration.
>
> BUG=webrtc:1161
>
> Committed: https://crrev.com/8f7a5aad55a64f0d81b6436a22ffbdfcdcde91e0
> Cr-Commit-Position: refs/heads/master@{#12736}
TBR=honghaiz@webrtc.org,pthatcher@webrtc.org,zhihuang@webrtc.org
# Not skipping CQ checks because original CL landed more than 1 days ago.
BUG=webrtc:1161
Review URL: https://codereview.webrtc.org/1982713002 .
Cr-Commit-Position: refs/heads/master@{#12762}