#include <zigbee_csma_transmission_model.h>


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... | |
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.
| shawn::ZigbeeCsmaTransmissionModel::ZigbeeCsmaTransmissionModel | ( | ) |
| shawn::ZigbeeCsmaTransmissionModel::~ZigbeeCsmaTransmissionModel | ( | ) |
| 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_
| mi | The received message |
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_
Implements shawn::TransmissionModel.
| void shawn::ZigbeeCsmaTransmissionModel::random_backoff | ( | csma_msg * | msg | ) | throw () [protected] |
This method produces a random backoff time for the given message.
| 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.
| slot | the slot time | |
| deliver_time | the time whose backoff boundary to be computed |
| 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.
| round | the concerning simulation round | |
| cur_round_msg | the vector that holds the messages which will be delivered at this round |
| 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.
| round | the concerning simulation round | |
| cur_round_msg | the vector that holds the messages which will be delivered at this round |
| bool shawn::ZigbeeCsmaTransmissionModel::need_delay | ( | csma_msg * | new_msg, | |
| csma_msg * | msg | |||
| ) | throw () [protected] |
See if new_msg will interfere with msg.
| bool shawn::ZigbeeCsmaTransmissionModel::deliver_one_message | ( | csma_msg * | msg | ) | throw () [protected] |
Deliver one message.
| 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
| 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.
int shawn::ZigbeeCsmaTransmissionModel::received_ [protected] |
Number of received messages.
int shawn::ZigbeeCsmaTransmissionModel::dropped_ [protected] |
Number of messages dropped.
int shawn::ZigbeeCsmaTransmissionModel::deliver_num_ [protected] |
Number of messages delivered so far.
double shawn::ZigbeeCsmaTransmissionModel::last_delay_ [protected] |
The delay of last message.
int shawn::ZigbeeCsmaTransmissionModel::packet_failure_ [protected] |
double shawn::ZigbeeCsmaTransmissionModel::average_delay_ [protected] |
Number of packets failed to reach the destination.
double shawn::ZigbeeCsmaTransmissionModel::jitter_ [protected] |
The average variation of delay.
int shawn::ZigbeeCsmaTransmissionModel::max_backoff_num_ [protected] |
The maximum value of the number of backoff before a message failure.
int shawn::ZigbeeCsmaTransmissionModel::min_backoff_exponent_ [protected] |
The minimum value of backoff exponent, a backoff period is random(pow(2,exponent))*backoff_period.
int shawn::ZigbeeCsmaTransmissionModel::max_backoff_exponent_ [protected] |
The maximum value of backoff exponent.
double shawn::ZigbeeCsmaTransmissionModel::backoff_period_ [protected] |
The duration of one backoff period.
double shawn::ZigbeeCsmaTransmissionModel::slot_ [protected] |
The time slot which should be set a positive value in a slotted CSMA context.
int shawn::ZigbeeCsmaTransmissionModel::contention_window_ [protected] |
The length of the contention window.
std::vector<csma_msg*> shawn::ZigbeeCsmaTransmissionModel::aired_messages_ [protected] |
The messages that have been sent by the nodes and are waiting for delivery.
1.5.6