NS-3 based Named Data Networking (NDN) simulator
ndnSIM 2.5: NDN, CCN, CCNx, content centric networks
API Documentation
ndn-scenario-helper.hpp
Go to the documentation of this file.
1
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
20
#ifndef NDNSIM_HELPER_NDN_SCENARIO_HELPER_HPP
21
#define NDNSIM_HELPER_NDN_SCENARIO_HELPER_HPP
22
23
#include "
ndn-stack-helper.hpp
"
24
25
#include "ns3/net-device.h"
26
#include "ns3/node.h"
27
28
#include <ndn-cxx/name.hpp>
29
#include <map>
30
31
namespace
ns3
{
32
namespace
ndn
{
33
63
class
ScenarioHelper
64
{
65
public
:
72
struct
RouteInfo
73
{
74
std::string
node1
;
75
std::string
node2
;
76
Name
prefix
;
77
int32_t
metric
;
78
};
79
80
/*
81
* @brief Application information for addApps method
82
*
83
* It is preferred to use initializer list to indirectly pass AppInfo's to addApps
84
* method.
85
*/
86
struct
AppInfo
87
{
88
std::string
node
;
89
std::string
name
;
90
std::initializer_list<std::pair<std::string, std::string>>
params
;
91
std::string
start
;
92
std::string
end
;
93
};
94
95
public
:
96
ScenarioHelper
();
97
110
void
111
createTopology
(std::initializer_list<std::initializer_list<std::string>
/*node clique*/
> topology,
112
bool
shouldInstallNdnStack =
true
);
113
125
void
126
addRoutes
(std::initializer_list<RouteInfo> routes);
127
143
void
144
addApps
(std::initializer_list<AppInfo> apps);
145
146
public
:
// topology accessors
151
Ptr<Node>
152
getNode
(
const
std::string& nodeName);
153
158
shared_ptr<Face>
159
getFace
(
const
std::string& node1,
const
std::string& node2);
160
165
Ptr<NetDevice>
166
getNetDevice
(
const
std::string& node1,
const
std::string& node2);
167
171
void
172
disableRibManager
();
173
174
// Cannot be disabled for now
175
// /**
176
// * \brief Disable Face Manager
177
// */
178
// void
179
// disableFaceManager();
180
184
void
185
disableStrategyChoiceManager
();
186
190
void
191
disableForwarderStatusManager
();
192
196
StackHelper
&
197
getStackHelper
();
198
199
private
:
200
Ptr<Node>
201
getOrCreateNode(
const
std::string& nodeName);
202
203
private
:
204
bool
m_isTopologyInitialized;
205
StackHelper
ndnHelper;
206
std::map<std::string, std::map<std::string, Ptr<NetDevice>>> links;
207
std::map<std::string, Ptr<Node>> nodes;
208
};
209
210
}
// namespace ndn
211
}
// namespace ns3
212
213
#endif // NDNSIM_HELPER_NDN_SCENARIO_HELPER_HPP
ns3::ndn::ScenarioHelper::AppInfo::start
std::string start
Definition:
ndn-scenario-helper.hpp:91
ns3::ndn::ScenarioHelper::RouteInfo::node1
std::string node1
Definition:
ndn-scenario-helper.hpp:74
ndn
Copyright (c) 2011-2015 Regents of the University of California.
Definition:
ndn-strategy-choice-helper.hpp:34
ns3::ndn::ScenarioHelper::getNode
Ptr< Node > getNode(const std::string &nodeName)
Get node.
Definition:
ndn-scenario-helper.cpp:126
ns3::ndn::ScenarioHelper::disableRibManager
void disableRibManager()
Disable RIB Manager.
Definition:
ndn-scenario-helper.cpp:68
ns3::ndn::ScenarioHelper::disableForwarderStatusManager
void disableForwarderStatusManager()
Disable Forwarder Status Manager.
Definition:
ndn-scenario-helper.cpp:86
ns3::ndn::ScenarioHelper::AppInfo::end
std::string end
Definition:
ndn-scenario-helper.hpp:92
ns3::ndn::ScenarioHelper::RouteInfo::metric
int32_t metric
Definition:
ndn-scenario-helper.hpp:77
ns3::ndn::ScenarioHelper::ScenarioHelper
ScenarioHelper()
Definition:
ndn-scenario-helper.cpp:33
ns3::ndn::ScenarioHelper::createTopology
void createTopology(std::initializer_list< std::initializer_list< std::string >> topology, bool shouldInstallNdnStack=true)
Create topology.
Definition:
ndn-scenario-helper.cpp:39
ns3::ndn::ScenarioHelper::getNetDevice
Ptr< NetDevice > getNetDevice(const std::string &node1, const std::string &node2)
Get NetDevice on the node1 pointing towards node2.
Definition:
ndn-scenario-helper.cpp:144
ns3::ndn::ScenarioHelper::getFace
shared_ptr< Face > getFace(const std::string &node1, const std::string &node2)
Get face on the node1 pointing towards node2.
Definition:
ndn-scenario-helper.cpp:137
ns3::ndn::ScenarioHelper::getStackHelper
StackHelper & getStackHelper()
Get NDN stack helper, e.g., to adjust its parameters.
Definition:
ndn-scenario-helper.cpp:158
ns3::ndn::Name
Name
Definition:
ndn-common.cpp:25
ns3::ndn::StackHelper
Helper class to install NDN stack and configure its parameters.
Definition:
ndn-stack-helper.hpp:56
ns3
Copyright (c) 2011-2015 Regents of the University of California.
Definition:
content-store-impl.cpp:38
ndn-stack-helper.hpp
ns3::ndn::ScenarioHelper::AppInfo::name
std::string name
Definition:
ndn-scenario-helper.hpp:89
ns3::ndn::ScenarioHelper::AppInfo::params
std::initializer_list< std::pair< std::string, std::string > > params
Definition:
ndn-scenario-helper.hpp:90
ns3::ndn::ScenarioHelper::AppInfo::node
std::string node
Definition:
ndn-scenario-helper.hpp:88
ns3::ndn::ScenarioHelper::addRoutes
void addRoutes(std::initializer_list< RouteInfo > routes)
Create routes between topology nodes.
Definition:
ndn-scenario-helper.cpp:92
ns3::ndn::ScenarioHelper
Helper class to simplify writing basic simulation scenarios.
Definition:
ndn-scenario-helper.hpp:63
ns3::ndn::ScenarioHelper::RouteInfo::node2
std::string node2
Definition:
ndn-scenario-helper.hpp:75
ns3::ndn::ScenarioHelper::disableStrategyChoiceManager
void disableStrategyChoiceManager()
Disable Face Manager.
Definition:
ndn-scenario-helper.cpp:80
ns3::ndn::ScenarioHelper::addApps
void addApps(std::initializer_list< AppInfo > apps)
Create and install application on nodes.
Definition:
ndn-scenario-helper.cpp:101
ns3::ndn::ScenarioHelper::AppInfo
Definition:
ndn-scenario-helper.hpp:86
ns3::ndn::ScenarioHelper::RouteInfo::prefix
Name prefix
Definition:
ndn-scenario-helper.hpp:76
ns3::ndn::ScenarioHelper::RouteInfo
Route information for addRoutes method.
Definition:
ndn-scenario-helper.hpp:72
ndnSIM
helper
ndn-scenario-helper.hpp
Generated on Tue Aug 7 2018 16:19:16 for ndnSIM by
1.8.14