small fixes
This commit is contained in:
parent
b0e2cab17a
commit
70cea0d219
@ -38,7 +38,13 @@ struct CCAI {
|
|||||||
//static_assert(maximum_segment_size == 574); // mesured in wireshark
|
//static_assert(maximum_segment_size == 574); // mesured in wireshark
|
||||||
|
|
||||||
// flow control
|
// 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
|
public: // api
|
||||||
CCAI(size_t maximum_segment_data_size) : MAXIMUM_SEGMENT_DATA_SIZE(maximum_segment_data_size) {}
|
CCAI(size_t maximum_segment_data_size) : MAXIMUM_SEGMENT_DATA_SIZE(maximum_segment_data_size) {}
|
||||||
|
@ -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_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
|
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:
|
protected:
|
||||||
// initialize to low value, will get corrected very fast
|
// initialize to low value, will get corrected very fast
|
||||||
float _fwnd {0.01f * max_byterate_allowed}; // in bytes
|
float _fwnd {0.01f * max_byterate_allowed}; // in bytes
|
||||||
|
@ -47,14 +47,12 @@ struct LEDBAT : public CCAI{
|
|||||||
|
|
||||||
//static constexpr size_t rtt_buffer_size_max {2000};
|
//static constexpr size_t rtt_buffer_size_max {2000};
|
||||||
|
|
||||||
float max_byterate_allowed {10*1024*1024}; // 10MiB/s
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
LEDBAT(size_t maximum_segment_data_size);
|
LEDBAT(size_t maximum_segment_data_size);
|
||||||
|
|
||||||
// return the current believed window in bytes of how much data can be inflight,
|
// return the current believed window in bytes of how much data can be inflight,
|
||||||
// without overstepping the delay requirement
|
// without overstepping the delay requirement
|
||||||
float getCWnD(void) const {
|
float getWindow(void) override {
|
||||||
return _cwnd;
|
return _cwnd;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,5 +1,9 @@
|
|||||||
#include "./ngcft1.hpp"
|
#include "./ngcft1.hpp"
|
||||||
|
|
||||||
|
#include "./flow_only.hpp"
|
||||||
|
#include "./cubic.hpp"
|
||||||
|
#include "./ledbat.hpp"
|
||||||
|
|
||||||
#include <solanaceae/toxcore/utils.hpp>
|
#include <solanaceae/toxcore/utils.hpp>
|
||||||
|
|
||||||
#include <sodium.h>
|
#include <sodium.h>
|
||||||
@ -511,6 +515,9 @@ bool NGCFT1::onEvent(const Events::NGCEXT_ft1_init_ack& e) {
|
|||||||
if (!peer.cca) {
|
if (!peer.cca) {
|
||||||
peer.max_packet_data_size = negotiated_packet_data_size;
|
peer.max_packet_data_size = negotiated_packet_data_size;
|
||||||
peer.cca = std::make_unique<CUBIC>(peer.max_packet_data_size);
|
peer.cca = std::make_unique<CUBIC>(peer.max_packet_data_size);
|
||||||
|
//peer.cca = std::make_unique<LEDBAT>(peer.max_packet_data_size);
|
||||||
|
//peer.cca = std::make_unique<FlowOnly>(peer.max_packet_data_size);
|
||||||
|
//peer.cca->max_byterate_allowed = 1.f *1024*1024;
|
||||||
}
|
}
|
||||||
|
|
||||||
// iterate will now call NGC_FT1_send_data_cb
|
// iterate will now call NGC_FT1_send_data_cb
|
||||||
|
@ -6,9 +6,7 @@
|
|||||||
#include <solanaceae/toxcore/tox_interface.hpp>
|
#include <solanaceae/toxcore/tox_interface.hpp>
|
||||||
|
|
||||||
#include <solanaceae/ngc_ext/ngcext.hpp>
|
#include <solanaceae/ngc_ext/ngcext.hpp>
|
||||||
#include "./cubic.hpp"
|
#include "./cca.hpp"
|
||||||
//#include "./flow_only.hpp"
|
|
||||||
//#include "./ledbat.hpp"
|
|
||||||
|
|
||||||
#include "./rcv_buf.hpp"
|
#include "./rcv_buf.hpp"
|
||||||
#include "./snd_buf.hpp"
|
#include "./snd_buf.hpp"
|
||||||
|
Loading…
Reference in New Issue
Block a user