shawn::ZigbeeCsmaTransmissionModel Class Reference

A ZigbeeCsmaTransmissionmodel is a CSMA transmission model. More...

#include <zigbee_csma_transmission_model.h>

Inheritance diagram for shawn::ZigbeeCsmaTransmissionModel:

Inheritance graph
[legend]
Collaboration diagram for shawn::ZigbeeCsmaTransmissionModel:

Collaboration graph
[legend]

List of all members.

Public Member Functions

construction, destruction and support for life cycle
 ZigbeeCsmaTransmissionModel ()
 ~ZigbeeCsmaTransmissionModel ()
virtual void init () throw ()
 Initialize the csma transmission model.
virtual void reset () throw ()
 Reset the csma transmission model.
Transmission Model Implementation
virtual bool supports_mobility (void) const throw (std::logic_error)
 Mobility is depending on mobility support from the edge model.
virtual void send_message (MessageInfo &mi) throw ()
 Stores each message in a vector for delivery at the next simulation round start.
virtual void deliver_messages () throw ()
 Delivers all messages which are in the vector.

Protected Member Functions

void random_backoff (csma_msg *msg) throw ()
 This method produces a random backoff time for the given message.
double get_backoff_boundary (double slot, double deliver_time)
 This method decide the backoff boundary of the deliver_time.
void arrange_one_round_unslotted (int round, std::vector< csma_msg * > &cur_round_msg) throw ()
 This method is used in unslotted context to move the messages which should be delivered at this round from aired_messages_ to cur_round_msg.
void arrange_one_round_slotted (int round, std::vector< csma_msg * > &cur_round_msg) throw ()
 This method is used in slotted context to move the messages which should be delivered at this round from aired_messages_ to cur_round_msg.
bool need_delay (csma_msg *new_msg, csma_msg *msg) throw ()
 See if new_msg will interfere with msg.
bool deliver_one_message (csma_msg *msg) throw ()
 Deliver one message.
void find_destinations (csma_msg *pmsg)
 Find the neighbors of the node who send a message.
bool remove_collided_destinations (csma_msg *msg1, csma_msg *msg2) throw ()
 Set the valid_ tags of destinations where messages collide to be false.

Protected Attributes

int received_
 Number of received messages.
int dropped_
 Number of messages dropped.
int deliver_num_
 Number of messages delivered so far.
double last_delay_
 The delay of last message.
int packet_failure_
double average_delay_
 Number of packets failed to reach the destination.
double jitter_
 The average variation of delay.
int max_backoff_num_
 The maximum value of the number of backoff before a message failure.
int min_backoff_exponent_
 The minimum value of backoff exponent, a backoff period is random(pow(2,exponent))*backoff_period.
int max_backoff_exponent_
 The maximum value of backoff exponent.
double backoff_period_
 The duration of one backoff period.
double slot_
 The time slot which should be set a positive value in a slotted CSMA context.
int contention_window_
 The length of the contention window.
std::vector< csma_msg * > aired_messages_
 The messages that have been sent by the nodes and are waiting for delivery.

Classes

struct  csma_msg
 Message structure used in csma transmission model. More...
struct  later_than
struct  msg_pre
struct  same_round
 Unary function to determine if two messages are of the same simulation round. More...


Detailed Description

A ZigbeeCsmaTransmissionmodel is a CSMA transmission model.

It involves the initial backoff, congestion backoff and contention window. Its configuration includes max_backoff_num, min_backoff_exponent and max_backoff_exponent, backoff_period. For slotted CSMA, slot and contention_window can also be set through parameters.


Constructor & Destructor Documentation

shawn::ZigbeeCsmaTransmissionModel::ZigbeeCsmaTransmissionModel (  ) 

shawn::ZigbeeCsmaTransmissionModel::~ZigbeeCsmaTransmissionModel (  ) 


Member Function Documentation

virtual void shawn::ZigbeeCsmaTransmissionModel::init (  )  throw () [virtual]

Initialize the csma transmission model.

Get the configuration of parameters.

Reimplemented from shawn::TransmissionModel.

virtual void shawn::ZigbeeCsmaTransmissionModel::reset (  )  throw () [virtual]

Reset the csma transmission model.

Clear the statistic vriables and set the parameters to its default value.

Reimplemented from shawn::TransmissionModel.

virtual bool shawn::ZigbeeCsmaTransmissionModel::supports_mobility ( void   )  const throw (std::logic_error) [virtual]

Mobility is depending on mobility support from the edge model.

The edge model is used to determine the 1-hop neighbours which will receive the message

Implements shawn::TransmissionModel.

virtual void shawn::ZigbeeCsmaTransmissionModel::send_message ( MessageInfo mi  )  throw () [virtual]

Stores each message in a vector for delivery at the next simulation round start.

A new structure of csma_msg will be build and inserted into aired_messages_

Parameters:
mi The received message
See also:
aired_messages_

Implements shawn::TransmissionModel.

virtual void shawn::ZigbeeCsmaTransmissionModel::deliver_messages (  )  throw () [virtual]

Delivers all messages which are in the vector.

The delivery sequence of messages is arranged here, then call deliver_one_message( csma_msg* msg ) for each element in aired_messages_

See also:
aired_messages_

Implements shawn::TransmissionModel.

void shawn::ZigbeeCsmaTransmissionModel::random_backoff ( csma_msg msg  )  throw () [protected]

This method produces a random backoff time for the given message.

Parameters:
msg the message that will be given a backoff time

double shawn::ZigbeeCsmaTransmissionModel::get_backoff_boundary ( double  slot,
double  deliver_time 
) [protected]

This method decide the backoff boundary of the deliver_time.

Parameters:
slot the slot time
deliver_time the time whose backoff boundary to be computed
Returns:
the time of the backoff boundary

void shawn::ZigbeeCsmaTransmissionModel::arrange_one_round_unslotted ( int  round,
std::vector< csma_msg * > &  cur_round_msg 
) throw () [protected]

This method is used in unslotted context to move the messages which should be delivered at this round from aired_messages_ to cur_round_msg.

Parameters:
round the concerning simulation round
cur_round_msg the vector that holds the messages which will be delivered at this round
See also:
aired_messages_

void shawn::ZigbeeCsmaTransmissionModel::arrange_one_round_slotted ( int  round,
std::vector< csma_msg * > &  cur_round_msg 
) throw () [protected]

This method is used in slotted context to move the messages which should be delivered at this round from aired_messages_ to cur_round_msg.

Parameters:
round the concerning simulation round
cur_round_msg the vector that holds the messages which will be delivered at this round
See also:
aired_messages_

bool shawn::ZigbeeCsmaTransmissionModel::need_delay ( csma_msg new_msg,
csma_msg msg 
) throw () [protected]

See if new_msg will interfere with msg.

Returns:
true if new_msg need delay

bool shawn::ZigbeeCsmaTransmissionModel::deliver_one_message ( csma_msg msg  )  throw () [protected]

Deliver one message.

Returns:
true if delivery succeed, false if the message is dropped

void shawn::ZigbeeCsmaTransmissionModel::find_destinations ( csma_msg pmsg  )  [protected]

Find the neighbors of the node who send a message.

Find all the destinations of a new-coming messages, which are the neighbours of its source node

Parameters:
pmsg the message whose source node's neighbours to be determined

bool shawn::ZigbeeCsmaTransmissionModel::remove_collided_destinations ( csma_msg msg1,
csma_msg msg2 
) throw () [protected]

Set the valid_ tags of destinations where messages collide to be false.

Returns:
true if any valid_ tag is set false


Member Data Documentation

Number of received messages.

Number of messages dropped.

Number of messages delivered so far.

The delay of last message.

Number of packets failed to reach the destination.

The average variation of delay.

The maximum value of the number of backoff before a message failure.

The minimum value of backoff exponent, a backoff period is random(pow(2,exponent))*backoff_period.

The maximum value of backoff exponent.

The duration of one backoff period.

The time slot which should be set a positive value in a slotted CSMA context.

The length of the contention window.

The messages that have been sent by the nodes and are waiting for delivery.


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

Generated on Tue Feb 7 00:01:36 2012 for Shawn by  doxygen 1.5.6