shawn::CsmaTransmissionModel Class Reference

A CsmaTransmissionmodel senses the channel before it delivers a message. This class implements the CSMA/CA transmission model. A processor waits for the medium to be free before sending. If a neighbor is already sending, the new message will be delayed until the end of the transmission plus a backoff time In this implementation one can define parameters for the mediums bandwidth and the upper bound for the randomy chosen backoff This module can be called by: transm_model=csma bandwidth=1 backoff=0.5. More...

#include <csma_transmission_model.h>

Inheritance diagram for shawn::CsmaTransmissionModel:

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

Collaboration graph
[legend]

List of all members.

Public Member Functions

virtual void deliver_messages () throw ()
 Delivers all messages which are in the vector Method inherited from shawn::TransmissionModel. Is not implemented in this module since the messages are added to the shawn::EventScheduler and do not have to be delivered at the beginning of a round.
construction, destruction and support for life cycle
 CsmaTransmissionModel (int bandwidth, double backoff, double sending_jitter)
 ~CsmaTransmissionModel ()
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.
basic method inherited from EventHandler
virtual void CsmaTransmissionModel::timeout (EventScheduler &event_scheduler, EventScheduler::EventHandle event_handle, double time, EventScheduler::EventTagHandle &event_tag_handle) throw ()
Delivers a message.
void deliver (csma_msg *msg) throw ()


Detailed Description

A CsmaTransmissionmodel senses the channel before it delivers a message. This class implements the CSMA/CA transmission model. A processor waits for the medium to be free before sending. If a neighbor is already sending, the new message will be delayed until the end of the transmission plus a backoff time In this implementation one can define parameters for the mediums bandwidth and the upper bound for the randomy chosen backoff This module can be called by: transm_model=csma bandwidth=1 backoff=0.5.

Constructor & Destructor Documentation

shawn::CsmaTransmissionModel::CsmaTransmissionModel ( int  bandwidth,
double  backoff,
double  sending_jitter 
)

shawn::CsmaTransmissionModel::~CsmaTransmissionModel (  ) 


Member Function Documentation

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

Initialize the csma transmission model.

Gets the list of neighbors

Reimplemented from shawn::TransmissionModel.

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

Reset the csma transmission model.

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

Reimplemented from shawn::TransmissionModel.

virtual bool shawn::CsmaTransmissionModel::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::CsmaTransmissionModel::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_

See also:
aired_messages_

Implements shawn::TransmissionModel.

virtual void shawn::CsmaTransmissionModel::CsmaTransmissionModel::timeout ( EventScheduler event_scheduler,
EventScheduler::EventHandle  event_handle,
double  time,
EventScheduler::EventTagHandle &  event_tag_handle 
) throw () [virtual]

Timeout Event. Receives a csma_msg as a EventScheduler::EventTagHandle. If message has not been sent yet, deliver() will be called. Otherwise message has been transfered and will be deleted from sending processor's MessageList

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

Delivers all messages which are in the vector Method inherited from shawn::TransmissionModel. Is not implemented in this module since the messages are added to the shawn::EventScheduler and do not have to be delivered at the beginning of a round.

Implements shawn::TransmissionModel.

void shawn::CsmaTransmissionModel::deliver ( csma_msg msg  )  throw ()

This method implements the CSMA/CA algorithm. The processor listens if a neighbor is sending. If no neighbor is sending, it will deliver its message, otherwise it will delay the message to the end of the transmission plus a random backoff.

Parameters:
msg Pointer to the message to be send


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

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