From 70cea0d21999a9db7abd5df8efd18d0bb68201f6 Mon Sep 17 00:00:00 2001 From: Green Sky Date: Wed, 13 Dec 2023 19:38:55 +0100 Subject: [PATCH] small fixes --- solanaceae/ngc_ft1/cca.hpp | 8 +++++++- solanaceae/ngc_ft1/flow_only.hpp | 8 -------- solanaceae/ngc_ft1/ledbat.hpp | 6 ++---- solanaceae/ngc_ft1/ngcft1.cpp | 7 +++++++ solanaceae/ngc_ft1/ngcft1.hpp | 4 +--- 5 files changed, 17 insertions(+), 16 deletions(-) diff --git a/solanaceae/ngc_ft1/cca.hpp b/solanaceae/ngc_ft1/cca.hpp index 8d72023..750e04e 100644 --- a/solanaceae/ngc_ft1/cca.hpp +++ b/solanaceae/ngc_ft1/cca.hpp @@ -38,7 +38,13 @@ struct CCAI { //static_assert(maximum_segment_size == 574); // mesured in wireshark // flow control - float max_byterate_allowed {10*1024*1024}; // 10MiB/s + //float max_byterate_allowed {100.f*1024*1024}; // 100MiB/s + float max_byterate_allowed {10.f*1024*1024}; // 10MiB/s + //float max_byterate_allowed {1.f*1024*1024}; // 1MiB/s + //float max_byterate_allowed {0.6f*1024*1024}; // 600KiB/s + //float max_byterate_allowed {0.5f*1024*1024}; // 500KiB/s + //float max_byterate_allowed {0.15f*1024*1024}; // 150KiB/s + //float max_byterate_allowed {0.05f*1024*1024}; // 50KiB/s public: // api CCAI(size_t maximum_segment_data_size) : MAXIMUM_SEGMENT_DATA_SIZE(maximum_segment_data_size) {} diff --git a/solanaceae/ngc_ft1/flow_only.hpp b/solanaceae/ngc_ft1/flow_only.hpp index d46ad5b..b1aaf71 100644 --- a/solanaceae/ngc_ft1/flow_only.hpp +++ b/solanaceae/ngc_ft1/flow_only.hpp @@ -15,14 +15,6 @@ struct FlowOnly : public CCAI { static constexpr float RTT_UP_MAX = 3.0f; // how much larger a delay can be to be taken into account static constexpr float RTT_MAX = 2.f; // 2 sec is probably too much - //float max_byterate_allowed {100.f*1024*1024}; // 100MiB/s - float max_byterate_allowed {10.f*1024*1024}; // 10MiB/s - //float max_byterate_allowed {1.f*1024*1024}; // 1MiB/s - //float max_byterate_allowed {0.6f*1024*1024}; // 600KiB/s - //float max_byterate_allowed {0.5f*1024*1024}; // 500KiB/s - //float max_byterate_allowed {0.05f*1024*1024}; // 50KiB/s - //float max_byterate_allowed {0.15f*1024*1024}; // 150KiB/s - protected: // initialize to low value, will get corrected very fast float _fwnd {0.01f * max_byterate_allowed}; // in bytes diff --git a/solanaceae/ngc_ft1/ledbat.hpp b/solanaceae/ngc_ft1/ledbat.hpp index 02a474c..af836ed 100644 --- a/solanaceae/ngc_ft1/ledbat.hpp +++ b/solanaceae/ngc_ft1/ledbat.hpp @@ -11,7 +11,7 @@ // LEDBAT++: https://www.ietf.org/archive/id/draft-irtf-iccrg-ledbat-plus-plus-01.txt // LEDBAT++ implementation -struct LEDBAT : public CCAI{ +struct LEDBAT : public CCAI { public: // config #if 0 using SeqIDType = std::pair; // tf_id, seq_id @@ -47,14 +47,12 @@ struct LEDBAT : public CCAI{ //static constexpr size_t rtt_buffer_size_max {2000}; - float max_byterate_allowed {10*1024*1024}; // 10MiB/s - public: LEDBAT(size_t maximum_segment_data_size); // return the current believed window in bytes of how much data can be inflight, // without overstepping the delay requirement - float getCWnD(void) const { + float getWindow(void) override { return _cwnd; } diff --git a/solanaceae/ngc_ft1/ngcft1.cpp b/solanaceae/ngc_ft1/ngcft1.cpp index 6effa79..39246c0 100644 --- a/solanaceae/ngc_ft1/ngcft1.cpp +++ b/solanaceae/ngc_ft1/ngcft1.cpp @@ -1,5 +1,9 @@ #include "./ngcft1.hpp" +#include "./flow_only.hpp" +#include "./cubic.hpp" +#include "./ledbat.hpp" + #include #include @@ -511,6 +515,9 @@ bool NGCFT1::onEvent(const Events::NGCEXT_ft1_init_ack& e) { if (!peer.cca) { peer.max_packet_data_size = negotiated_packet_data_size; peer.cca = std::make_unique(peer.max_packet_data_size); + //peer.cca = std::make_unique(peer.max_packet_data_size); + //peer.cca = std::make_unique(peer.max_packet_data_size); + //peer.cca->max_byterate_allowed = 1.f *1024*1024; } // iterate will now call NGC_FT1_send_data_cb diff --git a/solanaceae/ngc_ft1/ngcft1.hpp b/solanaceae/ngc_ft1/ngcft1.hpp index 0502caa..c0ac8ba 100644 --- a/solanaceae/ngc_ft1/ngcft1.hpp +++ b/solanaceae/ngc_ft1/ngcft1.hpp @@ -6,9 +6,7 @@ #include #include -#include "./cubic.hpp" -//#include "./flow_only.hpp" -//#include "./ledbat.hpp" +#include "./cca.hpp" #include "./rcv_buf.hpp" #include "./snd_buf.hpp"