22#include "omnetpp/cexception.h"
26class LinkStateDatabase;
27struct LinkStateAdvertisement;
28struct SummaryLinkStateAdvertisement;
29struct OspfNeighborInfo;
Represents the database that holds link-state advertisements of nodes. Effectively,...
Definition Ospf.h:88
NodeAddr getSecondNodeInPathToDestNode(NodeAddr source_id, NodeAddr dst_id, const VertexMap &vertices) const
Definition Ospf.cc:88
std::map< NodeAddr, int > generateRoutingTableFromGraph(NodeAddr source) const
Definition Ospf.cc:37
LinkStateDatabaseSummary getLinkStateDatabaseSummary()
Get the Link State Database Summary object.
Definition Ospf.cc:28
virtual const VertexMap dijkstraAlgorithm(NodeAddr source_id) const
Dijkstra's Algorithm Reference: Thomas H. Cormen, Charles E. Leiserson, Ronald L. Rivest,...
Definition Ospf.cc:107
VertexMap generateVerticesFromLsdb() const
Definition Ospf.cc:138
RouterIds identifyMissingLinkStateAdvertisementId(const LinkStateDatabaseSummary &lsdb_summary_from_neighbor) const
Definition Ospf.cc:49
LinkStateUpdate getLinkStateUpdatesFor(const RouterIds &requests, int my_address) const
Definition Ospf.cc:64
virtual bool needsFullLinkStateAdvertisementOf(const SummaryLinkStateAdvertisement &summary_lsa) const
Definition Ospf.cc:57
std::map< NodeAddr, VertexSharedPtr > VertexMap
Definition Ospf.h:103
int getHopAddressToNeighbor(NodeAddr src, NodeAddr neighbor) const
Definition Ospf.cc:81
double weight(NodeAddr node1, NodeAddr node2) const
Definition Ospf.cc:146
LinkStateDatabaseSummary lsdb_summary
Definition Ospf.h:130
VertexSharedPtr popMinDistanceNode(PriorityQueue &q) const
Definition Ospf.cc:153
virtual LinkStateAdvertisement getLinkStateAdvertisementOf(NodeAddr router) const
Definition Ospf.cc:74
std::map< NodeAddr, LinkStateAdvertisement > link_state_database
Definition Ospf.h:129
bool hasLinkStateAdvertisementOf(NodeAddr router) const
Definition Ospf.cc:79
std::shared_ptr< Vertex > VertexSharedPtr
Definition Ospf.h:102
std::priority_queue< VertexSharedPtr, std::vector< VertexSharedPtr >, VertexMinPriority > PriorityQueue
Definition Ospf.h:104
void updateLinkStateDatabase(LinkStateAdvertisement &lsa)
Adds new lsa or updated lsa to link_state_database As a sideffect, this function clears lsdb_summary.
Definition Ospf.cc:9
std::vector< LinkStateAdvertisement > LinkStateUpdate
Definition Ospf.h:36
std::map< NodeAddr, OspfNeighborInfo > NeighborTable
Definition Ospf.h:34
int NodeAddr
Definition Ospf.h:32
OspfState
Definition Ospf.h:38
std::vector< int > RouterIds
Definition Ospf.h:33
std::vector< SummaryLinkStateAdvertisement > LinkStateDatabaseSummary
Definition Ospf.h:35
Full link-state advertisement that holds info of neighbor_nodes. Element that makes up the LinkStateD...
Definition Ospf.h:74
LinkStateAdvertisement()=default
LinkStateAdvertisement(NodeAddr _id, NodeAddr _origin_id, int _age, NeighborTable _neighbor_table)
Definition Ospf.h:77
NeighborTable neighbor_nodes
Definition Ospf.h:75
LinkStateAdvertisement(NodeAddr _id, NodeAddr _origin_id, NeighborTable _neighbor_table)
Definition Ospf.h:76
double distance_from_source
Definition Ospf.h:134
NodeAddr node_id
Definition Ospf.h:133
static constexpr int no_prev_node
Definition Ospf.h:136
Vertex(LinkStateAdvertisement _lsa)
Definition Ospf.h:137
NodeAddr prev_node_in_path
Definition Ospf.h:135
bool operator()(VertexSharedPtr const l, VertexSharedPtr const r) const noexcept
Definition Ospf.h:142
OspfNeighborInfo(int _router_id, int _hop_address, double _cost)
Definition Ospf.h:51
OspfNeighborInfo(int _router_id, int _hop_address, OspfState _state, double _cost)
Definition Ospf.h:52
OspfNeighborInfo(int _hop_address, OspfState _state)
Definition Ospf.h:49
OspfNeighborInfo(int _hop_address, OspfState _state, double _cost)
Definition Ospf.h:50
double cost
Definition Ospf.h:46
int hop_address
Definition Ospf.h:44
NodeAddr router_id
Definition Ospf.h:41
OspfNeighborInfo()=default
OspfState state
Definition Ospf.h:45
OspfNeighborInfo(int _router_id)
Definition Ospf.h:48
This struct is used in DBD packet exchange for two nodes to communicate what link-state advertisement...
Definition Ospf.h:61
int lsa_age
Definition Ospf.h:64
NodeAddr lsa_origin_id
Definition Ospf.h:63
SummaryLinkStateAdvertisement(NodeAddr _id, NodeAddr _origin_id, int _age)
Definition Ospf.h:65
SummaryLinkStateAdvertisement()=default
NodeAddr lsa_id
Definition Ospf.h:62