|
INET Framework for OMNeT++/OMNEST
|
Base class for Ethernet MAC implementations. More...
#include <EtherMACBase.h>
Classes | |
| struct | EtherDescr |
| class | InnerQueue |
| class | MacQueue |
Public Types | |
| enum | MACTransmitState { TX_IDLE_STATE = 1, WAIT_IFG_STATE, SEND_IFG_STATE, TRANSMITTING_STATE, JAMMING_STATE, BACKOFF_STATE, PAUSE_STATE } |
| enum | MACReceiveState { RX_IDLE_STATE = 1, RECEIVING_STATE, RX_COLLISION_STATE, RX_RECONNECT_STATE } |
Public Member Functions | |
| EtherMACBase () | |
| virtual | ~EtherMACBase () |
| virtual MACAddress | getMACAddress () |
| double | getTxRate () |
| bool | isActive () |
| MACTransmitState | getTransmitState () |
| MACReceiveState | getReceiveState () |
| virtual bool | handleOperationStage (LifecycleOperation *operation, int stage, IDoneCallback *doneCallback) override |
| Perform one stage of a lifecycle operation. More... | |
Public Member Functions inherited from inet::MACBase | |
| MACBase () | |
| virtual | ~MACBase () |
Public Member Functions inherited from inet::ILifecycle | |
| virtual | ~ILifecycle () |
Static Public Attributes | |
| static const double | SPEED_OF_LIGHT_IN_CABLE = 200000000.0 |
| static simsignal_t | dropPkIfaceDownSignal = registerSignal("dropPkIfaceDown") |
| static simsignal_t | dropPkFromHLIfaceDownSignal = registerSignal("dropPkFromHLIfaceDown") |
Protected Types | |
| enum | SelfMsgKindValues { ENDIFG = 100, ENDRECEPTION, ENDBACKOFF, ENDTRANSMISSION, ENDJAMMING, ENDPAUSE } |
| enum | { NUM_OF_ETHERDESCRS = 6 } |
Protected Member Functions | |
| virtual void | initialize (int stage) override |
| virtual int | numInitStages () const override |
| virtual void | initializeFlags () |
| virtual void | initializeMACAddress () |
| virtual void | initializeQueueModule () |
| virtual void | initializeStatistics () |
| virtual void | finish () override |
| virtual bool | dropFrameNotForUs (EtherFrame *frame) |
| Checks destination address and drops the frame when frame is not for us; returns true if frame is dropped. More... | |
| virtual void | readChannelParameters (bool errorWhenAsymmetric) |
| Calculates datarates, etc. More... | |
| virtual void | printParameters () |
| virtual void | getNextFrameFromQueue () |
| virtual void | requestNextFrameFromExtQueue () |
| virtual void | processConnectDisconnect () |
| virtual EtherPhyFrame * | encapsulate (EtherFrame *phyFrame) |
| virtual EtherFrame * | decapsulate (EtherPhyFrame *phyFrame) |
| virtual InterfaceEntry * | createInterfaceEntry () override |
| should create InterfaceEntry More... | |
| virtual void | flushQueue () override |
| should clear queue and emit signal "dropPkFromHLIfaceDown" with entire packets More... | |
| virtual void | clearQueue () override |
| should clear queue silently More... | |
| virtual bool | isUpperMsg (cMessage *msg) override |
| should return true if the msg arrived from upper layer, else return false More... | |
| virtual void | refreshDisplay () const override |
| virtual void | receiveSignal (cComponent *src, simsignal_t signalId, cObject *obj, cObject *details) override |
| virtual void | refreshConnection () |
Protected Member Functions inherited from inet::MACBase | |
| void | registerInterface () |
| virtual void | updateOperationalFlag (bool isNodeUp) |
| virtual bool | isNodeUp () |
| virtual void | handleMessageWhenDown (cMessage *msg) |
Protected Attributes | |
| const EtherDescr * | curEtherDescr = nullptr |
| MACAddress | address |
| bool | connected = false |
| bool | disabled = false |
| bool | promiscuous = false |
| bool | duplexMode = false |
| bool | frameBursting = false |
| MacQueue | txQueue |
| cChannel * | transmissionChannel = nullptr |
| cGate * | physInGate = nullptr |
| cGate * | physOutGate = nullptr |
| cGate * | upperLayerInGate = nullptr |
| bool | channelsDiffer = false |
| MACTransmitState | transmitState = (MACTransmitState)-1 |
| MACReceiveState | receiveState = (MACReceiveState)-1 |
| simtime_t | lastTxFinishTime |
| int | pauseUnitsRequested = 0 |
| EtherFrame * | curTxFrame = nullptr |
| cMessage * | endTxMsg = nullptr |
| cMessage * | endIFGMsg = nullptr |
| cMessage * | endPauseMsg = nullptr |
| unsigned long | numFramesSent = 0 |
| unsigned long | numFramesReceivedOK = 0 |
| unsigned long | numBytesSent = 0 |
| unsigned long | numBytesReceivedOK = 0 |
| unsigned long | numFramesFromHL = 0 |
| unsigned long | numDroppedPkFromHLIfaceDown = 0 |
| unsigned long | numDroppedIfaceDown = 0 |
| unsigned long | numDroppedBitError = 0 |
| unsigned long | numDroppedNotForUs = 0 |
| unsigned long | numFramesPassedToHL = 0 |
| unsigned long | numPauseFramesRcvd = 0 |
| unsigned long | numPauseFramesSent = 0 |
Protected Attributes inherited from inet::MACBase | |
| cModule * | hostModule = nullptr |
| bool | isOperational = false |
| InterfaceEntry * | interfaceEntry = nullptr |
Static Protected Attributes | |
| static const EtherDescr | etherDescrs [NUM_OF_ETHERDESCRS] |
| static const EtherDescr | nullEtherDescr |
| static simsignal_t | txPkSignal = registerSignal("txPk") |
| static simsignal_t | rxPkOkSignal = registerSignal("rxPkOk") |
| static simsignal_t | txPausePkUnitsSignal = registerSignal("txPausePkUnits") |
| static simsignal_t | rxPausePkUnitsSignal = registerSignal("rxPausePkUnits") |
| static simsignal_t | rxPkFromHLSignal = registerSignal("rxPkFromHL") |
| static simsignal_t | dropPkNotForUsSignal = registerSignal("dropPkNotForUs") |
| static simsignal_t | dropPkBitErrorSignal = registerSignal("dropPkBitError") |
| static simsignal_t | packetSentToLowerSignal = registerSignal("packetSentToLower") |
| static simsignal_t | packetReceivedFromLowerSignal = registerSignal("packetReceivedFromLower") |
| static simsignal_t | packetSentToUpperSignal = registerSignal("packetSentToUpper") |
| static simsignal_t | packetReceivedFromUpperSignal = registerSignal("packetReceivedFromUpper") |
| static simsignal_t | transmitStateSignal = registerSignal("transmitState") |
| static simsignal_t | receiveStateSignal = registerSignal("receiveState") |
Base class for Ethernet MAC implementations.
| Enumerator | |
|---|---|
| TX_IDLE_STATE | |
| WAIT_IFG_STATE | |
| SEND_IFG_STATE | |
| TRANSMITTING_STATE | |
| JAMMING_STATE | |
| BACKOFF_STATE | |
| PAUSE_STATE | |
|
protected |
| inet::EtherMACBase::EtherMACBase | ( | ) |
|
virtual |
|
overrideprotectedvirtual |
|
overrideprotectedvirtual |
should create InterfaceEntry
Implements inet::MACBase.
|
protectedvirtual |
Referenced by inet::EtherMAC::frameReceptionComplete(), inet::EtherMACFullDuplex::processMsgFromNetwork(), and inet::EtherMAC::processMsgFromNetwork().
|
protectedvirtual |
Checks destination address and drops the frame when frame is not for us; returns true if frame is dropped.
Referenced by inet::EtherMAC::frameReceptionComplete(), and inet::EtherMACFullDuplex::processMsgFromNetwork().
|
protectedvirtual |
|
overrideprotectedvirtual |
Reimplemented in inet::EtherMAC, and inet::EtherMACFullDuplex.
Referenced by inet::EtherMACFullDuplex::finish(), and inet::EtherMAC::finish().
|
overrideprotectedvirtual |
should clear queue and emit signal "dropPkFromHLIfaceDown" with entire packets
Implements inet::MACBase.
|
inlinevirtual |
|
protectedvirtual |
Referenced by inet::EtherMACFullDuplex::handleEndIFGPeriod(), inet::EtherMACFullDuplex::handleEndPausePeriod(), inet::EtherMAC::handleEndTxPeriod(), and inet::EtherMAC::handleRetransmission().
|
inline |
|
inline |
|
inline |
|
overridevirtual |
Perform one stage of a lifecycle operation.
Processing may be done entirely within this method, or may be a longer process that involves nonzero simulation time or several events, and is triggered by this method call.
Return value: true = "done"; false = "not yet done, will invoke doneCallback when done"
Reimplemented from inet::MACBase.
|
overrideprotectedvirtual |
Reimplemented from inet::MACBase.
Reimplemented in inet::EtherMAC, and inet::EtherMACFullDuplex.
Referenced by inet::EtherMACFullDuplex::initialize(), and inet::EtherMAC::initialize().
|
protectedvirtual |
Reimplemented in inet::EtherMAC, and inet::EtherMACFullDuplex.
Referenced by handleOperationStage(), initialize(), inet::EtherMACFullDuplex::initializeFlags(), and inet::EtherMAC::initializeFlags().
|
protectedvirtual |
Referenced by handleOperationStage(), and initialize().
|
protectedvirtual |
Referenced by handleOperationStage(), and initialize().
|
protectedvirtual |
Reimplemented in inet::EtherMAC, and inet::EtherMACFullDuplex.
Referenced by initialize(), inet::EtherMACFullDuplex::initializeStatistics(), and inet::EtherMAC::initializeStatistics().
|
inline |
|
inlineoverrideprotectedvirtual |
|
inlineoverrideprotectedvirtual |
|
protectedvirtual |
|
protectedvirtual |
Reimplemented in inet::EtherMAC.
Referenced by handleOperationStage(), inet::EtherMAC::processConnectDisconnect(), and refreshConnection().
|
protectedvirtual |
Calculates datarates, etc.
Verifies the datarates on the incoming/outgoing channels, and throws error when they differ and the parameter errorWhenAsymmetric is true.
Reimplemented in inet::EtherMAC.
Referenced by inet::EtherMACFullDuplex::handleMessage(), initialize(), inet::EtherMAC::readChannelParameters(), and refreshConnection().
|
overrideprotectedvirtual |
Reimplemented from inet::MACBase.
|
protectedvirtual |
Referenced by receiveSignal().
|
overrideprotectedvirtual |
|
protectedvirtual |
Referenced by inet::EtherMACFullDuplex::processFrameFromUpperLayer(), and inet::EtherMAC::processFrameFromUpperLayer().
|
protected |
Referenced by createInterfaceEntry(), dropFrameNotForUs(), initializeMACAddress(), printParameters(), inet::EtherMACFullDuplex::processFrameFromUpperLayer(), inet::EtherMAC::processFrameFromUpperLayer(), inet::EtherMACFullDuplex::startFrameTransmission(), and inet::EtherMAC::startFrameTransmission().
|
protected |
|
protected |
Referenced by handleOperationStage(), initializeFlags(), inet::EtherMAC::processConnectDisconnect(), processConnectDisconnect(), inet::EtherMACFullDuplex::processFrameFromUpperLayer(), inet::EtherMAC::processFrameFromUpperLayer(), inet::EtherMACFullDuplex::processMsgFromNetwork(), inet::EtherMAC::processMsgFromNetwork(), inet::EtherMAC::readChannelParameters(), readChannelParameters(), and refreshConnection().
|
protected |
Referenced by EtherMACBase(), inet::EtherMAC::fillIFGIfInBurst(), inet::EtherMAC::handleRetransmission(), printParameters(), inet::EtherMAC::processConnectDisconnect(), inet::EtherMAC::processMsgFromNetwork(), inet::EtherMAC::readChannelParameters(), readChannelParameters(), inet::EtherMACFullDuplex::scheduleEndIFGPeriod(), inet::EtherMAC::scheduleEndIFGPeriod(), inet::EtherMACFullDuplex::scheduleEndPausePeriod(), inet::EtherMAC::scheduleEndPausePeriod(), inet::EtherMACFullDuplex::startFrameTransmission(), and inet::EtherMAC::startFrameTransmission().
|
protected |
Referenced by inet::EtherMACFullDuplex::beginSendFrames(), inet::EtherMAC::beginSendFrames(), inet::EtherMAC::fillIFGIfInBurst(), getNextFrameFromQueue(), inet::EtherMAC::handleEndBackoffPeriod(), inet::EtherMACFullDuplex::handleEndIFGPeriod(), inet::EtherMACFullDuplex::handleEndPausePeriod(), inet::EtherMACFullDuplex::handleEndTxPeriod(), inet::EtherMAC::handleEndTxPeriod(), inet::EtherMAC::handleRetransmission(), initialize(), processConnectDisconnect(), inet::EtherMACFullDuplex::processFrameFromUpperLayer(), inet::EtherMAC::processFrameFromUpperLayer(), requestNextFrameFromExtQueue(), inet::EtherMACFullDuplex::scheduleEndIFGPeriod(), inet::EtherMACFullDuplex::scheduleEndPausePeriod(), inet::EtherMACFullDuplex::startFrameTransmission(), inet::EtherMAC::startFrameTransmission(), and ~EtherMACBase().
|
protected |
|
staticprotected |
|
static |
Referenced by flushQueue(), inet::EtherMACFullDuplex::processFrameFromUpperLayer(), inet::EtherMAC::processFrameFromUpperLayer(), inet::visualizer::PacketDropVisualizerBase::receiveSignal(), inet::visualizer::PacketDropVisualizerBase::subscribe(), and inet::visualizer::PacketDropVisualizerBase::unsubscribe().
|
static |
Referenced by processConnectDisconnect(), inet::EtherMACFullDuplex::processMsgFromNetwork(), inet::EtherMAC::processMsgFromNetwork(), inet::visualizer::PacketDropVisualizerBase::receiveSignal(), inet::visualizer::PacketDropVisualizerBase::subscribe(), and inet::visualizer::PacketDropVisualizerBase::unsubscribe().
|
staticprotected |
Referenced by dropFrameNotForUs().
|
protected |
Referenced by decapsulate(), encapsulate(), finish(), inet::EtherMAC::handleEndTxPeriod(), inet::EtherMAC::handleMessage(), inet::EtherMACFullDuplex::initializeFlags(), inet::EtherMAC::initializeFlags(), initializeFlags(), printParameters(), inet::EtherMAC::processConnectDisconnect(), inet::EtherMAC::processFrameFromUpperLayer(), inet::EtherMAC::processMsgFromNetwork(), inet::EtherMAC::readChannelParameters(), and inet::EtherMAC::startFrameTransmission().
|
protected |
|
protected |
Referenced by inet::EtherMACFullDuplex::handleSelfMessage(), initialize(), processConnectDisconnect(), inet::EtherMACFullDuplex::processPauseCommand(), inet::EtherMAC::processReceivedPauseFrame(), inet::EtherMACFullDuplex::scheduleEndPausePeriod(), inet::EtherMAC::scheduleEndPausePeriod(), and ~EtherMACBase().
|
protected |
|
staticprotected |
Referenced by readChannelParameters().
|
protected |
|
protected |
|
staticprotected |
Referenced by EtherMACBase(), and readChannelParameters().
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
Referenced by dropFrameNotForUs(), and initializeStatistics().
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
staticprotected |
|
staticprotected |
|
staticprotected |
Referenced by inet::EtherMACFullDuplex::handleEndTxPeriod(), and inet::EtherMAC::handleEndTxPeriod().
|
staticprotected |
|
protected |
|
protected |
|
protected |
|
protected |
Referenced by dropFrameNotForUs(), initializeFlags(), and printParameters().
|
protected |
Referenced by inet::EtherMAC::handleEndBackoffPeriod(), inet::EtherMAC::handleEndRxPeriod(), inet::EtherMAC::handleEndTxPeriod(), inet::EtherMAC::handleMessage(), initialize(), inet::EtherMAC::printState(), inet::EtherMAC::processConnectDisconnect(), processConnectDisconnect(), inet::EtherMAC::processDetectedCollision(), inet::EtherMAC::processFrameFromUpperLayer(), inet::EtherMAC::processMsgFromNetwork(), refreshDisplay(), inet::EtherMAC::scheduleEndRxPeriod(), and inet::EtherMAC::startFrameTransmission().
|
staticprotected |
|
staticprotected |
|
staticprotected |
|
staticprotected |
|
static |
Referenced by inet::EtherMAC::processMsgFromNetwork().
|
protected |
|
protected |
Referenced by inet::EtherMACFullDuplex::beginSendFrames(), inet::EtherMAC::beginSendFrames(), inet::EtherMAC::fillIFGIfInBurst(), inet::EtherMAC::handleEndBackoffPeriod(), inet::EtherMACFullDuplex::handleEndIFGPeriod(), inet::EtherMAC::handleEndIFGPeriod(), inet::EtherMAC::handleEndJammingPeriod(), inet::EtherMACFullDuplex::handleEndPausePeriod(), inet::EtherMAC::handleEndPausePeriod(), inet::EtherMAC::handleEndRxPeriod(), inet::EtherMACFullDuplex::handleEndTxPeriod(), inet::EtherMAC::handleEndTxPeriod(), inet::EtherMAC::handleMessage(), inet::EtherMAC::handleRetransmission(), initialize(), inet::EtherMAC::printState(), processConnectDisconnect(), inet::EtherMACFullDuplex::processFrameFromUpperLayer(), inet::EtherMAC::processFrameFromUpperLayer(), inet::EtherMAC::processMsgFromNetwork(), inet::EtherMACFullDuplex::processPauseCommand(), inet::EtherMAC::processReceivedPauseFrame(), refreshDisplay(), inet::EtherMACFullDuplex::scheduleEndIFGPeriod(), inet::EtherMAC::scheduleEndIFGPeriod(), inet::EtherMACFullDuplex::scheduleEndPausePeriod(), inet::EtherMAC::scheduleEndPausePeriod(), inet::EtherMAC::scheduleEndTxPeriod(), inet::EtherMAC::sendJamSignal(), and inet::EtherMACFullDuplex::startFrameTransmission().
|
staticprotected |
Referenced by inet::EtherMACFullDuplex::beginSendFrames(), inet::EtherMAC::beginSendFrames(), inet::EtherMAC::fillIFGIfInBurst(), inet::EtherMAC::handleEndBackoffPeriod(), inet::EtherMAC::handleRetransmission(), processConnectDisconnect(), inet::EtherMACFullDuplex::scheduleEndIFGPeriod(), inet::EtherMAC::scheduleEndIFGPeriod(), inet::EtherMACFullDuplex::scheduleEndPausePeriod(), inet::EtherMAC::scheduleEndPausePeriod(), inet::EtherMAC::scheduleEndTxPeriod(), inet::EtherMAC::sendJamSignal(), and inet::EtherMACFullDuplex::startFrameTransmission().
|
staticprotected |
Referenced by inet::EtherMACFullDuplex::handleEndTxPeriod(), and inet::EtherMAC::handleEndTxPeriod().
|
staticprotected |
Referenced by inet::EtherMACFullDuplex::handleEndTxPeriod(), and inet::EtherMAC::handleEndTxPeriod().
|
protected |
Referenced by inet::EtherMACFullDuplex::beginSendFrames(), clearQueue(), flushQueue(), getNextFrameFromQueue(), inet::EtherMAC::handleEndTxPeriod(), initializeQueueModule(), inet::EtherMAC::printState(), processConnectDisconnect(), inet::EtherMACFullDuplex::processFrameFromUpperLayer(), inet::EtherMAC::processFrameFromUpperLayer(), and requestNextFrameFromExtQueue().
|
protected |
Referenced by inet::EtherMACFullDuplex::handleMessage(), inet::EtherMAC::handleMessage(), and initialize().