INET Framework for OMNeT++/OMNEST
|
Implements the Rapid Spanning Tree Protocol. More...
#include <RSTP.h>
Public Member Functions | |
RSTP () | |
virtual | ~RSTP () |
virtual int | numInitStages () const override |
virtual void | receiveSignal (cComponent *source, simsignal_t signalID, cObject *obj, cObject *details) override |
Public Member Functions inherited from inet::STPBase | |
STPBase () | |
virtual bool | handleOperationStage (LifecycleOperation *operation, int stage, IDoneCallback *doneCallback) override |
Perform one stage of a lifecycle operation. More... | |
Public Member Functions inherited from inet::ILifecycle | |
virtual | ~ILifecycle () |
Protected Types | |
enum | SelfKinds { SELF_HELLOTIME = 1, SELF_UPGRADE } |
enum | CompareResult { WORSE_PORT = -4, WORSE_SRC = -3, WORSE_RPC = -2, WORSE_ROOT = -1, SIMILAR = 0, BETTER_ROOT = 1, BETTER_RPC = 2, BETTER_SRC = 3, BETTER_PORT = 4 } |
Protected Member Functions | |
virtual void | initialize (int stage) override |
virtual void | finish () override |
virtual void | initInterfacedata (unsigned int portNum) |
virtual void | start () override |
virtual void | stop () override |
virtual void | initPorts () |
initialize RSTP dynamic information More... | |
virtual int | getBestAlternate () |
Gets the best alternate port. More... | |
virtual void | sendBPDUs () |
Sends BPDUs through all ports, if they are required. More... | |
virtual void | sendBPDU (int port) |
Sends BPDU through a port. More... | |
virtual void | handleMessage (cMessage *msg) override |
General processing. More... | |
virtual void | handleIncomingFrame (BPDU *frame) |
BPDU processing. More... | |
virtual void | processBPDU (BPDU *frame, unsigned int arrival) |
virtual bool | processBetterSource (BPDU *frame, unsigned int arrival) |
virtual bool | processSameSource (BPDU *frame, unsigned int arrival) |
virtual void | printState () |
Prints current data base info. More... | |
virtual void | updateInterfacedata (BPDU *frame, unsigned int portNum) |
Update Interfacedata with the content of the BDPU frame. More... | |
virtual CompareResult | contestInterfacedata (BPDU *msg, unsigned int portNum) |
Compares the BPDU frame with the BPDU this module would send through that port. More... | |
virtual CompareResult | contestInterfacedata (unsigned int portNum) |
Compares the port's best BPDU with the BPDU this module would send through that port. More... | |
virtual CompareResult | compareInterfacedata (unsigned int portNum, BPDU *msg, int linkCost) |
Compares a port's best BPDU with a BPDU frame. More... | |
virtual CompareResult | compareRSTPData (int rootPriority1, int rootPriority2, MACAddress rootAddress1, MACAddress rootAddress2, int rootPathCost1, int rootPathCost2, int bridgePriority1, int bridgePriority2, MACAddress bridgeAddress1, MACAddress bridgeAddress2, int portPriority1, int portPriority2, int portNum1, int portNum2) |
Compares two RSTP data. More... | |
virtual void | sendTCNtoRoot () |
If root TCWhile has not expired, sends a BPDU to the Root with TCFlag=true. More... | |
virtual void | handleHelloTime (cMessage *) |
HelloTime event handling. More... | |
virtual void | handleUpgrade (cMessage *) |
Upgrade event handling. More... | |
virtual void | checkTC (BPDU *frame, int arrival) |
Checks the frame TC flag. More... | |
virtual void | handleBackup (BPDU *frame, unsigned int arrival) |
Handles the switch to backup in one of the ports. More... | |
virtual void | scheduleNextUpgrade () |
schedule next upgrade self-message More... | |
virtual void | flushOtherPorts (unsigned int portNum) |
flush all port expect one More... | |
Protected Member Functions inherited from inet::STPBase | |
virtual void | colorLink (unsigned int i, bool forwarding) const |
Adds effects to be represented by Tkenv. More... | |
virtual void | refreshDisplay () const override |
Adds effects to be represented by Tkenv. More... | |
virtual int | getRootIndex () const |
Obtains the root gate index. More... | |
Ieee8021dInterfaceData * | getPortInterfaceData (unsigned int portNum) |
Gets Ieee8021dInterfaceData for port number. More... | |
const Ieee8021dInterfaceData * | getPortInterfaceData (unsigned int portNum) const |
InterfaceEntry * | getPortInterfaceEntry (unsigned int portNum) |
Gets InterfaceEntry for port number. More... | |
virtual InterfaceEntry * | chooseInterface () |
Protected Attributes | |
simtime_t | migrateTime |
simtime_t | tcWhileTime |
bool | autoEdge = false |
cMessage * | helloTimer = nullptr |
cMessage * | upgradeTimer = nullptr |
Protected Attributes inherited from inet::STPBase | |
bool | visualize = false |
bool | isOperational = false |
unsigned int | numPorts = 0 |
unsigned int | bridgePriority = 0 |
MACAddress | bridgeAddress |
simtime_t | maxAge |
simtime_t | helloTime |
simtime_t | forwardDelay |
cModule * | switchModule = nullptr |
IMACAddressTable * | macTable = nullptr |
IInterfaceTable * | ifTable = nullptr |
InterfaceEntry * | ie = nullptr |
Implements the Rapid Spanning Tree Protocol.
See the NED file for details.
|
protected |
Enumerator | |
---|---|
WORSE_PORT | |
WORSE_SRC | |
WORSE_RPC | |
WORSE_ROOT | |
SIMILAR | |
BETTER_ROOT | |
BETTER_RPC | |
BETTER_SRC | |
BETTER_PORT |
|
protected |
|
virtual |
|
protectedvirtual |
Checks the frame TC flag.
Sets TCWhile if the port was forwarding and the flag is true.
Referenced by handleIncomingFrame().
|
protectedvirtual |
Compares a port's best BPDU with a BPDU frame.
Referenced by processBetterSource(), processBPDU(), and processSameSource().
|
protectedvirtual |
Compares two RSTP data.
Referenced by compareInterfacedata(), contestInterfacedata(), and getBestAlternate().
|
protectedvirtual |
Compares the BPDU frame with the BPDU this module would send through that port.
Referenced by processBetterSource(), and processSameSource().
|
protectedvirtual |
Compares the port's best BPDU with the BPDU this module would send through that port.
|
protectedvirtual |
flush all port expect one
Referenced by handleHelloTime(), handleUpgrade(), processBetterSource(), and processSameSource().
|
protectedvirtual |
Gets the best alternate port.
Referenced by handleHelloTime(), and processSameSource().
|
protectedvirtual |
Handles the switch to backup in one of the ports.
Referenced by handleIncomingFrame().
|
protectedvirtual |
HelloTime event handling.
Referenced by handleMessage().
|
protectedvirtual |
BPDU processing.
Updates port information. Handles port role changes.
Referenced by handleMessage().
|
overrideprotectedvirtual |
General processing.
|
protectedvirtual |
Upgrade event handling.
Referenced by handleMessage().
|
overrideprotectedvirtual |
Reimplemented from inet::STPBase.
|
protectedvirtual |
Referenced by handleHelloTime(), initPorts(), and processBetterSource().
|
protectedvirtual |
initialize RSTP dynamic information
Referenced by handleHelloTime(), processSameSource(), and start().
|
inlineoverridevirtual |
Reimplemented from inet::STPBase.
|
protectedvirtual |
Prints current data base info.
|
protectedvirtual |
Referenced by processBPDU().
|
protectedvirtual |
Referenced by handleIncomingFrame().
|
protectedvirtual |
Referenced by processBPDU().
|
overridevirtual |
Reimplemented from inet::STPBase.
|
protectedvirtual |
schedule next upgrade self-message
Referenced by handleHelloTime(), handleUpgrade(), initPorts(), processBetterSource(), processSameSource(), and receiveSignal().
|
protectedvirtual |
Sends BPDU through a port.
Referenced by processBetterSource(), processSameSource(), and sendBPDUs().
|
protectedvirtual |
Sends BPDUs through all ports, if they are required.
Referenced by handleHelloTime(), and processBPDU().
|
protectedvirtual |
If root TCWhile has not expired, sends a BPDU to the Root with TCFlag=true.
Referenced by handleHelloTime(), and processBPDU().
|
overrideprotectedvirtual |
Reimplemented from inet::STPBase.
|
overrideprotectedvirtual |
Reimplemented from inet::STPBase.
|
protectedvirtual |
Update Interfacedata with the content of the BDPU frame.
Referenced by processBetterSource(), and processSameSource().
|
protected |
Referenced by initialize().
|
protected |
Referenced by initialize(), start(), stop(), and ~RSTP().
|
protected |
Referenced by initialize(), initPorts(), processBetterSource(), and receiveSignal().
|
protected |
Referenced by checkTC(), flushOtherPorts(), initialize(), and processBetterSource().
|
protected |
Referenced by initialize(), scheduleNextUpgrade(), stop(), and ~RSTP().