aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--libtransport/includes/hicn/transport/interfaces/socket_options_keys.h1
-rw-r--r--libtransport/src/implementation/socket_consumer.h11
-rw-r--r--libtransport/src/protocols/raaqm.cc8
-rw-r--r--libtransport/src/protocols/rtc.cc2
4 files changed, 22 insertions, 0 deletions
diff --git a/libtransport/includes/hicn/transport/interfaces/socket_options_keys.h b/libtransport/includes/hicn/transport/interfaces/socket_options_keys.h
index 0b7a79c3d..f50e919b4 100644
--- a/libtransport/includes/hicn/transport/interfaces/socket_options_keys.h
+++ b/libtransport/includes/hicn/transport/interfaces/socket_options_keys.h
@@ -66,6 +66,7 @@ typedef enum {
MINIMUM_DROP_PROBABILITY = 205,
PATH_ID = 206,
RTT_STATS = 207,
+ PER_SESSION_CWINDOW_RESET = 208
} RaaqmTransportOptions;
typedef enum {
diff --git a/libtransport/src/implementation/socket_consumer.h b/libtransport/src/implementation/socket_consumer.h
index 5e5073956..87965923e 100644
--- a/libtransport/src/implementation/socket_consumer.h
+++ b/libtransport/src/implementation/socket_consumer.h
@@ -58,6 +58,7 @@ class ConsumerSocket : public Socket<BasePortal> {
verifier_(std::make_shared<utils::Verifier>()),
verify_signature_(false),
key_content_(false),
+ reset_window_(false),
on_interest_output_(VOID_HANDLER),
on_interest_timeout_(VOID_HANDLER),
on_interest_satisfied_(VOID_HANDLER),
@@ -343,6 +344,11 @@ class ConsumerSocket : public Socket<BasePortal> {
result = SOCKET_OPTION_SET;
break;
+ case RaaqmTransportOptions::PER_SESSION_CWINDOW_RESET:
+ reset_window_ = socket_option_value;
+ result = SOCKET_OPTION_SET;
+ break;
+
default:
return result;
}
@@ -648,6 +654,10 @@ class ConsumerSocket : public Socket<BasePortal> {
socket_option_value = is_async_;
break;
+ case RaaqmTransportOptions::PER_SESSION_CWINDOW_RESET:
+ socket_option_value = reset_window_;
+ break;
+
default:
return SOCKET_OPTION_NOT_GET;
}
@@ -923,6 +933,7 @@ class ConsumerSocket : public Socket<BasePortal> {
PARCKeyId *key_id_;
std::atomic_bool verify_signature_;
bool key_content_;
+ bool reset_window_;
ConsumerInterestCallback on_interest_retransmission_;
ConsumerInterestCallback on_interest_output_;
diff --git a/libtransport/src/protocols/raaqm.cc b/libtransport/src/protocols/raaqm.cc
index 783d6194b..5023adf2e 100644
--- a/libtransport/src/protocols/raaqm.cc
+++ b/libtransport/src/protocols/raaqm.cc
@@ -116,6 +116,14 @@ void RaaqmTransportProtocol::reset() {
// Reset protocol variables
interests_in_flight_ = 0;
t0_ = utils::SteadyClock::now();
+
+ // Optionally reset congestion window
+ bool reset_window;
+ socket_->getSocketOption(RaaqmTransportOptions::PER_SESSION_CWINDOW_RESET,
+ reset_window);
+ if (reset_window) {
+ current_window_size_ = 1;
+ }
}
bool RaaqmTransportProtocol::verifyKeyPackets() {
diff --git a/libtransport/src/protocols/rtc.cc b/libtransport/src/protocols/rtc.cc
index b1502f51f..a01b8daa5 100644
--- a/libtransport/src/protocols/rtc.cc
+++ b/libtransport/src/protocols/rtc.cc
@@ -348,6 +348,8 @@ void RTCTransportProtocol::computeMaxWindow(uint32_t productionRate,
void RTCTransportProtocol::updateWindow() {
if (currentState_ == HICN_RTC_SYNC_STATE) return;
+ if (estimatedBw_ == 0) return;
+
if (currentCWin_ < maxCWin_ * 0.9) {
currentCWin_ =
min(maxCWin_, (uint32_t)(currentCWin_ * HICN_WIN_INCREASE_FACTOR));