This class reads annotated topology and apply settings to the corresponding nodes and links. More...
#include <annotated-topology-reader.hpp>
Public Member Functions | |
AnnotatedTopologyReader (const std::string &path="", double scale=1.0) | |
Constructor. More... | |
virtual | ~AnnotatedTopologyReader () |
virtual NodeContainer | Read () |
Main annotated topology reading function. More... | |
virtual NodeContainer | GetNodes () const |
Get nodes read by the reader. More... | |
virtual const std::list< Link > & | GetLinks () const |
Get links read by the reader. More... | |
virtual void | AssignIpv4Addresses (Ipv4Address base) |
Assign IPv4 addresses to all links. More... | |
virtual void | SetBoundingBox (double ulx, double uly, double lrx, double lry) |
Set bounding box where nodes will be randomly places (if positions are unspecified) More... | |
virtual void | SetMobilityModel (const std::string &model) |
Set mobility model to be used on nodes. More... | |
virtual void | ApplyOspfMetric () |
Apply OSPF metric on Ipv4 (if exists) and Ccnx (if exists) stacks. More... | |
virtual void | SaveTopology (const std::string &file) |
Save positions (e.g., after manual modification using visualizer) More... | |
virtual void | SaveGraphviz (const std::string &file) |
Save topology in graphviz format (.dot file) More... | |
Protected Member Functions | |
Ptr< Node > | CreateNode (const std::string name, uint32_t systemId) |
Ptr< Node > | CreateNode (const std::string name, double posX, double posY, uint32_t systemId) |
void | ApplySettings () |
This method applies setting to corresponding nodes and links NetDeviceContainer must be allocated NodeContainer from Read method. More... | |
Protected Attributes | |
std::string | m_path |
NodeContainer | m_nodes |
This class reads annotated topology and apply settings to the corresponding nodes and links.
Definition at line 36 of file annotated-topology-reader.hpp.
ns3::AnnotatedTopologyReader::AnnotatedTopologyReader | ( | const std::string & | path = "" , |
double | scale = 1.0 |
||
) |
Constructor.
path | ns3::Names path |
scale | Scaling factor for coordinates in input file |
Definition at line 67 of file annotated-topology-reader.cpp.
References SetMobilityModel().
|
virtual |
Definition at line 104 of file annotated-topology-reader.cpp.
|
virtual |
Main annotated topology reading function.
This method opens an input stream and reads topology file with annotations.
Reimplemented in ns3::RocketfuelMapReader, and ns3::RocketfuelWeightsReader.
Definition at line 155 of file annotated-topology-reader.cpp.
References ApplySettings(), CreateNode(), m_nodes, and m_path.
Referenced by ns3::RocketfuelWeightsReader::Read().
|
virtual |
Get nodes read by the reader.
Definition at line 143 of file annotated-topology-reader.cpp.
References m_nodes.
|
virtual |
Get links read by the reader.
Definition at line 149 of file annotated-topology-reader.cpp.
Referenced by ns3::RocketfuelMapReader::Read().
|
virtual |
Assign IPv4 addresses to all links.
Note, IPv4 stack should be installed on all nodes prior this call
Every link will receive /24 netmask
base | Starting IPv4 address (second link will have base+256) |
Definition at line 270 of file annotated-topology-reader.cpp.
|
virtual |
Set bounding box where nodes will be randomly places (if positions are unspecified)
ulx | Upper left x coordinate |
uly | Upper left y coordinate |
lrx | Lower right x coordinate |
lry | Lower right y coordinate |
Definition at line 86 of file annotated-topology-reader.cpp.
|
virtual |
Set mobility model to be used on nodes.
model | class name of the model |
Definition at line 98 of file annotated-topology-reader.cpp.
Referenced by AnnotatedTopologyReader().
|
virtual |
Apply OSPF metric on Ipv4 (if exists) and Ccnx (if exists) stacks.
Definition at line 283 of file annotated-topology-reader.cpp.
References ns3::ndn::L3Protocol::getFaceByNetDevice().
|
virtual |
Save positions (e.g., after manual modification using visualizer)
Reimplemented in ns3::RocketfuelMapReader.
Definition at line 436 of file annotated-topology-reader.cpp.
References m_nodes.
|
virtual |
Save topology in graphviz format (.dot file)
Reimplemented in ns3::RocketfuelMapReader.
Definition at line 539 of file annotated-topology-reader.cpp.
References m_nodes.
|
protected |
Definition at line 110 of file annotated-topology-reader.cpp.
References m_nodes, and m_path.
Referenced by Read(), ns3::RocketfuelWeightsReader::Read(), and ns3::RocketfuelMapReader::Read().
|
protected |
Definition at line 124 of file annotated-topology-reader.cpp.
|
protected |
This method applies setting to corresponding nodes and links NetDeviceContainer must be allocated NodeContainer from Read method.
Definition at line 328 of file annotated-topology-reader.cpp.
Referenced by ns3::RocketfuelWeightsReader::Commit(), Read(), and ns3::RocketfuelMapReader::Read().
|
protected |
Definition at line 135 of file annotated-topology-reader.hpp.
Referenced by CreateNode(), Read(), and ns3::RocketfuelWeightsReader::Read().
|
protected |
Definition at line 136 of file annotated-topology-reader.hpp.
Referenced by CreateNode(), GetNodes(), Read(), ns3::RocketfuelWeightsReader::Read(), ns3::RocketfuelMapReader::Read(), SaveGraphviz(), and SaveTopology().