28 m_classic_data(logger_ptr, sock)
77 const size_t& snd_flying_bytes = sock->m_snd_flying_bytes;
89 const size_t new_wnd_bytes = max((snd_flying_bytes + bytes) * window_decay_percent / 100,
90 2 * sock->max_block_size());
93 "set sl_st_thresh=cong_wnd to [" << window_decay_percent <<
"%] of "
94 "In-flight [" << sock->bytes_blocks_str(snd_flying_bytes + bytes) <<
"].");
141 const size_t& snd_flying_bytes = sock->m_snd_flying_bytes;
150 const size_t new_slow_start_thresh_bytes = max((snd_flying_bytes + bytes) * window_decay_percent / 100,
151 2 * sock->max_block_size());
153 FLOW_LOG_TRACE(
"cong_ctl [" << sock <<
"] update: DTO event; set sl_st_thresh "
154 "to [" << window_decay_percent <<
"%] of "
155 "cong_wnd [" << sock->bytes_blocks_str(snd_flying_bytes + bytes) <<
"]; "
156 "cong_wnd to minimal value.");
167 unsigned int window_decay_percent = sock->opt(sock->m_opts.m_st_cong_ctl_classic_wnd_decay_percent);
168 assert(window_decay_percent <= 100);
169 if (window_decay_percent == 0)
171 window_decay_percent = 50;
173 return window_decay_percent;
Interface that the user should implement, passing the implementing Logger into logging classes (Flow'...
void on_drop_timeout(size_t new_slow_start_thresh_bytes)
Adjust state, including CWND and SSTHRESH, assuming a Drop Timeout just occurred.
void on_congestion_event(size_t new_slow_start_thresh_bytes, size_t new_cong_wnd_bytes)
Sets internally stored SSHTRESH and CWND to the given values; appropriately resets internal state so ...
void on_acks(size_t bytes)
Adjusts state, including potentially CWND, based on either "congestion avoidance" or "slow start" alg...
size_t congestion_window_bytes() const
Return current stored CWND value in bytes.
void on_idle_timeout()
Adjust state, namely CWND, assuming an Idle Timeout just occurred.
Congestion_control_classic_data m_classic_data
The Reno CWND/SSTHRESH-changing engine and CWND/SSTHRESH storage.
void on_acks(size_t bytes, size_t packets) override
Implements Congestion_control_strategy::on_acks() API.
void on_idle_timeout() override
Implements Congestion_control_strategy::on_idle_timeout() API.
void on_drop_timeout(size_t bytes, size_t packets) override
Implements Congestion_control_strategy::on_drop_timeout() API.
unsigned int congestion_window_decay() const
Returns the decay (as a percentage) to apply to the congestion window upon encounterling loss.
size_t congestion_window_bytes() const override
Implements Congestion_control_strategy::congestion_window_bytes() API.
Congestion_control_classic(log::Logger *logger_ptr, Peer_socket::Const_ptr sock)
Constructs object by setting up logging and saving a pointer to the containing Peer_socket.
void on_loss_event(size_t bytes, size_t packets) override
Implements Congestion_control_strategy::on_loss_event() API.
The abstract interface for a per-socket module that determines the socket's congestion control behavi...
Peer_socket::Const_ptr socket() const
Utility for subclasses that returns a handle to the containing Peer_socket.
Const_target_ptr Const_ptr
Short-hand for ref-counted pointer to immutable values of type Target_type::element_type (a-la T cons...
#define FLOW_LOG_TRACE(ARG_stream_fragment)
Logs a TRACE message into flow::log::Logger *get_logger() with flow::log::Component get_log_component...
Flow module containing the API and implementation of the Flow network protocol, a TCP-inspired stream...