24#include <boost/utility.hpp>
25#include <boost/random.hpp>
69 private boost::noncopyable
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'...
Objects of this class can be fed to Node to make it internally simulate network conditions like loss,...
std::queue< Fine_duration > Latency_seq
Short-hand for list of packet latencies.
Net_env_simulator(log::Logger *logger_ptr, seed_type_t random_seed=0, prob_type_t recv_packet_loss_prob=0, const Packet_loss_seq &recv_packet_loss_seq=Packet_loss_seq(), const Latency_range &recv_latency_range=Latency_range(), const Latency_seq &recv_latency_seq=Latency_seq(), prob_type_t recv_packet_dup_prob=0, const Packet_dup_seq &recv_packet_dup_seq=Packet_dup_seq())
Constructs simulator.
Packet_dup_seq m_recv_packet_dup_seq
At a given point in time, the i-th from now (in chronological order) received packet will be duplicat...
std::queue< bool > Packet_dup_seq
Short-hand for list of packet duplication outcomes.
Random_generator m_rnd_generator
Random number generator for various random events like packet loss.
boost::random::bernoulli_distribution< prob_type_t > m_recv_packet_loss_distribution
Returns true or false according to some probability set at construction; used for received packet los...
double prob_type_t
Short-hand for floating point between 0 and 1 used to express probability.
Packet_loss_seq m_recv_packet_loss_seq
At a given point in time, the i-th from now (in chronological order) received packet will be dropped ...
std::pair< Fine_duration, Fine_duration > Latency_range
Short-hand for latency range [low, high].
boost::random::uniform_int_distribution< Fine_duration::rep > m_recv_latency_distribution_msec
Returns random latencies (in units of Fine_duration) within the improper [low, high] range given at c...
Fine_duration received_packet_latency()
Low-level packet was received and not dropped, but should we simulate that it was lagged by an additi...
util::Rnd_gen_uniform_range_base::Random_generator Random_generator
Random number generator.
boost::random::bernoulli_distribution< prob_type_t > m_recv_packet_dup_distribution
Returns true or false according to some probability set at construction; used for received packet dup...
uint32_t seed_type_t
Short-hand for the random seed integer type.
Latency_seq m_recv_latency_seq
At a given point in time, the i-th from now (in chronological order) received packet will be lagged b...
seed_type_t m_seed
Random seed for m_rnd_generator (saved for reproducibility of "random" events).
bool should_duplicate_received_packet()
Low-level packet was received, but should we simulate that it was duplicated? Probability and/or pres...
bool should_drop_received_packet()
Low-level packet was received, but should we simulate that it was dropped before receipt?...
std::queue< bool > Packet_loss_seq
Short-hand for list of packet loss outcomes.
Flow module containing the API and implementation of the Flow network protocol, a TCP-inspired stream...
Fine_clock::duration Fine_duration
A high-res time duration as computed from two Fine_time_pts.