INET Framework for OMNeT++/OMNEST
|
#include <CsmaCaMac.h>
Public Member Functions | |
Construction functions | |
virtual | ~CsmaCaMac () |
Public Member Functions inherited from inet::OperationalBase | |
OperationalBase () | |
Public Member Functions inherited from inet::ILifecycle | |
virtual | ~ILifecycle () |
Protected Member Functions | |
Initialization functions | |
virtual void | initialize (int stage) override |
Initialization of the module and its variables. More... | |
virtual void | initializeQueueModule () |
virtual void | finish () override |
virtual InterfaceEntry * | createInterfaceEntry () override |
Message handing functions | |
Functions called from other classes to notify about state changes and to handle messages. | |
virtual void | handleSelfMessage (cMessage *msg) override |
virtual void | handleUpperPacket (cPacket *msg) override |
virtual void | handleLowerPacket (cPacket *msg) override |
virtual void | handleWithFsm (cMessage *msg) |
virtual void | receiveSignal (cComponent *source, simsignal_t signalID, long value, cObject *details) override |
virtual CsmaCaMacDataFrame * | encapsulate (cPacket *msg) |
virtual cPacket * | decapsulate (CsmaCaMacDataFrame *frame) |
Timer functions | |
These functions have the side effect of starting the corresponding timers. | |
virtual void | scheduleSifsTimer (CsmaCaMacFrame *frame) |
virtual void | scheduleDifsTimer () |
virtual void | cancelDifsTimer () |
virtual void | scheduleAckTimeout (CsmaCaMacDataFrame *frame) |
virtual void | cancelAckTimer () |
virtual void | invalidateBackoffPeriod () |
virtual bool | isInvalidBackoffPeriod () |
virtual void | generateBackoffPeriod () |
virtual void | decreaseBackoffPeriod () |
virtual void | scheduleBackoffTimer () |
virtual void | cancelBackoffTimer () |
Frame transmission functions | |
virtual void | sendDataFrame (CsmaCaMacDataFrame *frameToSend) |
virtual void | sendAckFrame () |
Utility functions | |
virtual void | finishCurrentTransmission () |
virtual void | giveUpCurrentTransmission () |
virtual void | retryCurrentTransmission () |
virtual CsmaCaMacDataFrame * | getCurrentTransmission () |
virtual void | popTransmissionQueue () |
virtual void | resetStateVariables () |
virtual bool | isMediumFree () |
virtual bool | isReceiving () |
virtual bool | isAck (CsmaCaMacFrame *frame) |
virtual bool | isBroadcast (CsmaCaMacFrame *msg) |
virtual bool | isForUs (CsmaCaMacFrame *msg) |
Protected Member Functions inherited from inet::MACProtocolBase | |
MACProtocolBase () | |
virtual void | registerInterface () |
virtual void | sendUp (cMessage *message) |
virtual void | sendDown (cMessage *message) |
virtual bool | isUpperMessage (cMessage *message) override |
virtual bool | isLowerMessage (cMessage *message) override |
virtual bool | isInitializeStage (int stage) override |
virtual bool | isNodeStartStage (int stage) override |
virtual bool | isNodeShutdownStage (int stage) override |
Protected Member Functions inherited from inet::LayeredProtocolBase | |
virtual void | handleMessageWhenUp (cMessage *message) override |
virtual void | handleUpperCommand (cMessage *message) |
virtual void | handleLowerCommand (cMessage *message) |
Protected Member Functions inherited from inet::OperationalBase | |
virtual int | numInitStages () const override |
virtual void | handleMessage (cMessage *msg) override |
virtual void | handleMessageWhenDown (cMessage *msg) |
virtual bool | handleOperationStage (LifecycleOperation *operation, int stage, IDoneCallback *doneCallback) override |
Perform one stage of a lifecycle operation. More... | |
virtual bool | handleNodeStart (IDoneCallback *doneCallback) |
virtual bool | handleNodeShutdown (IDoneCallback *doneCallback) |
virtual void | handleNodeCrash () |
virtual void | setOperational (bool isOperational) |
Protected Attributes | |
Configuration parameters | |
MACAddress | address |
bool | useAck = true |
double | bitrate = NaN |
int | headerLength = -1 |
int | ackLength = -1 |
simtime_t | ackTimeout = -1 |
simtime_t | slotTime = -1 |
simtime_t | sifsTime = -1 |
simtime_t | difsTime = -1 |
int | maxQueueSize = -1 |
int | retryLimit = -1 |
int | cwMin = -1 |
int | cwMax = -1 |
int | cwMulticast = -1 |
Timer messages | |
cMessage * | endSifs = nullptr |
End of the Short Inter-Frame Time period. More... | |
cMessage * | endDifs = nullptr |
End of the Data Inter-Frame Time period. More... | |
cMessage * | endBackoff = nullptr |
End of the backoff period. More... | |
cMessage * | endAckTimeout = nullptr |
End of the ack timeout. More... | |
cMessage * | endData = nullptr |
Timeout after the transmission of a Data frame. More... | |
cMessage * | mediumStateChange = nullptr |
Radio state change self message. More... | |
Statistics | |
long | numRetry |
long | numSentWithoutRetry |
long | numGivenUp |
long | numCollision |
long | numSent |
long | numReceived |
long | numSentBroadcast |
long | numReceivedBroadcast |
Protected Attributes inherited from inet::OperationalBase | |
bool | isOperational |
simtime_t | lastChange |
CsmaCaMac state variables | |
Various state information checked and modified according to the state machine. | |
enum | State { IDLE, DEFER, WAITDIFS, BACKOFF, TRANSMIT, WAITACK, RECEIVE, WAITSIFS } |
IRadio * | radio = nullptr |
IRadio::TransmissionState | transmissionState = IRadio::TRANSMISSION_STATE_UNDEFINED |
cFSM | fsm |
simtime_t | backoffPeriod = -1 |
Remaining backoff period in seconds. More... | |
int | retryCounter = -1 |
Number of frame retransmission attempts. More... | |
PacketQueue | transmissionQueue |
Messages received from upper layer and to be transmitted later. More... | |
IPassiveQueue * | queueModule = nullptr |
Passive queue module to request messages from. More... | |
Additional Inherited Members | |
Public Attributes inherited from inet::MACProtocolBase | |
InterfaceEntry * | interfaceEntry |
int | upperLayerInGateId |
Gate ids. More... | |
int | upperLayerOutGateId |
int | lowerLayerInGateId |
int | lowerLayerOutGateId |
Static Public Attributes inherited from inet::LayeredProtocolBase | |
static simsignal_t | packetSentToUpperSignal = registerSignal("packetSentToUpper") |
static simsignal_t | packetReceivedFromUpperSignal = registerSignal("packetReceivedFromUpper") |
static simsignal_t | packetFromUpperDroppedSignal = registerSignal("packetFromUpperDropped") |
static simsignal_t | packetSentToLowerSignal = registerSignal("packetSentToLower") |
static simsignal_t | packetReceivedFromLowerSignal = registerSignal("packetReceivedFromLower") |
static simsignal_t | packetFromLowerDroppedSignal = registerSignal("packetFromLowerDropped") |
|
protected |
|
virtual |
|
protectedvirtual |
Referenced by handleWithFsm().
|
protectedvirtual |
Referenced by handleWithFsm().
|
protectedvirtual |
Referenced by handleWithFsm().
|
overrideprotectedvirtual |
Implements inet::MACProtocolBase.
|
protectedvirtual |
Referenced by handleWithFsm().
|
protectedvirtual |
Referenced by handleWithFsm().
|
protectedvirtual |
Referenced by handleUpperPacket().
|
overrideprotectedvirtual |
|
protectedvirtual |
Referenced by handleWithFsm().
|
protectedvirtual |
Referenced by retryCurrentTransmission(), and scheduleBackoffTimer().
|
protectedvirtual |
Referenced by generateBackoffPeriod(), giveUpCurrentTransmission(), and handleWithFsm().
|
protectedvirtual |
Referenced by handleWithFsm().
|
overrideprotectedvirtual |
Implements inet::LayeredProtocolBase.
|
overrideprotectedvirtual |
Reimplemented from inet::LayeredProtocolBase.
|
overrideprotectedvirtual |
Implements inet::LayeredProtocolBase.
|
protectedvirtual |
Referenced by handleLowerPacket(), handleSelfMessage(), handleUpperPacket(), and receiveSignal().
|
overrideprotectedvirtual |
Initialization of the module and its variables.
Reimplemented from inet::MACProtocolBase.
|
protectedvirtual |
Referenced by initialize().
|
protectedvirtual |
Referenced by handleWithFsm().
|
protectedvirtual |
Referenced by handleWithFsm().
|
protectedvirtual |
Referenced by handleWithFsm().
|
protectedvirtual |
Referenced by handleLowerPacket(), and handleWithFsm().
|
protectedvirtual |
Referenced by scheduleBackoffTimer().
|
protectedvirtual |
Referenced by handleWithFsm().
|
protectedvirtual |
Referenced by handleWithFsm().
|
protectedvirtual |
Referenced by finishCurrentTransmission(), and giveUpCurrentTransmission().
|
overrideprotectedvirtual |
|
protectedvirtual |
Referenced by finishCurrentTransmission(), giveUpCurrentTransmission(), and handleWithFsm().
|
protectedvirtual |
Referenced by handleWithFsm().
|
protectedvirtual |
Referenced by handleWithFsm().
|
protectedvirtual |
Referenced by handleWithFsm().
|
protectedvirtual |
Referenced by handleWithFsm().
|
protectedvirtual |
Referenced by handleWithFsm().
|
protectedvirtual |
Referenced by handleWithFsm().
|
protectedvirtual |
Referenced by handleWithFsm().
|
protected |
Referenced by initialize(), and sendAckFrame().
|
protected |
Referenced by initialize(), and scheduleAckTimeout().
|
protected |
Referenced by createInterfaceEntry(), encapsulate(), handleLowerPacket(), initialize(), and isForUs().
|
protected |
Remaining backoff period in seconds.
Referenced by decreaseBackoffPeriod(), generateBackoffPeriod(), initialize(), invalidateBackoffPeriod(), isInvalidBackoffPeriod(), resetStateVariables(), and scheduleBackoffTimer().
|
protected |
Referenced by createInterfaceEntry(), and initialize().
|
protected |
Referenced by generateBackoffPeriod(), and initialize().
|
protected |
Referenced by generateBackoffPeriod(), and initialize().
|
protected |
Referenced by generateBackoffPeriod(), and initialize().
|
protected |
Referenced by initialize(), and scheduleDifsTimer().
|
protected |
End of the ack timeout.
Referenced by cancelAckTimer(), handleWithFsm(), initialize(), scheduleAckTimeout(), and ~CsmaCaMac().
|
protected |
End of the backoff period.
Referenced by cancelBackoffTimer(), decreaseBackoffPeriod(), handleWithFsm(), initialize(), scheduleBackoffTimer(), and ~CsmaCaMac().
|
protected |
Timeout after the transmission of a Data frame.
Referenced by handleWithFsm(), initialize(), receiveSignal(), and ~CsmaCaMac().
|
protected |
End of the Data Inter-Frame Time period.
Referenced by cancelDifsTimer(), handleWithFsm(), initialize(), scheduleDifsTimer(), and ~CsmaCaMac().
|
protected |
End of the Short Inter-Frame Time period.
Referenced by handleWithFsm(), initialize(), scheduleSifsTimer(), sendAckFrame(), and ~CsmaCaMac().
|
protected |
Referenced by handleUpperPacket(), handleWithFsm(), and initialize().
|
protected |
Referenced by encapsulate(), and initialize().
|
protected |
Referenced by handleUpperPacket(), and initialize().
|
protected |
Radio state change self message.
Currently this is optimized away and sent directly
Referenced by handleWithFsm(), initialize(), receiveSignal(), and ~CsmaCaMac().
|
protected |
Referenced by finish(), handleWithFsm(), and initialize().
|
protected |
Referenced by finish(), giveUpCurrentTransmission(), and initialize().
|
protected |
Referenced by finish(), handleWithFsm(), and initialize().
|
protected |
Referenced by finish(), handleWithFsm(), and initialize().
|
protected |
Referenced by finish(), initialize(), and retryCurrentTransmission().
|
protected |
Referenced by finish(), handleWithFsm(), and initialize().
|
protected |
Referenced by finish(), handleWithFsm(), and initialize().
|
protected |
Referenced by finish(), handleWithFsm(), and initialize().
|
protected |
Passive queue module to request messages from.
Referenced by initializeQueueModule(), and popTransmissionQueue().
|
protected |
Referenced by initialize(), isMediumFree(), isReceiving(), receiveSignal(), sendAckFrame(), and sendDataFrame().
|
protected |
Number of frame retransmission attempts.
Referenced by generateBackoffPeriod(), handleWithFsm(), initialize(), resetStateVariables(), and retryCurrentTransmission().
|
protected |
Referenced by generateBackoffPeriod(), handleWithFsm(), initialize(), and retryCurrentTransmission().
|
protected |
Referenced by initialize(), and scheduleSifsTimer().
|
protected |
Referenced by decreaseBackoffPeriod(), generateBackoffPeriod(), and initialize().
|
protected |
Messages received from upper layer and to be transmitted later.
Referenced by getCurrentTransmission(), handleUpperPacket(), handleWithFsm(), initialize(), and popTransmissionQueue().
|
protected |
Referenced by receiveSignal().
|
protected |
Referenced by handleWithFsm(), and initialize().