|
WSF
|
#include <WsfCommProtocolOSPF.hpp>


Classes | |
| struct | LinkStateData |
Public Types | |
| using | ProtocolVector = std::vector<ProtocolOSPF*> |
| ProtocolVector provides a vector of OSPF protocols. | |
| using | AreaVector = std::vector<std::shared_ptr<OSPF_Area>> |
| using | AreaGraphMap = std::map<Address, std::unique_ptr<graph::Graph>> |
| A mapping of an area with the corresponding graph/routing table. | |
| Public Types inherited from WsfComponentT< Router > | |
| typedef Router | ParentType |
| This is needed to support the WsfComponentList template. | |
| Public Types inherited from WsfObject | |
| typedef std::vector< WsfStringId > | TypeList |
| The list of types returned by GetTypeList. | |
Common OSPF message identifiers. | |
| enum class | RouterAreaType : size_t { cNONE , cNORMAL , cABR , cASBR } |
| static constexpr const char * | cOSPF_ALL_HELLO = "OSPF_ALL_HELLO" |
| static constexpr const char * | cOSPF_ALL_DROP = "OSPF_ALL_DROP" |
| static constexpr const char * | cOSPF_ALL_DR_DROP = "OSPF_ALL_DR_DROP" |
| static constexpr const char * | cOSPF_ALL_DR_ADD = "OSPF_ALL_DR_ADD" |
| static ProtocolOSPF * | Find (const Router &aParent) |
| static ProtocolOSPF * | FindOrCreate (Router &aParent) |
| ProtocolOSPF ()=default | |
| ~ProtocolOSPF () override=default | |
| ProtocolOSPF (const ProtocolOSPF &aSrc) | |
Graph/Table Methods | |
| using | LinkStateMap = std::map<Address, std::vector<LinkStateData>> |
| using | LinkStateIt = LinkStateMap::iterator |
| graph::Graph * | GetGraph () const override |
| graph::Graph * | GetGraph (const Address &aArea) |
| bool | ShouldPropagateTruth () const override |
| void | SetGraph (const Address &aArea, std::unique_ptr< graph::Graph > aGraph) |
| AreaVector & | GetAreas () |
| OSPF_Area * | GetArea (const Address &aAreaAddress) |
| const std::vector< Address > & | GetInputAreas () const |
| const Address & | GetInputBackbone () const |
| bool | IsSetup () const |
| void | SetSetup (bool aSetup) |
| RouterAreaType | GetAreaType () const |
| void | SetAreaType (RouterAreaType aType) |
| size_t | GetPriorityDR () const |
| Comm * | GetPriorityInterface (const std::string aNetwork) const |
| void | PlatformInitialized (double aSimTime, WsfPlatform *aPlatformPtr) |
| Callback methods to handle addition of routers during runtime. | |
| ProtocolVector | GetAllOSPF () |
| std::set< std::shared_ptr< OSPF_Area > > | GetAllAreas () |
| Convenience method for runtime acquisition of all existing areas. | |
| void | SetRouterRoleType (ProtocolOSPF &aProtocol) |
| A method that determines and sets the OSPF router type. | |
| void | VerifyBackboneConnections (const AreaVector &aAreas) |
| void | InitializeLinkState (const AreaVector &aAreas, graph::Graph &aGraph) |
| Address | InterfaceInContiguousOSPF (const Address &aDestinationInterface, ProtocolOSPF &aProtocol, std::set< Address > &aCheckedAreas) |
| std::set< ProtocolOSPF * > | GetAllASBR (ProtocolOSPF &aProtocol, std::set< Address > &aCheckedAreas) |
| Provides all of the ASBRs in contiguous OSPF areas. | |
Routing Methods | |
Routing in OSPF is based on the location of the sender in respect to the backbone, and whether the destination is in the same area, a different area, or even external to a connected OSPF area. These methods standardize the routing procedures based on discovery of these conditions during normal routing operation. | |
| std::vector< Address > | RouteToBackbone (ProtocolOSPF &aProtocol, const Address &aSendingAddress, double &aCost, size_t &aHops) |
| std::vector< Address > | RouteFromBackbone (ProtocolOSPF &aProtocol, const Address &aSendingAddress, const Address &aDestinationAddress, double &aCost, size_t &aHops) |
| std::pair< std::vector< Address >, Comm * > | RouteExternallyASBR (const Message &aMessage) |
| std::vector< Address > | MyMessage (Message &aMessage) const |
| void | ScheduleEvent (std::unique_ptr< WsfEvent > aEvent) const |
| void | SendHello (double aSimTime) |
| void | ReceiveHello (double aSimTime, const Address &aReceiverAddress, const std::vector< Address > &aValidAreas, Message &aMessage) |
| void | SendDR_GraphAdd (double aSimTime, const Address &aReceivingInterface, const std::vector< Address > &aTraceRoute) |
| void | ReceiveDR_GraphAdd (double aSimTime, const Address &aReceivingInterface, const std::vector< Address > &aValidAreas, Message &aMessage) |
| void | SendDR_GraphDrop (double aSimTime, const Address &aReceivingInterface, const Address &aDroppedInterface, const std::string &aDroppedInterfaceNetwork) |
| void | ReceiveDR_GraphDrop (double aSimTime, const Address &aReceivingInterface, const std::vector< Address > &aValidAreas, Message &aMessage) |
| void | DR_GraphAdd (graph::Graph &aGraph, const Address &aReceivingInterface, const std::vector< Address > &aTraceRoute) |
| void | DR_GraphDrop (graph::Graph &aGraph, const Address &aArea, const Address &aDroppedInterface, const std::string &aDroppedNetwork) |
| void | TimeoutUpdate (double aSimTime, bool aCalledFromEvent) |
| Handles the update of the link state list for checks on dropped interfaces via timeout. | |
| void | AddLinkState (const Address &aAreaAddress, const LinkStateData &aData) |
| LinkStateData * | FindLinkState (const Address &aAreaAddress, const Address &aLocalAddress, const Address &aRemoteAddress) |
| std::vector< LinkStateData > | FindLinkState (const Address &aAreaAddress, const Address &aRemoteAddress) |
| bool | RemoveLinkState (const Address &aAreaAddress, const Address &aLocalAddress, const Address &aRemoteAddress) |
| const LinkStateMap & | GetLinkStates () const |
| LinkStateMap & | GetLinkStates () |
Required interface from WsfComponent. | |
| WsfComponent * | CloneComponent () const override |
| const int * | GetComponentRoles () const override |
| void * | QueryInterface (int aRole) override |
| int | GetPriority () const override |
| ProtocolOSPF * | Clone () const override |
| const char * | GetScriptClassName () const override |
Optional interface usage | |
| void | Setup () override |
| bool | ProcessInput (UtInput &aInput) override |
| bool | Initialize (double aSimTime) override |
ProtocolProcess methods | |
This method implements the OSPF logic for reception of OSPF messages in the network layer. It "grabs" the message and checks if it is an OSPF type message (via Aux data) and acts accordingly to that data. | |
| bool | Send (double aSimTime, Router::SendData &aData) override |
| bool | Receive (double aSimTime, const Address &aReceivingInterface, Message &aMessage, bool &aOverrideForward) override |
| std::vector< Address > | Routing (double aSimTime, const Address &aSendingInterface, size_t &aHopNumber, double &aCost, const Message &aMessage) override |
Additional Inherited Members | |
| Public Member Functions inherited from wsf::comm::router::ProtocolInterface | |
| ProtocolInterface ()=default | |
| ~ProtocolInterface () override=default | |
| const char * | GetScriptClassName () const override |
| WsfStringId | GetComponentName () const override final |
| bool | operator< (const ProtocolInterface &aRhs) const |
| virtual void | PerfectCommAdded (double aSimTime, Comm *aCommPtr) |
| virtual void | PerfectCommRemoved (double aSimTime, Comm *aCommPtr) |
| virtual void | PerfectNetworkAdded (double aSimTime, Network *aNetworkPtr) |
| virtual void | PerfectNetworkRemoved (double aSimTime, Network *aNetworkPtr) |
| virtual void | PerfectCommEnabled (double aSimTime, Comm *aCommPtr) |
| virtual void | PerfectCommDisabled (double aSimTime, Comm *aCommPtr) |
| virtual void | PerfectConnectionAdded (double aSimTime, const Address &aSourceAddress, const Address &aDestinationAddress) |
| virtual void | PerfectConnectionRemoved (double aSimTime, const Address &aSourceAddress, const Address &aDestinationAddress) |
| virtual void | PerfectConnectionEnabled (double aSimTime, const Address &aSourceAddress, const Address &aDestinationAddress) |
| virtual void | PerfectConnectionDisabled (double aSimTime, const Address &aSourceAddress, const Address &aDestinationAddress) |
| Public Member Functions inherited from wsf::comm::router::RouterComponent | |
| RouterComponent ()=default | |
| ~RouterComponent () override=default | |
| Router * | GetRouter () const |
| WsfSimulation * | GetSimulation () const |
| NetworkManager * | GetNetworkManager () const |
| virtual void | PendingStart () |
| virtual bool | Initialize (double aSimTime) |
| virtual bool | Initialize2 (double aSimTime) |
| virtual bool | PreInitialize (double aSimTime) |
| virtual bool | ProcessInput (UtInput &aInput) |
| Public Member Functions inherited from WsfComponentT< Router > | |
| WsfComponentT () | |
| WsfComponentT & | operator= (const WsfComponentT &) noexcept |
| ~WsfComponentT () override=default | |
| virtual void | ComponentParentChanged (ParentType *aParentPtr) |
| ParentType * | GetComponentParent () const |
| void | SetComponentParent (ParentType *aParentPtr) |
| Public Member Functions inherited from WsfComponent | |
| virtual | ~WsfComponent ()=default |
| virtual int | GetComponentInitializationOrder () const |
| template<typename T> | |
| bool | QueryInterfaceT (T *&aRolePtr) |
| bool | ComponentHasRole (int aRole) |
| Returns true if the component has the specified role. | |
| virtual void | PreInput () |
| Public Member Functions inherited from WsfObject | |
| WsfObject () | |
| This is the constructor for the WsfObject class. | |
| ~WsfObject () override | |
| This is the destructor for the WsfObject class. | |
| const char * | GetScriptClassName () const override |
| const std::string & | GetType () const |
| WsfStringId | GetTypeId () const |
| Get the string ID of the 'type' of the object. | |
| void | SetType (WsfStringId aType) |
| const std::string & | GetBaseType () const |
| WsfStringId | GetBaseTypeId () const |
| const TypeList & | GetTypeList () const |
| bool | IsA_TypeOf (WsfStringId aType) const |
| WsfObject & | operator= (const WsfObject &aRhs) |
| Assignment operator. | |
| template<typename T> | |
| void | Serialize (T &aBuff) |
| For XIO (de)serialization. | |
| const std::string & | GetName () const |
| WsfStringId | GetNameId () const |
| void | SetName (WsfStringId aName) |
| WsfObject (const WsfObject &aSrc) | |
| Copy constructor (for Clone()). | |
This is a generic implementation of some of the features commonly associated with the OSPF routing protocol. Usage assumes several operating conditions that may be otherwise configurable in a full implementation to avoid issues with complexity and performance in a mission level simulation. Note that this protocol requires multicasting capabilities, currently provided by the basic IGMP multicast protocol, pre-defined and included in AFSIM, in order to function correctly. Removing the IGMP protocol when using this protocol will result in a lack of state sharing between routers with OSPF.
In general, this protocol provides some general capabilities commonly associated with OSPF in a generalized and highly abstract nature. These include:
What this implementation does NOT do:
| using wsf::comm::router::ProtocolOSPF::AreaGraphMap = std::map<Address, std::unique_ptr<graph::Graph>> |
A mapping of an area with the corresponding graph/routing table.
| using wsf::comm::router::ProtocolOSPF::AreaVector = std::vector<std::shared_ptr<OSPF_Area>> |
A list of areas associated with this router/protocol. These are shared pointers, as the OSPF_Area lifetime is shared between any routers sharing the OSPF area, and the area objects are common across routers who are members.
| using wsf::comm::router::ProtocolOSPF::LinkStateIt = LinkStateMap::iterator |
| using wsf::comm::router::ProtocolOSPF::LinkStateMap = std::map<Address, std::vector<LinkStateData>> |
A LinkStateMap provides a mapping between an area and the link state data in that area. Only ABRs and ASBRs will have more than one map entry (one for each area).
| using wsf::comm::router::ProtocolOSPF::ProtocolVector = std::vector<ProtocolOSPF*> |
ProtocolVector provides a vector of OSPF protocols.
|
strong |
|
default |
|
overridedefault |
References Clone(), CloneComponent(), GetComponentRoles(), GetPriority(), ProtocolOSPF(), and QueryInterface().
| wsf::comm::router::ProtocolOSPF::ProtocolOSPF | ( | const ProtocolOSPF & | aSrc | ) |
References wsf::comm::router::ProtocolInterface::ProtocolInterface(), and ProtocolOSPF().
|
protected |
|
overridevirtual |
Return a copy of this object. Must be implemented by all derived types. If cloning is impossible, a WsfUncloneableException should be thrown.
Implements wsf::comm::router::ProtocolInterface.
References ProtocolOSPF().
Referenced by ~ProtocolOSPF().
|
overridevirtual |
Clones a component. May return null if component does not support clone.
Implements wsf::comm::router::ProtocolInterface.
References ProtocolOSPF().
Referenced by ~ProtocolOSPF().
|
protected |
Updates the local graph to reflect the data contained in a received OSPF HELLO message, Only valid for routers acting as the DR/BDR.
References wsf::comm::graph::Graph::CreateNode(), wsf::comm::graph::Graph::FindEdge(), wsf::comm::graph::Graph::FindNode(), wsf::comm::graph::Graph::InsertEdge(), and wsf::comm::Address::IsNull().
Referenced by ReceiveDR_GraphAdd(), and ReceiveHello().
|
protected |
Updates the local graph to reflect a dropped interface due to timeout of non-reception of OSPF HELLO. Only valid for routers acting as the DR/BDR.
References GetArea(), GetGraph(), wsf::comm::router::RouterComponent::GetSimulation(), and wsf::comm::graph::Graph::RemoveNode().
Referenced by ReceiveDR_GraphDrop().
|
static |
References WsfComponentList::GetComponent(), wsf::comm::router::Router::GetComponents(), and ProtocolOSPF().
Referenced by FindOrCreate().
|
protected |
Referenced by ReceiveHello(), RouteToBackbone(), and Routing().
|
protected |
Finds a link state regardless of local interface. Returns all link states that match the destination in the provided area.
|
static |
|
protected |
Convenience method for runtime acquisition of all existing areas.
References GetAllOSPF().
Referenced by PlatformInitialized().
|
protected |
Provides all of the ASBRs in contiguous OSPF areas.
References cASBR, GetAllASBR(), GetAreas(), and ProtocolOSPF().
Referenced by GetAllASBR(), and RouteExternallyASBR().
|
protected |
Convenience method for querying the Network Manager and getting all of the OSPF enabled comm objects at the time of the call.
References WsfComponentList::RoleIterator< T >::AtEnd(), WsfSimulation::GetPlatformCount(), wsf::comm::router::RouterComponent::GetRouter(), WsfPlatformPart::GetSimulation(), and platformPtr.
Referenced by GetAllAreas(), and Setup().
Referenced by DR_GraphDrop(), ReceiveDR_GraphAdd(), ReceiveDR_GraphDrop(), and ReceiveHello().
|
inline |
Referenced by GetAllASBR(), InterfaceInContiguousOSPF(), Routing(), and SetRouterRoleType().
|
inline |
Referenced by SetRouterRoleType().
|
overridevirtual |
Returns a zero-terminated array of component roles. Note that the array should be in decreasing order of specificity and should generally the inheritance hierarchy. The first entry should be the components 'primary' role. For example a sensor would do the following:
Implements wsf::comm::router::ProtocolInterface.
References cWSF_COMPONENT_COMM_ROUTER_PROTOCOL, cWSF_COMPONENT_COMM_ROUTER_PROTOCOL_OSPF, and cWSF_COMPONENT_NULL.
Referenced by ~ProtocolOSPF().
|
overridevirtual |
This graph is truth via the network manager. It shouldn't be used internally. It is provided for multicast functionality.
Implements wsf::comm::router::ProtocolInterface.
References WsfSimulation::GetCommNetworkManager(), wsf::comm::NetworkManager::GetGraph(), and wsf::comm::router::RouterComponent::GetSimulation().
Referenced by DR_GraphDrop(), ReceiveDR_GraphAdd(), ReceiveDR_GraphDrop(), ReceiveHello(), and Setup().
| graph::Graph * wsf::comm::router::ProtocolOSPF::GetGraph | ( | const Address & | aArea | ) |
|
inline |
|
inline |
|
inlineprotected |
|
inlineprotected |
|
overridevirtual |
Required query for protocol priority. Protocols are evaluated in order based on their assigned priorities. A lower value indicates a higher priority.
Implements wsf::comm::router::ProtocolInterface.
References wsf::comm::cOSPF.
Referenced by ~ProtocolOSPF().
|
inline |
| Comm * wsf::comm::router::ProtocolOSPF::GetPriorityInterface | ( | const std::string | aNetwork | ) | const |
Given a network name, returns the interface available to this router/protocol with the highest priority (the highest binary value address) belonging to that network. Returns a nullptr if such an interface could not be found.
References wsf::comm::router::RouterComponent::GetRouter().
Referenced by wsf::comm::router::OSPF_Area::ElectionDR().
|
inlineoverride |
|
overridevirtual |
Perform phase 1 initialization. This is called by WsfPlatform::Initialize() during phase 1 initialization of the platform. The component should complete validation of input data that could not be done by ProcessInput, as well as any other functions to prepare for simulation use (subject to the next paragraph).
The order in which components are initialized is defined by GetComponentInitializationOrder. In general a component implementation of this method should not be dependent on the state of another component, i.e.: it should not assume that the other components Initialize() method has been called. If such a dependency exists one should use Initialize2() if possible, or specify a value GetComponentInitializationOrder to force things to initialize in a particular order.
| aSimTime | The current simulation time. |
Reimplemented from wsf::comm::router::ProtocolInterface.
References WsfComponentList::GetComponent(), wsf::comm::router::Router::GetComponents(), WsfObject::GetName(), WsfPlatformPart::GetPlatform(), wsf::comm::router::RouterComponent::GetRouter(), wsf::comm::router::RouterComponent::GetSimulation(), wsf::comm::router::ProtocolMulticast::Initialize(), PlatformInitialized(), ScheduleEvent(), SendHello(), and TimeoutUpdate().
|
protected |
A method for initializing link state data for OSPF routers. Used only for sim initialization for network convergence. The data is maintained organically during runtime, or with the entry of new routers/interfaces. Uses the provided graph to initialize the data.
References wsf::comm::graph::Graph::FindAnyPath(), wsf::comm::Address::GetAddress(), wsf::comm::router::ProtocolOSPF::LinkStateData::mLastUpdateTime, wsf::comm::router::ProtocolOSPF::LinkStateData::mLocalInterface, wsf::comm::router::ProtocolOSPF::LinkStateData::mLocalNetwork, wsf::comm::router::ProtocolOSPF::LinkStateData::mRemoteInterface, and wsf::comm::router::ProtocolOSPF::LinkStateData::mRemoteNetwork.
Referenced by Setup().
|
protected |
Instead of using summary tables, we cheat by peeking at other area link state data to find the membership of a router with an interface in our connected OSPF areas. Returns the address of the area, which is null if not found.
References GetAreas(), InterfaceInContiguousOSPF(), and ProtocolOSPF().
Referenced by InterfaceInContiguousOSPF(), and Routing().
|
inline |
Referenced by SetRouterRoleType(), and Setup().
|
protected |
Determines if a message is for us. OSPF multicast messages provide the area, so we ensure this matches the area we belong to. Returns the matching addresses of the areas shared.
References wsf::comm::Message::SourceMessage().
Referenced by Receive().
| void wsf::comm::router::ProtocolOSPF::PlatformInitialized | ( | double | aSimTime, |
| WsfPlatform * | aPlatformPtr ) |
Callback methods to handle addition of routers during runtime.
References WsfComponentList::RoleIterator< T >::AtEnd(), wsf::comm::Comm::cLEVEL_2, wsf::comm::Address::GetAddress(), GetAllAreas(), WsfPlatform::GetComponents(), wsf::comm::router::RouterComponent::GetSimulation(), ProtocolOSPF(), SetRouterRoleType(), and VerifyBackboneConnections().
Referenced by Initialize().
|
overridevirtual |
Evaluate the current input command and determine if it is one processed by the component. The component should get the current command from the input stream and determine if it is one that it recognizes. If it does not recognize the command then it should leave the command in the input stream and return false. If it does recognize the command then it should process the command and return true. If invalid arguments are encountered then it should throw an exception.
| aInput | The input stream. |
| UtInput::ExceptionBase | if an invalid input was encountered. |
Reimplemented from wsf::comm::router::ProtocolInterface.
References wsf::comm::Address::ProcessInput(), and WsfRandomVariable::ProcessInput().
|
overridevirtual |
Requests a component's role interface. A component can support one or more roles.
| aRole | The role whose interface is to be returned. |
Implements wsf::comm::router::ProtocolInterface.
References cWSF_COMPONENT_COMM_ROUTER_PROTOCOL, cWSF_COMPONENT_COMM_ROUTER_PROTOCOL_OSPF, and wsf::comm::router::ProtocolInterface::ProtocolInterface().
Referenced by ~ProtocolOSPF().
|
overridevirtual |
Received a hello message.
Received a drop message for DR/BDR graph usage.
Receive an add message for DR/BDR graph usage.
Reimplemented from wsf::comm::router::ProtocolInterface.
References wsf::comm::router::cID_OSPF_ALL_DR_ADD, wsf::comm::router::cID_OSPF_ALL_DR_DROP, wsf::comm::router::cID_OSPF_ALL_HELLO, MyMessage(), ReceiveDR_GraphAdd(), ReceiveDR_GraphDrop(), ReceiveHello(), and wsf::comm::Message::SourceMessage().
|
protected |
References DR_GraphAdd(), GetArea(), wsf::comm::router::OSPF_Area::GetBDRs(), wsf::comm::NetworkManager::GetComm(), WsfSimulation::GetCommNetworkManager(), wsf::comm::router::OSPF_Area::GetDRs(), GetGraph(), wsf::comm::router::RouterComponent::GetSimulation(), and wsf::comm::Message::SourceMessage().
Referenced by Receive().
|
protected |
References DR_GraphDrop(), GetArea(), wsf::comm::router::OSPF_Area::GetBDRs(), wsf::comm::NetworkManager::GetComm(), WsfSimulation::GetCommNetworkManager(), wsf::comm::router::OSPF_Area::GetDRs(), GetGraph(), wsf::comm::router::RouterComponent::GetSimulation(), and wsf::comm::Message::SourceMessage().
Referenced by Receive().
|
protected |
References AddLinkState(), DR_GraphAdd(), FindLinkState(), GetArea(), wsf::comm::router::OSPF_Area::GetBDRs(), wsf::comm::NetworkManager::GetComm(), WsfSimulation::GetCommNetworkManager(), wsf::comm::router::OSPF_Area::GetDRs(), GetGraph(), wsf::comm::router::RouterComponent::GetSimulation(), wsf::comm::Message::GetTraceRoute(), wsf::comm::router::ProtocolOSPF::LinkStateData::mLastUpdateTime, wsf::comm::router::ProtocolOSPF::LinkStateData::mLocalInterface, wsf::comm::router::ProtocolOSPF::LinkStateData::mLocalNetwork, wsf::comm::router::ProtocolOSPF::LinkStateData::mRemoteInterface, wsf::comm::router::ProtocolOSPF::LinkStateData::mRemoteNetwork, SendDR_GraphAdd(), wsf::comm::Message::SourceMessage(), and TimeoutUpdate().
Referenced by Receive().
|
protected |
|
protected |
Using all of the connected ASBRs, find the optimal external route to the destination using a non-OSPF routing protocol. This is not guaranteed to succeed. Removes the need for ASBR's to send summary data across OSPF by directly polling. Does not provide a path from the current sender to the ASBR itself, just the best external path available and identification of the router that provides it.
References cWSF_COMPONENT_COMM_ROUTER_PROTOCOL, cWSF_COMPONENT_COMM_ROUTER_PROTOCOL_MULTICAST, cWSF_COMPONENT_COMM_ROUTER_PROTOCOL_OSPF, GetAllASBR(), wsf::comm::router::RouterComponent::GetSimulation(), wsf::comm::router::ProtocolInterface::ProtocolInterface(), and wsf::comm::router::ProtocolInterface::Routing().
Referenced by Routing().
|
protected |
Find a route to the correct area from the backbone. Assumes knowledge that the destination is in a connected OSPF area that isn't the backbone, and the current handling router is in the backbone.
References cABR, cASBR, wsf::comm::NetworkManager::GetComm(), WsfSimulation::GetCommNetworkManager(), wsf::comm::router::RouterComponent::GetSimulation(), and ProtocolOSPF().
Referenced by Routing().
|
protected |
Finds a route to the backbone. Assumes knowledge that the destination is in a connected OSPF area, and the current handling router is not in the backbone.
We only want the ABR/ASBRs. Check that they are in the backbone.
References cABR, cASBR, FindLinkState(), wsf::comm::Address::GetAddress(), wsf::comm::NetworkManager::GetComm(), WsfSimulation::GetCommNetworkManager(), wsf::comm::router::RouterComponent::GetSimulation(), and ProtocolOSPF().
Referenced by Routing().
|
overridevirtual |
The routing method is used by the router to determine the route based on the protocol defined routing algorithm. A return of an empty vector indicates that no path was found. The router will utilize any of its available interfaces to find a valid path.
Implements wsf::comm::router::ProtocolInterface.
References FindLinkState(), wsf::comm::Address::GetAddress(), wsf::comm::router::OSPF_Area::GetAddress(), GetAreas(), WsfSimulation::GetCommNetworkManager(), WsfComponentList::GetComponent(), wsf::comm::router::Router::GetComponents(), wsf::comm::router::OSPF_Area::GetDRs(), wsf::comm::router::RouterComponent::GetRouter(), wsf::comm::router::RouterComponent::GetSimulation(), InterfaceInContiguousOSPF(), wsf::comm::Address::IsNull(), ProtocolOSPF(), RouteExternallyASBR(), RouteFromBackbone(), RouteToBackbone(), and wsf::comm::Message::SourceMessage().
Referenced by Send().
|
protected |
Schedules an event. Doesn't fire if the scheduler is removed from the sim.
References WsfComponentT< Router >::GetComponentParent(), and wsf::comm::router::RouterComponent::GetSimulation().
Referenced by Initialize(), SendHello(), and TimeoutUpdate().
|
overridevirtual |
|
protected |
Send a message to DR/BDR over multicast about a discovered interface and connections.
References wsf::comm::router::cID_OSPF_ALL_DR_ADD, wsf::comm::NetworkManager::GetComm(), WsfSimulation::GetCommNetworkManager(), and wsf::comm::router::RouterComponent::GetSimulation().
Referenced by ReceiveHello().
|
protected |
OSPF messages These messages are generic link state messages to implement general OSPF behavior.
Reschedule hello packet sending.
References wsf::comm::router::cID_OSPF_ALL_HELLO, wsf::comm::router::RouterComponent::GetRouter(), wsf::comm::router::RouterComponent::GetSimulation(), ScheduleEvent(), and SendHello().
Referenced by Initialize(), and SendHello().
|
inline |
Referenced by SetRouterRoleType().
| void wsf::comm::router::ProtocolOSPF::SetGraph | ( | const Address & | aArea, |
| std::unique_ptr< graph::Graph > | aGraph ) |
Referenced by wsf::comm::router::OSPF_Area::ElectionDR().
|
protected |
A method that determines and sets the OSPF router type.
References cABR, cASBR, cNONE, cWSF_COMPONENT_COMM_ROUTER_PROTOCOL, cWSF_COMPONENT_COMM_ROUTER_PROTOCOL_MULTICAST, cWSF_COMPONENT_COMM_ROUTER_PROTOCOL_OSPF, GetAreas(), GetAreaType(), wsf::comm::router::Router::GetComponents(), WsfObject::GetName(), WsfPlatformPart::GetPlatform(), wsf::comm::router::RouterComponent::GetRouter(), wsf::comm::router::Router::IsActive(), IsSetup(), ProtocolOSPF(), and SetAreaType().
Referenced by PlatformInitialized(), and Setup().
|
inline |
|
overridevirtual |
Reimplemented from wsf::comm::router::RouterComponent.
References wsf::comm::Comm::cLEVEL_2, wsf::comm::Address::GetAddress(), GetAllOSPF(), WsfSimulation::GetCommNetworkManager(), wsf::comm::NetworkManager::GetGraph(), GetGraph(), wsf::comm::router::RouterComponent::GetSimulation(), InitializeLinkState(), IsSetup(), SetRouterRoleType(), and VerifyBackboneConnections().
|
inlineoverridevirtual |
Implements wsf::comm::router::ProtocolInterface.
|
protected |
Handles the update of the link state list for checks on dropped interfaces via timeout.
References ScheduleEvent(), SendDR_GraphDrop(), and TimeoutUpdate().
Referenced by Initialize(), ReceiveHello(), and TimeoutUpdate().
|
protected |
A method that provides verification that each area is directly connected to the backbone, and throw an exception if this condition does not exist due to improper user configuration.
Referenced by PlatformInitialized(), and Setup().
|
staticconstexpr |
|
staticconstexpr |
|
staticconstexpr |
|
staticconstexpr |