MADARA  3.0.5
madara::transport::QoSTransportSettings Class Reference

Container for quality-of-service settings. More...

#include <QoSTransportSettings.h>

Inheritance diagram for madara::transport::QoSTransportSettings:
Collaboration diagram for madara::transport::QoSTransportSettings:

Public Types

typedef ACE_Guard< MADARA_LOCK_TYPE > ContextGuard
 
typedef std::vector< std::string > Voters
 

Public Member Functions

 QoSTransportSettings ()
 Default constructor. More...
 
 QoSTransportSettings (const QoSTransportSettings &settings)
 Copy constructor. More...
 
 QoSTransportSettings (const TransportSettings &settings)
 Copy constructor. More...
 
virtual ~QoSTransportSettings ()
 Destructor. More...
 
void add_banned_peer (const std::string &peer)
 Adds a banned peer. More...
 
void add_filter (filters::BufferFilter *filter)
 Adds a buffer filter to the chain. More...
 
void add_read_domain (const std::string domain)
 Adds a read domain to the list of domains to read from. More...
 
void add_rebroadcast_filter (uint32_t types, knowledge::KnowledgeRecord(*function)(knowledge::FunctionArguments &, knowledge::Variables &))
 Adds a filter that will be applied to certain types after receiving and before rebroadcasting (if TTL > 0) More...
 
void add_rebroadcast_filter (uint32_t types, filters::RecordFilter *filter)
 Adds a filter that will be applied to certain types after receiving and before rebroadcasting (if TTL > 0) More...
 
void add_rebroadcast_filter (void(*function)(knowledge::KnowledgeMap &, const TransportContext &, knowledge::Variables &))
 Adds an aggregate update filter that will be applied before rebroadcasting, after individual record filters. More...
 
void add_rebroadcast_filter (filters::AggregateFilter *filter)
 Adds an aggregate update filter that will be applied before rebroadcasting, after individual record filters. More...
 
void add_receive_filter (uint32_t types, knowledge::KnowledgeRecord(*function)(knowledge::FunctionArguments &, knowledge::Variables &))
 Adds a filter that will be applied to certain types after receiving and before applying to the local knowledge base. More...
 
void add_receive_filter (uint32_t types, filters::RecordFilter *filter)
 Adds a filter that will be applied to certain types after receiving. More...
 
void add_receive_filter (void(*function)(knowledge::KnowledgeMap &, const TransportContext &, knowledge::Variables &))
 Adds an aggregate update filter that will be applied after receiving, after individual record filters. More...
 
void add_receive_filter (filters::AggregateFilter *filter)
 Adds an aggregate update filter that will be applied after receiving, after individual record filters. More...
 
void add_send_filter (uint32_t types, knowledge::KnowledgeRecord(*function)(knowledge::FunctionArguments &, knowledge::Variables &))
 Adds a filter that will be applied to certain types before sending. More...
 
void add_send_filter (uint32_t types, filters::RecordFilter *filter)
 Adds a filter that will be applied to certain types before sending. More...
 
void add_send_filter (void(*function)(knowledge::KnowledgeMap &, const TransportContext &, knowledge::Variables &))
 Adds an aggregate update filter that will be applied before sending, after individual record filters. More...
 
void add_send_filter (filters::AggregateFilter *filter)
 Adds an aggregate update filter that will be applied before sending, after individual record filters. More...
 
void add_trusted_peer (const std::string &peer)
 Adds a trusted peer. More...
 
void attach (knowledge::ThreadSafeContext *context)
 Attaches a context to the various filtering systems. More...
 
void clear_buffer_filters (void)
 Clears the list of buffer filters. More...
 
void clear_read_domains (void)
 Clears the list of read domains. More...
 
void clear_rebroadcast_aggregate_filters (void)
 Clears the list of rebroadcast time aggregate filters. More...
 
void clear_rebroadcast_filters (uint32_t types)
 Clears the list of filters for the specified types. More...
 
void clear_receive_aggregate_filters (void)
 Clears the list of receive time aggregate filters. More...
 
void clear_receive_filters (uint32_t types)
 Clears the list of filters for the specified types. More...
 
void clear_send_aggregate_filters (void)
 Clears the list of send time aggregate filters. More...
 
void clear_send_filters (uint32_t types)
 Clears the list of filters for the specified types. More...
 
void enable_participant_ttl (unsigned char maximum_ttl=255)
 Enables rebroadcast support up to a certain time to live for other agent's messages. More...
 
int filter_decode (unsigned char *source, int size, int max_size) const
 Calls decode on the the buffer filter chain. More...
 
int filter_encode (unsigned char *source, int size, int max_size) const
 Calls encode on the the buffer filter chain. More...
 
knowledge::KnowledgeRecord filter_rebroadcast (const madara::knowledge::KnowledgeRecord &input, const std::string &name, transport::TransportContext &context) const
 Filters an input according to the rebroadcast filter chain. More...
 
void filter_rebroadcast (knowledge::KnowledgeMap &records, const transport::TransportContext &transport_context) const
 Filters aggregate records according to the rebroadcast filter chain. More...
 
knowledge::KnowledgeRecord filter_receive (const madara::knowledge::KnowledgeRecord &input, const std::string &name, transport::TransportContext &context) const
 Filters an input according to the receive filter chain. More...
 
void filter_receive (knowledge::KnowledgeMap &records, const transport::TransportContext &transport_context) const
 Filters aggregate records according to the receive filter chain. More...
 
knowledge::KnowledgeRecord filter_send (const madara::knowledge::KnowledgeRecord &input, const std::string &name, transport::TransportContext &context) const
 Filters an input according to send's filter chain. More...
 
void filter_send (knowledge::KnowledgeMap &records, const transport::TransportContext &transport_context) const
 Filters aggregate records according to the send filter chain. More...
 
double get_deadline (void) const
 Returns the latency deadline in seconds. More...
 
uint64_t get_drop_burst (void) const
 Returns the bursts of packet drops. More...
 
double get_drop_rate (void) const
 Returns the percentage of dropped packets to enforce on sends. More...
 
int get_drop_type (void) const
 Returns the policy type for packet drops. More...
 
size_t get_number_of_buffer_filters (void) const
 Returns the number of buffer filters. More...
 
size_t get_number_of_rebroadcast_aggregate_filters (void) const
 Returns the number of aggregate filters applied before rebroadcasting @ return the number of aggregate filters. More...
 
size_t get_number_of_rebroadcast_filtered_types (void) const
 Returns the number of types that are filtered before rebroadcast. More...
 
size_t get_number_of_receive_aggregate_filters (void) const
 Returns the number of aggregate filters applied after receiving @ return the number of aggregate filters. More...
 
size_t get_number_of_receive_filtered_types (void) const
 Returns the number of types that are filtered after received. More...
 
size_t get_number_of_send_aggregate_filters (void) const
 Returns the number of aggregate filters applied before sending @ return the number of aggregate filters. More...
 
size_t get_number_of_send_filtered_types (void) const
 Returns the number of types that are filtered before send. More...
 
unsigned char get_participant_ttl (void) const
 Returns the maximum time to live participation of this transport in rebroadcasting of other agent's messages. More...
 
void get_read_domains (std::vector< std::string > &domains)
 Retrieves the list of read domains. More...
 
unsigned char get_rebroadcast_ttl (void) const
 Gets the time to live for rebroadcasting (number of rebroadcasts per message). More...
 
int64_t get_send_bandwidth_limit (void) const
 Returns the limit for sending on this transport in bytes per second. More...
 
int64_t get_total_bandwidth_limit (void) const
 Returns the total limit for this transport in bytes per second. More...
 
bool is_reading_domain (const std::string domain) const
 Checks if a domain is in the domain read list. More...
 
bool is_trusted (const std::string &peer) const
 Checks if a peer is trusted. More...
 
virtual void load (const std::string &filename, const std::string &prefix="transport")
 Loads the settings from a file. More...
 
size_t num_read_domains (void) const
 Returns the number of read domains. More...
 
void operator= (const QoSTransportSettings &settings)
 Assignment operator. More...
 
void operator= (const TransportSettings &settings)
 Assignment operator. More...
 
void print_num_filters_rebroadcast (void) const
 Prints the number of filters chained for each type to the rebroadcast filter. More...
 
void print_num_filters_receive (void) const
 Prints the number of filters chained for each type to the receive filter. More...
 
void print_num_filters_send (void) const
 Prints the number of filters chained for each type to the send filter. More...
 
bool remove_banned_peer (const std::string &peer)
 Removes a trusted peer, if it exists in the list. More...
 
bool remove_trusted_peer (const std::string &peer)
 Removes a trusted peer, if it exists in the list. More...
 
virtual void save (const std::string &filename, const std::string &prefix="transport") const
 Saves the settings from a file. More...
 
void set_deadline (double deadline)
 Sets the packet deadline in seconds. More...
 
void set_rebroadcast_ttl (unsigned char ttl)
 Sets the time to live for our packets. More...
 
void set_send_bandwidth_limit (int64_t bandwidth)
 Sets a bandwidth limit for sending on this transport in bytes per sec. More...
 
void set_total_bandwidth_limit (int64_t bandwidth)
 Sets a bandwidth limit for receiving and sending over the transport. More...
 
void update_drop_rate (double drop_rate, int drop_type=PACKET_DROP_DETERMINISTIC, uint64_t drop_burst=1)
 Updates a packet drop rate, type, and burst. More...
 

Public Attributes

uint32_t deadline
 Deadline for sessions with any other reasoning entity. More...
 
bool delay_launch
 delay launching transports More...
 
OriginatorFragmentMap fragment_map
 map of fragments received by originator More...
 
uint32_t fragment_queue_length
 Indicates queue length for holding clock-keyed fragments. More...
 
std::vector< std::string > hosts
 Host information for transports that require it. More...
 
uint32_t id
 the id of this process. More...
 
uint32_t max_fragment_size
 Maximum allowed fragment size for partitioning large messages. More...
 
bool never_exit
 prevent MADARA from exiting on fatal errors and invalid state More...
 
bool no_receiving
 if true, never receive over transport More...
 
bool no_sending
 if true, never send over transport More...
 
std::string on_data_received_logic
 logic to be evaluated after every successful update More...
 
uint32_t processes
 number of processes expected in the network (best to overestimate if building latency tables More...
 
uint32_t queue_length
 Length of the buffer used to store history of events. More...
 
double read_thread_hertz
 number of valid messages allowed to be received per second. More...
 
uint32_t read_threads
 the number of read threads to start More...
 
uint32_t reliability
 Reliability required of the transport. More...
 
int resend_attempts
 Maximum number of attempts to resend if transport is busy. More...
 
bool send_reduced_message_header
 send the reduced message header (clock, size, updates, KaRL id) More...
 
double slack_time
 time to sleep between sends and rebroadcasts More...
 
uint32_t type
 Type of transport. See madara::transport::Types for options. More...
 
std::string write_domain
 All class members are accessible to users for easy setup. More...
 

Static Public Attributes

static const uint32_t DEFAULT_DEADLINE = 0
 Default deadline. More...
 
static const uint32_t DEFAULT_QUEUE_LENGTH = 500000
 Default queue length for event history (must be high for reliable transport. More...
 
static const uint32_t DEFAULT_RELIABILITY = RELIABLE
 Default reliability. More...
 
static const uint32_t DEFAULT_TRANSPORT = NO_TRANSPORT
 Default transport. More...
 

Private Attributes

std::map< std::string, int > banned_peers_
 A container of all banned peers. More...
 
filters::BufferFilters buffer_filters_
 buffer filters have an encode and decode method More...
 
double latency_deadline_
 Deadline for packets at which packets drop. More...
 
int64_t max_send_bandwidth_
 Maximum send bandwidth usage per second before packets drop. More...
 
int64_t max_total_bandwidth_
 Maximum bandwidth usage for the transport (receive/send) before drop. More...
 
uint64_t packet_drop_burst_
 Burst of packet drops. More...
 
double packet_drop_rate_
 Rate for dropping packets. More...
 
int packet_drop_type_
 Drop rate type. More...
 
unsigned char participant_rebroadcast_ttl_
 This field is meant to limit the number of rebroadcasts that this transport will participate in. More...
 
knowledge::KnowledgeRecordFilters rebroadcast_filters_
 A container for rebroadcast filters. More...
 
unsigned char rebroadcast_ttl_
 number of rebroadcasts for receivers to ultimately do. More...
 
knowledge::KnowledgeRecordFilters receive_filters_
 A container for receive filters. More...
 
knowledge::KnowledgeRecordFilters send_filters_
 A container for filters applied before sending from this host. More...
 
std::map< std::string, int > trusted_peers_
 A container of all trusted peers. More...
 

Detailed Description

Container for quality-of-service settings.

Definition at line 49 of file QoSTransportSettings.h.

Member Typedef Documentation

typedef ACE_Guard<MADARA_LOCK_TYPE> madara::transport::TransportSettings::ContextGuard
inherited

Definition at line 99 of file TransportSettings.h.

typedef std::vector<std::string> madara::transport::TransportSettings::Voters
inherited

Definition at line 104 of file TransportSettings.h.

Constructor & Destructor Documentation

madara::transport::QoSTransportSettings::QoSTransportSettings ( )

Default constructor.

Definition at line 11 of file QoSTransportSettings.cpp.

madara::transport::QoSTransportSettings::QoSTransportSettings ( const QoSTransportSettings settings)

Copy constructor.

Definition at line 22 of file QoSTransportSettings.cpp.

madara::transport::QoSTransportSettings::QoSTransportSettings ( const TransportSettings settings)

Copy constructor.

Definition at line 42 of file QoSTransportSettings.cpp.

madara::transport::QoSTransportSettings::~QoSTransportSettings ( )
virtual

Destructor.

Definition at line 79 of file QoSTransportSettings.cpp.

Member Function Documentation

void madara::transport::QoSTransportSettings::add_banned_peer ( const std::string &  peer)

Adds a banned peer.

By default, all peers are trusted unless a trusted peer or banned peer is added to the settings.

Parameters
peerpeer to add (generally ip:port)

Definition at line 173 of file QoSTransportSettings.cpp.

void madara::transport::QoSTransportSettings::add_filter ( filters::BufferFilter filter)

Adds a buffer filter to the chain.

Parameters
filteran instance of a buffer filter

Definition at line 272 of file QoSTransportSettings.cpp.

void madara::transport::TransportSettings::add_read_domain ( const std::string  domain)
inlineinherited

Adds a read domain to the list of domains to read from.

Parameters
domaindomain to add to the read list

Definition at line 15 of file TransportSettings.inl.

void madara::transport::QoSTransportSettings::add_rebroadcast_filter ( uint32_t  types,
knowledge::KnowledgeRecord(*)(knowledge::FunctionArguments &, knowledge::Variables &)  function 
)

Adds a filter that will be applied to certain types after receiving and before rebroadcasting (if TTL > 0)

Parameters
typesthe types to add the filter to
functionthe function that will take the knowledge record in FunctionArguments.

Definition at line 303 of file QoSTransportSettings.cpp.

void madara::transport::QoSTransportSettings::add_rebroadcast_filter ( uint32_t  types,
filters::RecordFilter filter 
)

Adds a filter that will be applied to certain types after receiving and before rebroadcasting (if TTL > 0)

Parameters
typesthe types to add the filter to
filteran instance of an individual record filter that will be managed by the underlying infrastructure

Definition at line 311 of file QoSTransportSettings.cpp.

void madara::transport::QoSTransportSettings::add_rebroadcast_filter ( void(*)(knowledge::KnowledgeMap &, const TransportContext &, knowledge::Variables &)  function)

Adds an aggregate update filter that will be applied before rebroadcasting, after individual record filters.

Parameters
functionan aggregate update filter

Definition at line 318 of file QoSTransportSettings.cpp.

void madara::transport::QoSTransportSettings::add_rebroadcast_filter ( filters::AggregateFilter filter)

Adds an aggregate update filter that will be applied before rebroadcasting, after individual record filters.

Parameters
filteran instance of an aggregate record filter that will be managed by the underlying infrastructure

Definition at line 327 of file QoSTransportSettings.cpp.

void madara::transport::QoSTransportSettings::add_receive_filter ( uint32_t  types,
knowledge::KnowledgeRecord(*)(knowledge::FunctionArguments &, knowledge::Variables &)  function 
)

Adds a filter that will be applied to certain types after receiving and before applying to the local knowledge base.

Parameters
typesthe types to add the filter to
functionthe function that will take the knowledge record in FunctionArguments.

Definition at line 279 of file QoSTransportSettings.cpp.

void madara::transport::QoSTransportSettings::add_receive_filter ( uint32_t  types,
filters::RecordFilter filter 
)

Adds a filter that will be applied to certain types after receiving.

Parameters
typesthe types to add the filter to
filteran instance of an individual record filter that will be managed by the underlying infrastructure

Definition at line 287 of file QoSTransportSettings.cpp.

void madara::transport::QoSTransportSettings::add_receive_filter ( void(*)(knowledge::KnowledgeMap &, const TransportContext &, knowledge::Variables &)  function)

Adds an aggregate update filter that will be applied after receiving, after individual record filters.

Parameters
functionan aggregate update filter

Definition at line 294 of file QoSTransportSettings.cpp.

void madara::transport::QoSTransportSettings::add_receive_filter ( filters::AggregateFilter filter)

Adds an aggregate update filter that will be applied after receiving, after individual record filters.

Parameters
filteran instance of an aggregate record filter that will be managed by the underlying infrastructure

Definition at line 265 of file QoSTransportSettings.cpp.

void madara::transport::QoSTransportSettings::add_send_filter ( uint32_t  types,
knowledge::KnowledgeRecord(*)(knowledge::FunctionArguments &, knowledge::Variables &)  function 
)

Adds a filter that will be applied to certain types before sending.

Parameters
typesthe types to add the filter to
functionthe function that will take the knowledge record in FunctionArguments.

Definition at line 234 of file QoSTransportSettings.cpp.

void madara::transport::QoSTransportSettings::add_send_filter ( uint32_t  types,
filters::RecordFilter filter 
)

Adds a filter that will be applied to certain types before sending.

Parameters
typesthe types to add the filter to
filteran instance of an individual record filter that will be managed by the underlying infrastructure

Definition at line 242 of file QoSTransportSettings.cpp.

void madara::transport::QoSTransportSettings::add_send_filter ( void(*)(knowledge::KnowledgeMap &, const TransportContext &, knowledge::Variables &)  function)

Adds an aggregate update filter that will be applied before sending, after individual record filters.

Parameters
functionan aggregate update filter

Definition at line 249 of file QoSTransportSettings.cpp.

void madara::transport::QoSTransportSettings::add_send_filter ( filters::AggregateFilter filter)

Adds an aggregate update filter that will be applied before sending, after individual record filters.

Parameters
filteran instance of an aggregate record filter that will be managed by the underlying infrastructure

Definition at line 258 of file QoSTransportSettings.cpp.

void madara::transport::QoSTransportSettings::add_trusted_peer ( const std::string &  peer)

Adds a trusted peer.

By default, all peers are trusted unless a trusted peer or banned peer is added to the settings.

Parameters
peerpeer to add (generally ip:port)

Definition at line 165 of file QoSTransportSettings.cpp.

void madara::transport::QoSTransportSettings::attach ( knowledge::ThreadSafeContext context)

Attaches a context to the various filtering systems.

If the context ever goes out of scope, a 0 should be passed into this function to the context.

Parameters
contextcontext to be used for Variable lookups

Definition at line 435 of file QoSTransportSettings.cpp.

void madara::transport::QoSTransportSettings::clear_buffer_filters ( void  )

Clears the list of buffer filters.

Definition at line 477 of file QoSTransportSettings.cpp.

void madara::transport::TransportSettings::clear_read_domains ( void  )
inlineinherited

Clears the list of read domains.

Definition at line 22 of file TransportSettings.inl.

void madara::transport::QoSTransportSettings::clear_rebroadcast_aggregate_filters ( void  )

Clears the list of rebroadcast time aggregate filters.

Definition at line 484 of file QoSTransportSettings.cpp.

void madara::transport::QoSTransportSettings::clear_rebroadcast_filters ( uint32_t  types)

Clears the list of filters for the specified types.

Parameters
typesthe types to clear the filters of

Definition at line 470 of file QoSTransportSettings.cpp.

void madara::transport::QoSTransportSettings::clear_receive_aggregate_filters ( void  )

Clears the list of receive time aggregate filters.

Definition at line 464 of file QoSTransportSettings.cpp.

void madara::transport::QoSTransportSettings::clear_receive_filters ( uint32_t  types)

Clears the list of filters for the specified types.

Parameters
typesthe types to clear the filters of

Definition at line 457 of file QoSTransportSettings.cpp.

void madara::transport::QoSTransportSettings::clear_send_aggregate_filters ( void  )

Clears the list of send time aggregate filters.

Definition at line 451 of file QoSTransportSettings.cpp.

void madara::transport::QoSTransportSettings::clear_send_filters ( uint32_t  types)

Clears the list of filters for the specified types.

Parameters
typesthe types to clear the filters of

Definition at line 444 of file QoSTransportSettings.cpp.

void madara::transport::QoSTransportSettings::enable_participant_ttl ( unsigned char  maximum_ttl = 255)

Enables rebroadcast support up to a certain time to live for other agent's messages.

Default is 0 (no participation in rebroadcasts)

Parameters
maximum_ttlMaximum time to live to support (0 for not participating in rebroadcasts). A transport cannot participate in more than 255 resends.

Definition at line 152 of file QoSTransportSettings.cpp.

int madara::transport::QoSTransportSettings::filter_decode ( unsigned char *  source,
int  size,
int  max_size 
) const

Calls decode on the the buffer filter chain.

Parameters
sourcethe source and destination buffer
sizethe amount of data in the buffer in bytes
max_sizethe amount of bytes the buffer can hold
Returns
the new size after encoding

Definition at line 524 of file QoSTransportSettings.cpp.

int madara::transport::QoSTransportSettings::filter_encode ( unsigned char *  source,
int  size,
int  max_size 
) const

Calls encode on the the buffer filter chain.

Parameters
sourcethe source and destination buffer
sizethe amount of data in the buffer in bytes
max_sizethe amount of bytes the buffer can hold
Returns
the new size after encoding

Definition at line 509 of file QoSTransportSettings.cpp.

madara::knowledge::KnowledgeRecord madara::transport::QoSTransportSettings::filter_rebroadcast ( const madara::knowledge::KnowledgeRecord input,
const std::string &  name,
transport::TransportContext context 
) const

Filters an input according to the rebroadcast filter chain.

Parameters
namevariable name of input ("" for unnamed)
inputthe argument to the filter chain
contextthe context of the transport
Returns
the result of filtering the input

Definition at line 556 of file QoSTransportSettings.cpp.

void madara::transport::QoSTransportSettings::filter_rebroadcast ( knowledge::KnowledgeMap records,
const transport::TransportContext transport_context 
) const

Filters aggregate records according to the rebroadcast filter chain.

Parameters
recordsthe aggregate record map
transport_contextthe context of the transport

Definition at line 565 of file QoSTransportSettings.cpp.

madara::knowledge::KnowledgeRecord madara::transport::QoSTransportSettings::filter_receive ( const madara::knowledge::KnowledgeRecord input,
const std::string &  name,
transport::TransportContext context 
) const

Filters an input according to the receive filter chain.

Parameters
namevariable name of input ("" for unnamed)
inputthe argument to the filter chain
contextthe context of the transport
Returns
the result of filtering the input

Definition at line 539 of file QoSTransportSettings.cpp.

void madara::transport::QoSTransportSettings::filter_receive ( knowledge::KnowledgeMap records,
const transport::TransportContext transport_context 
) const

Filters aggregate records according to the receive filter chain.

Parameters
recordsthe aggregate record map
transport_contextthe context of the transport

Definition at line 548 of file QoSTransportSettings.cpp.

madara::knowledge::KnowledgeRecord madara::transport::QoSTransportSettings::filter_send ( const madara::knowledge::KnowledgeRecord input,
const std::string &  name,
transport::TransportContext context 
) const

Filters an input according to send's filter chain.

Parameters
namevariable name of input ("" for unnamed)
inputthe argument to the filter chain
contextthe context of the transport
Returns
the result of filtering the input

Definition at line 491 of file QoSTransportSettings.cpp.

void madara::transport::QoSTransportSettings::filter_send ( knowledge::KnowledgeMap records,
const transport::TransportContext transport_context 
) const

Filters aggregate records according to the send filter chain.

Parameters
recordsthe aggregate record map
transport_contextthe context of the transport

Definition at line 500 of file QoSTransportSettings.cpp.

double madara::transport::QoSTransportSettings::get_deadline ( void  ) const

Returns the latency deadline in seconds.

-1 means no deadline.

Returns
deadline in seconds

Definition at line 709 of file QoSTransportSettings.cpp.

uint64_t madara::transport::QoSTransportSettings::get_drop_burst ( void  ) const

Returns the bursts of packet drops.

Returns
the consecutive bursts of dropped packets

Definition at line 669 of file QoSTransportSettings.cpp.

double madara::transport::QoSTransportSettings::get_drop_rate ( void  ) const

Returns the percentage of dropped packets to enforce on sends.

Returns
the percentage of dropped packets to enforce

Definition at line 657 of file QoSTransportSettings.cpp.

int madara::transport::QoSTransportSettings::get_drop_type ( void  ) const

Returns the policy type for packet drops.

Returns
the policy type for packet drops

Definition at line 663 of file QoSTransportSettings.cpp.

size_t madara::transport::QoSTransportSettings::get_number_of_buffer_filters ( void  ) const

Returns the number of buffer filters.

Returns
the number of buffer filters

Definition at line 639 of file QoSTransportSettings.cpp.

size_t madara::transport::QoSTransportSettings::get_number_of_rebroadcast_aggregate_filters ( void  ) const

Returns the number of aggregate filters applied before rebroadcasting @ return the number of aggregate filters.

Definition at line 617 of file QoSTransportSettings.cpp.

size_t madara::transport::QoSTransportSettings::get_number_of_rebroadcast_filtered_types ( void  ) const

Returns the number of types that are filtered before rebroadcast.

Returns
the number of types that have filters

Definition at line 610 of file QoSTransportSettings.cpp.

size_t madara::transport::QoSTransportSettings::get_number_of_receive_aggregate_filters ( void  ) const

Returns the number of aggregate filters applied after receiving @ return the number of aggregate filters.

Definition at line 632 of file QoSTransportSettings.cpp.

size_t madara::transport::QoSTransportSettings::get_number_of_receive_filtered_types ( void  ) const

Returns the number of types that are filtered after received.

Returns
the number of types that have filters

Definition at line 625 of file QoSTransportSettings.cpp.

size_t madara::transport::QoSTransportSettings::get_number_of_send_aggregate_filters ( void  ) const

Returns the number of aggregate filters applied before sending @ return the number of aggregate filters.

Definition at line 603 of file QoSTransportSettings.cpp.

size_t madara::transport::QoSTransportSettings::get_number_of_send_filtered_types ( void  ) const

Returns the number of types that are filtered before send.

Returns
the number of types that have filters

Definition at line 596 of file QoSTransportSettings.cpp.

unsigned char madara::transport::QoSTransportSettings::get_participant_ttl ( void  ) const

Returns the maximum time to live participation of this transport in rebroadcasting of other agent's messages.

Returns
the maximum number of ttls this transport will participate in (per message)

Definition at line 159 of file QoSTransportSettings.cpp.

void madara::transport::TransportSettings::get_read_domains ( std::vector< std::string > &  domains)
inlineinherited

Retrieves the list of read domains.

Parameters
domainsthe list to fill with all read domains

Definition at line 28 of file TransportSettings.inl.

unsigned char madara::transport::QoSTransportSettings::get_rebroadcast_ttl ( void  ) const

Gets the time to live for rebroadcasting (number of rebroadcasts per message).

Definition at line 146 of file QoSTransportSettings.cpp.

int64_t madara::transport::QoSTransportSettings::get_send_bandwidth_limit ( void  ) const

Returns the limit for sending on this transport in bytes per second.

Returns
the send bandwidth limiting in bytes per second

Definition at line 682 of file QoSTransportSettings.cpp.

int64_t madara::transport::QoSTransportSettings::get_total_bandwidth_limit ( void  ) const

Returns the total limit for this transport in bytes per second.

-1 means no limit.

Returns
the total bandwidth limit in bytes per second

Definition at line 696 of file QoSTransportSettings.cpp.

bool madara::transport::TransportSettings::is_reading_domain ( const std::string  domain) const
inlineinherited

Checks if a domain is in the domain read list.

Parameters
domaindomain to check
Returns
true if the domain exists in the read list

Definition at line 39 of file TransportSettings.inl.

bool madara::transport::QoSTransportSettings::is_trusted ( const std::string &  peer) const

Checks if a peer is trusted.

Parameters
peerpeer to check (generally ip:port)
Returns
true if peer is trusted, false otherwise

There are three conditions when a peer is trusted. The first is when the trusted_peers are everyone (empty set) and the peer does not exist in the banned list. The second is when trusted_peers contains the peer.

Definition at line 207 of file QoSTransportSettings.cpp.

void madara::transport::QoSTransportSettings::load ( const std::string &  filename,
const std::string &  prefix = "transport" 
)
virtual

Loads the settings from a file.

Parameters
filenamethe file to load from
prefixprefix for all transports settings

Reimplemented from madara::transport::TransportSettings.

Definition at line 715 of file QoSTransportSettings.cpp.

size_t madara::transport::TransportSettings::num_read_domains ( void  ) const
inlineinherited

Returns the number of read domains.

Returns
the number of domains in the read list

Definition at line 47 of file TransportSettings.inl.

void madara::transport::QoSTransportSettings::operator= ( const QoSTransportSettings settings)

Assignment operator.

Definition at line 85 of file QoSTransportSettings.cpp.

void madara::transport::QoSTransportSettings::operator= ( const TransportSettings settings)

Assignment operator.

Definition at line 113 of file QoSTransportSettings.cpp.

void madara::transport::QoSTransportSettings::print_num_filters_rebroadcast ( void  ) const

Prints the number of filters chained for each type to the rebroadcast filter.

Definition at line 587 of file QoSTransportSettings.cpp.

void madara::transport::QoSTransportSettings::print_num_filters_receive ( void  ) const

Prints the number of filters chained for each type to the receive filter.

Definition at line 580 of file QoSTransportSettings.cpp.

void madara::transport::QoSTransportSettings::print_num_filters_send ( void  ) const

Prints the number of filters chained for each type to the send filter.

Definition at line 573 of file QoSTransportSettings.cpp.

bool madara::transport::QoSTransportSettings::remove_banned_peer ( const std::string &  peer)

Removes a trusted peer, if it exists in the list.

Parameters
peerpeer to remove (generally ip:port)
Returns
true if peer existed, false if peer was not in list

Definition at line 194 of file QoSTransportSettings.cpp.

bool madara::transport::QoSTransportSettings::remove_trusted_peer ( const std::string &  peer)

Removes a trusted peer, if it exists in the list.

Parameters
peerpeer to remove (generally ip:port)
Returns
true if peer existed, false if peer was not in list

Definition at line 181 of file QoSTransportSettings.cpp.

void madara::transport::QoSTransportSettings::save ( const std::string &  filename,
const std::string &  prefix = "transport" 
) const
virtual

Saves the settings from a file.

Parameters
filenamethe file to load from
prefixprefix for all transports settings

Reimplemented from madara::transport::TransportSettings.

Definition at line 763 of file QoSTransportSettings.cpp.

void madara::transport::QoSTransportSettings::set_deadline ( double  deadline)

Sets the packet deadline in seconds.

Note that most transports only enforce deadline in seconds. However, future transports may allow for microsecond or millisecond deadlines, so we use a double here for expansion purposes. -1 means no deadline.

Parameters
deadlinedeadline in seconds

Definition at line 703 of file QoSTransportSettings.cpp.

void madara::transport::QoSTransportSettings::set_rebroadcast_ttl ( unsigned char  ttl)

Sets the time to live for our packets.

This number is decremented by one by each receiver. If time to live is greater than 0, the message will be rebroadcasted. Default is 0.

Parameters
ttltime-to-live for message sent over this transport

Definition at line 140 of file QoSTransportSettings.cpp.

void madara::transport::QoSTransportSettings::set_send_bandwidth_limit ( int64_t  bandwidth)

Sets a bandwidth limit for sending on this transport in bytes per sec.

Parameters
bandwidthsend bandwidth in bytes per second

Definition at line 675 of file QoSTransportSettings.cpp.

void madara::transport::QoSTransportSettings::set_total_bandwidth_limit ( int64_t  bandwidth)

Sets a bandwidth limit for receiving and sending over the transport.

-1 means no limit.

Parameters
bandwidthtotal bandwidth limit in bytes per second

Definition at line 689 of file QoSTransportSettings.cpp.

void madara::transport::QoSTransportSettings::update_drop_rate ( double  drop_rate,
int  drop_type = PACKET_DROP_DETERMINISTIC,
uint64_t  drop_burst = 1 
)

Updates a packet drop rate, type, and burst.

Parameters
drop_ratepercent drop rate for sending packets
drop_typetype of drop rate policy to use
See also
PacketDropTypes
Parameters
drop_burstnumber of packets to drop consecutively

Definition at line 646 of file QoSTransportSettings.cpp.

Member Data Documentation

std::map<std::string, int> madara::transport::QoSTransportSettings::banned_peers_
private

A container of all banned peers.

Definition at line 681 of file QoSTransportSettings.h.

filters::BufferFilters madara::transport::QoSTransportSettings::buffer_filters_
private

buffer filters have an encode and decode method

Definition at line 701 of file QoSTransportSettings.h.

uint32_t madara::transport::TransportSettings::deadline
inherited

Deadline for sessions with any other reasoning entity.

Definition at line 755 of file TransportSettings.h.

const uint32_t madara::transport::TransportSettings::DEFAULT_DEADLINE = 0
staticinherited

Default deadline.

Definition at line 111 of file TransportSettings.h.

const uint32_t madara::transport::TransportSettings::DEFAULT_QUEUE_LENGTH = 500000
staticinherited

Default queue length for event history (must be high for reliable transport.

Definition at line 108 of file TransportSettings.h.

const uint32_t madara::transport::TransportSettings::DEFAULT_RELIABILITY = RELIABLE
staticinherited

Default reliability.

Definition at line 117 of file TransportSettings.h.

const uint32_t madara::transport::TransportSettings::DEFAULT_TRANSPORT = NO_TRANSPORT
staticinherited

Default transport.

Definition at line 114 of file TransportSettings.h.

bool madara::transport::TransportSettings::delay_launch
inherited

delay launching transports

Definition at line 792 of file TransportSettings.h.

OriginatorFragmentMap madara::transport::TransportSettings::fragment_map
mutableinherited

map of fragments received by originator

Definition at line 801 of file TransportSettings.h.

uint32_t madara::transport::TransportSettings::fragment_queue_length
inherited

Indicates queue length for holding clock-keyed fragments.

Note that this does not limit the number of fragments–only how many clock values we want to queue for defragmentation. So, if you have a fragment_queue_length of 3, and your last three received fragmented clock values were 1=4GB, 2=4GB, 3=4GB, then you could have 12GB, regardless of max_fragment_size.

Definition at line 774 of file TransportSettings.h.

std::vector<std::string> madara::transport::TransportSettings::hosts
inherited

Host information for transports that require it.

The format of these is transport specific, but for UDP, you might have "localhost:1234" for a host named localhost and a port of 1234. See the specific transport for more information.

Definition at line 857 of file TransportSettings.h.

uint32_t madara::transport::TransportSettings::id
inherited

the id of this process.

May be useful for latency gathering or testing purposes

Definition at line 782 of file TransportSettings.h.

double madara::transport::QoSTransportSettings::latency_deadline_
private

Deadline for packets at which packets drop.

Definition at line 731 of file QoSTransportSettings.h.

uint32_t madara::transport::TransportSettings::max_fragment_size
inherited

Maximum allowed fragment size for partitioning large messages.

Definition at line 761 of file TransportSettings.h.

int64_t madara::transport::QoSTransportSettings::max_send_bandwidth_
private

Maximum send bandwidth usage per second before packets drop.

Definition at line 721 of file QoSTransportSettings.h.

int64_t madara::transport::QoSTransportSettings::max_total_bandwidth_
private

Maximum bandwidth usage for the transport (receive/send) before drop.

Definition at line 726 of file QoSTransportSettings.h.

bool madara::transport::TransportSettings::never_exit
inherited

prevent MADARA from exiting on fatal errors and invalid state

Definition at line 795 of file TransportSettings.h.

bool madara::transport::TransportSettings::no_receiving
inherited

if true, never receive over transport

Definition at line 867 of file TransportSettings.h.

bool madara::transport::TransportSettings::no_sending
inherited

if true, never send over transport

Definition at line 862 of file TransportSettings.h.

std::string madara::transport::TransportSettings::on_data_received_logic
inherited

logic to be evaluated after every successful update

Definition at line 789 of file TransportSettings.h.

uint64_t madara::transport::QoSTransportSettings::packet_drop_burst_
private

Burst of packet drops.

Definition at line 716 of file QoSTransportSettings.h.

double madara::transport::QoSTransportSettings::packet_drop_rate_
private

Rate for dropping packets.

Definition at line 706 of file QoSTransportSettings.h.

int madara::transport::QoSTransportSettings::packet_drop_type_
private

Drop rate type.

Definition at line 711 of file QoSTransportSettings.h.

unsigned char madara::transport::QoSTransportSettings::participant_rebroadcast_ttl_
private

This field is meant to limit the number of rebroadcasts that this transport will participate in.

If a ttl > 0 is received on a message header, the new ttl for rebroadcasts will be set to the minimum of this field and the decrement of the ttl of the message. A zero here means the transport will not participate in rebroadcasts

Definition at line 671 of file QoSTransportSettings.h.

uint32_t madara::transport::TransportSettings::processes
inherited

number of processes expected in the network (best to overestimate if building latency tables

Definition at line 786 of file TransportSettings.h.

uint32_t madara::transport::TransportSettings::queue_length
inherited

Length of the buffer used to store history of events.

Definition at line 752 of file TransportSettings.h.

double madara::transport::TransportSettings::read_thread_hertz
inherited

number of valid messages allowed to be received per second.

This value can be -1 or 0.0 to go as fast as possible

Definition at line 810 of file TransportSettings.h.

uint32_t madara::transport::TransportSettings::read_threads
inherited

the number of read threads to start

Definition at line 749 of file TransportSettings.h.

knowledge::KnowledgeRecordFilters madara::transport::QoSTransportSettings::rebroadcast_filters_
private

A container for rebroadcast filters.

Definition at line 686 of file QoSTransportSettings.h.

unsigned char madara::transport::QoSTransportSettings::rebroadcast_ttl_
private

number of rebroadcasts for receivers to ultimately do.

This field is experimental and is meant to allow for rebroadcasting messages across a number of loosely connected agents or amongst a routing network. For instance, if A is connected to B and B is connected to C, and A would like to have its update known to C, then a rebroadcast_ttl of 1 would instruct B to rebroadcast updates with a ttl of (rebroadcast_ttl - 1), resulting in 0 ttl when received by C (it will not rebroadcast).

Definition at line 662 of file QoSTransportSettings.h.

knowledge::KnowledgeRecordFilters madara::transport::QoSTransportSettings::receive_filters_
private

A container for receive filters.

Definition at line 691 of file QoSTransportSettings.h.

uint32_t madara::transport::TransportSettings::reliability
inherited

Reliability required of the transport.

See madara::transport::Reliabilities for options

Definition at line 778 of file TransportSettings.h.

int madara::transport::TransportSettings::resend_attempts
inherited

Maximum number of attempts to resend if transport is busy.

Definition at line 764 of file TransportSettings.h.

knowledge::KnowledgeRecordFilters madara::transport::QoSTransportSettings::send_filters_
private

A container for filters applied before sending from this host.

Definition at line 696 of file QoSTransportSettings.h.

bool madara::transport::TransportSettings::send_reduced_message_header
inherited

send the reduced message header (clock, size, updates, KaRL id)

Definition at line 798 of file TransportSettings.h.

double madara::transport::TransportSettings::slack_time
inherited

time to sleep between sends and rebroadcasts

Definition at line 804 of file TransportSettings.h.

std::map<std::string, int> madara::transport::QoSTransportSettings::trusted_peers_
private

A container of all trusted peers.

Definition at line 676 of file QoSTransportSettings.h.

uint32_t madara::transport::TransportSettings::type
inherited

Type of transport. See madara::transport::Types for options.

Definition at line 758 of file TransportSettings.h.

std::string madara::transport::TransportSettings::write_domain
inherited

All class members are accessible to users for easy setup.

We only write to one domain

Definition at line 746 of file TransportSettings.h.


The documentation for this class was generated from the following files: