21 Commits

Author SHA1 Message Date
honghaiz
a73df559d6 Do not rely on specific ordering on generated candidates in TestGetAllPortsPortRange
This fixes another WebRTC swarming tests.

BUG=webrtc:6500

Review-Url: https://codereview.webrtc.org/2450983002
Cr-Commit-Position: refs/heads/master@{#14804}
2016-10-27 18:44:24 +00:00
nisse
3d7901d1bd Delete httpportallocator.h.
BUG=webrtc:6424

Review-Url: https://codereview.webrtc.org/2392913002
Cr-Commit-Position: refs/heads/master@{#14516}
2016-10-05 07:46:49 +00:00
Honghai Zhang
c67e0f5753 Signal to remove remote candidates if ports are pruned.
Previously when a Turn port is pruned, if its candidate has been sent to the remote side, the remote side will keep the candidate and use that to create connections.
We now signal the remote side to remove the candidates so that at least no new connection will be created using the removed candidates.

Also updated the virtual socket server to better support our test cases.
1. Allow the virtual socket server to set transit delay for packets sent from a given IP address.
2. Ensure the ordered packet delivery for each socket (Previously the delivery order is enforced on the whole test case, so if a udp packet gets delayed based on its IP address, all TCP packets sent after the UDP packet will be delayed at least until the UDP packet is received).

BUG=webrtc:6380
R=deadbeef@webrtc.org, pthatcher@webrtc.org, skvlad@webrtc.org

Review URL: https://codereview.webrtc.org/2261523004 .

Cr-Commit-Position: refs/heads/master@{#14297}
2016-09-19 23:57:48 +00:00
deadbeef
b60a8198f1 Fixing inconsistency with behavior of ClearGettingPorts.
I found that, depending on when it's called, ClearGettingPorts may or
may not signal CandidatesAllocationDone, and may or may not continue
to gather more ports/candidates.

I'm fixing this inconsistency by having it always signal
CandidatesAllocationDone (if needed), and always stop gathering until
the next network change event. This makes it equivalent to
StopGettingPorts, except that it allows gathering to be restarted if
a network change occurs.

I also found that P2PTransportChannel was signaling "gathering
complete" even when continual gathering was enabled. This wasn't caught
by the unit tests due to the inconsistency of ClearGettingPorts as
described above.

Review-Url: https://codereview.webrtc.org/2124283003
Cr-Commit-Position: refs/heads/master@{#13908}
2016-08-24 22:15:07 +00:00
johan
fe1ffb141b Remove unused SessionId from TransportChannel and PortAllocatorSession.
BUG=

Review-Url: https://codereview.webrtc.org/2237853002
Cr-Commit-Position: refs/heads/master@{#13731}
2016-08-11 19:37:51 +00:00
Taylor Brandstetter
734262c765 Fixing invalid operator< implementation.
It was possible that "A < B" and "B < A" both evaluated to true.
This manifested as an assert on Windows, and a memory leak on Linux.

Note that the concept of "less than" is meaningless for this object.
The operator is only needed so the object can be used as a key in an
std::map.

BUG=webrtc:6068
R=honghaiz@webrtc.org, kjellander@webrtc.org, skvlad@webrtc.org

Review URL: https://codereview.webrtc.org/2187913002 .

Cr-Commit-Position: refs/heads/master@{#13598}
2016-08-01 23:37:21 +00:00
Honghai Zhang
a74363c998 Remove ports that are not used by any channel after timeout
If a port is not used by any channel and if it has no connection for 30
seconds, it will be removed.
Note, as long as a port is used by a transport channel, it will be kept
even if it does not have any connection. This will be beneficial to
continual gathering because new connections can be created in the future
when network changes.

BUG=
R=pthatcher@webrtc.org, zhihuang@webrtc.org

Review URL: https://codereview.webrtc.org/2171183002 .

Cr-Commit-Position: refs/heads/master@{#13567}
2016-07-29 01:06:26 +00:00
Honghai Zhang
8eeecabd33 Merge SignalPortPruned and SignalPortsRemoved.
These two signals have the same purpose and is kind of redundant.
Rename to SignalPortsPruned.

BUG=
R=pthatcher@webrtc.org, zhihuang@webrtc.org

Review URL: https://codereview.webrtc.org/2176743003 .

Cr-Commit-Position: refs/heads/master@{#13562}
2016-07-28 20:20:29 +00:00
Honghai Zhang
b9e7b4ad66 Add config to prune low-priority TURN ports for creating connections
When the flag prune_turn_ports is set, When a high-priority turn port becomes available, it will prune low-priority ones. The pruned port will not be used for creating connections locally and its candidates will not be sent over to the remove side (unless they have been sent before being pruned).

This effectively reduces the number of TURN candidates and connections created by TURN ports.

BUG=
R=deadbeef@webrtc.org, pthatcher@webrtc.org

Review URL: https://codereview.webrtc.org/2093623004 .

Committed: https://crrev.com/17aac053f585e892114974d2eb248e05ad37f973
Cr-Original-Commit-Position: refs/heads/master@{#13335}
Cr-Commit-Position: refs/heads/master@{#13354}
2016-07-01 03:52:16 +00:00
danilchap
f4e8cf0d5b Revert of Add config to prune TURN ports (patchset #12 id:360001 of https://codereview.webrtc.org/2093623004/ )
Reason for revert:
Breaks Win32/Win64 Debug bots in client.webrtc waterfall

Original issue's description:
> Add config to prune low-priority TURN ports for creating connections
> When the flag prune_turn_ports is set, When a high-priority turn port becomes available, it will prune low-priority ones. The pruned port will not be used for creating connections locally and its candidates will not be sent over to the remove side (unless they have been sent before being pruned).
>
> This effectively reduces the number of TURN candidates and connections created by TURN ports.
>
> BUG=
> R=deadbeef@webrtc.org, pthatcher@webrtc.org
>
> Committed: https://crrev.com/17aac053f585e892114974d2eb248e05ad37f973
> Cr-Commit-Position: refs/heads/master@{#13335}

TBR=pthatcher@webrtc.org,deadbeef@webrtc.org,honghaiz@webrtc.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=

Review-Url: https://codereview.webrtc.org/2111663003
Cr-Commit-Position: refs/heads/master@{#13342}
2016-06-30 08:55:10 +00:00
Honghai Zhang
17aac053f5 Add config to prune low-priority TURN ports for creating connections
When the flag prune_turn_ports is set, When a high-priority turn port becomes available, it will prune low-priority ones. The pruned port will not be used for creating connections locally and its candidates will not be sent over to the remove side (unless they have been sent before being pruned).

This effectively reduces the number of TURN candidates and connections created by TURN ports.

BUG=
R=deadbeef@webrtc.org, pthatcher@webrtc.org

Review URL: https://codereview.webrtc.org/2093623004 .

Cr-Commit-Position: refs/heads/master@{#13335}
2016-06-30 04:42:05 +00:00
honghaiz
603470576e Add a flag to filter out high-cost networks.
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}
2016-06-01 01:29:18 +00:00
deadbeef
8271a7f6d7 Increasing a timeout for TestGetAllPortsNoUdpAllowed.
The timeout was 3 seconds, but on one bot (TSan) it took 4.3 seconds.

NOTRY=True
TBR=pthatcher@webrtc.org

Review-Url: https://codereview.webrtc.org/2021413002
Cr-Commit-Position: refs/heads/master@{#12978}
2016-05-31 23:27:15 +00:00
Taylor Brandstetter
8c9be5e490 In BasicPortAllocator test, don't require a specific candidate order.
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}
2016-05-26 23:07:39 +00:00
philipel
834081aadf Disabled BasicPortAllocatorTest.TestDisableUdpTurn (flaky)
TBR=mflodman@webrtc.org

BUG=webrtc:5929

Review URL: https://codereview.webrtc.org/2011593003 .

Cr-Commit-Position: refs/heads/master@{#12886}
2016-05-25 09:13:03 +00:00
zhihuang
6d0d4bf31d Change the size of the ICE ufrag to 4 bytes.
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}
2016-05-24 17:13:41 +00:00
Taylor Brandstetter
417eebe5dd Fixing the behavior of the candidate filter with pooled candidates.
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}
2016-05-23 23:02:29 +00:00
Taylor Brandstetter
8fcf414846 Attempting to fix flaky tests that deal with STUN timeout.
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}
2016-05-23 19:49:35 +00:00
Taylor Brandstetter
a1c303535f Relanding: Implement RTCConfiguration.iceCandidatePoolSize.
Depends on this CL in order to work in Chromium:
https://codereview.chromium.org/1976673002/

It works by creating pooled PortAllocatorSessions which can be picked up
by a P2PTransportChannel when needed (after a local description is set).

This can optimize candidate gathering time when there is some time between
creating a PeerConnection and setting a local description.

R=pthatcher@webrtc.org

Committed: 48e9d05f51

Review URL: https://codereview.webrtc.org/1956453003 .

Cr-Commit-Position: refs/heads/master@{#12729}
2016-05-13 15:15:20 +00:00
deadbeef
c55fb30649 Revert of Implement RTCConfiguration.iceCandidatePoolSize. (patchset #7 id:120001 of https://codereview.webrtc.org/1956453003/ )
Reason for revert:
Breaks remoting_unittests. They defined their own operator== which conflicts with this one.

I'll remove the operator== in a roll CL. But until it's approved, I'm reverting this so the FYI bots will pass.

Original issue's description:
> Implement RTCConfiguration.iceCandidatePoolSize.
>
> It works by creating pooled PortAllocatorSessions which can be picked up
> by a P2PTransportChannel when needed (after a local description is set).
>
> This can optimize candidate gathering time when there is some time between
> creating a PeerConnection and setting a local description.
>
> R=pthatcher@webrtc.org
>
> Committed: 48e9d05f51

TBR=pthatcher@webrtc.org,honghaiz@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/1972043004
Cr-Commit-Position: refs/heads/master@{#12709}
2016-05-12 19:51:45 +00:00
Taylor Brandstetter
48e9d05f51 Implement RTCConfiguration.iceCandidatePoolSize.
It works by creating pooled PortAllocatorSessions which can be picked up
by a P2PTransportChannel when needed (after a local description is set).

This can optimize candidate gathering time when there is some time between
creating a PeerConnection and setting a local description.

R=pthatcher@webrtc.org

Review URL: https://codereview.webrtc.org/1956453003 .

Cr-Commit-Position: refs/heads/master@{#12708}
2016-05-12 17:19:44 +00:00