23#include <boost/weak_ptr.hpp>
78 private boost::noncopyable
210 static bool in_slow_start(
size_t cong_wnd_bytes,
size_t slow_start_thresh_bytes);
230 void log_state(
const std::string& context)
const;
252 boost::weak_ptr<Peer_socket::Const_ptr::element_type>
m_sock;
Convenience class that simply stores a Logger and/or Component passed into a constructor; and returns...
Interface that the user should implement, passing the implementing Logger into logging classes (Flow'...
Utility class for use by Congestion_control_strategy implementations that implements congestion windo...
void log_state(const std::string &context) const
Logs, in a TRACE message, all internal state values.
size_t slow_start_threshold_bytes() const
Return current stored SSTHRESH value in bytes.
size_t m_acked_bytes_since_window_update
While in congestion avoidance mode (!in_slow_start()), the # of acked bytes reported to on_acks() tha...
size_t m_slow_start_thresh_bytes
Current value of SSTRESH.
size_t m_cong_wnd_bytes
Current value of CWND.
Congestion_control_classic_data(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_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 clamp_congestion_window()
If congestion_window_at_limit(), sets CWND to the limit value.
const size_t m_init_cong_wnd_bytes
Initial value of CWND in constructor.
Peer_socket::Const_ptr socket() const
Analogous to Congestion_control_strategy::socket().
bool congestion_window_at_limit() const
Returns true if and only if the stored CWND is >= a certain constant maximum value.
void on_acks(size_t bytes)
Adjusts state, including potentially CWND, based on either "congestion avoidance" or "slow start" alg...
size_t init_congestion_window_bytes() const
The value to which the constructor set the stored CWND value (also known as Initial Window or IW).
static const size_t S_MAX_SLOW_START_CWND_INCREMENT_BLOCKS
The constant that limits how much CWND can grow in slow start for a single ack group.
size_t congestion_window_bytes() const
Return current stored CWND value in bytes.
boost::weak_ptr< Peer_socket::Const_ptr::element_type > m_sock
Same meaning as in Congestion_control_strategy.
bool in_slow_start() const
Return true if and only if CWND < SSTHRESH.
void on_idle_timeout()
Adjust state, namely CWND, assuming an Idle Timeout just occurred.
Const_target_ptr Const_ptr
Short-hand for ref-counted pointer to immutable values of type Target_type::element_type (a-la T cons...
Flow module containing the API and implementation of the Flow network protocol, a TCP-inspired stream...