#include <Mac80211.h>
Inherits BasicLayer.
Inheritance diagram for Mac80211:
Public Member Functions | |
Module_Class_Members (Mac80211, BasicLayer, 0) | |
virtual void | initialize (int) |
Initialization of the module and some variables. | |
virtual void | finish () |
Protected Types | |
typedef std::list< Mac80211Pkt * > | MacPktList |
typedef std::list< NeighborEntry > | NeighborList |
enum | timerType { TIMEOUT, NAV, CONTENTION, END_SIFS } |
enum | State { WFDATA = 0, QUIET = 1, IDLE = 2, CONTEND = 3, WFCTS = 4, WFACK = 5, BUSY = 6 } |
Protected Member Functions | |
virtual void | receiveBBItem (int category, const BBItem *details, int scopeModuleId) |
Called by the Blackboard whenever a change occurs we're interested in. | |
virtual void | handleSelfMsg (cMessage *) |
Handle self messages such as timer... | |
virtual void | handleUpperMsg (cMessage *) |
Handle messages from upper layer. | |
virtual void | handleLowerMsg (cMessage *) |
Handle messages from lower layer. | |
virtual void | handleLowerControl (cMessage *) |
Handle messages from lower layer. | |
virtual void | handleEndContentionTimer () |
handle end of contention | |
void | handleMsgNotForMe (cMessage *af, double duration) |
handle a message that is not for me or errornous | |
void | handleMsgForMe (Mac80211Pkt *) |
handle a message that was meant for me | |
void | handleBroadcastMsg (Mac80211Pkt *) |
void | handleEndTransmission () |
handle the end of a transmission... | |
void | handleEndSifsTimer () |
handle end of SIFS | |
void | handleTimeoutTimer () |
handle time out | |
void | handleNavTimer () |
NAV timer expired, the exchange of messages of other stations is done. | |
void | handleRTSframe (Mac80211Pkt *) |
void | handleDATAframe (Mac80211Pkt *) |
void | handleACKframe (Mac80211Pkt *) |
void | handleCTSframe (Mac80211Pkt *) |
virtual void | sendDATAframe (Mac80211Pkt *) |
send data frame | |
void | sendACKframe (Mac80211Pkt *) |
send Acknoledgement | |
void | sendCTSframe (Mac80211Pkt *) |
send CTS frame | |
virtual void | sendRTSframe () |
send RTS frame | |
void | sendBROADCASTframe () |
send broadcast frame | |
Mac80211Pkt * | encapsMsg (cMessage *netw) |
encapsulate packet | |
cMessage * | decapsMsg (Mac80211Pkt *frame) |
decapsulate packet | |
virtual void | beginNewCycle () |
start a new contention period | |
double | backoff () |
Compute a backoff value. | |
int | contentionWindow () |
Compute a new contention window. | |
void | testMaxAttempts () |
Test if maximum number of retries to transmit is exceeded. | |
double | timeOut (frameType_802_11 type, double br) |
return a timeOut value for a certain type of frame | |
double | packetDuration (double bits, double br) |
computes the duration of a transmission over the physical channel, given a certain bitrate | |
const char * | stateName (State state) |
Produce a readable name of the given state. | |
void | setState (State state) |
Sets the state, and produces a log message in between. | |
bool | rtsCts (Mac80211Pkt *m) |
Check whether the next packet should be send with RTS/CTS. | |
void | suspendContention () |
suspend an ongoing contention, pick it up again when the channel becomes idle | |
double | retrieveBitrate (int destAddress) |
figure out at which bitrate to send to this particular destination | |
void | addNeighbor (Mac80211Pkt *af) |
add a new entry to the neighbor list | |
NeighborList::iterator | findNeighbor (int id) |
find a neighbor based on his address | |
NeighborList::iterator | findOldestNeighbor () |
find the oldest neighbor -- usually in order to overwrite this entry | |
Protected Attributes | |
int | myMacAddr |
MAC address (simply module id). | |
cMessage * | timeout |
Timer used for time-outs after the transmission of a RTS, a CTS, or a DATA packet. | |
cMessage * | nav |
Timer used for the defer time of a node. Also called NAV : networks allocation vector. | |
cMessage * | contention |
Timer used for contention periods. | |
cMessage * | endSifs |
Timer used to indicate the end of a SIFS. | |
State | state |
Current state of the MAC. | |
RadioState::States | radioState |
Current state of active channel (radio), set using radio, updated via BB. | |
int | catRadioState |
category number given by bb for RadioState | |
MediumIndication::States | medium |
last medium state | |
int | catMedium |
category number given by bb for RSSI | |
double | defaultBitrate |
Default bitrate. | |
double | bitrate |
Current bit rate at which data is transmitted. | |
int | catBitrate |
and category number | |
bool | autoBitrate |
Auto bit rate adaptation -- switch. | |
std::vector< double > | snrThresholds |
Hold RSSI thresholds at which to change the bitrates. | |
SingleChannelRadio * | radio |
cached pointer to radio module | |
unsigned | queueLength |
Maximal number of packets in the queue; should be set in the omnetpp.ini. | |
bool | nextIsBroadcast |
Boolean used to know if the next packet is a broadcast packet. | |
MacPktList | fromUpperLayer |
Buffering of messages from upper layer. | |
unsigned | longRetryCounter |
Number of frame transmission attempt. | |
unsigned | shortRetryCounter |
Number of frame transmission attempt. | |
simtime_t | remainingBackoff |
remaining backoff time. If the backoff timer is interrupted, this variable holds the remaining backoff time. | |
int | rtsCtsThreshold |
Number of bits in a packet before RTS/CTS is used. | |
double | delta |
Very small value used in timer scheduling in order to avoid multiple changements of state in the same simulation time. | |
unsigned | neighborhoodCacheSize |
Keep information for this many neighbors. | |
simtime_t | neighborhoodCacheMaxAge |
Consider information in cache outdate if it is older than this. | |
NeighborList | neighbors |
bool | switching |
int | fsc |
Classes | |
struct | NeighborEntry |
For more info, see the NED file.
|
Definition of the states |
|
Definition of the timer types |
|
Compute a backoff value. Compute the backoff value. |
|
start a new contention period Start a new contention period if the channel is free and if there's a packet to send. Called at the end of a deferring period, a busy period, or after a failure. Called by the HandleMsgForMe(), HandleTimer() HandleUpperMsg(), and, without RTS/CTS, by handleMsgNotForMe(). |
|
Compute a new contention window. Compute the contention window with the binary backoff algorithm. |
|
encapsulate packet Encapsulates the received network-layer packet into a MacPkt and set all needed header fields. |
|
Handle ACK and delete corresponding packet from queue |
|
Handle a broadcast packet. This packet is simply passed to the upper layer. No acknowledgement is needed. Called by handleLowerMsg(Mac80211Pkt *af) |
|
Handle a CTS frame. Called by HandleMsgForMe(Mac80211Pkt* af) |
|
Handle a frame which expected to be a DATA frame. Called by HandleMsgForMe() |
|
handle end of contention The node has won the contention, and is now allowed to send an RTS/DATA or Broadcast packet. The backoff value is deleted and will be newly computed in the next contention period |
|
handle end of SIFS Handle the end sifs timer. Then sends a CTS, a DATA, or an ACK frame |
|
handle the end of a transmission... Handle the end of transmission timer (end of the transmission of an ACK or a broadcast packet). Called by HandleTimer(cMessage* msg) |
|
Handle messages from lower layer. Handle all messages from lower layer. Checks the destination MAC adress of the packet. Then calls one of the three functions : handleMsgNotForMe(), handleBroadcastMsg(), or handleMsgForMe(). Called by handleMessage(). Implements BasicLayer. |
|
handle a message that was meant for me Handle a packet for the node. The result of this reception is a function of the type of the received message (RTS,CTS,DATA, or ACK), and of the current state of the MAC (WFDATA, CONTEND, IDLE, WFCTS, or WFACK). Called by handleLowerMsg() |
|
handle a message that is not for me or errornous Handle all ACKs,RTS, CTS, or DATA not for the node. If RTS/CTS is used the node must stay quiet until the current handshake between the two communicating nodes is over. This is done by scheduling the timer message nav (Network Allocation Vector). Without RTS/CTS a new contention is started. If an error occured the node must defer for EIFS. Called by handleLowerMsg() |
|
NAV timer expired, the exchange of messages of other stations is done. Handle the NAV timer (end of a defering period). Called by HandleTimer(cMessage* msg) |
|
Handle aframe wich is expected to be an RTS. Called by HandleMsgForMe() |
|
Handle self messages such as timer... handle timers Implements BasicLayer. |
|
handle time out Handle the time out timer. Called by handleTimer(cMessage* msg) |
|
Handle messages from upper layer. This implementation does not support fragmentation, so it is tested if the maximum length of the MPDU is exceeded. Implements BasicLayer. |
|
Initialization of the module and some variables. First we have to initialize the module from which we derived ours, in this case BasicModule. This module takes care of the gate initialization. Reimplemented from BasicLayer. |
|
computes the duration of a transmission over the physical channel, given a certain bitrate Computes the duration of the transmission of a frame over the physical channel. 'bits' should be the total length of the MAC packet in bits. |
|
Called by the Blackboard whenever a change occurs we're interested in. Handle change nofitications. In this layer it is usually information about the radio channel, i.e. if it is IDLE etc. Reimplemented from BasicModule. |
|
send Acknoledgement Send an ACK frame.Called by HandleEndSifsTimer() |
|
send broadcast frame Send a BROADCAST frame.Called by handleContentionTimer() |
|
send CTS frame Send a CTS frame.Called by HandleEndSifsTimer() |
|
send data frame Send a DATA frame. Called by HandleEndSifsTimer() or handleEndContentionTimer() |
|
send RTS frame Send a RTS frame.Called by handleContentionTimer() |
|
Test if maximum number of retries to transmit is exceeded. Test if the maximal retry limit is reached, and delete the frame to send in this case. |
|
return a timeOut value for a certain type of frame Return a time-out value for a type of frame. Called by SendRTSframe, sendCTSframe, etc. |
|
Default bitrate. The default bitrate must be set in the omnetpp.ini. It is used whenever an auto bitrate is not appropriate, like broadcasts. |
|
sequence control -- to detect duplicates |
|
Number of frame transmission attempt. Incremented when the SHORT_RETRY_LIMIT is hit, or when an ACK or CTS is missing. |
|
take care of switchover times |