Commit 6b413cbf authored by caminha's avatar caminha
Browse files

satisfaction fix and simple plots

parent 9aeed6c1
......@@ -10,6 +10,7 @@ cluster_experiments
*.rej
.idea/
**/.DS_Store/
*.o
*.pyc
......
......@@ -13,7 +13,7 @@
<provider copy-of="extension" id="org.eclipse.cdt.autotools.core.LibtoolGCCBuildCommandParser"/>
<provider class="org.eclipse.cdt.managedbuilder.language.settings.providers.GCCBuiltinSpecsDetector" console="false" env-hash="-1662945468773356678" id="org.eclipse.cdt.managedbuilder.core.GCCBuiltinSpecsDetector" keep-relative-paths="false" name="CDT GCC Built-in Compiler Settings" parameter="${COMMAND} ${FLAGS} -E -P -v -dD &quot;${INPUTS}&quot;" prefer-non-shared="true">
<provider class="org.eclipse.cdt.managedbuilder.language.settings.providers.GCCBuiltinSpecsDetector" console="false" env-hash="-1662813790159214678" id="org.eclipse.cdt.managedbuilder.core.GCCBuiltinSpecsDetector" keep-relative-paths="false" name="CDT GCC Built-in Compiler Settings" parameter="${COMMAND} ${FLAGS} -E -P -v -dD &quot;${INPUTS}&quot;" prefer-non-shared="true">
<language-scope id="org.eclipse.cdt.core.gcc"/>
......@@ -37,7 +37,7 @@
<provider copy-of="extension" id="org.eclipse.cdt.autotools.core.LibtoolGCCBuildCommandParser"/>
<provider class="org.eclipse.cdt.managedbuilder.language.settings.providers.GCCBuiltinSpecsDetector" console="false" env-hash="-1662945468773356678" id="org.eclipse.cdt.managedbuilder.core.GCCBuiltinSpecsDetector" keep-relative-paths="false" name="CDT GCC Built-in Compiler Settings" parameter="${COMMAND} ${FLAGS} -E -P -v -dD &quot;${INPUTS}&quot;" prefer-non-shared="true">
<provider class="org.eclipse.cdt.managedbuilder.language.settings.providers.GCCBuiltinSpecsDetector" console="false" env-hash="-1662813790159214678" id="org.eclipse.cdt.managedbuilder.core.GCCBuiltinSpecsDetector" keep-relative-paths="false" name="CDT GCC Built-in Compiler Settings" parameter="${COMMAND} ${FLAGS} -E -P -v -dD &quot;${INPUTS}&quot;" prefer-non-shared="true">
<language-scope id="org.eclipse.cdt.core.gcc"/>
......
......@@ -35,7 +35,7 @@
#include "ns3/ndnSIM/apps/ndn-app.hpp"
#include "ns3/ndnSIM/apps/ndn-consumer.hpp"
#include "ns3/ndnSIM/apps/ndn-producer.hpp"
#include "ns3/ndnSIM/apps/inter-system-intermediator.hpp"
#include "ns3/ndnSIM/apps/inter-domain-intermediator.hpp"
#include "ns3/ndnSIM/apps/ndn-subscription-consumer.hpp"
#include "ns3/ndnSIM/apps/iot-attributed-content-producer.hpp"
#include "ns3/ndnSIM/utils/tracers/ndn-l3-rate-tracer.hpp"
......
......@@ -37,7 +37,7 @@
#include "ns3/ndnSIM/apps/ndn-app.hpp"
#include "ns3/ndnSIM/apps/ndn-consumer.hpp"
#include "ns3/ndnSIM/apps/ndn-producer.hpp"
#include "ns3/ndnSIM/apps/inter-system-intermediator.hpp"
#include "ns3/ndnSIM/apps/inter-domain-intermediator.hpp"
#include "ns3/ndnSIM/apps/ndn-data-pusher.hpp"
//#include "ns3/ndnSIM/apps/nas-mediator-proactive.hpp"
#include "ns3/ndnSIM/apps/ndn-subscription-consumer.hpp"
......@@ -401,13 +401,13 @@ main(int argc, char *argv[])
};
privacyPolicy.addProducerTransformationPolicy(transformationPolicy);
ndn::AppHelper consumerMediatorHelper("ns3::ndn::InterSystemIntermediator");
ndn::AppHelper consumerMediatorHelper("ns3::ndn::InterDomainIntermediator");
ApplicationContainer consumerMediatorApplications;
for (uint c=0; c<nConsumerAs; c++)
{
consumerMediatorHelper.SetAttribute("NanoAsPrefix", StringValue("/consumer"+to_string(c)+"/"));
Ptr<Application> new_app = consumerMediatorHelper.Install(consumerMediators.Get(c)).Get(0);
Ptr<ndn::InterSystemIntermediator> consumer_mediator_app = DynamicCast<ndn::InterSystemIntermediator> (new_app);
Ptr<ndn::InterDomainIntermediator> consumer_mediator_app = DynamicCast<ndn::InterDomainIntermediator> (new_app);
consumer_mediator_app->setSubEquivalenceChecking("none");
for (uint p=0; p<nProducers; p++)
consumer_mediator_app->addPushedDataSource("/pushedDataPool/", "/producer-data/p"+to_string(p));
......@@ -509,7 +509,7 @@ main(int argc, char *argv[])
for (uint i=0; i<consumerMediatorApplications.GetN(); i++)
{
std::string name = Names::FindName(consumerMediatorApplications.Get(i)->GetNode());
Ptr<ndn::InterSystemIntermediator> mediator = DynamicCast<ndn::InterSystemIntermediator>
Ptr<ndn::InterDomainIntermediator> mediator = DynamicCast<ndn::InterDomainIntermediator>
(consumerMediatorApplications.Get(i));
outputFile << name << "\tOutStream\t" << mediator->getProducerStreamReused() << std::endl;
outputFile << name << "\tInStream\t" << mediator->getConsumerStreamReused() << std::endl;
......
......@@ -35,7 +35,7 @@
#include "ns3/ndnSIM/apps/ndn-app.hpp"
#include "ns3/ndnSIM/apps/ndn-consumer.hpp"
#include "ns3/ndnSIM/apps/ndn-producer.hpp"
#include "ns3/ndnSIM/apps/inter-system-intermediator.hpp"
#include "ns3/ndnSIM/apps/inter-domain-intermediator.hpp"
#include "ns3/ndnSIM/apps/ndn-subscription-consumer.hpp"
#include "ns3/ndnSIM/apps/iot-attributed-content-producer.hpp"
#include "ns3/ndnSIM/utils/tracers/ndn-l3-rate-tracer.hpp"
......@@ -455,7 +455,7 @@ main(int argc, char *argv[])
////// Mediator Applications /////////////////////////////////////////
ndn::AppHelper mediatorHelper("ns3::ndn::InterSystemIntermediator");
ndn::AppHelper mediatorHelper("ns3::ndn::InterDomainIntermediator");
mediatorHelper.SetAttribute("SubEquivalenceCheck", StringValue(subEquivalence));
ApplicationContainer consumerMediatorApplications;
for (uint m=0; m<nConsumerAs && nConsumersPerAs!=1; m++)
......@@ -508,7 +508,7 @@ main(int argc, char *argv[])
for (uint bm=0; bm<nBrokerAs; bm++)
{
brokerNasParameters.setConsumerNasPrefix("/dataBroker"+to_string(bm)+"/");
Ptr<ndn::InterSystemIntermediator> broker_app = DynamicCast<ndn::InterSystemIntermediator>
Ptr<ndn::InterDomainIntermediator> broker_app = DynamicCast<ndn::InterDomainIntermediator>
(brokerMediatorApplications.Get(bm));
for (uint pid=bm*nProducerAsPerBroker; pid < bm*nProducerAsPerBroker+nProducerAsPerBroker; pid++)
broker_app->addDataSource("allPowerUsageData", "/producer"+to_string(pid)+"/allUsageData/");//, brokerNasParameters);
......@@ -518,7 +518,7 @@ main(int argc, char *argv[])
{
nas::NasInterestTransformationAndParameters providerNasParameters;
uint producerAsId = i/nProducersPerAs;
DynamicCast<ndn::InterSystemIntermediator>(producerMediatorApplications.Get(producerAsId))
DynamicCast<ndn::InterDomainIntermediator>(producerMediatorApplications.Get(producerAsId))
->addDataSource ("allUsageData", "/producer"+to_string(producerAsId)+"/p"+to_string(i));
}
......@@ -544,7 +544,7 @@ main(int argc, char *argv[])
};
brokerPolicy.addProducerTransformationPolicy(brokerProducerTransformation);
for (uint bm=0; bm<nBrokerAs; bm++)
DynamicCast<ndn::InterSystemIntermediator>(brokerMediatorApplications.Get(bm))
DynamicCast<ndn::InterDomainIntermediator>(brokerMediatorApplications.Get(bm))
->setPoolPolicy("allPowerUsageData", brokerPolicy);
......@@ -661,7 +661,7 @@ main(int argc, char *argv[])
for (uint i=0; i<allMediatorApplications.GetN(); i++)
{
std::string name = Names::FindName(allMediatorApplications.Get(i)->GetNode());
Ptr<ndn::InterSystemIntermediator> mediator = DynamicCast<ndn::InterSystemIntermediator>(allMediatorApplications.Get(i));
Ptr<ndn::InterDomainIntermediator> mediator = DynamicCast<ndn::InterDomainIntermediator>(allMediatorApplications.Get(i));
outputFile << name << "\tOutStream\t" << mediator->getProducerStreamReused() << std::endl;
outputFile << name << "\tInStream\t" << mediator->getConsumerStreamReused() << std::endl;
outputFile << name << "\tBoth\t" << mediator->getProducerStreamReused() + mediator->getConsumerStreamReused() << std::endl;
......
......@@ -7,7 +7,7 @@
#include "stream-arranger.h"
#include "ns3/ndnSIM/apps/inter-system-intermediator.hpp"
#include "ns3/ndnSIM/apps/inter-domain-intermediator.hpp"
#include "ns3/ndnSIM/nas/NasInterestTransformationAndParameters.hpp"
#include "ns3/names.h"
......@@ -19,7 +19,7 @@ namespace ndn
StreamArranger::StreamArranger(std::string subEquivalence, Time producerStopTime,
shared_ptr<GlobalRoutingHelper> routingHelper):
producerHelper("ns3::ndn::IotAttributedContentProducer"),
intermediaryHelper("ns3::ndn::InterSystemIntermediator")
intermediaryHelper("ns3::ndn::InterDomainIntermediator")
{
this->producerStopTime = producerStopTime;
this->routingHelper = routingHelper;
......@@ -92,7 +92,7 @@ namespace ndn
sourceParams.addTransformation("PT" + childNodeId);
sourceParams.addTransformationParam("PT" + childNodeId, "p", "1");
DynamicCast<ndn::InterSystemIntermediator>(app)->addDataSource("/dataset", dataSourceName, sourceParams);
DynamicCast<ndn::InterDomainIntermediator>(app)->addDataSource("/dataset", dataSourceName, sourceParams);
}
std::string intermediaryDatasetName = "/system"+iid+"/dataset";
......@@ -119,7 +119,7 @@ namespace ndn
sourceParams.addTransformation("PT" + childNodeId);
sourceParams.addTransformationParam("PT" + childNodeId, "p", "1");
DynamicCast<ndn::InterSystemIntermediator>(app)->addDataSource("/dataset", dataSourceName, sourceParams);
DynamicCast<ndn::InterDomainIntermediator>(app)->addDataSource("/dataset", dataSourceName, sourceParams);
}
std::string intermediaryDatasetName = "/system"+iid+"/dataset";
......
......@@ -33,7 +33,7 @@ namespace ndn
if (intermediateNode->GetNApplications() > 0)
{
std::string name = Names::FindName(intermediateNode);
Ptr<InterSystemIntermediator> mediatorApp = DynamicCast<InterSystemIntermediator>(intermediateNode->GetApplication(0));
Ptr<InterDomainIntermediator> mediatorApp = DynamicCast<InterDomainIntermediator>(intermediateNode->GetApplication(0));
outputFile << name << "\tOutStream\t" << mediatorApp->getProducerStreamReused() << std::endl;
outputFile << name << "\tInStream\t" << mediatorApp->getConsumerStreamReused() << std::endl;
outputFile << name << "\tBoth\t" << mediatorApp->getProducerStreamReused() + mediatorApp->getConsumerStreamReused() << std::endl;
......
......@@ -12,7 +12,7 @@
#include "ns3/network-module.h"
#include "ns3/ndnSIM-module.h"
#include "ns3/ndnSIM/apps/inter-system-intermediator.hpp"
#include "ns3/ndnSIM/apps/inter-domain-intermediator.hpp"
#include "ns3/ndnSIM/apps/ndn-single-subscription-consumer.hpp"
#include "ns3/ndnSIM/apps/ndn-subscription-consumer.hpp"
......
......@@ -73,30 +73,32 @@ namespace ndn
parameters.setConsumerNasPrefix("/consumer1");
DynamicCast<ndn::Consumer>(app)->SetParameters(parameters);
uint chosenSubInterval;
if (secondSubInterval == "Same")
chosenSubInterval = 2;
else if (secondSubInterval == "Compatible")
chosenSubInterval = 4;
else if (secondSubInterval == "Incompatible")
chosenSubInterval = 1;
else
BOOST_THROW_EXCEPTION(invalid_argument("Invalid secondSubInterval type"));
consumerHelper.SetAttribute("SubscriptionInterval", TimeValue(Minutes(chosenSubInterval)));
app = consumerHelper.Install(topology->consumers.Get(1)).Get(0);
starttime = MilliSeconds(340);
app->SetStartTime(starttime);
app->SetStopTime(consumerStopTime);
DynamicCast<SingleSubscriptionConsumer>(app)->setSubscriptionCount(1);
// Consumer NAS parameters
parameters.setPurpose("Research");
parameters.setConsumerNasPrefix("/consumer2");
DynamicCast<ndn::Consumer>(app)->SetParameters(parameters);
if (secondSubInterval != "None")
{
uint chosenSubInterval;
if (secondSubInterval == "Same")
chosenSubInterval = 2;
else if (secondSubInterval == "Compatible")
chosenSubInterval = 4;
else if (secondSubInterval == "Incompatible")
chosenSubInterval = 1;
else
BOOST_THROW_EXCEPTION(invalid_argument("Invalid secondSubInterval type"));
consumerHelper.SetAttribute("SubscriptionInterval", TimeValue(Minutes(chosenSubInterval)));
app = consumerHelper.Install(topology->consumers.Get(1)).Get(0);
starttime = MilliSeconds(340);
app->SetStartTime(starttime);
app->SetStopTime(consumerStopTime);
DynamicCast<SingleSubscriptionConsumer>(app)->setSubscriptionCount(1);
// Consumer NAS parameters
parameters.setPurpose("Research");
parameters.setConsumerNasPrefix("/consumer2");
DynamicCast<ndn::Consumer>(app)->SetParameters(parameters);
}
}
void
......@@ -133,30 +135,33 @@ namespace ndn
DynamicCast<ndn::Consumer>(app)->SetParameters(parameters);
uint chosenSubInterval;
if (secondSubInterval == "Same")
chosenSubInterval = 2;
else if (secondSubInterval == "Compatible")
chosenSubInterval = 4;
else if (secondSubInterval == "Incompatible")
chosenSubInterval = 1;
else
BOOST_THROW_EXCEPTION(invalid_argument("Invalid secondSubInterval type"));
consumerHelper.SetAttribute("SubscriptionInterval", TimeValue(Minutes(chosenSubInterval)));
app = consumerHelper.Install(topology->consumers.Get(1)).Get(0);
starttime = MilliSeconds(340);
app->SetStartTime(starttime);
app->SetStopTime(consumerStopTime);
subCount = topology->producers.GetN();
DynamicCast<SubscriptionConsumer>(app)->setSubscriptionCount(subCount);
// Consumer NAS parameters
parameters.setPurpose("Research");
parameters.setConsumerNasPrefix("/consumer2");
DynamicCast<ndn::Consumer>(app)->SetParameters(parameters);
if (secondSubInterval != "None")
{
uint chosenSubInterval;
if (secondSubInterval == "Same")
chosenSubInterval = 2;
else if (secondSubInterval == "Compatible")
chosenSubInterval = 4;
else if (secondSubInterval == "Incompatible")
chosenSubInterval = 1;
else
BOOST_THROW_EXCEPTION(invalid_argument("Invalid secondSubInterval type"));
consumerHelper.SetAttribute("SubscriptionInterval", TimeValue(Minutes(chosenSubInterval)));
app = consumerHelper.Install(topology->consumers.Get(1)).Get(0);
starttime = MilliSeconds(340);
app->SetStartTime(starttime);
app->SetStopTime(consumerStopTime);
subCount = topology->producers.GetN();
DynamicCast<SubscriptionConsumer>(app)->setSubscriptionCount(subCount);
// Consumer NAS parameters
parameters.setPurpose("Research");
parameters.setConsumerNasPrefix("/consumer2");
DynamicCast<ndn::Consumer>(app)->SetParameters(parameters);
}
}
} /* namespace ndn */
......
......@@ -69,11 +69,10 @@ main(int argc, char *argv[])
// cmd.AddValue("randomTransformationParamCount", "Number of values for the transformations considered", randomTransformationParamCount);
// cmd.AddValue("subscriptionIntervalCount", "Number of possible values used by consumers for subscription intervals, generated as 1s, 2s, 4s,...", subscriptionIntervalCount);
cmd.AddValue("appScenario", "Scenario of applications to be used (PrivateDomains or DirectSubscriptions)", appScenario);
cmd.AddValue("secondSubInterval", "What type sub interval for the second interest (Same or Compatible or Incompatible)", secondSubInterval);
cmd.AddValue("secondSubInterval", "What type sub interval for the second interest (Same or Compatible or Incompatible or None)", secondSubInterval);
// cmd.AddValue("subEquivalenceType", "Type of equivalence checking done by the mediators (none/equal/multiplier)", subEquivalence);
cmd.Parse(argc, argv);
////// Constants /////////////////////////////////////////
const Time tSimulationTime = Minutes(120);
const Time producerStopTime = tSimulationTime - Seconds(2);
......@@ -82,7 +81,8 @@ main(int argc, char *argv[])
// BOOST_ASSERT((subEquivalence == "none" || subEquivalence == "equal" || subEquivalence == "multiplier"));
BOOST_ASSERT((appScenario == "PrivateDomains" || appScenario == "DirectSubscriptions"));
BOOST_ASSERT((secondSubInterval == "Same" || secondSubInterval == "Compatible" || secondSubInterval == "Incompatible"));
BOOST_ASSERT((secondSubInterval == "Same" || secondSubInterval == "Compatible" ||
secondSubInterval == "Incompatible" || secondSubInterval == "None"));
////// Record Parameters /////////////////////////////////////////
ofstream outputFile;
......@@ -107,10 +107,9 @@ main(int argc, char *argv[])
outputFile.close();
// Topology creators and parameters //////////////////////////////////////////////////////////////////////
Ptr<PhysicalTopologyCreator> physicalcreator = CreateObject<PhysicalTopologyCreator>();
shared_ptr<PhysicalTopology> physicalTopology = physicalcreator->create_physical_topology();
shared_ptr<PhysicalTopology> physicalTopology = physicalcreator->create_physical_topology(secondSubInterval);
......@@ -171,7 +170,8 @@ main(int argc, char *argv[])
// {
// if (!nfd::scope_prefix::LOCALHOST.isPrefixOf(csEntry->GetName()))
// {
// NS_LOG_UNCOND(" " << csEntry->GetName() << ", At: " << csEntry->GetName().at(-1).toSteadyClockTimeStamp().time_since_epoch().count() * 1e-9 / 60);
// NS_LOG_UNCOND(" " << csEntry->GetName() << ", Size: " << csEntry->GetData()->wireEncode().size());// << ", At: " <<
//// csEntry->GetName().at(-1).toSteadyClockTimeStamp().time_since_epoch().count() * 1e-9 / 60);
// }
// }
// }
......
......@@ -35,16 +35,16 @@ namespace ndn {
shared_ptr<PhysicalTopology>
PhysicalTopologyCreator::create_physical_topology()
PhysicalTopologyCreator::create_physical_topology(string secondSubInterval)
{
auto rng = CreateObject<UniformRandomVariable>();
shared_ptr<PhysicalTopology> topology = make_shared<PhysicalTopology>();
topology->consumers.Create(2);
topology->consumers.Create(secondSubInterval == "None" ? 1 : 2);
topology->routers.Create(1);
topology->domainRouters.Create(13);
topology->producers.Create(24);
topology->producers.Create(27);
Ptr<Node> firstRouter = topology->routers.Get(0);
for (uint i=0; i<topology->consumers.GetN(); i++)
......@@ -71,29 +71,28 @@ namespace ndn {
for (uint i=0; i<topology->domainRouters.GetN(); i++)
Names::Add("DR" + to_string(i+1), topology->domainRouters.Get(i));
p2pHelper.Install(firstDomainRouter, topology->domainRouters.Get(1));
p2pHelper.Install(firstDomainRouter, topology->domainRouters.Get(2));
p2pHelper.Install(firstDomainRouter, topology->domainRouters.Get(3));
p2pHelper.Install(firstDomainRouter, topology->domainRouters.Get(4));
p2pHelper.Install(firstDomainRouter, topology->domainRouters.Get( 1));
p2pHelper.Install(firstDomainRouter, topology->domainRouters.Get( 2));
p2pHelper.Install(firstDomainRouter, topology->domainRouters.Get( 3));
p2pHelper.Install(topology->domainRouters.Get(1), topology->domainRouters.Get(5));
p2pHelper.Install(topology->domainRouters.Get(1), topology->domainRouters.Get(6));
p2pHelper.Install(topology->domainRouters.Get(1), topology->domainRouters.Get( 4));
p2pHelper.Install(topology->domainRouters.Get(1), topology->domainRouters.Get( 5));
p2pHelper.Install(topology->domainRouters.Get(1), topology->domainRouters.Get( 6));
p2pHelper.Install(topology->domainRouters.Get(2), topology->domainRouters.Get(7));
p2pHelper.Install(topology->domainRouters.Get(2), topology->domainRouters.Get(8));
p2pHelper.Install(topology->domainRouters.Get(2), topology->domainRouters.Get( 7));
p2pHelper.Install(topology->domainRouters.Get(2), topology->domainRouters.Get( 8));
p2pHelper.Install(topology->domainRouters.Get(2), topology->domainRouters.Get( 9));
p2pHelper.Install(topology->domainRouters.Get(3), topology->domainRouters.Get(9));
p2pHelper.Install(topology->domainRouters.Get(3), topology->domainRouters.Get(10));
p2pHelper.Install(topology->domainRouters.Get(4), topology->domainRouters.Get(11));
p2pHelper.Install(topology->domainRouters.Get(4), topology->domainRouters.Get(12));
p2pHelper.Install(topology->domainRouters.Get(3), topology->domainRouters.Get(11));
p2pHelper.Install(topology->domainRouters.Get(3), topology->domainRouters.Get(12));
for (uint i=0; i<topology->producers.GetN(); i++)
{
Ptr<Node> producer = topology->producers.Get(i);
Names::Add("P" + to_string(i+1), producer);
uint domainRouterIdx = std::floor(i/3) + 5;
uint domainRouterIdx = std::floor(i/3) + 4;;
Ptr<Node> domainRouter = topology->domainRouters.Get(domainRouterIdx);
p2pHelper.Install(producer, domainRouter);
}
......
......@@ -40,7 +40,7 @@ namespace ndn {
~PhysicalTopologyCreator () {};
shared_ptr<PhysicalTopology>
create_physical_topology();
create_physical_topology(string secondSubInterval);
protected:
PointToPointHelper p2pHelper;
};
......
......@@ -7,7 +7,7 @@
#include "../simple-domain-streams/stream-arranger.h"
#include "ns3/ndnSIM/apps/inter-system-intermediator.hpp"
#include "ns3/ndnSIM/apps/inter-domain-intermediator.hpp"
#include "ns3/ndnSIM/nas/NasInterestTransformationAndParameters.hpp"
#include "ns3/names.h"
......@@ -18,7 +18,7 @@ namespace ndn
StreamArranger::StreamArranger(std::string subEquivalence, Time producerStopTime):
producerHelper("ns3::ndn::IotAttributedContentProducer"),
intermediaryHelper("ns3::ndn::InterSystemIntermediator")
intermediaryHelper("ns3::ndn::InterDomainIntermediator")
{
this->producerStopTime = producerStopTime;
this->routingHelper = make_shared<GlobalRoutingHelper>();
......@@ -30,44 +30,44 @@ namespace ndn
{
std::vector<uint> childs;
childs = { 1, 2, 3, 4};
setupIntermediary(phyTopology, 0, childs, intermediaryStopTime, true);
childs = { 1, 2, 3};
setupIntermediary(phyTopology, 0, childs, intermediaryStopTime, false);
childs = { 5, 6};
setupIntermediary(phyTopology, 1, childs, intermediaryStopTime, true);
childs = { 4, 5, 6};
setupIntermediary(phyTopology, 1, childs, intermediaryStopTime, false);
childs = { 7, 8};
setupIntermediary(phyTopology, 2, childs, intermediaryStopTime, true);
childs = { 7, 8, 9};
setupIntermediary(phyTopology, 2, childs, intermediaryStopTime, false);
childs = { 9, 10};
setupIntermediary(phyTopology, 3, childs, intermediaryStopTime, true);
childs = {11, 12};
setupIntermediary(phyTopology, 4, childs, intermediaryStopTime, true);
childs = {10, 11, 12};
setupIntermediary(phyTopology, 3, childs, intermediaryStopTime, false);
childs = { 0, 1, 2};
setupIntermediary(phyTopology, 5, childs, intermediaryStopTime, false);
setupIntermediary(phyTopology, 4, childs, intermediaryStopTime, true);
childs = { 3, 4, 5};
setupIntermediary(phyTopology, 6, childs, intermediaryStopTime, false);
setupIntermediary(phyTopology, 5, childs, intermediaryStopTime, true);
childs = { 6, 7, 8};
setupIntermediary(phyTopology, 7, childs, intermediaryStopTime, false);
setupIntermediary(phyTopology, 6, childs, intermediaryStopTime, true);
childs = { 9, 10, 11};
setupIntermediary(phyTopology, 8, childs, intermediaryStopTime, false);
setupIntermediary(phyTopology, 7, childs, intermediaryStopTime, true);
childs = {12, 13, 14};
setupIntermediary(phyTopology, 9, childs, intermediaryStopTime, false);
setupIntermediary(phyTopology, 8, childs, intermediaryStopTime, true);
childs = {15, 16, 17};
setupIntermediary(phyTopology, 10, childs, intermediaryStopTime, false);
setupIntermediary(phyTopology, 9, childs, intermediaryStopTime, true);
childs = {18, 19, 20};
setupIntermediary(phyTopology, 11, childs, intermediaryStopTime, false);
setupIntermediary(phyTopology, 10, childs, intermediaryStopTime, true);
childs = {21, 22, 23};
setupIntermediary(phyTopology, 12, childs, intermediaryStopTime, false);
setupIntermediary(phyTopology, 11, childs, intermediaryStopTime, true);
childs = {24, 25, 26};
setupIntermediary(phyTopology, 12, childs, intermediaryStopTime, true);
for (uint i=0; i<phyTopology->producers.GetN(); i++)
setupProducer(phyTopology, i);
......@@ -93,7 +93,7 @@ namespace ndn
}
void StreamArranger::setupIntermediary(const shared_ptr<PhysicalTopology> &phyTopology, uint nodeIdx,
std::vector<uint> childIdxs, Time intermediaryStopTime, bool isMiddle)
std::vector<uint> childIdxs, Time intermediaryStopTime, bool producerChilds)
{
intermediaryHelper.SetAttribute("NanoAsPrefix", StringValue("/domain"+to_string(nodeIdx)+"/"));
Ptr<Application> app = intermediaryHelper.Install(phyTopology->domainRouters.Get(nodeIdx)).Get(0);
......@@ -103,14 +103,14 @@ namespace ndn
for (uint childIdx : childIdxs)
{
nas::NasInterestTransformationAndParameters sourceParams;
sourceParams.addTransformation("PT"+to_string(childIdx));
sourceParams.addTransformationParam("PT"+to_string(childIdx), "p", "1");
if (isMiddle)
DynamicCast<ndn::InterSystemIntermediator>(app)
->addDataSource("/dataset", "/domain"+to_string(childIdx)+"/dataset", sourceParams);
else
DynamicCast<ndn::InterSystemIntermediator>(app)
->addDataSource("/dataset", "/producer"+to_string(childIdx), sourceParams);
sourceParams.addTransformation("avg");
sourceParams.addTransformationParam("avg", "every", "10");
string sourceName = producerChilds ? "/producer" + to_string(childIdx) :
"/domain" + to_string(childIdx) + "/dataset";
DynamicCast<ndn::InterDomainIntermediator>(app)
->addDataSource("/dataset", sourceName, sourceParams);
}
routingHelper->AddOrigin("/domain"+to_string(nodeIdx)+"/dataset",
......
......@@ -33,7 +33,7 @@ namespace ndn
if (intermediateNode->GetNApplications() > 0)
{
std::string name = Names::FindName(intermediateNode);
Ptr<InterSystemIntermediator> mediatorApp = DynamicCast<InterSystemIntermediator>(intermediateNode->GetApplication(0));
Ptr<InterDomainIntermediator> mediatorApp = DynamicCast<InterDomainIntermediator>(intermediateNode->GetApplication(0));
outputFile << name << "\tOutStream\t" << mediatorApp->getProducerStreamReused() << std::endl;
outputFile << name << "\tInStream\t" << mediatorApp->getConsumerStreamReused() << std::endl;
outputFile << name << "\tBoth\t" << mediatorApp->getProducerStreamReused() + mediatorApp->getConsumerStreamReused() << std::endl;
......
......@@ -12,7 +12,7 @@
#include "ns3/network-module.h"
#include "ns3/ndnSIM-module.h"
#include "ns3/ndnSIM/apps/inter-system-intermediator.hpp"
#include "ns3/ndnSIM/apps/inter-domain-intermediator.hpp"
#include "ns3/ndnSIM/apps/ndn-single-subscription-consumer.hpp"
#include "ns3/ndnSIM/apps/ndn-subscription-consumer.hpp"
......
......@@ -35,7 +35,8 @@ def runSimulation(script, outDir, totalNumRuns, slurm, seed, run_params):
while retries < maxretries:
completedProcess = run(call_list, stdout=PIPE, stderr=PIPE, universal_newlines=True)
if completedProcess.returncode != 0:
run_logger.error("Simulation returned %d w/ params %s!"%(' '.join(run_params), completedProcess.returncode))
run_logger.error("Simulation returned %d w/ params %s!" %
(completedProcess.returncode, ' '.join(run_params)))
run_logger.error("STDOUT: " + completedProcess.stdout)
run_logger.error("STDERR: " + completedProcess.stderr)
retries += 1
......
......@@ -106,7 +106,8 @@ node_type_order = ("Consumer", "Border Router", # "Consumer Router",
# scenarioOrder = ("NasArch", "PullEverything", "PushEverything")
scenarioOrder = ("Transformation overlay", "Conventional NDN subscriptions")
nodeOrder = "C1", "C2", "Router", "DR1", "L1 DRs", "L2 DRs", "Producer"
nodeOrder = "C1", "C2", 'Router', "DR1", "L1 DR", "L2 DR", "Producer"
subIntervalOrder = "Same", 'Compatible', 'Incompatible'
# nodeTypeOrder = ['Router', 'DRL0', 'DRL1', 'DRL2', 'Producer']
if params.single_pdf:
......@@ -117,25 +118,43 @@ else:
logger.info("Plotting content store graphs...")
fullCsDF.loc[fullCsDF.Node.isin(['DR%d' % i for i in range(2, 6)]), "Node"] = "L1 DRs"
fullCsDF.loc[fullCsDF.Node.isin(['DR%d' % i for i in range(6, 14)]), "Node"] = "L2 DRs"
fullCsDF.loc[fullCsDF.Node == "R1", "Node"] = "Router"
# print(fullCsDF.loc[(fullCsDF.appScenario == "Conventional NDN subscriptions") &
# (fullCsDF.Type.str.contains("CacheSizeByte")), ['Node', 'Packets']])
fullCsDF.loc[fullCsDF.Node.isin(['DR%d' % i for i in range(2, 5)]), "Node"] = "L1 DR"
fullCsDF.loc[fullCsDF.Node.isin(['DR%d' % i for i in range(5, 14)]), "Node"] = "L2 DR"