#include <AlohaMacLayer.h>
Inherits BasicMacLayer.
Inheritance diagram for AlohaMacLayer:
Public Member Functions | |
Module_Class_Members (AlohaMacLayer, BasicMacLayer, 0) | |
virtual void | initialize (int) |
Initialization of the module and some variables. | |
virtual void | finish () |
Delete all dynamically allocated objects of the module. | |
virtual void | handleUpperMsg (cMessage *) |
Handle messages from upper layer. | |
virtual void | handleSelfMsg (cMessage *) |
Handle self messages such as timers. | |
virtual void | handleLowerControl (cMessage *msg) |
Handle control messages from lower layer. | |
virtual void | receiveBBItem (int category, const BBItem *details, int scopeModuleId) |
Called by the Blackboard whenever a change occurs we're interested in. | |
Protected Types | |
typedef std::list< MacPkt * > | MacQueue |
enum | States { RX, TX } |
MAC states. More... | |
Protected Member Functions | |
void | prepareSend () |
Prepare sending of a packet (switch the radio). | |
Protected Attributes | |
States | macState |
kepp track of MAC state | |
RadioState::States | radioState |
Current state of active channel (radio), set using radio, updated via BB. | |
int | catRadioState |
category number given by bb for RadioState | |
SingleChannelRadio * | radio |
cached pointer to radio module | |
MacQueue | macQueue |
A queue to store packets from upper layer in case another packet is still waiting for transmission.. | |
unsigned int | queueLength |
length of the queue |
This is an implementation of a pure Aloha (not slottes). The idea of Aloha is to send a packet whenever a packet is ready to be sent.
If a packet from the upper layer arrives although there is still another packet waiting for its transmission or being transmitted the new packet is stored in a queue. The length of this queue can be specified by the user in the omnetpp.ini file. By default the length is 10. The minimum queue length is 1. If the queue is full new packet(s) will be deleted.
|
MAC states. The MAC states help to keep track what the MAC is actually trying to do -- this is esp. useful when radio switching takes some time. RX -- MAC accepts packets from PHY layer TX -- MAC transmits a packet |
|
Handle self messages such as timers. After the timer expires try to retransmit the message by calling handleUpperMsg again. Implements BasicLayer. |
|
Called by the Blackboard whenever a change occurs we're interested in. Update the internal copies of interesting BB variables Reimplemented from BasicModule. |