23 #ifndef ROCKETFUEL_MAP_READER_H
24 #define ROCKETFUEL_MAP_READER_H
26 #include "ns3/annotated-topology-reader.h"
27 #include "ns3/net-device-container.h"
28 #include "ns3/random-variable.h"
30 #include "ns3/data-rate.h"
32 #include <boost/graph/adjacency_list.hpp>
41 int clientNodeDegrees;
44 string minb2bBandwidth;
47 string maxb2bBandwidth;
51 string minb2gBandwidth;
54 string maxb2gBandwidth;
58 string ming2cBandwidth;
61 string maxg2cBandwidth;
83 RocketfuelMapReader (
const std::string &path=
"",
double scale=1.0,
const string &referenceOspfRate=
"100Mbps");
107 virtual NodeContainer
108 Read (
RocketfuelParams params,
bool keepOneComponent=
true,
bool connectBackbones=
true);
111 GetBackboneRouters()
const;
114 GetGatewayRouters()
const;
117 GetCustomerRouters()
const;
120 SaveTopology (
const std::string &file);
123 SaveGraphviz (
const std::string &file);
131 GenerateFromMapsFile (
int argc,
char *argv[]);
134 CreateLink (
string nodeName1,
string nodeName2,
136 const string &minBw,
const string &maxBw,
137 const string &minDelay,
const string &maxDelay);
139 KeepOnlyBiggestConnectedComponent ();
141 void AssignClients(uint32_t clientDegree, uint32_t gwDegree);
144 ConnectBackboneRouters ();
147 UniformVariable m_randVar;
149 NodeContainer m_backboneRouters;
150 NodeContainer m_gatewayRouters;
151 NodeContainer m_customerRouters;
153 typedef boost::adjacency_list_traits<boost::setS, boost::setS, boost::undirectedS> Traits;
155 enum node_type_t {UNKNOWN = 0, CLIENT = 1, GATEWAY = 2, BACKBONE = 3};
157 typedef boost::property< boost::vertex_name_t, std::string, boost::property
158 < boost::vertex_index_t, uint32_t, boost::property
159 < boost::vertex_rank_t, node_type_t, boost::property
160 < boost::vertex_color_t, std::string > > > > nodeProperty;
162 typedef boost::no_property edgeProperty;
164 typedef boost::adjacency_list< boost::setS, boost::setS, boost::undirectedS,
165 nodeProperty, edgeProperty > Graph;
167 typedef map<string, Traits::vertex_descriptor> node_map_t;
168 node_map_t m_graphNodes;
171 uint32_t m_maxNodeId;
173 const DataRate m_referenceOspfRate;
178 assignGw (Traits::vertex_descriptor vertex, uint32_t degree, node_type_t nodeType);
Topology file reader and topology estimator (extension of Rocketfuel-format type).
This class reads annotated topology and apply settings to the corresponding nodes and links...