Add field trial for ExtraICEPing

This patch adds a field trial for sending an extra ice ping
when receiving a ice ping and we have not received an ice ping
response. The theory is that this will decrease time it takes
for a connection to become writable and improve behavior with
ice reroutes (choosing a new ice candidate pair).

Bug: webrtc:10273
Change-Id: I98d442649869e7c7655edbbb5ab42c596f5d3b9d
Reviewed-on: https://webrtc-review.googlesource.com/c/120722
Commit-Queue: Qingsi Wang <qingsi@webrtc.org>
Reviewed-by: Qingsi Wang <qingsi@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#26503}
This commit is contained in:
Jonas Oreland 2019-01-31 12:29:41 +01:00 committed by Commit Bot
parent 39ecb17572
commit f3e9abf6b3
2 changed files with 10 additions and 0 deletions

View File

@ -631,6 +631,10 @@ void P2PTransportChannel::SetIceConfig(const IceConfig& config) {
<< config.stun_keepalive_interval_or_default();
}
if (webrtc::field_trial::IsEnabled("WebRTC-ExtraICEPing")) {
RTC_LOG(LS_INFO) << "Set WebRTC-ExtraICEPing: Enabled";
}
webrtc::BasicRegatheringController::Config regathering_config(
config_.regather_all_networks_interval_range,
config_.regather_on_failed_networks_interval_or_default());

View File

@ -30,6 +30,7 @@
#include "rtc_base/numerics/safe_minmax.h"
#include "rtc_base/string_encode.h"
#include "rtc_base/third_party/base64/base64.h"
#include "system_wrappers/include/field_trial.h"
namespace {
@ -1328,6 +1329,11 @@ void Connection::OnReadPacket(const char* data,
void Connection::HandleBindingRequest(IceMessage* msg) {
// This connection should now be receiving.
ReceivedPing();
if (webrtc::field_trial::IsEnabled("WebRTC-ExtraICEPing") &&
last_ping_response_received_ == 0) {
RTC_LOG(LS_INFO) << ToString() << "WebRTC-ExtraICEPing/Sending extra ping";
Ping(rtc::TimeMillis());
}
const rtc::SocketAddress& remote_addr = remote_candidate_.address();
const std::string& remote_ufrag = remote_candidate_.username();