examples: Modifying examples to work with the new codebase
diff --git a/examples/custom-apps/custom-app.cpp b/examples/custom-apps/custom-app.cpp
index 62cacc4..b081c27 100644
--- a/examples/custom-apps/custom-app.cpp
+++ b/examples/custom-apps/custom-app.cpp
@@ -26,9 +26,8 @@
#include "ns3/simulator.h"
#include "ns3/packet.h"
-#include "ns3/ndn-app-face.hpp"
+#include "ns3/ndnSIM/helper/ndn-fib-helper.hpp"
-#include "ns3/ndn-fib.hpp"
#include "ns3/random-variable.h"
NS_LOG_COMPONENT_DEFINE("CustomApp");
@@ -52,22 +51,17 @@
// initialize ndn::App
ndn::App::StartApplication();
+ Simulator::Schedule(Seconds(1.0), &CustomApp::SendInterest, this);
+
// Create a name components object for name ``/prefix/sub``
- Ptr<ndn::Name> prefix = Create<ndn::Name>(); // now prefix contains ``/``
- prefix->append("prefix"); // now prefix contains ``/prefix``
- prefix->append("sub"); // now prefix contains ``/prefix/sub``
-
- /////////////////////////////////////////////////////////////////////////////
- // Creating FIB entry that ensures that we will receive incoming Interests //
- /////////////////////////////////////////////////////////////////////////////
-
- // Get FIB object
- Ptr<ndn::Fib> fib = GetNode()->GetObject<ndn::Fib>();
+ shared_ptr<Name> prefix = make_shared<Name>(); // now prefix contains ``/``
+ prefix->append("prefix"); // now prefix contains ``/prefix``
+ prefix->append("sub"); // now prefix contains ``/prefix/sub``
// Add entry to FIB
- // Note that ``m_face`` is cretaed by ndn::App
- Ptr<ndn::fib::Entry> fibEntry = fib->Add(*prefix, m_face, 0);
+ ndn::FibHelper::AddRoute(node, *prefix, m_face, 0);
+ // Schedule send of first interest
Simulator::Schedule(Seconds(1.0), &CustomApp::SendInterest, this);
}
@@ -86,55 +80,53 @@
// Sending one Interest packet out //
/////////////////////////////////////
- Ptr<ndn::Name> prefix = Create<ndn::Name>("/prefix/sub"); // another way to create name
+ auto prefix = make_shared<Name>("/prefix/sub"); // another way to create name
// Create and configure ndn::Interest
- Ptr<ndn::Interest> interest = Create<ndn::Interest>();
+ auto interest = make_shared<Interest>();
UniformVariable rand(0, std::numeric_limits<uint32_t>::max());
- interest->SetNonce(rand.GetValue());
- interest->SetName(prefix);
- interest->SetInterestLifetime(Seconds(1.0));
+ interest->setNonce(rand.GetValue());
+ interest->setName(*prefix);
+ interest->setInterestLifetime(time::seconds(1));
NS_LOG_DEBUG("Sending Interest packet for " << *prefix);
// Call trace (for logging purposes)
m_transmittedInterests(interest, this, m_face);
- m_face->ReceiveInterest(interest);
+ m_face->onReceiveInterest(*interest);
}
// Callback that will be called when Interest arrives
void
-CustomApp::OnInterest(Ptr<const ndn::Interest> interest)
+CustomApp::OnInterest(shared_ptr<const ndn::Interest> interest)
{
ndn::App::OnInterest(interest);
- NS_LOG_DEBUG("Received Interest packet for " << interest->GetName());
-
- // Create and configure ndn::Data and ndn::DataTail
- // (header is added in front of the packet, tail is added at the end of the packet)
+ NS_LOG_DEBUG("Received Interest packet for " << interest->getName());
// Note that Interests send out by the app will not be sent back to the app !
- Ptr<ndn::Data> data = Create<ndn::Data>(Create<Packet>(1024));
- data->SetName(
- Create<ndn::Name>(interest->GetName())); // data will have the same name as Interests
+ auto data = make_shared<ndn::Data>(interest->getName());
+ data->setFreshnessPeriod(ndn::time::milliseconds(uint64_t(1000)));
+ data->setContent(make_shared<::ndn::Buffer>(1024));
+ StackHelper::getKeyChain().sign(*data);
- NS_LOG_DEBUG("Sending Data packet for " << data->GetName());
+ NS_LOG_DEBUG("Sending Data packet for " << data->getName());
// Call trace (for logging purposes)
m_transmittedDatas(data, this, m_face);
- m_face->ReceiveData(data);
+ m_face->onReceiveData(*data);
}
// Callback that will be called when Data arrives
void
-CustomApp::OnData(Ptr<const ndn::Data> contentObject)
+CustomApp::OnData(shared_ptr<const ndn::Data> contentObject)
{
- NS_LOG_DEBUG("Receiving Data packet for " << contentObject->GetName());
+ NS_LOG_DEBUG("Receiving Data packet for " << contentObject->getName());
- std::cout << "DATA received for name " << contentObject->GetName() << std::endl;
+ std::cout << "DATA received for name " << contentObject->getName() << std::endl;
}
} // namespace ns3
diff --git a/examples/custom-apps/custom-app.hpp b/examples/custom-apps/custom-app.hpp
index 7dca200..8d90f40 100644
--- a/examples/custom-apps/custom-app.hpp
+++ b/examples/custom-apps/custom-app.hpp
@@ -25,7 +25,7 @@
#include "ns3/ndnSIM/model/ndn-common.hpp"
-#include "ns3/ndn-app.hpp"
+#include "ns3/ndnSIM/apps/ndn-app.hpp"
namespace ns3 {
@@ -55,11 +55,11 @@
// (overridden from ndn::App) Callback that will be called when Interest arrives
virtual void
- OnInterest(Ptr<const ndn::Interest> interest);
+ OnInterest(shared_ptr<const ndn::Interest> interest);
// (overridden from ndn::App) Callback that will be called when Data arrives
virtual void
- OnData(Ptr<const ndn::Data> contentObject);
+ OnData(shared_ptr<const ndn::Data> contentObject);
private:
void
diff --git a/examples/custom-apps/dumb-requester.cpp b/examples/custom-apps/dumb-requester.cpp
index 8850e18..44ec204 100644
--- a/examples/custom-apps/dumb-requester.cpp
+++ b/examples/custom-apps/dumb-requester.cpp
@@ -85,14 +85,12 @@
// Sending one Interest packet out //
/////////////////////////////////////
- Ptr<ndn::Name> prefix = Create<ndn::Name>(m_name); // another way to create name
-
// Create and configure ndn::Interest
- Ptr<ndn::Interest> interest = Create<ndn::Interest>();
+ auto interest = make_shared<ndn::Interest>(*m_name);
UniformVariable rand(0, std::numeric_limits<uint32_t>::max());
- interest->SetNonce(rand.GetValue());
- interest->SetName(prefix);
- interest->SetInterestLifetime(Seconds(1.0));
+ interest->setNonce(rand.GetValue());
+ interest->setName(*prefix);
+ interest->setInterestLifetime(time::seconds(1));
NS_LOG_DEBUG("Sending Interest packet for " << *prefix);
@@ -100,15 +98,15 @@
m_transmittedInterests(interest, this, m_face);
// Forward packet to lower (network) layer
- m_face->ReceiveInterest(interest);
+ m_face->onReceiveInterest(*interest);
Simulator::Schedule(Seconds(1.0), &DumbRequester::SendInterest, this);
}
void
-DumbRequester::OnData(Ptr<const ndn::Data> contentObject)
+DumbRequester::OnData(shared_ptr<const ndn::Data> contentObject)
{
- NS_LOG_DEBUG("Receiving Data packet for " << contentObject->GetName());
+ NS_LOG_DEBUG("Receiving Data packet for " << contentObject->getName());
}
} // namespace ns3
diff --git a/examples/custom-apps/dumb-requester.hpp b/examples/custom-apps/dumb-requester.hpp
index 0091c25..a1f9427 100644
--- a/examples/custom-apps/dumb-requester.hpp
+++ b/examples/custom-apps/dumb-requester.hpp
@@ -25,7 +25,7 @@
#include "ns3/ndnSIM/model/ndn-common.hpp"
-#include "ns3/ndn-app.hpp"
+#include "ns3/ndnSIM/apps/ndn-app.hpp"
namespace ns3 {
@@ -52,7 +52,7 @@
// (overridden from ndn::App) Callback that will be called when Data arrives
virtual void
- OnData(Ptr<const ndn::Data> contentObject);
+ OnData(shared_ptr<const ndn::Data> contentObject);
private:
void
diff --git a/examples/custom-apps/hijacker.cpp b/examples/custom-apps/hijacker.cpp
index 70e2d9e..eedd08f 100644
--- a/examples/custom-apps/hijacker.cpp
+++ b/examples/custom-apps/hijacker.cpp
@@ -17,11 +17,12 @@
*
* Author: Alexander Afanasyev <alexander.afanasyev@ucla.edu>
*/
-
// hijacker.cc
#include "hijacker.hpp"
+#include "ns3/ndnSIM/helper/ndn-fib-helper.hpp"
+
NS_LOG_COMPONENT_DEFINE("Hijacker");
namespace ns3 {
@@ -42,12 +43,12 @@
}
void
-Hijacker::OnInterest(Ptr<const ndn::Interest> interest)
+Hijacker::OnInterest(shared_ptr<const ndn::Interest> interest)
{
ndn::App::OnInterest(interest); // forward call to perform app-level tracing
// do nothing else (hijack interest)
- NS_LOG_DEBUG("Do nothing for incoming interest for" << interest->GetName());
+ NS_LOG_DEBUG("Do nothing for incoming interest for" << interest->getName());
}
void
@@ -56,9 +57,7 @@
App::StartApplication();
// equivalent to setting interest filter for "/" prefix
- Ptr<ndn::Fib> fib = GetNode()->GetObject<ndn::Fib>();
- Ptr<ndn::fib::Entry> fibEntry = fib->Add(ndn::Name("/"), m_face, 0);
- fibEntry->UpdateStatus(m_face, ndn::fib::FaceMetric::NDN_FIB_GREEN);
+ ndn::FibHelper::AddRoute(GetNode(), "/", m_face, 0);
}
void
diff --git a/examples/custom-apps/hijacker.hpp b/examples/custom-apps/hijacker.hpp
index a794f12..73efad0 100644
--- a/examples/custom-apps/hijacker.hpp
+++ b/examples/custom-apps/hijacker.hpp
@@ -38,7 +38,7 @@
// Receive all Interests but do nothing in response
void
- OnInterest(Ptr<const ndn::Interest> interest);
+ OnInterest(shared_ptr<const ndn::Interest> interest);
protected:
// inherited from Application base class.
diff --git a/examples/ndn-congestion-alt-topo-plugin.cpp b/examples/ndn-congestion-alt-topo-plugin.cpp
index 9491be4..69c8bd4 100644
--- a/examples/ndn-congestion-alt-topo-plugin.cpp
+++ b/examples/ndn-congestion-alt-topo-plugin.cpp
@@ -24,7 +24,7 @@
#include "ns3/network-module.h"
#include "ns3/ndnSIM-module.h"
-using namespace ns3;
+namespace ns3 {
/**
*
@@ -70,11 +70,14 @@
// Install NDN stack on all nodes
ndn::StackHelper ndnHelper;
- ndnHelper.SetForwardingStrategy("ns3::ndn::fw::CustomStrategy");
+ ndnHelper.SetContentStoreChoice(false);
ndnHelper.SetContentStore("ns3::ndn::cs::Lru", "MaxSize",
"1"); // ! Attention ! If set to 0, then MaxSize is infinite
ndnHelper.InstallAll();
+ // Set BestRoute strategy
+ ndn::StrategyChoiceHelper::InstallAll("/", "/localhost/nfd/strategy/best-route");
+
// Getting containers for the consumer/producer
Ptr<Node> consumers[4] = {Names::Find<Node>("c1"), Names::Find<Node>("c2"),
Names::Find<Node>("c3"), Names::Find<Node>("c4")};
@@ -115,20 +118,20 @@
}
// Manually configure FIB routes
- ndn::StackHelper::AddRoute("c1", "/data", "n1", 1); // link to n1
- ndn::StackHelper::AddRoute("c2", "/data", "n1", 1); // link to n1
- ndn::StackHelper::AddRoute("c3", "/data", "n1", 1); // link to n1
- ndn::StackHelper::AddRoute("c4", "/data", "n1", 1); // link to n1
+ ndn::FibHelper::AddRoute("c1", "/data", "n1", 1); // link to n1
+ ndn::FibHelper::AddRoute("c2", "/data", "n1", 1); // link to n1
+ ndn::FibHelper::AddRoute("c3", "/data", "n1", 1); // link to n1
+ ndn::FibHelper::AddRoute("c4", "/data", "n1", 1); // link to n1
- ndn::StackHelper::AddRoute("n1", "/data", "n2", 1); // link to n2
- ndn::StackHelper::AddRoute("n1", "/data", "n12", 2); // link to n12
+ ndn::FibHelper::AddRoute("n1", "/data", "n2", 1); // link to n2
+ ndn::FibHelper::AddRoute("n1", "/data", "n12", 2); // link to n12
- ndn::StackHelper::AddRoute("n12", "/data", "n2", 1); // link to n2
+ ndn::FibHelper::AddRoute("n12", "/data", "n2", 1); // link to n2
- ndn::StackHelper::AddRoute("n2", "/data/p1", "p1", 1); // link to p1
- ndn::StackHelper::AddRoute("n2", "/data/p2", "p2", 1); // link to p2
- ndn::StackHelper::AddRoute("n2", "/data/p3", "p3", 1); // link to p3
- ndn::StackHelper::AddRoute("n2", "/data/p4", "p4", 1); // link to p4
+ ndn::FibHelper::AddRoute("n2", "/data/p1", "p1", 1); // link to p1
+ ndn::FibHelper::AddRoute("n2", "/data/p2", "p2", 1); // link to p2
+ ndn::FibHelper::AddRoute("n2", "/data/p3", "p3", 1); // link to p3
+ ndn::FibHelper::AddRoute("n2", "/data/p4", "p4", 1); // link to p4
// Schedule simulation time and run the simulation
Simulator::Stop(Seconds(20.0));
@@ -137,3 +140,12 @@
return 0;
}
+
+
+} // namespace ns3
+
+int
+main(int argc, char* argv[])
+{
+ return ns3::main(argc, argv);
+}
diff --git a/examples/ndn-congestion-topo-plugin.cpp b/examples/ndn-congestion-topo-plugin.cpp
index 0a6a58b..3518873 100644
--- a/examples/ndn-congestion-topo-plugin.cpp
+++ b/examples/ndn-congestion-topo-plugin.cpp
@@ -17,20 +17,22 @@
*
* Author: Alexander Afanasyev <alexander.afanasyev@ucla.edu>
*/
+
// ndn-congestion-topo-plugin.cc
+
#include "ns3/core-module.h"
#include "ns3/network-module.h"
#include "ns3/ndnSIM-module.h"
-using namespace ns3;
+namespace ns3 {
/**
* This scenario simulates a grid topology (using topology reader module)
*
- * /------\ /------\
+ * /------\ /------\
* | Src1 |<--+ +-->| Dst1 |
* \------/ \ / \------/
- * \ /
+ * \ /
* +-->/------\ "bottleneck" /------\<-+
* | Rtr1 |<===============>| Rtr2 |
* +-->\------/ \------/<-+
@@ -56,10 +58,13 @@
// Install NDN stack on all nodes
ndn::StackHelper ndnHelper;
- ndnHelper.SetForwardingStrategy("ns3::ndn::fw::BestRoute");
+ ndnHelper.SetContentStoreChoice(false);
ndnHelper.SetContentStore("ns3::ndn::cs::Lru", "MaxSize", "10000");
ndnHelper.InstallAll();
+ // Choosing forwarding strategy
+ ndn::StrategyChoiceHelper::InstallAll("/prefix", "/localhost/nfd/strategy/best-route");
+
// Installing global routing interface on all nodes
ndn::GlobalRoutingHelper ndnGlobalRoutingHelper;
ndnGlobalRoutingHelper.InstallAll();
@@ -109,3 +114,12 @@
return 0;
}
+
+
+} // namespace ns3
+
+int
+main(int argc, char* argv[])
+{
+ return ns3::main(argc, argv);
+}
diff --git a/examples/ndn-csma.cpp b/examples/ndn-csma.cpp
index 71d1cfb..7a08f79 100644
--- a/examples/ndn-csma.cpp
+++ b/examples/ndn-csma.cpp
@@ -17,13 +17,15 @@
*
* Author: Alexander Afanasyev <alexander.afanasyev@ucla.edu>
*/
+
// ndn-csma.cc
+
#include "ns3/core-module.h"
#include "ns3/network-module.h"
#include "ns3/csma-module.h"
#include "ns3/ndnSIM-module.h"
-using namespace ns3;
+namespace ns3 {
/**
* This scenario simulates a very simple network topology:
@@ -96,3 +98,11 @@
return 0;
}
+
+} // namespace ns3
+
+int
+main(int argc, char* argv[])
+{
+ return ns3::main(argc, argv);
+}
diff --git a/examples/ndn-grid-topo-plugin.cpp b/examples/ndn-grid-topo-plugin.cpp
index 84f5f17..12a3910 100644
--- a/examples/ndn-grid-topo-plugin.cpp
+++ b/examples/ndn-grid-topo-plugin.cpp
@@ -17,12 +17,14 @@
*
* Author: Alexander Afanasyev <alexander.afanasyev@ucla.edu>
*/
+
// ndn-grid-topo-plugin.cc
+
#include "ns3/core-module.h"
#include "ns3/network-module.h"
#include "ns3/ndnSIM-module.h"
-using namespace ns3;
+namespace ns3 {
/**
* This scenario simulates a grid topology (using topology reader module)
@@ -60,9 +62,11 @@
// Install NDN stack on all nodes
ndn::StackHelper ndnHelper;
- ndnHelper.SetForwardingStrategy("ns3::ndn::fw::BestRoute");
ndnHelper.InstallAll();
+ // Set BestRoute strategy
+ ndn::StrategyChoiceHelper::InstallAll("/", "/localhost/nfd/strategy/best-route");
+
// Installing global routing interface on all nodes
ndn::GlobalRoutingHelper ndnGlobalRoutingHelper;
ndnGlobalRoutingHelper.InstallAll();
@@ -98,3 +102,11 @@
return 0;
}
+
+} // namespace ns3
+
+int
+main(int argc, char* argv[])
+{
+ return ns3::main(argc, argv);
+}
diff --git a/examples/ndn-grid.cpp b/examples/ndn-grid.cpp
index d475dfd..0469109 100644
--- a/examples/ndn-grid.cpp
+++ b/examples/ndn-grid.cpp
@@ -17,14 +17,16 @@
*
* Author: Alexander Afanasyev <alexander.afanasyev@ucla.edu>
*/
+
// ndn-grid.cc
+
#include "ns3/core-module.h"
#include "ns3/network-module.h"
#include "ns3/point-to-point-module.h"
#include "ns3/point-to-point-layout-module.h"
#include "ns3/ndnSIM-module.h"
-using namespace ns3;
+namespace ns3 {
/**
* This scenario simulates a grid topology (using PointToPointGrid module)
@@ -69,9 +71,11 @@
// Install NDN stack on all nodes
ndn::StackHelper ndnHelper;
- ndnHelper.SetForwardingStrategy("ns3::ndn::fw::BestRoute");
ndnHelper.InstallAll();
+ // Set BestRoute strategy
+ ndn::StrategyChoiceHelper::InstallAll("/", "/localhost/nfd/strategy/best-route");
+
// Installing global routing interface on all nodes
ndn::GlobalRoutingHelper ndnGlobalRoutingHelper;
ndnGlobalRoutingHelper.InstallAll();
@@ -107,3 +111,11 @@
return 0;
}
+
+} // namespace ns3
+
+int
+main(int argc, char* argv[])
+{
+ return ns3::main(argc, argv);
+}
diff --git a/examples/ndn-simple-wifi.cpp b/examples/ndn-simple-wifi.cpp
index a2b083f..9010d26 100644
--- a/examples/ndn-simple-wifi.cpp
+++ b/examples/ndn-simple-wifi.cpp
@@ -28,14 +28,13 @@
#include "ns3/ndnSIM-module.h"
using namespace std;
-using namespace ns3;
+namespace ns3 {
NS_LOG_COMPONENT_DEFINE("ndn.WifiExample");
//
// DISCLAIMER: Note that this is an extremely simple example, containing just 2 wifi nodes
-// communicating
-// directly over AdHoc channel.
+// communicating directly over AdHoc channel.
//
// Ptr<ndn::NetDeviceFace>
@@ -107,11 +106,14 @@
ndn::StackHelper ndnHelper;
// ndnHelper.AddNetDeviceFaceCreateCallback (WifiNetDevice::GetTypeId (), MakeCallback
// (MyNetDeviceFaceCallback));
- ndnHelper.SetForwardingStrategy("ns3::ndn::fw::BestRoute");
+ ndnHelper.SetContentStoreChoice(false);
ndnHelper.SetContentStore("ns3::ndn::cs::Lru", "MaxSize", "1000");
ndnHelper.SetDefaultRoutes(true);
ndnHelper.Install(nodes);
+ // Set BestRoute strategy
+ ndn::StrategyChoiceHelper::Install(nodes, "/", "/localhost/nfd/strategy/best-route");
+
// 4. Set up applications
NS_LOG_INFO("Installing Applications");
@@ -134,3 +136,11 @@
return 0;
}
+
+} // namespace ns3
+
+int
+main(int argc, char* argv[])
+{
+ return ns3::main(argc, argv);
+}
diff --git a/examples/ndn-simple-with-cs-lfu.cpp b/examples/ndn-simple-with-cs-lfu.cpp
deleted file mode 100644
index d22a549..0000000
--- a/examples/ndn-simple-with-cs-lfu.cpp
+++ /dev/null
@@ -1,166 +0,0 @@
-/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */
-/*
- * Copyright (c) 2012-2013 University of California, Los Angeles
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation;
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- * Author: Alexander Afanasyev <alexander.afanasyev@ucla.edu>
- */
-// ndn-simple-with-cs-lfu.cc
-#include "ns3/core-module.h"
-#include "ns3/network-module.h"
-#include "ns3/point-to-point-module.h"
-#include "ns3/ndnSIM-module.h"
-
-#include <sys/time.h>
-#include "ns3/ndnSIM/utils/mem-usage.hpp"
-
-using namespace ns3;
-
-/**
- * This scenario simulates a very simple network topology:
- *
- *
- * +----------+ 1Mbps +--------+ 1Mbps +----------+
- * | consumer | <------------> | router | <------------> | producer |
- * +----------+ 10ms +--------+ 10ms +----------+
- *
- * This scenario demonstrates how to use content store that responds to Freshness parameter set in
- *Datas.
- * That is, if producer set Freshness field to 2 seconds, the corresponding content object will not
- *be cached
- * more than 2 seconds (can be cached for a shorter time, if entry is evicted earlier)
- *
- * NS_LOG=ndn.Consumer ./waf --run ndn-simple-with-cs-lfu
- */
-
-void
-PrintCsMemStatsHeader(std::ostream& os)
-{
- os << "SimulationTime"
- << "\t"
- << "RealTime"
- << "\t"
- // << "NumberOfProcessedData" << "\t"
- // << "NumberOfProcessedInterests" << "\t"
- << "NumberPitEntries"
- << "\t"
- << "NumberCsEntries"
- << "\t"
- << "MemUsage"
- << "\n";
-}
-
-void
-PrintCsMemStats(std::ostream& os, Time nextPrintTime, double beginRealTime)
-{
- ::timeval t;
- gettimeofday(&t, NULL);
- double realTime = t.tv_sec + (0.000001 * (unsigned)t.tv_usec) - beginRealTime;
-
- os << Simulator::Now().ToDouble(Time::S) << "\t";
- os << realTime << "\t";
-
- // os << ndn::L3Protocol::GetDataCounter () << "\t";
- // os << ndn::L3Protocol::GetInterestCounter () << "\t";
-
- uint64_t pitCount = 0;
- uint64_t csCount = 0;
- for (NodeList::Iterator node = NodeList::Begin(); node != NodeList::End(); node++) {
- Ptr<ndn::Pit> pit = (*node)->GetObject<ndn::Pit>();
- Ptr<ndn::ContentStore> cs = (*node)->GetObject<ndn::ContentStore>();
-
- if (pit != 0)
- pitCount += pit->GetSize();
-
- if (cs != 0)
- csCount += cs->GetSize();
- }
-
- os << pitCount << "\t";
- os << csCount << "\t";
- os << MemUsage::Get() / 1024.0 / 1024.0 << "\n";
-
- Simulator::Schedule(nextPrintTime, PrintCsMemStats, boost::ref(os), nextPrintTime, beginRealTime);
-}
-
-int
-main(int argc, char* argv[])
-{
- // setting default parameters for PointToPoint links and channels
- Config::SetDefault("ns3::PointToPointNetDevice::DataRate", StringValue("1Mbps"));
- Config::SetDefault("ns3::PointToPointChannel::Delay", StringValue("10ms"));
- Config::SetDefault("ns3::DropTailQueue::MaxPackets", StringValue("20"));
-
- // Read optional command-line parameters (e.g., enable visualizer with ./waf --run=<> --visualize
- CommandLine cmd;
- cmd.Parse(argc, argv);
-
- // Creating nodes
- NodeContainer nodes;
- nodes.Create(3);
-
- // Connecting nodes using two links
- PointToPointHelper p2p;
- p2p.Install(nodes.Get(0), nodes.Get(1));
- p2p.Install(nodes.Get(1), nodes.Get(2));
-
- // Install CCNx stack on all nodes
- ndn::StackHelper ccnxHelper;
- ccnxHelper.SetDefaultRoutes(true);
-
- // node 0: disable cache completely
- ccnxHelper.SetContentStore("ns3::ndn::cs::Nocache"); // disable cache
- ccnxHelper.Install(nodes.Get(0));
-
- // node 1 and 2: set cache with Lfu policy
- ccnxHelper.SetContentStore("ns3::ndn::cs::Freshness::Lfu", "MaxSize",
- "2"); // can set cache size this way
- ccnxHelper.Install(nodes.Get(1));
- ccnxHelper.Install(nodes.Get(2));
-
- // alternative way to configure cache size
- // [number after nodeList is global ID of the node (= node->GetId ())]
- Config::Set("/NodeList/2/$ns3::ndn::ContentStore/MaxSize", UintegerValue(100000));
-
- // Installing applications
-
- // Consumer
- ndn::AppHelper consumerHelper("ns3::ndn::ConsumerCbr");
- // Consumer will request /prefix/0, /prefix/1, ...
- consumerHelper.SetPrefix("/prefix");
- consumerHelper.SetAttribute("Frequency", StringValue("10")); // 10 interests a second
- consumerHelper.Install(nodes.Get(0)); // first node
-
- // Producer
- ndn::AppHelper producerHelper("ns3::ndn::Producer");
- // Producer will reply to all requests starting with /prefix
- producerHelper.SetPrefix("/prefix");
- producerHelper.SetAttribute("PayloadSize", StringValue("1024"));
- producerHelper.Install(nodes.Get(2)); // last node
-
- Simulator::Stop(Seconds(200000.0));
-
- struct ::timeval t;
- gettimeofday(&t, NULL);
- double beginRealTime = t.tv_sec + (0.000001 * (unsigned)t.tv_usec);
- Simulator::Schedule(Seconds(0), PrintCsMemStatsHeader, boost::ref(std::cout));
- Simulator::Schedule(Seconds(100), PrintCsMemStats, boost::ref(std::cout), Seconds(100),
- beginRealTime);
-
- Simulator::Run();
- Simulator::Destroy();
-
- return 0;
-}
diff --git a/examples/ndn-simple-with-custom-app.cpp b/examples/ndn-simple-with-custom-app.cpp
index c10ceaa..04ed600 100644
--- a/examples/ndn-simple-with-custom-app.cpp
+++ b/examples/ndn-simple-with-custom-app.cpp
@@ -24,14 +24,14 @@
#include "ns3/network-module.h"
#include "ns3/ndnSIM-module.h"
-using namespace ns3;
+namespace ns3 {
/**
- * This scenario simulates a one-node two-app scenario:
+ * This scenario simulates a one-node two-custom-app scenario:
*
- * +------+ <-----> (CustomApp1)
- * | Node |
- * +------+ <-----> (CustomApp2)
+ * +------+ <-----> (CustomApp1)
+ * | Node |
+ * +------+ <-----> (CustomApp2)
*
* NS_LOG=CustomApp ./waf --run=ndn-simple-with-custom-app
*/
@@ -47,8 +47,8 @@
Ptr<Node> node = CreateObject<Node>();
// Install CCNx stack on all nodes
- ndn::StackHelper ccnxHelper;
- ccnxHelper.InstallAll();
+ ndn::StackHelper ndnHelper;
+ ndnHelper.InstallAll();
// Installing applications
@@ -69,3 +69,11 @@
return 0;
}
+
+} // namespace ns3
+
+int
+main(int argc, char* argv[])
+{
+ return ns3::main(argc, argv);
+}
diff --git a/examples/ndn-simple-with-link-failure.cpp b/examples/ndn-simple-with-link-failure.cpp
index c020a36..4fb20ba 100644
--- a/examples/ndn-simple-with-link-failure.cpp
+++ b/examples/ndn-simple-with-link-failure.cpp
@@ -25,9 +25,9 @@
#include "ns3/ndnSIM-module.h"
// for LinkStatusControl::FailLinks and LinkStatusControl::UpLinks
-#include "ns3/ndn-link-control-helper.hpp"
+#include "ns3/ndnSIM/helper/ndn-link-control-helper.hpp"
-using namespace ns3;
+namespace ns3 {
/**
* This scenario simulates a very simple network topology:
@@ -102,3 +102,11 @@
return 0;
}
+
+} // namespace ns3
+
+int
+main(int argc, char* argv[])
+{
+ return ns3::main(argc, argv);
+}
diff --git a/examples/ndn-simple-with-pcap.cpp b/examples/ndn-simple-with-pcap.cpp
index ecbc8eb..be45c98 100644
--- a/examples/ndn-simple-with-pcap.cpp
+++ b/examples/ndn-simple-with-pcap.cpp
@@ -23,7 +23,7 @@
#include "ns3/point-to-point-module.h"
#include "ns3/ndnSIM-module.h"
-using namespace ns3;
+namespace ns3 {
class PcapWriter {
public:
@@ -54,8 +54,6 @@
Config::SetDefault("ns3::PointToPointChannel::Delay", StringValue("10ms"));
Config::SetDefault("ns3::DropTailQueue::MaxPackets", StringValue("20"));
- Config::SetGlobal("ndn::WireFormat", StringValue("1"));
-
// Read optional command-line parameters (e.g., enable visualizer with ./waf --run=<> --visualize
CommandLine cmd;
cmd.Parse(argc, argv);
@@ -103,3 +101,11 @@
return 0;
}
+
+} // namespace ns3
+
+int
+main(int argc, char* argv[])
+{
+ return ns3::main(argc, argv);
+}
diff --git a/examples/ndn-simple.cpp b/examples/ndn-simple.cpp
index b7755e8..3e480e1 100644
--- a/examples/ndn-simple.cpp
+++ b/examples/ndn-simple.cpp
@@ -23,7 +23,7 @@
#include "ns3/point-to-point-module.h"
#include "ns3/ndnSIM-module.h"
-using namespace ns3;
+namespace ns3 {
/**
* This scenario simulates a very simple network topology:
@@ -71,6 +71,9 @@
ndnHelper.SetDefaultRoutes(true);
ndnHelper.InstallAll();
+ // Choosing forwarding strategy
+ ndn::StrategyChoiceHelper::InstallAll("/prefix", "/localhost/nfd/strategy/broadcast");
+
// Installing applications
// Consumer
@@ -94,3 +97,11 @@
return 0;
}
+
+} // namespace ns3
+
+int
+main(int argc, char* argv[])
+{
+ return ns3::main(argc, argv);
+}
diff --git a/examples/ndn-tree-app-delay-tracer.cpp b/examples/ndn-tree-app-delay-tracer.cpp
index b503843..4a6c0c8 100644
--- a/examples/ndn-tree-app-delay-tracer.cpp
+++ b/examples/ndn-tree-app-delay-tracer.cpp
@@ -24,7 +24,7 @@
#include "ns3/network-module.h"
#include "ns3/ndnSIM-module.h"
-using namespace ns3;
+namespace ns3 {
/**
* This scenario simulates a tree topology (using topology reader module)
@@ -34,22 +34,22 @@
* \------/ \------/ \------/ \------/
* ^ ^ ^ ^
* | | | |
- * \ / \ /
- * \ / \ / 10Mbps / 1ms
- * \ / \ /
- * | | | |
- * v v v v
+ * \ / \ /
+ * \ / \ / 10Mbps / 1ms
+ * \ / \ /
+ * | | | |
+ * v v v v
* /-------\ /-------\
* | rtr-1 | | rtr-2 |
* \-------/ \-------/
* ^ ^
- * | |
- * \ / 10 Mpbs / 1ms
- * +--------+ +--------+
- * | |
+ * | |
+ * \ / 10 Mpbs / 1ms
+ * +--------+ +--------+
+ * | |
* v v
- * /--------\
- * | root |
+ * /--------\
+ * | root |
* \--------/
*
*
@@ -70,12 +70,14 @@
// Install CCNx stack on all nodes
ndn::StackHelper ndnHelper;
- ndnHelper.SetForwardingStrategy("ns3::ndn::fw::BestRoute");
ndnHelper.InstallAll();
+ // Choosing forwarding strategy
+ ndn::StrategyChoiceHelper::InstallAll("/prefix", "/localhost/nfd/strategy/best-route");
+
// Installing global routing interface on all nodes
- ndn::GlobalRoutingHelper ccnxGlobalRoutingHelper;
- ccnxGlobalRoutingHelper.InstallAll();
+ ndn::GlobalRoutingHelper ndnGlobalRoutingHelper;
+ ndnGlobalRoutingHelper.InstallAll();
// Getting containers for the consumer/producer
Ptr<Node> consumers[4] = {Names::Find<Node>("leaf-1"), Names::Find<Node>("leaf-2"),
@@ -98,12 +100,12 @@
// Register /root prefix with global routing controller and
// install producer that will satisfy Interests in /root namespace
- ccnxGlobalRoutingHelper.AddOrigins("/root", producer);
+ ndnGlobalRoutingHelper.AddOrigins("/root", producer);
producerHelper.SetPrefix("/root");
producerHelper.Install(producer).Start(Seconds(9));
// Calculate and install FIBs
- ccnxGlobalRoutingHelper.CalculateRoutes();
+ ndn::GlobalRoutingHelper::CalculateRoutes();
Simulator::Stop(Seconds(20.0));
@@ -114,3 +116,11 @@
return 0;
}
+
+} // namespace ns3
+
+int
+main(int argc, char* argv[])
+{
+ return ns3::main(argc, argv);
+}
diff --git a/examples/ndn-tree-cs-tracers.cpp b/examples/ndn-tree-cs-tracers.cpp
index ce27888..a713ad2 100644
--- a/examples/ndn-tree-cs-tracers.cpp
+++ b/examples/ndn-tree-cs-tracers.cpp
@@ -24,7 +24,7 @@
#include "ns3/network-module.h"
#include "ns3/ndnSIM-module.h"
-using namespace ns3;
+namespace ns3 {
/**
* This scenario simulates a tree topology (using topology reader module)
@@ -34,22 +34,22 @@
* \------/ \------/ \------/ \------/
* ^ ^ ^ ^
* | | | |
- * \ / \ /
- * \ / \ / 10Mbps / 1ms
- * \ / \ /
- * | | | |
- * v v v v
+ * \ / \ /
+ * \ / \ / 10Mbps / 1ms
+ * \ / \ /
+ * | | | |
+ * v v v v
* /-------\ /-------\
* | rtr-1 | | rtr-2 |
* \-------/ \-------/
* ^ ^
- * | |
- * \ / 10 Mpbs / 1ms
- * +--------+ +--------+
- * | |
+ * | |
+ * \ / 10 Mpbs / 1ms
+ * +--------+ +--------+
+ * | |
* v v
- * /--------\
- * | root |
+ * /--------\
+ * | root |
* \--------/
*
*
@@ -70,14 +70,17 @@
// Install CCNx stack on all nodes
ndn::StackHelper ndnHelper;
- ndnHelper.SetForwardingStrategy("ns3::ndn::fw::BestRoute");
+ ndnHelper.SetContentStoreChoice(false);
ndnHelper.SetContentStore("ns3::ndn::cs::Lru", "MaxSize",
"100"); // default ContentStore parameters
ndnHelper.InstallAll();
+ // Choosing forwarding strategy
+ ndn::StrategyChoiceHelper::InstallAll("/prefix", "/localhost/nfd/strategy/best-route");
+
// Installing global routing interface on all nodes
- ndn::GlobalRoutingHelper ccnxGlobalRoutingHelper;
- ccnxGlobalRoutingHelper.InstallAll();
+ ndn::GlobalRoutingHelper ndnGlobalRoutingHelper;
+ ndnGlobalRoutingHelper.InstallAll();
// Getting containers for the consumer/producer
Ptr<Node> consumers[4] = {Names::Find<Node>("leaf-1"), Names::Find<Node>("leaf-2"),
@@ -99,12 +102,12 @@
// Register /root prefix with global routing controller and
// install producer that will satisfy Interests in /root namespace
- ccnxGlobalRoutingHelper.AddOrigins("/root", producer);
+ ndnGlobalRoutingHelper.AddOrigins("/root", producer);
producerHelper.SetPrefix("/root");
producerHelper.Install(producer);
// Calculate and install FIBs
- ccnxGlobalRoutingHelper.CalculateRoutes();
+ ndn::GlobalRoutingHelper::CalculateRoutes();
Simulator::Stop(Seconds(20.0));
@@ -115,3 +118,11 @@
return 0;
}
+
+} // namespace ns3
+
+int
+main(int argc, char* argv[])
+{
+ return ns3::main(argc, argv);
+}
diff --git a/examples/ndn-tree-tracers.cpp b/examples/ndn-tree-tracers.cpp
index 29772f7..24348ca 100644
--- a/examples/ndn-tree-tracers.cpp
+++ b/examples/ndn-tree-tracers.cpp
@@ -24,7 +24,7 @@
#include "ns3/network-module.h"
#include "ns3/ndnSIM-module.h"
-using namespace ns3;
+namespace ns3 {
/**
* This scenario simulates a tree topology (using topology reader module)
@@ -34,22 +34,22 @@
* \------/ \------/ \------/ \------/
* ^ ^ ^ ^
* | | | |
- * \ / \ /
- * \ / \ / 10Mbps / 1ms
- * \ / \ /
- * | | | |
- * v v v v
+ * \ / \ /
+ * \ / \ / 10Mbps / 1ms
+ * \ / \ /
+ * | | | |
+ * v v v v
* /-------\ /-------\
* | rtr-1 | | rtr-2 |
* \-------/ \-------/
* ^ ^
- * | |
- * \ / 10 Mpbs / 1ms
- * +--------+ +--------+
- * | |
+ * | |
+ * \ / 10 Mpbs / 1ms
+ * +--------+ +--------+
+ * | |
* v v
- * /--------\
- * | root |
+ * /--------\
+ * | root |
* \--------/
*
*
@@ -68,14 +68,16 @@
topologyReader.SetFileName("src/ndnSIM/examples/topologies/topo-tree.txt");
topologyReader.Read();
- // Install CCNx stack on all nodes
- ndn::StackHelper ccnxHelper;
- ccnxHelper.SetForwardingStrategy("ns3::ndn::fw::BestRoute");
- ccnxHelper.InstallAll();
+ // Install NDN stack on all nodes
+ ndn::StackHelper ndnHelper;
+ ndnHelper.InstallAll();
+
+ // Choosing forwarding strategy
+ ndn::StrategyChoiceHelper::InstallAll("/prefix", "/localhost/nfd/strategy/best-route");
// Installing global routing interface on all nodes
- ndn::GlobalRoutingHelper ccnxGlobalRoutingHelper;
- ccnxGlobalRoutingHelper.InstallAll();
+ ndn::GlobalRoutingHelper ndnGlobalRoutingHelper;
+ ndnGlobalRoutingHelper.InstallAll();
// Getting containers for the consumer/producer
Ptr<Node> consumers[4] = {Names::Find<Node>("leaf-1"), Names::Find<Node>("leaf-2"),
@@ -96,16 +98,15 @@
// Register /root prefix with global routing controller and
// install producer that will satisfy Interests in /root namespace
- ccnxGlobalRoutingHelper.AddOrigins("/root", producer);
+ ndnGlobalRoutingHelper.AddOrigins("/root", producer);
producerHelper.SetPrefix("/root");
producerHelper.Install(producer);
// Calculate and install FIBs
- ccnxGlobalRoutingHelper.CalculateRoutes();
+ ndn::GlobalRoutingHelper::CalculateRoutes();
Simulator::Stop(Seconds(20.0));
- ndn::L3AggregateTracer::InstallAll("aggregate-trace.txt", Seconds(0.5));
ndn::L3RateTracer::InstallAll("rate-trace.txt", Seconds(0.5));
Simulator::Run();
@@ -113,3 +114,11 @@
return 0;
}
+
+} // namespace ns3
+
+int
+main(int argc, char* argv[])
+{
+ return ns3::main(argc, argv);
+}
diff --git a/examples/ndn-tree-with-l2tracer.cpp b/examples/ndn-tree-with-l2tracer.cpp
index 8d5e3e0..cc24c23 100644
--- a/examples/ndn-tree-with-l2tracer.cpp
+++ b/examples/ndn-tree-with-l2tracer.cpp
@@ -4,7 +4,7 @@
#include "ns3/network-module.h"
#include "ns3/ndnSIM-module.h"
-using namespace ns3;
+namespace ns3 {
int
main(int argc, char* argv[])
@@ -17,15 +17,15 @@
topologyReader.Read();
/****************************************************************************/
- // Install CCNx stack on all nodes
- ndn::StackHelper ccnxHelper;
- ccnxHelper.SetContentStore("ns3::ndn::cs::Lru", "MaxSize", "1000");
- ccnxHelper.SetForwardingStrategy("ns3::ndn::fw::BestRoute");
- ccnxHelper.InstallAll();
+ // Install NDN stack on all nodes
+ ndn::StackHelper ndnHelper;
+ ndnHelper.SetContentStoreChoice(false);
+ ndnHelper.SetContentStore("ns3::ndn::cs::Lru", "MaxSize", "1000");
+ ndnHelper.InstallAll();
/****************************************************************************/
// Installing global routing interface on all nodes
- ndn::GlobalRoutingHelper ccnxGlobalRoutingHelper;
- ccnxGlobalRoutingHelper.InstallAll();
+ ndn::GlobalRoutingHelper ndnGlobalRoutingHelper;
+ ndnGlobalRoutingHelper.InstallAll();
/****************************************************************************/
// Getting containers for the consumer/producer
Ptr<Node> consumer1 = Names::Find<Node>("Src1");
@@ -87,45 +87,45 @@
/****************************************************************************/
// Register /dst1 to /dst9 prefix with global routing controller and
// install producer that will satisfy Interests in /dst1 to /dst9 namespace
- ccnxGlobalRoutingHelper.AddOrigins("/dst1", producer1);
+ ndnGlobalRoutingHelper.AddOrigins("/dst1", producer1);
producerHelper.SetPrefix("/dst1");
producerHelper.Install(producer1);
- ccnxGlobalRoutingHelper.AddOrigins("/dst2", producer2);
+ ndnGlobalRoutingHelper.AddOrigins("/dst2", producer2);
producerHelper.SetPrefix("/dst2");
producerHelper.Install(producer2);
- ccnxGlobalRoutingHelper.AddOrigins("/dst3", producer3);
+ ndnGlobalRoutingHelper.AddOrigins("/dst3", producer3);
producerHelper.SetPrefix("/dst3");
producerHelper.Install(producer3);
- ccnxGlobalRoutingHelper.AddOrigins("/dst4", producer4);
+ ndnGlobalRoutingHelper.AddOrigins("/dst4", producer4);
producerHelper.SetPrefix("/dst4");
producerHelper.Install(producer4);
- ccnxGlobalRoutingHelper.AddOrigins("/dst5", producer5);
+ ndnGlobalRoutingHelper.AddOrigins("/dst5", producer5);
producerHelper.SetPrefix("/dst5");
producerHelper.Install(producer5);
- ccnxGlobalRoutingHelper.AddOrigins("/dst6", producer6);
+ ndnGlobalRoutingHelper.AddOrigins("/dst6", producer6);
producerHelper.SetPrefix("/dst6");
producerHelper.Install(producer6);
- ccnxGlobalRoutingHelper.AddOrigins("/dst7", producer7);
+ ndnGlobalRoutingHelper.AddOrigins("/dst7", producer7);
producerHelper.SetPrefix("/dst7");
producerHelper.Install(producer7);
- ccnxGlobalRoutingHelper.AddOrigins("/dst8", producer8);
+ ndnGlobalRoutingHelper.AddOrigins("/dst8", producer8);
producerHelper.SetPrefix("/dst8");
producerHelper.Install(producer8);
- ccnxGlobalRoutingHelper.AddOrigins("/dst9", producer9);
+ ndnGlobalRoutingHelper.AddOrigins("/dst9", producer9);
producerHelper.SetPrefix("/dst9");
producerHelper.Install(producer9);
/*****************************************************************************/
// Calculate and install FIBs
- ccnxGlobalRoutingHelper.CalculateRoutes();
+ ndn::GlobalRoutingHelper::CalculateRoutes();
Simulator::Stop(Seconds(10.0));
@@ -139,3 +139,11 @@
return 0;
}
+
+} // namespace ns3
+
+int
+main(int argc, char* argv[])
+{
+ return ns3::main(argc, argv);
+}
diff --git a/examples/ndn-zipf-mandelbrot.cpp b/examples/ndn-zipf-mandelbrot.cpp
index 4bec18e..a5ba540 100644
--- a/examples/ndn-zipf-mandelbrot.cpp
+++ b/examples/ndn-zipf-mandelbrot.cpp
@@ -24,7 +24,7 @@
#include "ns3/point-to-point-layout-module.h"
#include "ns3/ndnSIM-module.h"
-using namespace ns3;
+namespace ns3 {
/**
* This scenario simulates a grid topology (using PointToPointGrid module)
@@ -69,15 +69,18 @@
grid.BoundingBox(100, 100, 200, 200);
// Install CCNx stack on all nodes
- ndn::StackHelper ccnxHelper;
- ccnxHelper.SetForwardingStrategy("ns3::ndn::fw::SmartFlooding");
- ccnxHelper.SetContentStore("ns3::ndn::cs::Lru", "MaxSize", "10");
- ccnxHelper.InstallAll();
+ ndn::StackHelper ndnHelper;
+ // ndnHelper.SetForwardingStrategy ("ns3::ndn::fw::SmartFlooding");
+ // ndnHelper.SetContentStore ("ns3::ndn::cs::Lru", "MaxSize", "10");
+ ndnHelper.InstallAll();
+
+ // Choosing forwarding strategy
+ ndn::StrategyChoiceHelper::InstallAll("/prefix", "/localhost/nfd/strategy/ncc");
// Installing global routing interface on all nodes
- // ndn::CbisGlobalRoutingHelper ccnxGlobalRoutingHelper;
- ndn::GlobalRoutingHelper ccnxGlobalRoutingHelper;
- ccnxGlobalRoutingHelper.InstallAll();
+ // ndn::CbisGlobalRoutingHelper ndnGlobalRoutingHelper;
+ ndn::GlobalRoutingHelper ndnGlobalRoutingHelper;
+ ndnGlobalRoutingHelper.InstallAll();
// Getting containers for the consumer/producer
Ptr<Node> producer = grid.GetNode(2, 2);
@@ -99,15 +102,23 @@
producerHelper.SetPrefix(prefix);
producerHelper.SetAttribute("PayloadSize", StringValue("100"));
producerHelper.Install(producer);
- ccnxGlobalRoutingHelper.AddOrigins(prefix, producer);
+ ndnGlobalRoutingHelper.AddOrigins(prefix, producer);
// Calculate and install FIBs
- ccnxGlobalRoutingHelper.CalculateRoutes();
+ ndn::GlobalRoutingHelper::CalculateRoutes();
- Simulator::Stop(Seconds(10.0));
+ Simulator::Stop(Seconds(1.0));
Simulator::Run();
Simulator::Destroy();
return 0;
}
+
+} // namespace ns3
+
+int
+main(int argc, char* argv[])
+{
+ return ns3::main(argc, argv);
+}
diff --git a/examples/topologies/topo-grid-3x3-loss.txt b/examples/topologies/topo-grid-3x3-loss.txt
index 922bcef..0807cc2 100644
--- a/examples/topologies/topo-grid-3x3-loss.txt
+++ b/examples/topologies/topo-grid-3x3-loss.txt
@@ -46,7 +46,7 @@
# delay: link delay
# queue: MaxPackets for transmission queue on the link (both directions)
# error: comma-separated list, specifying class for ErrorModel and necessary attributes
-Node0 Node1 1Mbps 1 10ms 10 ns3::RateErrorModel,ErrorUnit=ERROR_UNIT_PACKET,ErrorRate=0.9
+Node0 Node1 1Mbps 1 10ms 10 ns3::RateErrorModel,ErrorUnit=ERROR_UNIT_PACKET,ErrorRate=0.9
Node0 Node3 1Mbps 1 10ms 10
Node1 Node2 1Mbps 1 10ms 10
Node1 Node4 1Mbps 1 10ms 10
@@ -58,4 +58,3 @@
Node5 Node8 1Mbps 1 10ms 10
Node6 Node7 1Mbps 1 10ms 10
Node7 Node8 1Mbps 1 10ms 10
-
diff --git a/examples/wscript b/examples/wscript
index e2386ee..b7e9afb 100644
--- a/examples/wscript
+++ b/examples/wscript
@@ -10,5 +10,4 @@
name = str(i)[:-len(".cpp")]
obj = bld.create_ns3_program(name, all_modules)
obj.source = [i] + bld.path.ant_glob(['%s/**/*.cpp' % name])
- obj.includes += " .. ../NFD"
diff --git a/ndn-all.hpp b/ndn-all.hpp
index 294e30b..68dde0d 100644
--- a/ndn-all.hpp
+++ b/ndn-all.hpp
@@ -20,42 +20,24 @@
#ifndef NDNSIM_NDN_ALL_HPP
#define NDNSIM_NDN_ALL_HPP
-// #include "ns3/ndnSIM/helper/ndn-app-helper.hpp"
-// #include "ns3/ndnSIM/helper/ndn-face-container.hpp"
-// #include "ns3/ndnSIM/helper/ndn-fib-helper.hpp"
-// #include "ns3/ndnSIM/helper/ndn-global-routing-helper.hpp"
+#include "ns3/ndnSIM/helper/ndn-stack-helper.hpp"
+#include "ns3/ndnSIM/helper/ndn-app-helper.hpp"
+#include "ns3/ndnSIM/helper/ndn-global-routing-helper.hpp"
// #include "ns3/ndnSIM/helper/ndn-ip-faces-helper.hpp"
// #include "ns3/ndnSIM/helper/ndn-link-control-helper.hpp"
-// #include "ns3/ndnSIM/helper/ndn-stack-helper.hpp"
-// #include "ns3/ndnSIM/helper/ndn-strategy-choice-helper.hpp"
-// #include "ns3/ndnSIM/utils/batches.hpp"
-// #include "ns3/ndnSIM/utils/topology/annotated-topology-reader.hpp"
-// #include "ns3/ndnSIM/utils/topology/rocketfuel-map-reader.hpp"
-// #include "ns3/ndnSIM/utils/topology/rocketfuel-weights-reader.hpp"
-// #include "ns3/ndnSIM/utils/tracers/l2-rate-tracer.hpp"
-// #include "ns3/ndnSIM/utils/tracers/l2-tracer.hpp"
-// #include "ns3/ndnSIM/utils/tracers/ndn-app-delay-tracer.hpp"
-// #include "ns3/ndnSIM/utils/tracers/ndn-cs-tracer.hpp"
-// #include "ns3/ndnSIM/utils/tracers/ndn-l3-aggregate-tracer.hpp"
-// #include "ns3/ndnSIM/utils/tracers/ndn-l3-rate-tracer.hpp"
-// #include "ns3/ndnSIM/utils/tracers/ndn-l3-tracer.hpp"
+#include "ns3/ndnSIM/utils/topology/annotated-topology-reader.hpp"
+#include "ns3/ndnSIM/utils/topology/rocketfuel-map-reader.hpp"
+#include "ns3/ndnSIM/utils/topology/rocketfuel-weights-reader.hpp"
+#include "ns3/ndnSIM/utils/tracers/l2-rate-tracer.hpp"
+#include "ns3/ndnSIM/utils/tracers/ndn-app-delay-tracer.hpp"
+#include "ns3/ndnSIM/utils/tracers/ndn-cs-tracer.hpp"
+#include "ns3/ndnSIM/utils/tracers/ndn-l3-rate-tracer.hpp"
// #include "ns3/ndnSIM/model/ndn-app-face.hpp"
-// #include "ns3/ndnSIM/model/ndn-common.hpp"
-// #include "ns3/ndnSIM/model/ndn-global-router.hpp"
-// #include "ns3/ndnSIM/model/ndn-header.hpp"
// #include "ns3/ndnSIM/model/ndn-l3-protocol.hpp"
// #include "ns3/ndnSIM/model/ndn-net-device-face.hpp"
-// #include "ns3/ndnSIM/model/ndn-ns3.hpp"
-// #include "ns3/ndnSIM/apps/callback-based-app.hpp"
// #include "ns3/ndnSIM/apps/ndn-app.hpp"
-// #include "ns3/ndnSIM/apps/ndn-consumer-batches.hpp"
-// #include "ns3/ndnSIM/apps/ndn-consumer-cbr.hpp"
-// #include "ns3/ndnSIM/apps/ndn-consumer-window.hpp"
-// #include "ns3/ndnSIM/apps/ndn-consumer-zipf-mandelbrot.hpp"
-// #include "ns3/ndnSIM/apps/ndn-consumer.hpp"
-// #include "ns3/ndnSIM/apps/ndn-producer.hpp"
#endif // NDNSIM_NDN_ALL_HPP
diff --git a/wscript b/wscript
index 0c97fc7..d21b913 100644
--- a/wscript
+++ b/wscript
@@ -89,8 +89,8 @@
module.full_headers = [p.path_from(bld.path) for p in bld.path.ant_glob(
['%s/**/*.hpp' % dir for dir in module_dirs])]
- # if bld.env.ENABLE_EXAMPLES:
- # bld.recurse('examples')
+ if bld.env.ENABLE_EXAMPLES:
+ bld.recurse('examples')
bld.ns3_python_bindings()