NS-3 based Named Data Networking (NDN) simulator
ndnSIM 2.0: NDN, CCN, CCNx, content centric networks
API Documentation
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Groups
Pages
rocketfuel-map-reader.hpp
Go to the documentation of this file.
1
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
20
// Based on the code by Hajime Tazaki <tazaki@sfc.wide.ad.jp>
21
22
#ifndef ROCKETFUEL_MAP_READER_H
23
#define ROCKETFUEL_MAP_READER_H
24
25
#include "
annotated-topology-reader.hpp
"
26
27
#include "ns3/net-device-container.h"
28
#include "ns3/random-variable.h"
29
#include "ns3/data-rate.h"
30
31
#include <set>
32
#include <boost/graph/adjacency_list.hpp>
33
34
using namespace
std;
35
36
namespace
ns3 {
37
38
struct
RocketfuelParams
{
39
double
averageRtt
;
40
int
clientNodeDegrees
;
41
42
// parameters for links Backbone <->Backbone
43
string
minb2bBandwidth
;
44
string
minb2bDelay
;
45
46
string
maxb2bBandwidth
;
47
string
maxb2bDelay
;
48
49
// parameters for links Backbone<->Gateway and Gateway <-> Gateway
50
string
minb2gBandwidth
;
51
string
minb2gDelay
;
52
53
string
maxb2gBandwidth
;
54
string
maxb2gDelay
;
55
56
// parameters for links Gateway <-> Customer
57
string
ming2cBandwidth
;
58
string
ming2cDelay
;
59
60
string
maxg2cBandwidth
;
61
string
maxg2cDelay
;
62
};
63
81
class
RocketfuelMapReader
:
public
AnnotatedTopologyReader
{
82
public
:
83
RocketfuelMapReader
(
const
std::string& path =
""
,
double
scale = 1.0,
84
const
string
& referenceOspfRate =
"100Mbps"
);
85
virtual
~
RocketfuelMapReader
();
86
91
virtual
NodeContainer
92
Read();
93
110
virtual
NodeContainer
111
Read(
RocketfuelParams
params,
bool
keepOneComponent =
true
,
bool
connectBackbones =
true
);
112
113
const
NodeContainer&
114
GetBackboneRouters()
const
;
115
116
const
NodeContainer&
117
GetGatewayRouters()
const
;
118
119
const
NodeContainer&
120
GetCustomerRouters()
const
;
121
122
virtual
void
123
SaveTopology(
const
std::string& file);
124
125
virtual
void
126
SaveGraphviz(
const
std::string& file);
127
128
private
:
129
RocketfuelMapReader
(
const
RocketfuelMapReader
&);
130
RocketfuelMapReader
&
131
operator=(
const
RocketfuelMapReader
&);
132
133
// NodeContainer
134
void
135
GenerateFromMapsFile(
int
argc,
char
* argv[]);
136
137
void
138
CreateLink(
string
nodeName1,
string
nodeName2,
double
averageRtt,
const
string
& minBw,
139
const
string
& maxBw,
const
string
& minDelay,
const
string
& maxDelay);
140
void
141
KeepOnlyBiggestConnectedComponent();
142
143
void
144
AssignClients(uint32_t clientDegree, uint32_t gwDegree);
145
146
void
147
ConnectBackboneRouters();
148
149
private
:
150
UniformVariable m_randVar;
151
152
NodeContainer m_backboneRouters;
153
NodeContainer m_gatewayRouters;
154
NodeContainer m_customerRouters;
155
156
typedef
boost::adjacency_list_traits<boost::setS, boost::setS, boost::undirectedS> Traits;
157
158
enum
node_type_t { UNKNOWN = 0, CLIENT = 1, GATEWAY = 2, BACKBONE = 3 };
159
160
typedef
boost::
161
property<boost::vertex_name_t, std::string,
162
boost::property<boost::vertex_index_t, uint32_t,
163
boost::property<boost::vertex_rank_t, node_type_t,
164
boost::property<boost::vertex_color_t, std::string>>>>
165
nodeProperty;
166
167
typedef
boost::no_property edgeProperty;
168
169
typedef
boost::adjacency_list<boost::setS, boost::setS, boost::undirectedS, nodeProperty,
170
edgeProperty> Graph;
171
172
typedef
map<string, Traits::vertex_descriptor> node_map_t;
173
node_map_t m_graphNodes;
174
175
Graph m_graph;
176
uint32_t m_maxNodeId;
177
178
const
DataRate m_referenceOspfRate;
// reference rate of OSPF metric calculation
179
180
private
:
181
void
182
assignGw(Traits::vertex_descriptor vertex, uint32_t degree, node_type_t nodeType);
183
};
// end class RocketfuelMapReader
184
185
};
// end namespace ns3
186
187
#endif
/* ROCKETFUEL_MAP_READER_H */
ns3::RocketfuelParams::maxb2bDelay
string maxb2bDelay
Definition:
rocketfuel-map-reader.hpp:47
annotated-topology-reader.hpp
ns3::RocketfuelParams::clientNodeDegrees
int clientNodeDegrees
Definition:
rocketfuel-map-reader.hpp:40
ns3::RocketfuelParams::maxg2cBandwidth
string maxg2cBandwidth
Definition:
rocketfuel-map-reader.hpp:60
ns3::AnnotatedTopologyReader
This class reads annotated topology and apply settings to the corresponding nodes and links...
Definition:
annotated-topology-reader.hpp:36
ns3::RocketfuelParams::minb2gBandwidth
string minb2gBandwidth
Definition:
rocketfuel-map-reader.hpp:50
ns3::RocketfuelMapReader
Topology file reader and topology estimator (extension of Rocketfuel-format type).
Definition:
rocketfuel-map-reader.hpp:81
ns3::RocketfuelParams::minb2bBandwidth
string minb2bBandwidth
Definition:
rocketfuel-map-reader.hpp:43
ns3::RocketfuelParams::maxb2bBandwidth
string maxb2bBandwidth
Definition:
rocketfuel-map-reader.hpp:46
ns3::RocketfuelParams
Definition:
rocketfuel-map-reader.hpp:38
ns3::RocketfuelParams::minb2gDelay
string minb2gDelay
Definition:
rocketfuel-map-reader.hpp:51
ns3::RocketfuelParams::ming2cDelay
string ming2cDelay
Definition:
rocketfuel-map-reader.hpp:58
ns3::RocketfuelParams::minb2bDelay
string minb2bDelay
Definition:
rocketfuel-map-reader.hpp:44
ns3::RocketfuelParams::maxb2gDelay
string maxb2gDelay
Definition:
rocketfuel-map-reader.hpp:54
ns3::RocketfuelParams::maxb2gBandwidth
string maxb2gBandwidth
Definition:
rocketfuel-map-reader.hpp:53
ns3::RocketfuelParams::maxg2cDelay
string maxg2cDelay
Definition:
rocketfuel-map-reader.hpp:61
RocketfuelMapReader
RocketfuelMapReader
Definition:
rocketfuel-map-reader.cpp:60
ns3::RocketfuelParams::averageRtt
double averageRtt
Definition:
rocketfuel-map-reader.hpp:39
ns3::RocketfuelParams::ming2cBandwidth
string ming2cBandwidth
Definition:
rocketfuel-map-reader.hpp:57
ndnSIM
utils
topology
rocketfuel-map-reader.hpp
Generated on Wed Feb 18 2015 16:31:16 for ndnSIM by
1.8.7