INET Framework for OMNeT++/OMNEST
|
Ethernet MAC module which supports both half-duplex (CSMA/CD) and full-duplex operation. More...
#include <EtherMAC.h>
Classes | |
struct | PkIdRxTime |
Public Member Functions | |
EtherMAC () | |
virtual | ~EtherMAC () |
Public Member Functions inherited from inet::EtherMACBase | |
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 () |
Protected Types | |
typedef std::list< PkIdRxTime > | EndRxTimeList |
Protected Types inherited from inet::EtherMACBase | |
enum | SelfMsgKindValues { ENDIFG = 100, ENDRECEPTION, ENDBACKOFF, ENDTRANSMISSION, ENDJAMMING, ENDPAUSE } |
enum | { NUM_OF_ETHERDESCRS = 6 } |
Protected Member Functions | |
virtual int | numInitStages () const override |
virtual void | initialize (int stage) override |
virtual void | initializeFlags () override |
virtual void | initializeStatistics () override |
virtual void | handleMessage (cMessage *msg) override |
virtual void | finish () override |
virtual void | handleSelfMessage (cMessage *msg) |
virtual void | handleEndIFGPeriod () |
virtual void | handleEndPausePeriod () |
virtual void | handleEndTxPeriod () |
virtual void | handleEndRxPeriod () |
virtual void | handleEndBackoffPeriod () |
virtual void | handleEndJammingPeriod () |
virtual void | handleRetransmission () |
virtual void | readChannelParameters (bool errorWhenAsymmetric) override |
Calculates datarates, etc. More... | |
virtual void | processFrameFromUpperLayer (EtherFrame *msg) |
virtual void | processMsgFromNetwork (cPacket *msg) |
virtual void | scheduleEndIFGPeriod () |
virtual void | fillIFGIfInBurst () |
virtual void | scheduleEndTxPeriod (int64_t sentFrameByteLength) |
virtual void | scheduleEndRxPeriod (cPacket *) |
virtual void | scheduleEndPausePeriod (int pauseUnits) |
virtual void | beginSendFrames () |
virtual void | sendJamSignal () |
virtual void | startFrameTransmission () |
virtual void | frameReceptionComplete () |
virtual void | processReceivedDataFrame (EtherFrame *frame) |
virtual void | processReceivedJam (EtherJam *jam) |
virtual void | processReceivedPauseFrame (EtherPauseFrame *frame) |
virtual void | processConnectDisconnect () override |
virtual void | addReception (simtime_t endRxTime) |
virtual void | addReceptionInReconnectState (long id, simtime_t endRxTime) |
virtual void | processDetectedCollision () |
virtual void | printState () |
Protected Member Functions inherited from inet::EtherMACBase | |
virtual void | initializeMACAddress () |
virtual void | initializeQueueModule () |
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 | printParameters () |
virtual void | getNextFrameFromQueue () |
virtual void | requestNextFrameFromExtQueue () |
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 | |
int | numConcurrentTransmissions = 0 |
int | backoffs = 0 |
long | currentSendPkTreeID = -1 |
cPacket * | frameBeingReceived = nullptr |
cMessage * | endRxMsg = nullptr |
cMessage * | endBackoffMsg = nullptr |
cMessage * | endJammingMsg = nullptr |
EndRxTimeList | endRxTimeList |
simtime_t | totalCollisionTime |
simtime_t | totalSuccessfulRxTxTime |
simtime_t | channelBusySince |
unsigned long | numCollisions = 0 |
unsigned long | numBackoffs = 0 |
unsigned int | framesSentInBurst = 0 |
long | bytesSentInBurst = 0 |
Protected Attributes inherited from inet::EtherMACBase | |
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 simsignal_t | collisionSignal = registerSignal("collision") |
static simsignal_t | backoffSignal = registerSignal("backoff") |
Static Protected Attributes inherited from inet::EtherMACBase | |
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") |
Additional Inherited Members | |
Public Types inherited from inet::EtherMACBase | |
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 } |
Static Public Attributes inherited from inet::EtherMACBase | |
static const double | SPEED_OF_LIGHT_IN_CABLE = 200000000.0 |
static simsignal_t | dropPkIfaceDownSignal = registerSignal("dropPkIfaceDown") |
static simsignal_t | dropPkFromHLIfaceDownSignal = registerSignal("dropPkFromHLIfaceDown") |
Ethernet MAC module which supports both half-duplex (CSMA/CD) and full-duplex operation.
(See also EtherMACFullDuplex which has a considerably smaller code with all the CSMA/CD complexity removed.)
See NED file for more details.
|
protected |
|
virtual |
|
protectedvirtual |
Referenced by processMsgFromNetwork(), and scheduleEndRxPeriod().
|
protectedvirtual |
Referenced by processConnectDisconnect(), and processMsgFromNetwork().
|
protectedvirtual |
Referenced by handleEndIFGPeriod(), handleEndPausePeriod(), and handleRetransmission().
|
protectedvirtual |
Referenced by handleEndTxPeriod(), and processFrameFromUpperLayer().
|
overrideprotectedvirtual |
Reimplemented from inet::EtherMACBase.
|
protectedvirtual |
Referenced by handleEndRxPeriod(), and processMsgFromNetwork().
|
protectedvirtual |
Referenced by handleSelfMessage().
|
protectedvirtual |
Referenced by handleSelfMessage().
|
protectedvirtual |
Referenced by handleSelfMessage().
|
protectedvirtual |
Referenced by handleSelfMessage().
|
protectedvirtual |
Referenced by handleSelfMessage().
|
protectedvirtual |
Referenced by handleSelfMessage().
|
overrideprotectedvirtual |
|
protectedvirtual |
Referenced by handleEndJammingPeriod().
|
protectedvirtual |
Referenced by handleMessage().
|
overrideprotectedvirtual |
Reimplemented from inet::EtherMACBase.
|
overrideprotectedvirtual |
Reimplemented from inet::EtherMACBase.
|
overrideprotectedvirtual |
Reimplemented from inet::EtherMACBase.
|
inlineoverrideprotectedvirtual |
Reimplemented from inet::EtherMACBase.
|
protectedvirtual |
Referenced by handleMessage(), and startFrameTransmission().
|
overrideprotectedvirtual |
Reimplemented from inet::EtherMACBase.
|
protectedvirtual |
Referenced by processMsgFromNetwork(), and processReceivedJam().
|
protectedvirtual |
Referenced by handleMessage().
|
protectedvirtual |
Referenced by handleMessage().
|
protectedvirtual |
Referenced by frameReceptionComplete().
|
protectedvirtual |
Referenced by processMsgFromNetwork().
|
protectedvirtual |
Referenced by frameReceptionComplete().
|
overrideprotectedvirtual |
Calculates datarates, etc.
Verifies the datarates on the incoming/outgoing channels, and throws error when they differ and the parameter errorWhenAsymmetric is true.
Reimplemented from inet::EtherMACBase.
Referenced by handleMessage().
|
protectedvirtual |
Referenced by handleEndBackoffPeriod(), handleEndRxPeriod(), and handleEndTxPeriod().
|
protectedvirtual |
Referenced by handleEndTxPeriod(), and processReceivedPauseFrame().
|
protectedvirtual |
Referenced by processMsgFromNetwork().
|
protectedvirtual |
Referenced by startFrameTransmission().
|
protectedvirtual |
Referenced by processMsgFromNetwork(), and startFrameTransmission().
|
protectedvirtual |
Referenced by beginSendFrames(), and processFrameFromUpperLayer().
|
protected |
Referenced by handleEndTxPeriod(), handleRetransmission(), initialize(), and printState().
|
staticprotected |
Referenced by handleRetransmission().
|
protected |
Referenced by fillIFGIfInBurst(), handleEndIFGPeriod(), initializeStatistics(), processConnectDisconnect(), and scheduleEndTxPeriod().
|
protected |
Referenced by handleEndRxPeriod(), handleEndTxPeriod(), processMsgFromNetwork(), and startFrameTransmission().
|
staticprotected |
Referenced by processDetectedCollision(), processMsgFromNetwork(), and startFrameTransmission().
|
protected |
Referenced by fillIFGIfInBurst(), handleEndIFGPeriod(), handleEndTxPeriod(), initialize(), sendJamSignal(), and startFrameTransmission().
|
protected |
Referenced by handleRetransmission(), initialize(), processConnectDisconnect(), and ~EtherMAC().
|
protected |
Referenced by initialize(), processConnectDisconnect(), sendJamSignal(), and ~EtherMAC().
|
protected |
|
protected |
Referenced by addReceptionInReconnectState(), handleEndRxPeriod(), and processConnectDisconnect().
|
protected |
|
protected |
|
protected |
Referenced by finish(), handleRetransmission(), and initializeStatistics().
|
protected |
Referenced by finish(), initializeStatistics(), processDetectedCollision(), processMsgFromNetwork(), and startFrameTransmission().
|
protected |
Referenced by addReception(), handleEndRxPeriod(), initialize(), printState(), and processReceivedJam().
|
protected |
Referenced by finish(), handleEndRxPeriod(), and initializeStatistics().
|
protected |
Referenced by finish(), handleEndRxPeriod(), handleEndTxPeriod(), initializeStatistics(), and processMsgFromNetwork().