16 Commits
Author SHA1 Message Date
SunnyQjm 5a0f0f31d0 Merge branch 'master' into nwfq 2021-06-25 09:59:41 +08:00
SunnyQjm 3b018d4821 update 2021-06-25 09:59:22 +08:00
SunnyQjm e313aa1393 CODEL 2021-06-22 09:49:13 +08:00
SunnyQjm 332f1ff3a9 modify 2021-06-21 22:01:26 +08:00
SunnyQjm ce39ab528b fix 2021-06-21 21:42:43 +08:00
SunnyQjm 7cbb3e8cfc modify: 所有虚拟队列使用统一的Codel检测 2021-06-21 21:41:44 +08:00
SunnyQjm 1373e3b231 reset markThresh 2021-06-21 21:31:47 +08:00
SunnyQjm a1e5672497 fix 2021-06-21 21:05:13 +08:00
SunnyQjm 5a012d80f0 fix 2021-06-21 21:03:57 +08:00
SunnyQjm 0f83e159bb fix 2021-06-21 21:02:42 +08:00
SunnyQjm 4375b287dc fix 2021-06-21 21:00:48 +08:00
SunnyQjm c763b524e6 fix 2021-06-21 20:51:40 +08:00
SunnyQjm 5a5c903134 fix 2021-06-21 20:50:53 +08:00
SunnyQjm 07425fb0db add: support Codel AQM 2021-06-21 20:46:34 +08:00
SunnyQjm 1269cbd6a6 update 2021-06-21 20:07:03 +08:00
SunnyQjm 2923dabc45 add: support mark, mark Thresh = 0.6 * queueizSiidfa asdf 2021-06-21 17:26:48 +08:00
43 changed files with 33104 additions and 126069 deletions

No files matched your search

@@ -27,6 +27,7 @@
#include <ndn-cxx/lp/pit-token.hpp>
#include <ndn-cxx/lp/tags.hpp>
#include "common/global.hpp"
#include <cmath>
@@ -51,6 +52,30 @@ GenericLinkService::GenericLinkService(const GenericLinkService::Options& option
m_reassembler.beforeTimeout.connect([this] (auto...) { ++this->nReassemblyTimeouts; });
m_reliability.onDroppedInterest.connect([this] (const auto& i) { this->notifyDroppedInterest(i); });
nReassembling.observe(&m_reassembler);
this->nwfq.setC(options.C);
// 启动令牌生成流程
this->nwfq.startTokenBucket();
this->sendPacketCallback = [this](){
auto vq = this->nwfq.wfqSchedule();
while (vq != nullptr) {
auto task = vq->front();
ssize_t sendQueueLength = getTransport()->getSendQueueLength();
ssize_t sendQueueCapacity = getTransport()->getSendQueueCapacity();
if (sendQueueLength + 1024 > sendQueueCapacity) {
break;
}
vq->pop();
lp::Packet lpPacket(task.interestPtr->wireEncode());
encodeLpFields(*task.interestPtr, lpPacket);
this->sendNetPacket(std::move(lpPacket), task.endpointId, true);
vq = this->nwfq.wfqSchedule();
}
getScheduler().schedule(time::nanoseconds(1000 * 1000), this->sendPacketCallback);
};
getScheduler().schedule(time::nanoseconds(1000 * 1000), this->sendPacketCallback);
}
void
@@ -95,11 +120,28 @@ GenericLinkService::sendLpPacket(lp::Packet&& pkt, const EndpointId& endpointId)
void
GenericLinkService::doSendInterest(const Interest& interest, const EndpointId& endpointId)
{
lp::Packet lpPacket(interest.wireEncode());
if (interest.getName().getPrefix(1).toUri() == "/localhost") {
lp::Packet lpPacket(interest.wireEncode());
encodeLpFields(interest, lpPacket);
this->sendNetPacket(std::move(lpPacket), endpointId, true);
} else {
auto success = this->nwfq.appendInterest(interest, endpointId);
//if (!success) {
// // send Nack
// lp::Nack nack(interest);
// nack.setReason(lp::NackReason::CONGESTION);
// if (this->nwfq.canMark(nack)) {
// // 拥塞标记
// nack.getInterest().setTag(make_shared<lp::CongestionMarkTag>(1));
// }
// this->receiveNack(nack, endpointId);
//}
}
//lp::Packet lpPacket(interest.wireEncode());
encodeLpFields(interest, lpPacket);
//encodeLpFields(interest, lpPacket);
this->sendNetPacket(std::move(lpPacket), endpointId, true);
//this->sendNetPacket(std::move(lpPacket), endpointId, true);
}
void
@@ -150,6 +192,16 @@ GenericLinkService::encodeLpFields(const ndn::PacketBase& netPkt, lp::Packet& lp
}
}
// add by qjm
auto dszTag = netPkt.getTag<lp::DSZTag>();
if (dszTag != nullptr) {
lpPacket.add<lp::DSZField>(*dszTag);
}
auto tosTag = netPkt.getTag<lp::TosTag>();
if (tosTag != nullptr) {
lpPacket.add<lp::TosField>(*tosTag);
}
auto pitToken = netPkt.getTag<lp::PitToken>();
if (pitToken != nullptr) {
lpPacket.add<lp::PitTokenField>(*pitToken);
@@ -411,6 +463,14 @@ GenericLinkService::decodeInterest(const Block& netPkt, const lp::Packet& firstP
interest->setTag(make_shared<lp::PitToken>(firstPkt.get<lp::PitTokenField>()));
}
// add by qjm
if (firstPkt.has<lp::DSZField>()) {
interest->setTag(make_shared<lp::DSZTag>(firstPkt.get<lp::DSZField>()));
}
if (firstPkt.has<lp::TosField>()) {
interest->setTag(make_shared<lp::TosTag>(firstPkt.get<lp::TosField>()));
}
this->receiveInterest(*interest, endpointId);
}
@@ -456,7 +516,10 @@ GenericLinkService::decodeData(const Block& netPkt, const lp::Packet& firstPkt,
if (firstPkt.has<lp::CongestionMarkField>()) {
data->setTag(make_shared<lp::CongestionMarkTag>(firstPkt.get<lp::CongestionMarkField>()));
}
}
//else if (this->nwfq.canMark(*data)) {
// data->setTag(make_shared<lp::CongestionMarkTag>(1));
//}
if (firstPkt.has<lp::NonDiscoveryField>()) {
++this->nInNetInvalid;
@@ -32,10 +32,14 @@
#include "lp-reliability.hpp"
#include <ndn-cxx/lp/tags.hpp>
#include <ndn-cxx/util/scheduler.hpp>
#include "nwfq.hpp"
namespace nfd {
namespace face {
using namespace ndn::util;
/** \brief counters provided by GenericLinkService
* \note The type name 'GenericLinkServiceCounters' is implementation detail.
* Use 'GenericLinkService::Counters' in public API.
@@ -158,6 +162,8 @@ public:
* To enable, set value of enableGeoTags option to a function that generates `shared_ptr<GeoTag>`
*/
std::function<std::shared_ptr<ndn::lp::GeoTag>()> enableGeoTags;
uint64_t C = 10000000;
};
/** \brief counters provided by GenericLinkService
@@ -307,6 +313,8 @@ PUBLIC_WITH_TESTS_ELSE_PRIVATE:
time::steady_clock::TimePoint m_nextMarkTime;
/// number of marked packets in the current incident of congestion
size_t m_nMarkedSinceInMarkingState;
NWFQ nwfq;
scheduler::EventCallback sendPacketCallback;
friend class LpReliability;
};
+196
View File
@@ -0,0 +1,196 @@
//
// Created by 阙建明 on 2021/6/14.
//
#include "nwfq.hpp"
#include <thread>
#include <chrono>
namespace nfd {
namespace face {
NFD_LOG_INIT(NWFQ);
uint64_t getTime() {
auto time_now = std::chrono::system_clock::now();
auto duration_in_ms = std::chrono::duration_cast<std::chrono::milliseconds>(time_now.time_since_epoch());
return duration_in_ms.count();
}
void VirtualQueue::pop() {
if (this->innerQueue.empty()) {
return;
}
uint64_t dataSize = 8552;
auto dszTag = this->innerQueue.front().interestPtr->getTag<lp::DSZTag>();
if (dszTag != nullptr) {
dataSize = dszTag->get();
}
this->currentSize -= dataSize;
this->innerQueue.pop();
}
bool VirtualQueue::enqueue(const Interest &interest, const EndpointId &endpointId, NWFQ &nwfq) {
uint64_t dataSize = 8552;
auto dszTag = interest.getTag<lp::DSZTag>();
if (dszTag != nullptr) {
dataSize = dszTag->get();
}
// 如果超出HQL 限制,则不入队,可以进行丢弃或者 Nack 处理
if (nwfq.totalQueueSize + dataSize >= nwfq.hql) {
return false;
}
// 判断,如果虚拟队列满,则不入队,可以进行丢弃或者Nack处理
if (this->currentSize + dataSize >= this->size) {
return false;
}
this->currentSize += dataSize;
uint64_t seq = this->lastSeq; // 队列为空,则设置序列号为最近一个调度出的包的序列号
if (!this->empty()) {
seq = this->lastSeq + 1.0 / this->weight * dataSize; // TODO: 此处this->dataSize应该缓存这个流平均Data包大小
} else {
seq = nwfq.lastSendSeq + 1.0 / this->weight * dataSize;
}
SendInterestTask sendInterestTask(endpointId, interest, seq);
this->lastSeq = seq;
// 进入虚拟队列
this->innerQueue.emplace(sendInterestTask);
nwfq.totalQueueSize += dataSize;
return true;
}
// bool VirtualQueue::canMark() {
// auto currentTime = getTime();
// //NFD_LOG_WARN("size: " << this->size << ", current: " << this->currentSize << ", lastSeq: " << this->lastSeq);
// if (this->currentSize < this->markThresh) {
// this->lastMarkTime = currentTime;
// return false;
// }
// if (currentTime - this->lastMarkTime > this->markInterval) {
// // NFD_LOG_INFO("last: " << this->lastMarkTime << ", current: " << currentTime);
// this->lastMarkTime = currentTime;
// return true;
// }
// return false;
// }
bool NWFQ::appendInterest(const Interest &interest, const EndpointId &endpointId) {
std::string key = interest.getName().getPrefix(1).toUri();
if (this->virtualQueues.count(key) == 0) {
this->virtualQueues[key] = std::make_shared<VirtualQueue>(1, this->queueSize);
// 当新建一个虚拟队列时,将所有虚拟队列最近发出的序列号作为起始序列号
this->virtualQueues[key]->setLastSeq(this->lastSendSeq);
// 通过提取 Interst 中的Tos Tag设置优先级
auto tosTag = interest.getTag<lp::TosTag>();
float weight = 1.0;
if (tosTag != nullptr) {
weight = tosTag->get();
}
this->virtualQueues[key]->setWeight(weight);
return this->virtualQueues[key]->enqueue(interest, endpointId, *this);
} else {
// 虚拟队列已经存在的情况
return this->virtualQueues[key]->enqueue(interest, endpointId, *this);
}
}
// bool NWFQ::canMark(const Name &name) {
// std::string key = name.getPrefix(1).toUri();
// if (this->virtualQueues.count(key) == 0) {
// return false;
// } else {
// return this->virtualQueues[key]->canMark();
// }
// }
//
// bool NWFQ::canMark(const Data &data) {
// return this->canMark(data.getName());
// }
//
// bool NWFQ::canMark(const lp::Nack &nack) {
// return this->canMark(nack.getInterest().getName());
// }
std::shared_ptr <VirtualQueue> NWFQ::wfqSchedule() {
std::shared_ptr <VirtualQueue> result = nullptr;
for (auto &item : this->virtualQueues) {
if (!item.second->empty()) {
if (result == nullptr || result->frontSeq() > item.second->frontSeq()) {
result = item.second;
}
}
}
if (result == nullptr) {
return nullptr;
}
uint64_t dataSize = 8552;
auto dszTag = result->front().interestPtr->getTag<lp::DSZTag>();
if (dszTag != nullptr) {
dataSize = dszTag->get();
}
// 令牌数量不够时,直接返回 nullptr 表示不可调度
if (this->tokens < dataSize) {
return nullptr;
}
// 如果有可调度的队列,且令牌数量足够,则消耗令牌
if (result != nullptr) {
this->tokens -= dataSize;
}
this->lastSendSeq = result->frontSeq();
// 通过排队时间判断是否需要标记
this->checkCongestionLevel(*result->front().interestPtr);
this->totalQueueSize -= dataSize;
auto value = this->tokens;
//NFD_LOG_WARN("tokens: " << value << ", " << result->frontSeq() << ", "<< result->front().interestPtr->getName().toUri());
return result;
}
void NWFQ::checkCongestionLevel(const Interest &interest) {
if (this->totalQueueSize == 0) {
return;
}
if (this->C == 1000000) {
NFD_LOG_DEBUG("TotalQueueSize: " << this->totalQueueSize);
}
if (this->totalQueueSize > this->markThresh) {
NFD_LOG_DEBUG("Fuck");
const auto now = time::steady_clock::now();
if (m_nextMarkTime == time::steady_clock::TimePoint::max()) {
m_nextMarkTime = now + this->markInterval;
}
// Mark packet if sendQueue stays above target for one interval
else if (now >= m_nextMarkTime) {
interest.setTag(make_shared<lp::CongestionMarkTag>(1));
++m_nMarkedSinceInMarkingState;
// Decrease the marking interval by the inverse of the square root of the number of packets
// marked in this incident of congestion
time::nanoseconds interval(static_cast<time::nanoseconds::rep>(
this->markInterval.count() /
std::sqrt(m_nMarkedSinceInMarkingState + 1)));
m_nextMarkTime += interval;
}
} else if (m_nextMarkTime != time::steady_clock::TimePoint::max()) {
m_nextMarkTime = time::steady_clock::TimePoint::max();
m_nMarkedSinceInMarkingState = 0;
}
}
}
}
+226
View File
@@ -0,0 +1,226 @@
//
// Created by 阙建明 on 2021/6/14.
//
#ifndef TEMPLATE_NWFQ_H
#define TEMPLATE_NWFQ_H
#include <queue>
#include <unordered_map>
#include <string>
#include "link-service.hpp"
#include <memory>
#include <ndn-cxx/util/scheduler.hpp>
#include <ndn-cxx/lp/tags.hpp>
#include "common/global.hpp"
#include "face-common.hpp"
namespace nfd {
namespace face {
using namespace ndn;
using namespace ndn::util;
class NWFQ;
/**
* 兴趣包发送 Task
*/
struct SendInterestTask {
SendInterestTask(const EndpointId &endpointId, const Interest &interest, uint64_t seq) :
endpointId(endpointId),
interestPtr(interest.shared_from_this()),
seq(seq) {
}
EndpointId endpointId;
shared_ptr<const Interest> interestPtr;
uint64_t seq; // WFQ序列号
};
/**
* 虚拟队列实现
*/
class VirtualQueue {
public:
explicit VirtualQueue(float weight, uint64_t size) :
weight(weight), size(size), currentSize(0){
}
/**
* 往虚拟队列里面放入一个
* @param interest
* @param endpointId
* @param seq
* @param isFirst 是否是创建虚拟队列之后第一次放包
* @return
*/
bool enqueue(const Interest &interest, const EndpointId &endpointId, NWFQ &nwfq);
/**
* 判断虚拟队列是否为空
*/
bool empty() {
return this->innerQueue.empty();
}
/**
* 返回队头元素的序列号
* @return
*/
uint64_t frontSeq() {
if (this->innerQueue.empty()) {
return this->lastSeq;
}
return this->innerQueue.front().seq;
}
/**
* 返回虚拟队列队头的元素(调用之前用 empty 判断不为空)
* @return
*/
SendInterestTask front() {
return this->innerQueue.front();
}
/**
* 弹出队头Task
*/
void pop();
/**
* 设置最近一次分配的序列号
* 1. 当这是一个新创建的虚拟队列时,会遍历所有虚拟队列,取所有虚拟队列队头序列号中最小的序列号;
* 2. 当这个队列空了一段时间时(超过1秒),会遍历所有虚拟队列,取所有虚拟队列队头序列号中最小的序列号;
* @param seq
*/
void setLastSeq(uint64_t seq) {
this->lastSeq = seq;
}
/**
* 获取最近一次分配的序列号
* @return
*/
uint64_t getLastSeq() {
return lastSeq;
}
void setWeight(float weight) {
this->weight = weight;
}
// /**
// * 返回是否可以标记,一个标记周期内,最多可以标记一次
// */
// bool canMark();
private:
float weight; // 队列权重(优先级越高,权重越大)
uint64_t size; // 队列大小(单位为字节)
int currentSize; // 当前队列占用大小(单位为字节,每个 Task 占用的大小等于其兴趣包对应的数据包的大小)
uint64_t lastSeq; // 最近一次分配的序列号
uint64_t lastMarkTime; // 最后一次标记的时间
std::queue <SendInterestTask> innerQueue; // 存放队列里面的兴趣包发送任务
};
class NWFQ {
public:
explicit NWFQ() : C(1000000), queueSize(1600000), tokens(0) {
this->hql = 200 * 1000 * 8;
this->markThresh = 64 * 1000 * 2;
};
/**
* 设置带宽大小
* @param C
*/
void setC(uint64_t C) {
this->C = C;
}
/**
* 设置队列的大小
* @param queueSize
*/
void setQueueSize(uint64_t queueSize) {
this->queueSize = queueSize;
}
/**
* 添加一个兴趣包
* 1. 首先根据兴趣包的名字,取第一个 Component 区分不同的流,放到不同的虚拟队列当中
* 2.
* @param interest
* @param endpointId
* @return bool 返回是否入队成功,如果入队失败,则表示对应的虚拟队列已经满了,需要丢弃或者做Nack处理
*/
bool appendInterest(const Interest &interest, const EndpointId &endpointId);
// /**
// * 判断某个前缀对应的包是否可以标记
// */
// bool canMark(const Name &name);
//
// /**
// * 判断是否可以给一个Data包标记
// */
// bool canMark(const Data &data);
//
// /**
// * 判断是否可以给一个 Nack 标记
// */
// bool canMark(const lp::Nack &nack);
/**
* 返回下一个可调度的虚拟队列
* @return
*/
std::shared_ptr <VirtualQueue> wfqSchedule();
/**
* 启动一个定时任务,按链路的带宽作为令牌生成速率,往令牌桶中投放令牌
*/
void startTokenBucket() {
this->generateTokenCallback = [this]() {
if (this->tokens + (this->C / 1000) < this->C) {
this->tokens += (this->C / 1000);
} else {
this->tokens = this->C;
}
getScheduler().schedule(time::nanoseconds(1000 * 1000), this->generateTokenCallback);
};
getScheduler().schedule(time::nanoseconds(1000 * 1000), this->generateTokenCallback);
}
/**
* 检查是否需要对兴趣包进行标记
* @param interest
*/
void checkCongestionLevel(const Interest &interest);
public:
uint64_t hql; // Hold-Queue-Limit
uint64_t totalQueueSize = 0; // 所有虚拟队列总的占用率
uint64_t lastSendSeq = 1;
uint64_t markThresh; // 标记阈值,为队列大小的10%
time::nanoseconds markInterval = 100_ms; // 标记周期 => 100 ms
time::steady_clock::TimePoint m_nextMarkTime;
/// number of marked packets in the current incident of congestion
size_t m_nMarkedSinceInMarkingState;
private:
uint64_t C; // 带宽
uint64_t queueSize; // 队列大小
uint64_t tokens; // 令牌桶中的令牌
scheduler::EventCallback generateTokenCallback;
std::unordered_map <std::string, std::shared_ptr<VirtualQueue>> virtualQueues; // 虚拟队列
};
}
}
#endif //TEMPLATE_NWFQ_H
@@ -28,6 +28,7 @@
#include "common/logger.hpp"
#include <ndn-cxx/lp/pit-token.hpp>
#include <ndn-cxx/lp/tags.hpp>
#include <boost/range/adaptor/map.hpp>
#include <boost/range/algorithm/copy.hpp>
@@ -232,6 +233,12 @@ Strategy::sendData(const shared_ptr<pit::Entry>& pitEntry, const Data& data,
auto inRecord = pitEntry->getInRecord(egress.face);
if (inRecord != pitEntry->in_end()) {
pitToken = inRecord->getInterest().getTag<lp::PitToken>();
// 把兴趣包中的 CongestionTag 传递给对应的数据包
auto congestionTag = inRecord->getInterest().getTag<ndn::lp::CongestionMarkTag>();
if (congestionTag != nullptr) {
data.setTag(congestionTag);
}
}
// delete the PIT entry's in-record based on egress,
+9 -23
View File
@@ -45,31 +45,37 @@ ConsumerPcon::GetTypeId()
MakeEnumAccessor(&ConsumerPcon::m_ccAlgorithm),
MakeEnumChecker(CcAlgorithm::AIMD, "AIMD", CcAlgorithm::BIC, "BIC",
CcAlgorithm::CUBIC, "CUBIC"))
.AddAttribute("Beta",
"TCP Multiplicative Decrease factor",
DoubleValue(0.5),
MakeDoubleAccessor(&ConsumerPcon::m_beta),
MakeDoubleChecker<double>())
.AddAttribute("CubicBeta",
"TCP CUBIC Multiplicative Decrease factor",
DoubleValue(0.8),
MakeDoubleAccessor(&ConsumerPcon::m_cubicBeta),
MakeDoubleChecker<double>())
.AddAttribute("AddRttSuppress",
"Minimum number of RTTs (1 + this factor) between window decreases",
DoubleValue(0.5), // This default value was chosen after manual testing
MakeDoubleAccessor(&ConsumerPcon::m_addRttSuppress),
MakeDoubleChecker<double>())
.AddAttribute("ReactToCongestionMarks",
"If true, process received congestion marks",
BooleanValue(true),
MakeBooleanAccessor(&ConsumerPcon::m_reactToCongestionMarks),
MakeBooleanChecker())
.AddAttribute("UseCwa",
"If true, use Conservative Window Adaptation",
BooleanValue(true),
MakeBooleanAccessor(&ConsumerPcon::m_useCwa),
MakeBooleanChecker())
.AddAttribute("UseCubicFastConvergence",
"If true, use TCP CUBIC Fast Convergence",
BooleanValue(false),
@@ -92,23 +98,9 @@ ConsumerPcon::ConsumerPcon()
, m_bicSsCwnd(0)
, m_bicSsTarget(0)
, m_isBicSs(false)
, m_recvDataNum(0)
{
}
uint32_t
ConsumerPcon::GetSeqMax() const
{
return m_seqMax;
}
void
ConsumerPcon::SetSeqMax(uint32_t seqMax)
{
m_seqMax = seqMax;
}
void
ConsumerPcon::OnData(shared_ptr<const Data> data)
{
@@ -138,13 +130,7 @@ ConsumerPcon::OnData(shared_ptr<const Data> data)
m_inFlight--;
}
NS_LOG_DEBUG("Window: " << m_window << ", InFlight: " << m_inFlight);
++this->m_recvDataNum;
if (this->m_recvDataNum == this->m_seqMax) {
this->StopApplication();
return;
}
//NS_LOG_DEBUG("Window: " << m_window << ", InFlight: " << m_inFlight);
ScheduleNextPacket();
}
@@ -158,7 +144,7 @@ ConsumerPcon::OnTimeout(uint32_t sequenceNum)
m_inFlight--;
}
NS_LOG_DEBUG("Window: " << m_window << ", InFlight: " << m_inFlight);
//NS_LOG_DEBUG("Window: " << m_window << ", InFlight: " << m_inFlight);
Consumer::OnTimeout(sequenceNum);
}
@@ -183,7 +169,7 @@ ConsumerPcon::WindowIncrease()
else {
BOOST_ASSERT_MSG(false, "Unknown CC Algorithm");
}
NS_LOG_DEBUG("Window size increased to " << m_window);
//NS_LOG_DEBUG("Window size increased to " << m_window);
}
void
@@ -75,14 +75,6 @@ private:
void
BicDecrease();
uint32_t
GetSeqMax() const;
void
SetSeqMax(uint32_t seqMax);
private:
CcAlgorithm m_ccAlgorithm;
double m_beta;
@@ -117,8 +109,6 @@ private:
double m_bicSsCwnd;
double m_bicSsTarget;
bool m_isBicSs; //!< whether we are currently in the BIC slow start phase
uint32_t m_recvDataNum;
};
} // namespace ndn
+1 -12
View File
@@ -71,11 +71,6 @@ ConsumerWindow::GetTypeId(void)
BooleanValue(true),
MakeBooleanAccessor(&ConsumerWindow::m_setInitialWindowOnTimeout),
MakeBooleanChecker())
.AddAttribute("DelayStart",
"Delay start time",
UintegerValue(0),
MakeUintegerAccessor(&ConsumerWindow::delayStart),
MakeUintegerChecker<uint32_t>())
.AddTraceSource("WindowTrace",
"Window that controls how many outstanding interests are allowed",
@@ -160,13 +155,7 @@ ConsumerWindow::SetSeqMax(uint32_t seqMax)
void
ConsumerWindow::ScheduleNextPacket()
{
if (this->m_firstTime) {
m_sendEvent =
Simulator::Schedule(MilliSeconds(this->delayStart),
&Consumer::SendPacket, this);
this->m_firstTime = false;
}
else if (m_window == static_cast<uint32_t>(0)) {
if (m_window == static_cast<uint32_t>(0)) {
Simulator::Remove(m_sendEvent);
NS_LOG_DEBUG(
@@ -101,8 +101,6 @@ protected:
TracedValue<double> m_window;
TracedValue<uint32_t> m_inFlight;
bool m_firstTime = true;
uint64_t delayStart; // 延迟启动时间
};
} // namespace ndn
@@ -281,6 +281,12 @@ StackHelper::PointToPointNetDeviceCallback(Ptr<Node> node, Ptr<L3Protocol> ndn,
opts.allowFragmentation = true;
opts.allowReassembly = true;
opts.allowCongestionMarking = true;
// Get DataRate
DataRateValue dataRateAttribute;
if (netDevice->GetAttributeFailSafe("DataRate", dataRateAttribute)) {
auto dataRate = dataRateAttribute.Get();
opts.C = dataRate.GetBitRate();
}
auto linkService = make_unique<::nfd::face::GenericLinkService>(opts);
+3
View File
@@ -265,6 +265,9 @@ extractLpLocalFields(NetPkt& netPacket, const lp::Packet& lpPacket)
addTagFromField<lp::IncomingFaceIdTag, lp::IncomingFaceIdField>(netPacket, lpPacket);
addTagFromField<lp::CongestionMarkTag, lp::CongestionMarkField>(netPacket, lpPacket);
// add by qjm
addTagFromField<lp::DSZTag, lp::DSZField>(netPacket, lpPacket);
if (lpPacket.has<lp::HopCountTagField>()) {
netPacket.setTag(make_shared<lp::HopCountTag>(lpPacket.get<lp::HopCountTagField>() + 1));
}
@@ -98,6 +98,10 @@ public: // consumer
addFieldFromTag<lp::NextHopFaceIdField, lp::NextHopFaceIdTag>(lpPacket, interest2);
addFieldFromTag<lp::CongestionMarkField, lp::CongestionMarkTag>(lpPacket, interest2);
// add by qjm
addFieldFromTag<lp::DSZField, lp::DSZTag>(lpPacket, interest2);
addFieldFromTag<lp::TosField, lp::TosTag>(lpPacket, interest2);
entry.recordForwarding();
m_face.m_transport->send(finishEncoding(std::move(lpPacket), interest2.wireEncode(),
'I', interest2.getName()));
+18 -1
View File
@@ -138,6 +138,21 @@ typedef FieldDecl<field_location_tags::Fragment,
tlv::Fragment> FragmentField;
BOOST_CONCEPT_ASSERT((Field<FragmentField>));
/**
* DSZ Field
* Data Size field
*/
typedef FieldDecl<field_location_tags::Header,
uint64_t, tlv::DSZ> DSZField;
/**
* Tos Field
*/
typedef FieldDecl<field_location_tags::Header,
uint64_t, tlv::Tos> TosField;
/** \brief Set of all field declarations.
*/
typedef boost::mpl::set<
@@ -156,7 +171,9 @@ typedef boost::mpl::set<
NonDiscoveryField,
PrefixAnnouncementField,
HopCountTagField,
GeoTagField
GeoTagField,
DSZField,
TosField
> FieldSet;
} // namespace lp
@@ -80,6 +80,17 @@ typedef SimpleTag<PrefixAnnouncementHeader, 15> PrefixAnnouncementTag;
*/
typedef SimpleTag<uint64_t, 0x60000000> HopCountTag;
/**
* DSZ
* Data Size
*/
typedef SimpleTag<uint64_t, 16> DSZTag;
/**
* Tos
*/
typedef SimpleTag<uint64_t, 17> TosTag;
/** \class GeoTag
* \brief a packet tag for GeoTag field
*
@@ -50,6 +50,11 @@ enum {
TxSequence = 840,
NonDiscovery = 844,
PrefixAnnouncement = 848,
// Add DSZ Tag
DSZ = 852,
// Add Tos Tag
Tos = 856
};
enum {
-1
View File
@@ -6,4 +6,3 @@
.lock*
build/
*.pyc
*.txt
@@ -1,73 +0,0 @@
#include "face/face.hpp"
#include "fw/strategy-info.hpp"
#include <string>
#include <map>
namespace nfd {
namespace fw {
/**
* 可以保存和获取属于相同名字前缀的测量信息
*/
class MtForwardingInfo : public StrategyInfo {
public:
static constexpr int getTypeId() {
return 1013;
}
MtForwardingInfo(): ownPrefix("null") {
}
/**
* 设置某个FaceId的转发概率的值
*/
setForwPerc(FaceId, faceId, double perc) {
this->forwPercMap[faceId] = perc;
}
/**
* 增加或者减少转发概率
*/
increaseForwPerc(FaceId, faceId, double changeRate) {
this->forwPercMap[faceId] += changeRate;
}
/**
* 获取记录了 faceid-> 转发概率映射的map
*/
const std::map<FaceId, double> getForwPercMap() const {
return this->forwPercMap;
}
/**
* 获取 Face 的数量
*/
int getFaceCount() {
return this->forwPercMap.size();
}
/**
* 获取前缀
*/
void setPrefix(std::string prefix) {
this->ownPrefix = prefix;
}
/**
* 设置前缀
*/
std::string getPrefix() const {
return this->ownPrefix;
}
private:
std::string ownPrefix;
std::map<FaceId, double> forwPercMap;
}
}
}
-8
View File
@@ -1,8 +0,0 @@
#include "pcon-strategy.hpp"
#include <boost/random/uniform_int_distribution.hpp>
#include <ndn-cxx/util/random.hpp>
#include "daemon/common/logger.hpp"
namespace nfd {
}
-36
View File
@@ -1,36 +0,0 @@
#include <boost/random/mersenne_twister.hpp>
#include "face/face.hpp"
#include "fw/strategy.hpp"
#include "fw/algorithm.hpp"
#include "fw/process-nack-traits.hpp"
namespace nfd {
namespace fw {
class PconStrategy : public Strategy, public ProcessNackTraits<PconStrategy> {
public:
PconStrategy(Forwarder& forwarder, const Name& name = getStrategyName());
virtual ~RandomLoadBalancerStrategy() override;
void afterReceiveInterest(const FaceEndpoint &ingress, const Interest &interest,
const shared_ptr <pit::Entry> &pitEntry) override;
void beforeSatisfyInterest(const shared_ptr <pit::Entry> &pitEntry,
const FaceEndpoint &ingress, const Data &data) override;
static const Name & getStrategyName();
private:
// 每收到一个CongestionMark,转发概率调整的比例
double CHANGE_PERC;
// 记录最后一次更新的时间
time::steady_clock::TimePoint m_lastFWRatioUpdate;
// 更新间隔,取110ms
const time::steady_clock::duration TIME_BETWEEN_FW_UPDATE;
}
}
}
File diff suppressed because it is too large. Load diff
-712
View File
@@ -1,712 +0,0 @@
Time Node Interface Type Packets Kilobytes PacketsRaw KilobytesRaw
0.5 C3 combined Drop 0 0 0 0
0.5 C2 combined Drop 0 0 0 0
0.5 C1 combined Drop 0 0 0 0
0.5 R1 combined Drop 0 0 0 0
0.5 R2 combined Drop 0 0 0 0
0.5 P4 combined Drop 0 0 0 0
0.5 P3 combined Drop 0 0 0 0
0.5 P2 combined Drop 0 0 0 0
0.5 P1 combined Drop 0 0 0 0
1 C3 combined Drop 0 0 0 0
1 C2 combined Drop 0 0 0 0
1 C1 combined Drop 0 0 0 0
1 R1 combined Drop 0 0 0 0
1 R2 combined Drop 0 0 0 0
1 P4 combined Drop 0 0 0 0
1 P3 combined Drop 0 0 0 0
1 P2 combined Drop 0 0 0 0
1 P1 combined Drop 0 0 0 0
1.5 C3 combined Drop 0 0 0 0
1.5 C2 combined Drop 0 0 0 0
1.5 C1 combined Drop 0 0 0 0
1.5 R1 combined Drop 0 0 0 0
1.5 R2 combined Drop 129 134 81 84.1641
1.5 P4 combined Drop 177 184 111 115.336
1.5 P3 combined Drop 0 0 0 0
1.5 P2 combined Drop 0 0 0 0
1.5 P1 combined Drop 0 0 0 0
2 C3 combined Drop 32 0 20 0.585938
2 C2 combined Drop 0 0 0 0
2 C1 combined Drop 33 0 21 0.615234
2 R1 combined Drop 0 0 0 0
2 R2 combined Drop 91 94 41 42.6152
2 P4 combined Drop 97 101 39 40.5254
2 P3 combined Drop 0 0 0 0
2 P2 combined Drop 0 0 0 0
2 P1 combined Drop 0 0 0 0
2.5 C3 combined Drop 6 0 0 0
2.5 C2 combined Drop 0 0 0 0
2.5 C1 combined Drop 6 0 0 0
2.5 R1 combined Drop 0 0 0 0
2.5 R2 combined Drop 56 58 24 24.9531
2.5 P4 combined Drop 19 20 0 0
2.5 P3 combined Drop 0 0 0 0
2.5 P2 combined Drop 0 0 0 0
2.5 P1 combined Drop 0 0 0 0
3 C3 combined Drop 1 0 0 0
3 C2 combined Drop 0 0 0 0
3 C1 combined Drop 1 0 0 0
3 R1 combined Drop 0 0 0 0
3 R2 combined Drop 11 11 0 0
3 P4 combined Drop 3 3 0 0
3 P3 combined Drop 0 0 0 0
3 P2 combined Drop 0 0 0 0
3 P1 combined Drop 0 0 0 0
3.5 C3 combined Drop 0 0 0 0
3.5 C2 combined Drop 0 0 0 0
3.5 C1 combined Drop 0 0 0 0
3.5 R1 combined Drop 0 0 0 0
3.5 R2 combined Drop 16 17 9 9.36035
3.5 P4 combined Drop 2 2 1 1.04004
3.5 P3 combined Drop 0 0 0 0
3.5 P2 combined Drop 0 0 0 0
3.5 P1 combined Drop 0 0 0 0
4 C3 combined Drop 0 0 0 0
4 C2 combined Drop 0 0 0 0
4 C1 combined Drop 0 0 0 0
4 R1 combined Drop 0 0 0 0
4 R2 combined Drop 3 3 0 0
4 P4 combined Drop 0 0 0 0
4 P3 combined Drop 0 0 0 0
4 P2 combined Drop 0 0 0 0
4 P1 combined Drop 0 0 0 0
4.5 C3 combined Drop 0 0 0 0
4.5 C2 combined Drop 0 0 0 0
4.5 C1 combined Drop 0 0 0 0
4.5 R1 combined Drop 0 0 0 0
4.5 R2 combined Drop 16 17 10 10.4004
4.5 P4 combined Drop 0 0 0 0
4.5 P3 combined Drop 0 0 0 0
4.5 P2 combined Drop 0 0 0 0
4.5 P1 combined Drop 0 0 0 0
5 C3 combined Drop 0 0 0 0
5 C2 combined Drop 0 0 0 0
5 C1 combined Drop 0 0 0 0
5 R1 combined Drop 0 0 0 0
5 R2 combined Drop 3 3 0 0
5 P4 combined Drop 0 0 0 0
5 P3 combined Drop 0 0 0 0
5 P2 combined Drop 0 0 0 0
5 P1 combined Drop 0 0 0 0
5.5 C3 combined Drop 0 0 0 0
5.5 C2 combined Drop 0 0 0 0
5.5 C1 combined Drop 0 0 0 0
5.5 R1 combined Drop 0 0 0 0
5.5 R2 combined Drop 0 0 0 0
5.5 P4 combined Drop 6 6 4 4.16016
5.5 P3 combined Drop 0 0 0 0
5.5 P2 combined Drop 0 0 0 0
5.5 P1 combined Drop 0 0 0 0
6 C3 combined Drop 0 0 0 0
6 C2 combined Drop 0 0 0 0
6 C1 combined Drop 0 0 0 0
6 R1 combined Drop 0 0 0 0
6 R2 combined Drop 0 0 0 0
6 P4 combined Drop 7 7 4 4.16016
6 P3 combined Drop 0 0 0 0
6 P2 combined Drop 0 0 0 0
6 P1 combined Drop 0 0 0 0
6.5 C3 combined Drop 0 0 0 0
6.5 C2 combined Drop 0 0 0 0
6.5 C1 combined Drop 0 0 0 0
6.5 R1 combined Drop 0 0 0 0
6.5 R2 combined Drop 0 0 0 0
6.5 P4 combined Drop 1 1 0 0
6.5 P3 combined Drop 0 0 0 0
6.5 P2 combined Drop 0 0 0 0
6.5 P1 combined Drop 0 0 0 0
7 C3 combined Drop 0 0 0 0
7 C2 combined Drop 0 0 0 0
7 C1 combined Drop 0 0 0 0
7 R1 combined Drop 0 0 0 0
7 R2 combined Drop 24 24 15 15.6006
7 P4 combined Drop 0 0 0 0
7 P3 combined Drop 0 0 0 0
7 P2 combined Drop 0 0 0 0
7 P1 combined Drop 0 0 0 0
7.5 C3 combined Drop 0 0 0 0
7.5 C2 combined Drop 0 0 0 0
7.5 C1 combined Drop 0 0 0 0
7.5 R1 combined Drop 0 0 0 0
7.5 R2 combined Drop 4 4 0 0
7.5 P4 combined Drop 0 0 0 0
7.5 P3 combined Drop 0 0 0 0
7.5 P2 combined Drop 0 0 0 0
7.5 P1 combined Drop 0 0 0 0
8 C3 combined Drop 0 0 0 0
8 C2 combined Drop 0 0 0 0
8 C1 combined Drop 0 0 0 0
8 R1 combined Drop 0 0 0 0
8 R2 combined Drop 0 0 0 0
8 P4 combined Drop 0 0 0 0
8 P3 combined Drop 0 0 0 0
8 P2 combined Drop 0 0 0 0
8 P1 combined Drop 0 0 0 0
8.5 C3 combined Drop 0 0 0 0
8.5 C2 combined Drop 0 0 0 0
8.5 C1 combined Drop 0 0 0 0
8.5 R1 combined Drop 0 0 0 0
8.5 R2 combined Drop 12 13 8 8.32031
8.5 P4 combined Drop 0 0 0 0
8.5 P3 combined Drop 0 0 0 0
8.5 P2 combined Drop 0 0 0 0
8.5 P1 combined Drop 0 0 0 0
9 C3 combined Drop 0 0 0 0
9 C2 combined Drop 0 0 0 0
9 C1 combined Drop 0 0 0 0
9 R1 combined Drop 0 0 0 0
9 R2 combined Drop 2 2 0 0
9 P4 combined Drop 0 0 0 0
9 P3 combined Drop 0 0 0 0
9 P2 combined Drop 0 0 0 0
9 P1 combined Drop 0 0 0 0
9.5 C3 combined Drop 0 0 0 0
9.5 C2 combined Drop 0 0 0 0
9.5 C1 combined Drop 0 0 0 0
9.5 R1 combined Drop 0 0 0 0
9.5 R2 combined Drop 3 3 2 2.08008
9.5 P4 combined Drop 8 8 5 5.2002
9.5 P3 combined Drop 0 0 0 0
9.5 P2 combined Drop 0 0 0 0
9.5 P1 combined Drop 0 0 0 0
10 C3 combined Drop 0 0 0 0
10 C2 combined Drop 0 0 0 0
10 C1 combined Drop 0 0 0 0
10 R1 combined Drop 0 0 0 0
10 R2 combined Drop 0 0 0 0
10 P4 combined Drop 3 3 1 1.04004
10 P3 combined Drop 0 0 0 0
10 P2 combined Drop 0 0 0 0
10 P1 combined Drop 0 0 0 0
10.5 C3 combined Drop 0 0 0 0
10.5 C2 combined Drop 0 0 0 0
10.5 C1 combined Drop 0 0 0 0
10.5 R1 combined Drop 0 0 0 0
10.5 R2 combined Drop 0 0 0 0
10.5 P4 combined Drop 10 10 6 6.24023
10.5 P3 combined Drop 0 0 0 0
10.5 P2 combined Drop 0 0 0 0
10.5 P1 combined Drop 0 0 0 0
11 C3 combined Drop 0 0 0 0
11 C2 combined Drop 0 0 0 0
11 C1 combined Drop 0 0 0 0
11 R1 combined Drop 0 0 0 0
11 R2 combined Drop 0 0 0 0
11 P4 combined Drop 14 15 8 8.32031
11 P3 combined Drop 0 0 0 0
11 P2 combined Drop 0 0 0 0
11 P1 combined Drop 0 0 0 0
11.5 C3 combined Drop 0 0 0 0
11.5 C2 combined Drop 0 0 0 0
11.5 C1 combined Drop 0 0 0 0
11.5 R1 combined Drop 0 0 0 0
11.5 R2 combined Drop 0 0 0 0
11.5 P4 combined Drop 2 2 0 0
11.5 P3 combined Drop 0 0 0 0
11.5 P2 combined Drop 0 0 0 0
11.5 P1 combined Drop 0 0 0 0
12 C3 combined Drop 0 0 0 0
12 C2 combined Drop 0 0 0 0
12 C1 combined Drop 0 0 0 0
12 R1 combined Drop 0 0 0 0
12 R2 combined Drop 0 0 0 0
12 P4 combined Drop 3 3 2 2.08008
12 P3 combined Drop 0 0 0 0
12 P2 combined Drop 0 0 0 0
12 P1 combined Drop 0 0 0 0
12.5 C3 combined Drop 0 0 0 0
12.5 C2 combined Drop 0 0 0 0
12.5 C1 combined Drop 0 0 0 0
12.5 R1 combined Drop 0 0 0 0
12.5 R2 combined Drop 0 0 0 0
12.5 P4 combined Drop 0 0 0 0
12.5 P3 combined Drop 0 0 0 0
12.5 P2 combined Drop 0 0 0 0
12.5 P1 combined Drop 0 0 0 0
13 C3 combined Drop 0 0 0 0
13 C2 combined Drop 0 0 0 0
13 C1 combined Drop 0 0 0 0
13 R1 combined Drop 0 0 0 0
13 R2 combined Drop 4 4 3 3.12012
13 P4 combined Drop 16 16 10 10.4004
13 P3 combined Drop 0 0 0 0
13 P2 combined Drop 0 0 0 0
13 P1 combined Drop 0 0 0 0
13.5 C3 combined Drop 0 0 0 0
13.5 C2 combined Drop 0 0 0 0
13.5 C1 combined Drop 0 0 0 0
13.5 R1 combined Drop 0 0 0 0
13.5 R2 combined Drop 0 0 0 0
13.5 P4 combined Drop 3 3 0 0
13.5 P3 combined Drop 0 0 0 0
13.5 P2 combined Drop 0 0 0 0
13.5 P1 combined Drop 0 0 0 0
14 C3 combined Drop 0 0 0 0
14 C2 combined Drop 0 0 0 0
14 C1 combined Drop 0 0 0 0
14 R1 combined Drop 0 0 0 0
14 R2 combined Drop 0 0 0 0
14 P4 combined Drop 3 3 2 2.08008
14 P3 combined Drop 0 0 0 0
14 P2 combined Drop 0 0 0 0
14 P1 combined Drop 0 0 0 0
14.5 C3 combined Drop 0 0 0 0
14.5 C2 combined Drop 0 0 0 0
14.5 C1 combined Drop 0 0 0 0
14.5 R1 combined Drop 0 0 0 0
14.5 R2 combined Drop 0 0 0 0
14.5 P4 combined Drop 0 0 0 0
14.5 P3 combined Drop 0 0 0 0
14.5 P2 combined Drop 0 0 0 0
14.5 P1 combined Drop 0 0 0 0
15 C3 combined Drop 0 0 0 0
15 C2 combined Drop 0 0 0 0
15 C1 combined Drop 0 0 0 0
15 R1 combined Drop 0 0 0 0
15 R2 combined Drop 0 0 0 0
15 P4 combined Drop 6 6 4 4.16016
15 P3 combined Drop 0 0 0 0
15 P2 combined Drop 0 0 0 0
15 P1 combined Drop 0 0 0 0
15.5 C3 combined Drop 0 0 0 0
15.5 C2 combined Drop 0 0 0 0
15.5 C1 combined Drop 0 0 0 0
15.5 R1 combined Drop 0 0 0 0
15.5 R2 combined Drop 4 4 3 3.12012
15.5 P4 combined Drop 1 1 0 0
15.5 P3 combined Drop 0 0 0 0
15.5 P2 combined Drop 0 0 0 0
15.5 P1 combined Drop 0 0 0 0
16 C3 combined Drop 0 0 0 0
16 C2 combined Drop 0 0 0 0
16 C1 combined Drop 0 0 0 0
16 R1 combined Drop 0 0 0 0
16 R2 combined Drop 7 7 4 4.16016
16 P4 combined Drop 0 0 0 0
16 P3 combined Drop 0 0 0 0
16 P2 combined Drop 0 0 0 0
16 P1 combined Drop 0 0 0 0
16.5 C3 combined Drop 0 0 0 0
16.5 C2 combined Drop 0 0 0 0
16.5 C1 combined Drop 0 0 0 0
16.5 R1 combined Drop 0 0 0 0
16.5 R2 combined Drop 1 1 0 0
16.5 P4 combined Drop 0 0 0 0
16.5 P3 combined Drop 0 0 0 0
16.5 P2 combined Drop 0 0 0 0
16.5 P1 combined Drop 0 0 0 0
17 C3 combined Drop 0 0 0 0
17 C2 combined Drop 0 0 0 0
17 C1 combined Drop 0 0 0 0
17 R1 combined Drop 0 0 0 0
17 R2 combined Drop 1 1 1 1.04004
17 P4 combined Drop 1 1 1 1.04004
17 P3 combined Drop 0 0 0 0
17 P2 combined Drop 0 0 0 0
17 P1 combined Drop 0 0 0 0
17.5 C3 combined Drop 0 0 0 0
17.5 C2 combined Drop 0 0 0 0
17.5 C1 combined Drop 0 0 0 0
17.5 R1 combined Drop 0 0 0 0
17.5 R2 combined Drop 5 5 3 3.12012
17.5 P4 combined Drop 0 0 0 0
17.5 P3 combined Drop 0 0 0 0
17.5 P2 combined Drop 0 0 0 0
17.5 P1 combined Drop 0 0 0 0
18 C3 combined Drop 0 0 0 0
18 C2 combined Drop 0 0 0 0
18 C1 combined Drop 0 0 0 0
18 R1 combined Drop 0 0 0 0
18 R2 combined Drop 0 0 0 0
18 P4 combined Drop 0 0 0 0
18 P3 combined Drop 0 0 0 0
18 P2 combined Drop 0 0 0 0
18 P1 combined Drop 0 0 0 0
18.5 C3 combined Drop 0 0 0 0
18.5 C2 combined Drop 0 0 0 0
18.5 C1 combined Drop 0 0 0 0
18.5 R1 combined Drop 0 0 0 0
18.5 R2 combined Drop 0 0 0 0
18.5 P4 combined Drop 20 21 13 13.5205
18.5 P3 combined Drop 0 0 0 0
18.5 P2 combined Drop 0 0 0 0
18.5 P1 combined Drop 0 0 0 0
19 C3 combined Drop 0 0 0 0
19 C2 combined Drop 0 0 0 0
19 C1 combined Drop 0 0 0 0
19 R1 combined Drop 0 0 0 0
19 R2 combined Drop 0 0 0 0
19 P4 combined Drop 3 4 0 0
19 P3 combined Drop 0 0 0 0
19 P2 combined Drop 0 0 0 0
19 P1 combined Drop 0 0 0 0
19.5 C3 combined Drop 0 0 0 0
19.5 C2 combined Drop 0 0 0 0
19.5 C1 combined Drop 0 0 0 0
19.5 R1 combined Drop 0 0 0 0
19.5 R2 combined Drop 6 6 4 4.16016
19.5 P4 combined Drop 8 9 5 5.2002
19.5 P3 combined Drop 0 0 0 0
19.5 P2 combined Drop 0 0 0 0
19.5 P1 combined Drop 0 0 0 0
20 C3 combined Drop 0 0 0 0
20 C2 combined Drop 0 0 0 0
20 C1 combined Drop 0 0 0 0
20 R1 combined Drop 0 0 0 0
20 R2 combined Drop 1 1 0 0
20 P4 combined Drop 9 10 5 5.2002
20 P3 combined Drop 0 0 0 0
20 P2 combined Drop 0 0 0 0
20 P1 combined Drop 0 0 0 0
20.5 C3 combined Drop 0 0 0 0
20.5 C2 combined Drop 0 0 0 0
20.5 C1 combined Drop 0 0 0 0
20.5 R1 combined Drop 0 0 0 0
20.5 R2 combined Drop 3 3 2 2.08008
20.5 P4 combined Drop 1 1 0 0
20.5 P3 combined Drop 0 0 0 0
20.5 P2 combined Drop 0 0 0 0
20.5 P1 combined Drop 0 0 0 0
21 C3 combined Drop 0 0 0 0
21 C2 combined Drop 0 0 0 0
21 C1 combined Drop 0 0 0 0
21 R1 combined Drop 0 0 0 0
21 R2 combined Drop 0 0 0 0
21 P4 combined Drop 5 5 3 3.12012
21 P3 combined Drop 0 0 0 0
21 P2 combined Drop 0 0 0 0
21 P1 combined Drop 0 0 0 0
21.5 C3 combined Drop 0 0 0 0
21.5 C2 combined Drop 0 0 0 0
21.5 C1 combined Drop 0 0 0 0
21.5 R1 combined Drop 0 0 0 0
21.5 R2 combined Drop 0 0 0 0
21.5 P4 combined Drop 0 0 0 0
21.5 P3 combined Drop 0 0 0 0
21.5 P2 combined Drop 0 0 0 0
21.5 P1 combined Drop 0 0 0 0
22 C3 combined Drop 0 0 0 0
22 C2 combined Drop 0 0 0 0
22 C1 combined Drop 0 0 0 0
22 R1 combined Drop 0 0 0 0
22 R2 combined Drop 0 0 0 0
22 P4 combined Drop 24 24 15 15.6006
22 P3 combined Drop 0 0 0 0
22 P2 combined Drop 0 0 0 0
22 P1 combined Drop 0 0 0 0
22.5 C3 combined Drop 0 0 0 0
22.5 C2 combined Drop 0 0 0 0
22.5 C1 combined Drop 0 0 0 0
22.5 R1 combined Drop 0 0 0 0
22.5 R2 combined Drop 0 0 0 0
22.5 P4 combined Drop 7 8 2 2.08008
22.5 P3 combined Drop 0 0 0 0
22.5 P2 combined Drop 0 0 0 0
22.5 P1 combined Drop 0 0 0 0
23 C3 combined Drop 0 0 0 0
23 C2 combined Drop 0 0 0 0
23 C1 combined Drop 0 0 0 0
23 R1 combined Drop 0 0 0 0
23 R2 combined Drop 0 0 0 0
23 P4 combined Drop 1 1 0 0
23 P3 combined Drop 0 0 0 0
23 P2 combined Drop 0 0 0 0
23 P1 combined Drop 0 0 0 0
23.5 C3 combined Drop 0 0 0 0
23.5 C2 combined Drop 0 0 0 0
23.5 C1 combined Drop 0 0 0 0
23.5 R1 combined Drop 0 0 0 0
23.5 R2 combined Drop 0 0 0 0
23.5 P4 combined Drop 21 21 13 13.5205
23.5 P3 combined Drop 0 0 0 0
23.5 P2 combined Drop 0 0 0 0
23.5 P1 combined Drop 0 0 0 0
24 C3 combined Drop 0 0 0 0
24 C2 combined Drop 0 0 0 0
24 C1 combined Drop 0 0 0 0
24 R1 combined Drop 0 0 0 0
24 R2 combined Drop 0 0 0 0
24 P4 combined Drop 4 4 0 0
24 P3 combined Drop 0 0 0 0
24 P2 combined Drop 0 0 0 0
24 P1 combined Drop 0 0 0 0
24.5 C3 combined Drop 0 0 0 0
24.5 C2 combined Drop 0 0 0 0
24.5 C1 combined Drop 0 0 0 0
24.5 R1 combined Drop 0 0 0 0
24.5 R2 combined Drop 0 0 0 0
24.5 P4 combined Drop 4 4 2 2.08008
24.5 P3 combined Drop 0 0 0 0
24.5 P2 combined Drop 0 0 0 0
24.5 P1 combined Drop 0 0 0 0
25 C3 combined Drop 0 0 0 0
25 C2 combined Drop 0 0 0 0
25 C1 combined Drop 0 0 0 0
25 R1 combined Drop 0 0 0 0
25 R2 combined Drop 0 0 0 0
25 P4 combined Drop 10 10 6 6.24023
25 P3 combined Drop 0 0 0 0
25 P2 combined Drop 0 0 0 0
25 P1 combined Drop 0 0 0 0
25.5 C3 combined Drop 0 0 0 0
25.5 C2 combined Drop 0 0 0 0
25.5 C1 combined Drop 0 0 0 0
25.5 R1 combined Drop 0 0 0 0
25.5 R2 combined Drop 0 0 0 0
25.5 P4 combined Drop 21 21 12 12.4805
25.5 P3 combined Drop 0 0 0 0
25.5 P2 combined Drop 0 0 0 0
25.5 P1 combined Drop 0 0 0 0
26 C3 combined Drop 0 0 0 0
26 C2 combined Drop 0 0 0 0
26 C1 combined Drop 0 0 0 0
26 R1 combined Drop 0 0 0 0
26 R2 combined Drop 0 0 0 0
26 P4 combined Drop 4 4 0 0
26 P3 combined Drop 0 0 0 0
26 P2 combined Drop 0 0 0 0
26 P1 combined Drop 0 0 0 0
26.5 C3 combined Drop 0 0 0 0
26.5 C2 combined Drop 0 0 0 0
26.5 C1 combined Drop 0 0 0 0
26.5 R1 combined Drop 0 0 0 0
26.5 R2 combined Drop 0 0 0 0
26.5 P4 combined Drop 0 0 0 0
26.5 P3 combined Drop 0 0 0 0
26.5 P2 combined Drop 0 0 0 0
26.5 P1 combined Drop 0 0 0 0
27 C3 combined Drop 0 0 0 0
27 C2 combined Drop 0 0 0 0
27 C1 combined Drop 0 0 0 0
27 R1 combined Drop 0 0 0 0
27 R2 combined Drop 27 28 17 17.6807
27 P4 combined Drop 0 0 0 0
27 P3 combined Drop 0 0 0 0
27 P2 combined Drop 0 0 0 0
27 P1 combined Drop 0 0 0 0
27.5 C3 combined Drop 0 0 0 0
27.5 C2 combined Drop 0 0 0 0
27.5 C1 combined Drop 0 0 0 0
27.5 R1 combined Drop 0 0 0 0
27.5 R2 combined Drop 5 5 0 0
27.5 P4 combined Drop 0 0 0 0
27.5 P3 combined Drop 0 0 0 0
27.5 P2 combined Drop 0 0 0 0
27.5 P1 combined Drop 0 0 0 0
28 C3 combined Drop 0 0 0 0
28 C2 combined Drop 0 0 0 0
28 C1 combined Drop 0 0 0 0
28 R1 combined Drop 0 0 0 0
28 R2 combined Drop 0 0 0 0
28 P4 combined Drop 0 0 0 0
28 P3 combined Drop 0 0 0 0
28 P2 combined Drop 0 0 0 0
28 P1 combined Drop 0 0 0 0
28.5 C3 combined Drop 0 0 0 0
28.5 C2 combined Drop 0 0 0 0
28.5 C1 combined Drop 0 0 0 0
28.5 R1 combined Drop 0 0 0 0
28.5 R2 combined Drop 0 0 0 0
28.5 P4 combined Drop 25 26 16 16.6406
28.5 P3 combined Drop 0 0 0 0
28.5 P2 combined Drop 0 0 0 0
28.5 P1 combined Drop 0 0 0 0
29 C3 combined Drop 0 0 0 0
29 C2 combined Drop 0 0 0 0
29 C1 combined Drop 0 0 0 0
29 R1 combined Drop 0 0 0 0
29 R2 combined Drop 0 0 0 0
29 P4 combined Drop 4 5 0 0
29 P3 combined Drop 0 0 0 0
29 P2 combined Drop 0 0 0 0
29 P1 combined Drop 0 0 0 0
29.5 C3 combined Drop 0 0 0 0
29.5 C2 combined Drop 0 0 0 0
29.5 C1 combined Drop 0 0 0 0
29.5 R1 combined Drop 0 0 0 0
29.5 R2 combined Drop 9 9 6 6.24023
29.5 P4 combined Drop 0 0 0 0
29.5 P3 combined Drop 0 0 0 0
29.5 P2 combined Drop 0 0 0 0
29.5 P1 combined Drop 0 0 0 0
30 C3 combined Drop 0 0 0 0
30 C2 combined Drop 0 0 0 0
30 C1 combined Drop 0 0 0 0
30 R1 combined Drop 0 0 0 0
30 R2 combined Drop 3 3 1 1.04004
30 P4 combined Drop 0 0 0 0
30 P3 combined Drop 0 0 0 0
30 P2 combined Drop 0 0 0 0
30 P1 combined Drop 0 0 0 0
30.5 C3 combined Drop 0 0 0 0
30.5 C2 combined Drop 0 0 0 0
30.5 C1 combined Drop 0 0 0 0
30.5 R1 combined Drop 0 0 0 0
30.5 R2 combined Drop 0 0 0 0
30.5 P4 combined Drop 0 0 0 0
30.5 P3 combined Drop 0 0 0 0
30.5 P2 combined Drop 0 0 0 0
30.5 P1 combined Drop 0 0 0 0
31 C3 combined Drop 0 0 0 0
31 C2 combined Drop 0 0 0 0
31 C1 combined Drop 0 0 0 0
31 R1 combined Drop 0 0 0 0
31 R2 combined Drop 0 0 0 0
31 P4 combined Drop 24 24 15 15.6006
31 P3 combined Drop 0 0 0 0
31 P2 combined Drop 0 0 0 0
31 P1 combined Drop 0 0 0 0
31.5 C3 combined Drop 0 0 0 0
31.5 C2 combined Drop 0 0 0 0
31.5 C1 combined Drop 0 0 0 0
31.5 R1 combined Drop 0 0 0 0
31.5 R2 combined Drop 0 0 0 0
31.5 P4 combined Drop 4 4 0 0
31.5 P3 combined Drop 0 0 0 0
31.5 P2 combined Drop 0 0 0 0
31.5 P1 combined Drop 0 0 0 0
32 C3 combined Drop 0 0 0 0
32 C2 combined Drop 0 0 0 0
32 C1 combined Drop 0 0 0 0
32 R1 combined Drop 0 0 0 0
32 R2 combined Drop 0 0 0 0
32 P4 combined Drop 23 24 14 14.5605
32 P3 combined Drop 0 0 0 0
32 P2 combined Drop 0 0 0 0
32 P1 combined Drop 0 0 0 0
32.5 C3 combined Drop 0 0 0 0
32.5 C2 combined Drop 0 0 0 0
32.5 C1 combined Drop 0 0 0 0
32.5 R1 combined Drop 0 0 0 0
32.5 R2 combined Drop 0 0 0 0
32.5 P4 combined Drop 7 8 2 2.08008
32.5 P3 combined Drop 0 0 0 0
32.5 P2 combined Drop 0 0 0 0
32.5 P1 combined Drop 0 0 0 0
33 C3 combined Drop 0 0 0 0
33 C2 combined Drop 0 0 0 0
33 C1 combined Drop 0 0 0 0
33 R1 combined Drop 0 0 0 0
33 R2 combined Drop 0 0 0 0
33 P4 combined Drop 1 1 0 0
33 P3 combined Drop 0 0 0 0
33 P2 combined Drop 0 0 0 0
33 P1 combined Drop 0 0 0 0
33.5 C3 combined Drop 0 0 0 0
33.5 C2 combined Drop 0 0 0 0
33.5 C1 combined Drop 0 0 0 0
33.5 R1 combined Drop 0 0 0 0
33.5 R2 combined Drop 0 0 0 0
33.5 P4 combined Drop 14 15 9 9.36035
33.5 P3 combined Drop 0 0 0 0
33.5 P2 combined Drop 0 0 0 0
33.5 P1 combined Drop 0 0 0 0
34 C3 combined Drop 0 0 0 0
34 C2 combined Drop 0 0 0 0
34 C1 combined Drop 0 0 0 0
34 R1 combined Drop 0 0 0 0
34 R2 combined Drop 0 0 0 0
34 P4 combined Drop 2 2 0 0
34 P3 combined Drop 0 0 0 0
34 P2 combined Drop 0 0 0 0
34 P1 combined Drop 0 0 0 0
34.5 C3 combined Drop 0 0 0 0
34.5 C2 combined Drop 0 0 0 0
34.5 C1 combined Drop 0 0 0 0
34.5 R1 combined Drop 0 0 0 0
34.5 R2 combined Drop 0 0 0 0
34.5 P4 combined Drop 13 13 8 8.32031
34.5 P3 combined Drop 0 0 0 0
34.5 P2 combined Drop 0 0 0 0
34.5 P1 combined Drop 0 0 0 0
35 C3 combined Drop 0 0 0 0
35 C2 combined Drop 0 0 0 0
35 C1 combined Drop 0 0 0 0
35 R1 combined Drop 0 0 0 0
35 R2 combined Drop 0 0 0 0
35 P4 combined Drop 2 2 0 0
35 P3 combined Drop 0 0 0 0
35 P2 combined Drop 0 0 0 0
35 P1 combined Drop 0 0 0 0
35.5 C3 combined Drop 0 0 0 0
35.5 C2 combined Drop 0 0 0 0
35.5 C1 combined Drop 0 0 0 0
35.5 R1 combined Drop 0 0 0 0
35.5 R2 combined Drop 4 4 3 3.12012
35.5 P4 combined Drop 0 0 0 0
35.5 P3 combined Drop 0 0 0 0
35.5 P2 combined Drop 0 0 0 0
35.5 P1 combined Drop 0 0 0 0
36 C3 combined Drop 0 0 0 0
36 C2 combined Drop 0 0 0 0
36 C1 combined Drop 0 0 0 0
36 R1 combined Drop 0 0 0 0
36 R2 combined Drop 8 9 5 5.2002
36 P4 combined Drop 0 0 0 0
36 P3 combined Drop 0 0 0 0
36 P2 combined Drop 0 0 0 0
36 P1 combined Drop 0 0 0 0
36.5 C3 combined Drop 0 0 0 0
36.5 C2 combined Drop 0 0 0 0
36.5 C1 combined Drop 0 0 0 0
36.5 R1 combined Drop 0 0 0 0
36.5 R2 combined Drop 1 1 0 0
36.5 P4 combined Drop 0 0 0 0
36.5 P3 combined Drop 0 0 0 0
36.5 P2 combined Drop 0 0 0 0
36.5 P1 combined Drop 0 0 0 0
37 C3 combined Drop 0 0 0 0
37 C2 combined Drop 0 0 0 0
37 C1 combined Drop 0 0 0 0
37 R1 combined Drop 0 0 0 0
37 R2 combined Drop 16 16 10 10.4004
37 P4 combined Drop 0 0 0 0
37 P3 combined Drop 0 0 0 0
37 P2 combined Drop 0 0 0 0
37 P1 combined Drop 0 0 0 0
37.5 C3 combined Drop 0 0 0 0
37.5 C2 combined Drop 0 0 0 0
37.5 C1 combined Drop 0 0 0 0
37.5 R1 combined Drop 0 0 0 0
37.5 R2 combined Drop 16 16 8 8.32031
37.5 P4 combined Drop 0 0 0 0
37.5 P3 combined Drop 0 0 0 0
37.5 P2 combined Drop 0 0 0 0
37.5 P1 combined Drop 0 0 0 0
38 C3 combined Drop 0 0 0 0
38 C2 combined Drop 0 0 0 0
38 C1 combined Drop 0 0 0 0
38 R1 combined Drop 0 0 0 0
38 R2 combined Drop 3 3 0 0
38 P4 combined Drop 0 0 0 0
38 P3 combined Drop 0 0 0 0
38 P2 combined Drop 0 0 0 0
38 P1 combined Drop 0 0 0 0
38.5 C3 combined Drop 0 0 0 0
38.5 C2 combined Drop 0 0 0 0
38.5 C1 combined Drop 0 0 0 0
38.5 R1 combined Drop 0 0 0 0
38.5 R2 combined Drop 0 0 0 0
38.5 P4 combined Drop 16 16 10 10.4004
38.5 P3 combined Drop 0 0 0 0
38.5 P2 combined Drop 0 0 0 0
38.5 P1 combined Drop 0 0 0 0
39 C3 combined Drop 0 0 0 0
39 C2 combined Drop 0 0 0 0
39 C1 combined Drop 0 0 0 0
39 R1 combined Drop 0 0 0 0
39 R2 combined Drop 0 0 0 0
39 P4 combined Drop 3 3 0 0
39 P3 combined Drop 0 0 0 0
39 P2 combined Drop 0 0 0 0
39 P1 combined Drop 0 0 0 0
39.5 C3 combined Drop 0 0 0 0
39.5 C2 combined Drop 0 0 0 0
39.5 C1 combined Drop 0 0 0 0
39.5 R1 combined Drop 0 0 0 0
39.5 R2 combined Drop 0 0 0 0
39.5 P4 combined Drop 29 30 18 18.7207
39.5 P3 combined Drop 0 0 0 0
39.5 P2 combined Drop 0 0 0 0
39.5 P1 combined Drop 0 0 0 0
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
-112
View File
@@ -1,112 +0,0 @@
#include "ns3/core-module.h"
#include "ns3/network-module.h"
#include "ns3/ndnSIM-module.h"
namespace ns3 {
int
main(int argc, char* argv[])
{
CommandLine cmd;
cmd.Parse(argc, argv);
AnnotatedTopologyReader topologyReader("", 25);
topologyReader.SetFileName("topologies/topo_experiment1.1.txt");
topologyReader.Read();
// Install NDN stack on all nodes
ndn::StackHelper ndnHelper;
ndnHelper.setPolicy("nfd::cs::lru");
ndnHelper.setCsSize(10000);
ndnHelper.InstallAll();
// Choosing forwarding strategy
ndn::StrategyChoiceHelper::InstallAll("/", "/localhost/nfd/strategy/best-route");
// Installing global routing interface on all nodes
ndn::GlobalRoutingHelper ndnGlobalRoutingHelper;
ndnGlobalRoutingHelper.InstallAll();
// Getting containers for the consumer/producer
Ptr<Node> C1 = Names::Find<Node>("C1");
Ptr<Node> C2 = Names::Find<Node>("C2");
Ptr<Node> C3 = Names::Find<Node>("C3");
Ptr<Node> C4 = Names::Find<Node>("C4");
Ptr<Node> P1 = Names::Find<Node>("P1");
Ptr<Node> P2 = Names::Find<Node>("P2");
Ptr<Node> P3 = Names::Find<Node>("P3");
Ptr<Node> P4 = Names::Find<Node>("P4");
ndn::AppHelper consumerHelper("ns3::ndn::ConsumerPcon");
//consumerHelper.SetAttribute("Frequency", StringValue("100")); // 100 interests a second
// on the first consumer node install a Consumer application
// that will express interests in /dst1 namespace
// C1
consumerHelper.SetPrefix("/P1");
consumerHelper.Install("C1");
// C2
consumerHelper.SetPrefix("/P2");
consumerHelper.Install("C2");
// C3
consumerHelper.SetPrefix("/P3");
consumerHelper.Install("C3");
// C4
consumerHelper.SetPrefix("/P4");
consumerHelper.Install("C4");
ndn::AppHelper producerHelper("ns3::ndn::Producer");
producerHelper.SetAttribute("PayloadSize", StringValue("1024"));
// Register /dst1 prefix with global routing controller and
// install producer that will satisfy Interests in /dst1 namespace
// P1
ndnGlobalRoutingHelper.AddOrigins("/P1", P1);
producerHelper.SetPrefix("/P1");
producerHelper.Install(P1);
// P2
ndnGlobalRoutingHelper.AddOrigins("/P2", P2);
producerHelper.SetPrefix("/P2");
producerHelper.Install(P2);
// P3
ndnGlobalRoutingHelper.AddOrigins("/P3", P3);
producerHelper.SetPrefix("/P3");
producerHelper.Install(P3);
// P4
ndnGlobalRoutingHelper.AddOrigins("/P4", P4);
producerHelper.SetPrefix("/P4");
producerHelper.Install(P4);
// Calculate and install FIBs
ndn::GlobalRoutingHelper::CalculateRoutes();
Simulator::Stop(Seconds(40));
ndn::L3RateTracer::InstallAll("pcon_experiment1.1.txt", Seconds(0.5));
ndn::AppDelayTracer::InstallAll("pcon_delay_experiment1.1.txt");
L2RateTracer::InstallAll("pcon_drop_experiment1.1.txt", Seconds(0.5));
Simulator::Run();
Simulator::Destroy();
return 0;
}
} // namespace ns3
int
main(int argc, char* argv[])
{
return ns3::main(argc, argv);
}
-112
View File
@@ -1,112 +0,0 @@
#include "ns3/core-module.h"
#include "ns3/network-module.h"
#include "ns3/ndnSIM-module.h"
namespace ns3 {
int
main(int argc, char* argv[])
{
CommandLine cmd;
cmd.Parse(argc, argv);
AnnotatedTopologyReader topologyReader("", 25);
topologyReader.SetFileName("topologies/topo_experiment1.2.txt");
topologyReader.Read();
// Install NDN stack on all nodes
ndn::StackHelper ndnHelper;
ndnHelper.setPolicy("nfd::cs::lru");
ndnHelper.setCsSize(10000);
ndnHelper.InstallAll();
// Choosing forwarding strategy
ndn::StrategyChoiceHelper::InstallAll("/", "/localhost/nfd/strategy/best-route");
// Installing global routing interface on all nodes
ndn::GlobalRoutingHelper ndnGlobalRoutingHelper;
ndnGlobalRoutingHelper.InstallAll();
// Getting containers for the consumer/producer
Ptr<Node> C1 = Names::Find<Node>("C1");
Ptr<Node> C2 = Names::Find<Node>("C2");
Ptr<Node> C3 = Names::Find<Node>("C3");
Ptr<Node> C4 = Names::Find<Node>("C4");
Ptr<Node> P1 = Names::Find<Node>("P1");
Ptr<Node> P2 = Names::Find<Node>("P2");
Ptr<Node> P3 = Names::Find<Node>("P3");
Ptr<Node> P4 = Names::Find<Node>("P4");
ndn::AppHelper consumerHelper("ns3::ndn::ConsumerPcon");
//consumerHelper.SetAttribute("Frequency", StringValue("100")); // 100 interests a second
// on the first consumer node install a Consumer application
// that will express interests in /dst1 namespace
// C1
consumerHelper.SetPrefix("/P1");
consumerHelper.Install("C1");
// C2
consumerHelper.SetPrefix("/P2");
consumerHelper.Install("C2");
// C3
consumerHelper.SetPrefix("/P3");
consumerHelper.Install("C3");
// C4
consumerHelper.SetPrefix("/P4");
consumerHelper.Install("C4");
ndn::AppHelper producerHelper("ns3::ndn::Producer");
producerHelper.SetAttribute("PayloadSize", StringValue("1024"));
// Register /dst1 prefix with global routing controller and
// install producer that will satisfy Interests in /dst1 namespace
// P1
ndnGlobalRoutingHelper.AddOrigins("/P1", P1);
producerHelper.SetPrefix("/P1");
producerHelper.Install(P1);
// P2
ndnGlobalRoutingHelper.AddOrigins("/P2", P2);
producerHelper.SetPrefix("/P2");
producerHelper.Install(P2);
// P3
ndnGlobalRoutingHelper.AddOrigins("/P3", P3);
producerHelper.SetPrefix("/P3");
producerHelper.Install(P3);
// P4
ndnGlobalRoutingHelper.AddOrigins("/P4", P4);
producerHelper.SetPrefix("/P4");
producerHelper.Install(P4);
// Calculate and install FIBs
ndn::GlobalRoutingHelper::CalculateRoutes();
Simulator::Stop(Seconds(120.0));
ndn::L3RateTracer::InstallAll("pcon_experiment1.2.txt", Seconds(1));
ndn::AppDelayTracer::InstallAll("pcon_delay_experiment1.2.txt");
L2RateTracer::InstallAll("pcon_drop_experiment1.2.txt", Seconds(1));
Simulator::Run();
Simulator::Destroy();
return 0;
}
} // namespace ns3
int
main(int argc, char* argv[])
{
return ns3::main(argc, argv);
}
-115
View File
@@ -1,115 +0,0 @@
#include "ns3/core-module.h"
#include "ns3/network-module.h"
#include "ns3/ndnSIM-module.h"
namespace ns3 {
int
main(int argc, char* argv[])
{
CommandLine cmd;
cmd.Parse(argc, argv);
AnnotatedTopologyReader topologyReader("", 25);
topologyReader.SetFileName("topologies/topo_experiment1.3.txt");
topologyReader.Read();
// Install NDN stack on all nodes
ndn::StackHelper ndnHelper;
ndnHelper.setPolicy("nfd::cs::lru");
ndnHelper.setCsSize(10000);
ndnHelper.InstallAll();
// Choosing forwarding strategy
ndn::StrategyChoiceHelper::InstallAll("/", "/localhost/nfd/strategy/best-route");
// Installing global routing interface on all nodes
ndn::GlobalRoutingHelper ndnGlobalRoutingHelper;
ndnGlobalRoutingHelper.InstallAll();
// Getting containers for the consumer/producer
Ptr<Node> C1 = Names::Find<Node>("C1");
Ptr<Node> C2 = Names::Find<Node>("C2");
Ptr<Node> C3 = Names::Find<Node>("C3");
Ptr<Node> C4 = Names::Find<Node>("C4");
Ptr<Node> P1 = Names::Find<Node>("P1");
Ptr<Node> P2 = Names::Find<Node>("P2");
Ptr<Node> P3 = Names::Find<Node>("P3");
Ptr<Node> P4 = Names::Find<Node>("P4");
ndn::AppHelper consumerHelper("ns3::ndn::ConsumerPcon");
//consumerHelper.SetAttribute("Frequency", StringValue("100")); // 100 interests a second
// on the first consumer node install a Consumer application
// that will express interests in /dst1 namespace
// C1
consumerHelper.SetPrefix("/P1");
consumerHelper.Install("C1");
// C2
consumerHelper.SetPrefix("/P2");
consumerHelper.Install("C2");
// C3
consumerHelper.SetPrefix("/P3");
consumerHelper.Install("C3");
// C4
consumerHelper.SetPrefix("/P4");
consumerHelper.Install("C4");
ndn::AppHelper producerHelper("ns3::ndn::Producer");
// Register /dst1 prefix with global routing controller and
// install producer that will satisfy Interests in /dst1 namespace
// P1
ndnGlobalRoutingHelper.AddOrigins("/P1", P1);
producerHelper.SetAttribute("PayloadSize", StringValue("400"));
producerHelper.SetPrefix("/P1");
producerHelper.Install(P1);
// P2
ndnGlobalRoutingHelper.AddOrigins("/P2", P2);
producerHelper.SetAttribute("PayloadSize", StringValue("500"));
producerHelper.SetPrefix("/P2");
producerHelper.Install(P2);
// P3
ndnGlobalRoutingHelper.AddOrigins("/P3", P3);
producerHelper.SetAttribute("PayloadSize", StringValue("600"));
producerHelper.SetPrefix("/P3");
producerHelper.Install(P3);
// P4
ndnGlobalRoutingHelper.AddOrigins("/P4", P4);
producerHelper.SetAttribute("PayloadSize", StringValue("700"));
producerHelper.SetPrefix("/P4");
producerHelper.Install(P4);
// Calculate and install FIBs
ndn::GlobalRoutingHelper::CalculateRoutes();
Simulator::Stop(Seconds(120));
ndn::L3RateTracer::InstallAll("pcon_experiment1.3.txt", Seconds(1));
ndn::AppDelayTracer::InstallAll("pcon_delay_experiment1.3.txt");
L2RateTracer::InstallAll("pcon_drop_experiment1.3.txt", Seconds(1));
Simulator::Run();
Simulator::Destroy();
return 0;
}
} // namespace ns3
int
main(int argc, char* argv[])
{
return ns3::main(argc, argv);
}
-116
View File
@@ -1,116 +0,0 @@
#include "ns3/core-module.h"
#include "ns3/network-module.h"
#include "ns3/ndnSIM-module.h"
namespace ns3 {
int
main(int argc, char* argv[])
{
CommandLine cmd;
cmd.Parse(argc, argv);
AnnotatedTopologyReader topologyReader("", 25);
topologyReader.SetFileName("topologies/topo_experiment1.4.txt");
topologyReader.Read();
// Install NDN stack on all nodes
ndn::StackHelper ndnHelper;
ndnHelper.setPolicy("nfd::cs::lru");
ndnHelper.setCsSize(10000);
ndnHelper.InstallAll();
// Choosing forwarding strategy
ndn::StrategyChoiceHelper::InstallAll("/", "/localhost/nfd/strategy/best-route");
// Installing global routing interface on all nodes
ndn::GlobalRoutingHelper ndnGlobalRoutingHelper;
ndnGlobalRoutingHelper.InstallAll();
// Getting containers for the consumer/producer
Ptr<Node> C1 = Names::Find<Node>("C1");
Ptr<Node> C2 = Names::Find<Node>("C2");
Ptr<Node> C3 = Names::Find<Node>("C3");
Ptr<Node> C4 = Names::Find<Node>("C4");
Ptr<Node> P1 = Names::Find<Node>("P1");
Ptr<Node> P2 = Names::Find<Node>("P2");
Ptr<Node> P3 = Names::Find<Node>("P3");
Ptr<Node> P4 = Names::Find<Node>("P4");
ndn::AppHelper consumerHelper("ns3::ndn::ConsumerPcon");
//consumerHelper.SetAttribute("Frequency", StringValue("100")); // 100 interests a second
// on the first consumer node install a Consumer application
// that will express interests in /dst1 namespace
// C1
consumerHelper.SetPrefix("/P1");
consumerHelper.Install(C1);
// C2
consumerHelper.SetPrefix("/P2");
consumerHelper.SetAttribute("DelayStart", UintegerValue(10000));
consumerHelper.Install(C2);
// C3
consumerHelper.SetPrefix("/P3");
consumerHelper.SetAttribute("DelayStart", UintegerValue(20000));
consumerHelper.Install(C3);
// C4
consumerHelper.SetPrefix("/P4");
consumerHelper.SetAttribute("DelayStart", UintegerValue(30000));
consumerHelper.Install(C4);
ndn::AppHelper producerHelper("ns3::ndn::Producer");
producerHelper.SetAttribute("PayloadSize", StringValue("1024"));
// Register /dst1 prefix with global routing controller and
// install producer that will satisfy Interests in /dst1 namespace
// P1
ndnGlobalRoutingHelper.AddOrigins("/P1", P1);
producerHelper.SetPrefix("/P1");
producerHelper.Install(P1);
// P2
ndnGlobalRoutingHelper.AddOrigins("/P2", P2);
producerHelper.SetPrefix("/P2");
producerHelper.Install(P2);
// P3
ndnGlobalRoutingHelper.AddOrigins("/P3", P3);
producerHelper.SetPrefix("/P3");
producerHelper.Install(P3);
// P4
ndnGlobalRoutingHelper.AddOrigins("/P4", P4);
producerHelper.SetPrefix("/P4");
producerHelper.Install(P4);
// Calculate and install FIBs
ndn::GlobalRoutingHelper::CalculateRoutes();
Simulator::Stop(Seconds(120));
ndn::L3RateTracer::InstallAll("pcon_experiment1.4.txt", Seconds(1));
ndn::AppDelayTracer::InstallAll("pcon_delay_experiment1.4.txt");
L2RateTracer::InstallAll("pcon_drop_experiment1.4.txt", Seconds(1));
Simulator::Run();
Simulator::Destroy();
return 0;
}
} // namespace ns3
int
main(int argc, char* argv[])
{
return ns3::main(argc, argv);
}
-113
View File
@@ -1,113 +0,0 @@
#include "ns3/core-module.h"
#include "ns3/network-module.h"
#include "ns3/ndnSIM-module.h"
namespace ns3 {
int
main(int argc, char* argv[])
{
CommandLine cmd;
cmd.Parse(argc, argv);
AnnotatedTopologyReader topologyReader("", 25);
topologyReader.SetFileName("topologies/topo_experiment1.5.txt");
topologyReader.Read();
// Install NDN stack on all nodes
ndn::StackHelper ndnHelper;
ndnHelper.setPolicy("nfd::cs::lru");
ndnHelper.setCsSize(10000);
ndnHelper.InstallAll();
// Choosing forwarding strategy
ndn::StrategyChoiceHelper::InstallAll("/", "/localhost/nfd/strategy/best-route");
// Installing global routing interface on all nodes
ndn::GlobalRoutingHelper ndnGlobalRoutingHelper;
ndnGlobalRoutingHelper.InstallAll();
// Getting containers for the consumer/producer
Ptr<Node> C1 = Names::Find<Node>("C1");
Ptr<Node> C2 = Names::Find<Node>("C2");
Ptr<Node> C3 = Names::Find<Node>("C3");
Ptr<Node> C4 = Names::Find<Node>("C4");
Ptr<Node> P1 = Names::Find<Node>("P1");
Ptr<Node> P2 = Names::Find<Node>("P2");
Ptr<Node> P3 = Names::Find<Node>("P3");
Ptr<Node> P4 = Names::Find<Node>("P4");
ndn::AppHelper consumerHelper("ns3::ndn::ConsumerPcon");
ndn::AppHelper consumerHelper2("ns3::ndn::ConsumerCbr");
consumerHelper2.SetAttribute("Frequency", StringValue("1000")); // 100 interests a second
// on the first consumer node install a Consumer application
// that will express interests in /dst1 namespace
// C1
consumerHelper2.SetPrefix("/P1");
consumerHelper2.Install("C1");
// C2
consumerHelper.SetPrefix("/P2");
consumerHelper.Install("C2");
// C3
consumerHelper.SetPrefix("/P3");
consumerHelper.Install("C3");
// C4
consumerHelper.SetPrefix("/P4");
consumerHelper.Install("C4");
ndn::AppHelper producerHelper("ns3::ndn::Producer");
producerHelper.SetAttribute("PayloadSize", StringValue("1024"));
// Register /dst1 prefix with global routing controller and
// install producer that will satisfy Interests in /dst1 namespace
// P1
ndnGlobalRoutingHelper.AddOrigins("/P1", P1);
producerHelper.SetPrefix("/P1");
producerHelper.Install(P1);
// P2
ndnGlobalRoutingHelper.AddOrigins("/P2", P2);
producerHelper.SetPrefix("/P2");
producerHelper.Install(P2);
// P3
ndnGlobalRoutingHelper.AddOrigins("/P3", P3);
producerHelper.SetPrefix("/P3");
producerHelper.Install(P3);
// P4
ndnGlobalRoutingHelper.AddOrigins("/P4", P4);
producerHelper.SetPrefix("/P4");
producerHelper.Install(P4);
// Calculate and install FIBs
ndn::GlobalRoutingHelper::CalculateRoutes();
Simulator::Stop(Seconds(120));
ndn::L3RateTracer::InstallAll("pcon_experiment1.5.txt", Seconds(1));
ndn::AppDelayTracer::InstallAll("pcon_delay_experiment1.5.txt");
L2RateTracer::InstallAll("pcon_drop_experiment1.5.txt", Seconds(1));
Simulator::Run();
Simulator::Destroy();
return 0;
}
} // namespace ns3
int
main(int argc, char* argv[])
{
return ns3::main(argc, argv);
}
-117
View File
@@ -1,117 +0,0 @@
#include "ns3/core-module.h"
#include "ns3/network-module.h"
#include "ns3/ndnSIM-module.h"
namespace ns3 {
int
main(int argc, char* argv[])
{
CommandLine cmd;
cmd.Parse(argc, argv);
AnnotatedTopologyReader topologyReader("", 25);
topologyReader.SetFileName("topologies/topo_experiment3.txt");
topologyReader.Read();
// Install NDN stack on all nodes
ndn::StackHelper ndnHelper;
ndnHelper.setPolicy("nfd::cs::lru");
ndnHelper.setCsSize(10000);
ndnHelper.InstallAll();
// Choosing forwarding strategy
ndn::StrategyChoiceHelper::InstallAll("/", "/localhost/nfd/strategy/best-route");
ndn::StrategyChoiceHelper::Install(Names::Find<Node>("R1"), "/", "/localhost/nfd/strategy/random/%FD%01");
//ndn::StrategyChoiceHelper::Install<nfd::fw::RandomLoadBalancerStrategy>(Names::Find<Node>("R2"), "/");
//ndn::StrategyChoiceHelper::Install<nfd::fw::RandomLoadBalancerStrategy>(Names::Find<Node>("R3"), "/");
// Installing global routing interface on all nodes
ndn::GlobalRoutingHelper ndnGlobalRoutingHelper;
ndnGlobalRoutingHelper.InstallAll();
// Getting containers for the consumer/producer
Ptr<Node> C1 = Names::Find<Node>("C1");
Ptr<Node> C2 = Names::Find<Node>("C2");
Ptr<Node> C3 = Names::Find<Node>("C3");
Ptr<Node> P1 = Names::Find<Node>("P1");
Ptr<Node> P2 = Names::Find<Node>("P2");
Ptr<Node> P3 = Names::Find<Node>("P3");
Ptr<Node> P4 = Names::Find<Node>("P4");
ndn::AppHelper consumerHelper("ns3::ndn::ConsumerPcon");
//consumerHelper.SetAttribute("Frequency", StringValue("100")); // 100 interests a second
// on the first consumer node install a Consumer application
// that will express interests in /dst1 namespace
// C1
consumerHelper.SetPrefix("/A");
consumerHelper.Install("C1");
// C2
consumerHelper.SetPrefix("/B");
consumerHelper.Install("C2");
// C3
consumerHelper.SetPrefix("/C");
consumerHelper.Install("C3");
ndn::AppHelper producerHelper("ns3::ndn::Producer");
producerHelper.SetAttribute("PayloadSize", StringValue("1024"));
// Register /dst1 prefix with global routing controller and
// install producer that will satisfy Interests in /dst1 namespace
// P1
ndnGlobalRoutingHelper.AddOrigins("/A", P1);
producerHelper.SetPrefix("/A");
producerHelper.Install(P1);
// P2
ndnGlobalRoutingHelper.AddOrigins("/B", P2);
producerHelper.SetPrefix("/B");
producerHelper.Install(P2);
// P3
ndnGlobalRoutingHelper.AddOrigins("/C", P3);
producerHelper.SetPrefix("/C");
producerHelper.Install(P3);
// P4
ndnGlobalRoutingHelper.AddOrigins("/A", P4);
producerHelper.SetPrefix("/A");
producerHelper.Install(P4);
ndnGlobalRoutingHelper.AddOrigins("/B", P4);
producerHelper.SetPrefix("/B");
producerHelper.Install(P4);
ndnGlobalRoutingHelper.AddOrigins("/C", P4);
producerHelper.SetPrefix("/C");
producerHelper.Install(P4);
// Calculate and install FIBs
ndn::GlobalRoutingHelper::CalculateRoutes();
Simulator::Stop(Seconds(60.0));
ndn::L3RateTracer::InstallAll("pcon_experiment3.txt", Seconds(1));
ndn::AppDelayTracer::InstallAll("pcon_delay_experiment3.txt");
L2RateTracer::InstallAll("pcon_drop_experiment3.txt", Seconds(1));
Simulator::Run();
Simulator::Destroy();
return 0;
}
} // namespace ns3
int
main(int argc, char* argv[])
{
return ns3::main(argc, argv);
}
+1 -1
View File
@@ -69,7 +69,7 @@ main(int argc, char* argv[])
Simulator::Stop(Seconds(20.0));
ndn::L3RateTracer::InstallAll("rate-trace.txt", Seconds(0.5));
ndn::L3RateTracer::InstallAll("rate-trace.txt", Seconds(0.1));
Simulator::Run();
Simulator::Destroy();
-86
View File
@@ -1,86 +0,0 @@
#include "ns3/core-module.h"
#include "ns3/network-module.h"
#include "ns3/ndnSIM-module.h"
namespace ns3 {
int
main(int argc, char* argv[])
{
CommandLine cmd;
cmd.Parse(argc, argv);
AnnotatedTopologyReader topologyReader("", 25);
topologyReader.SetFileName("topologies/topo-6-node.txt");
topologyReader.Read();
// Install NDN stack on all nodes
ndn::StackHelper ndnHelper;
ndnHelper.setPolicy("nfd::cs::lru");
ndnHelper.setCsSize(10000);
ndnHelper.InstallAll();
// Choosing forwarding strategy
ndn::StrategyChoiceHelper::InstallAll("/", "/localhost/nfd/strategy/best-route");
// Installing global routing interface on all nodes
ndn::GlobalRoutingHelper ndnGlobalRoutingHelper;
ndnGlobalRoutingHelper.InstallAll();
// Getting containers for the consumer/producer
Ptr<Node> consumer1 = Names::Find<Node>("Src1");
Ptr<Node> consumer2 = Names::Find<Node>("Src2");
Ptr<Node> producer1 = Names::Find<Node>("Dst1");
Ptr<Node> producer2 = Names::Find<Node>("Dst2");
ndn::AppHelper consumerHelper("ns3::ndn::ConsumerNWFQ");
ndn::AppHelper consumerHelper2("ns3::ndn::ConsumerCbr");
consumerHelper2.SetAttribute("Frequency", StringValue("500")); // 100 interests a second
// on the first consumer node install a Consumer application
// that will express interests in /dst1 namespace
consumerHelper2.SetPrefix("/dst1");
consumerHelper2.Install(consumer1);
// on the second consumer node install a Consumer application
// that will express interests in /dst2 namespace
consumerHelper.SetPrefix("/dst2");
//consumerHelper.SetAttribute("Frequency", StringValue("500")); // 100 interests a second
consumerHelper.Install(consumer2);
ndn::AppHelper producerHelper("ns3::ndn::Producer");
producerHelper.SetAttribute("PayloadSize", StringValue("1024"));
// Register /dst1 prefix with global routing controller and
// install producer that will satisfy Interests in /dst1 namespace
ndnGlobalRoutingHelper.AddOrigins("/dst1", producer1);
producerHelper.SetPrefix("/dst1");
producerHelper.Install(producer1);
// Register /dst2 prefix with global routing controller and
// install producer that will satisfy Interests in /dst2 namespace
ndnGlobalRoutingHelper.AddOrigins("/dst2", producer2);
producerHelper.SetPrefix("/dst2");
producerHelper.Install(producer2);
// Calculate and install FIBs
ndn::GlobalRoutingHelper::CalculateRoutes();
Simulator::Stop(Seconds(20.0));
ndn::L3RateTracer::InstallAll("rate-trace.txt", Seconds(0.5));
Simulator::Run();
Simulator::Destroy();
return 0;
}
} // namespace ns3
int
main(int argc, char* argv[])
{
return ns3::main(argc, argv);
}
+4 -2
View File
@@ -35,12 +35,14 @@ main(int argc, char* argv[])
Ptr<Node> producer2 = Names::Find<Node>("Dst2");
ndn::AppHelper consumerHelper("ns3::ndn::ConsumerNWFQ");
ndn::AppHelper consumerHelper2("ns3::ndn::ConsumerCbr");
consumerHelper2.SetAttribute("Frequency", StringValue("500")); // 100 interests a second
// on the first consumer node install a Consumer application
// that will express interests in /dst1 namespace
consumerHelper.SetPrefix("/dst1");
consumerHelper.Install(consumer1);
consumerHelper2.SetPrefix("/dst1");
consumerHelper2.Install(consumer1);
// on the second consumer node install a Consumer application
// that will express interests in /dst2 namespace
@@ -1,156 +0,0 @@
#include "ns3/core-module.h"
#include "ns3/network-module.h"
#include "ns3/ndnSIM-module.h"
namespace ns3 {
int
main(int argc, char* argv[])
{
CommandLine cmd;
cmd.Parse(argc, argv);
AnnotatedTopologyReader topologyReader("", 25);
topologyReader.SetFileName("topologies/topo_abilene.txt");
topologyReader.Read();
// Install NDN stack on all nodes
ndn::StackHelper ndnHelper;
ndnHelper.setPolicy("nfd::cs::lru");
ndnHelper.setCsSize(10000);
ndnHelper.InstallAll();
// Choosing forwarding strategy
ndn::StrategyChoiceHelper::InstallAll("/", "/localhost/nfd/strategy/best-route");
ndn::StrategyChoiceHelper::Install(Names::Find<Node>("R0"), "/", "/localhost/nfd/strategy/random/%FD%01");
ndn::StrategyChoiceHelper::Install(Names::Find<Node>("R1"), "/", "/localhost/nfd/strategy/random/%FD%01");
ndn::StrategyChoiceHelper::Install(Names::Find<Node>("R2"), "/", "/localhost/nfd/strategy/random/%FD%01");
ndn::StrategyChoiceHelper::Install(Names::Find<Node>("R3"), "/", "/localhost/nfd/strategy/random/%FD%01");
ndn::StrategyChoiceHelper::Install(Names::Find<Node>("R4"), "/", "/localhost/nfd/strategy/random/%FD%01");
ndn::StrategyChoiceHelper::Install(Names::Find<Node>("R5"), "/", "/localhost/nfd/strategy/random/%FD%01");
ndn::StrategyChoiceHelper::Install(Names::Find<Node>("R6"), "/", "/localhost/nfd/strategy/random/%FD%01");
ndn::StrategyChoiceHelper::Install(Names::Find<Node>("R7"), "/", "/localhost/nfd/strategy/random/%FD%01");
ndn::StrategyChoiceHelper::Install(Names::Find<Node>("R8"), "/", "/localhost/nfd/strategy/random/%FD%01");
ndn::StrategyChoiceHelper::Install(Names::Find<Node>("R9"), "/", "/localhost/nfd/strategy/random/%FD%01");
ndn::StrategyChoiceHelper::Install(Names::Find<Node>("R10"), "/", "/localhost/nfd/strategy/random/%FD%01");
// Installing global routing interface on all nodes
ndn::GlobalRoutingHelper ndnGlobalRoutingHelper;
ndnGlobalRoutingHelper.InstallAll();
// Getting containers for the consumer/producer
Ptr<Node> C1 = Names::Find<Node>("C1");
Ptr<Node> C2 = Names::Find<Node>("C2");
Ptr<Node> C3 = Names::Find<Node>("C3");
Ptr<Node> C4 = Names::Find<Node>("C4");
Ptr<Node> C5 = Names::Find<Node>("C5");
Ptr<Node> C6 = Names::Find<Node>("C6");
Ptr<Node> C7 = Names::Find<Node>("C7");
Ptr<Node> C8 = Names::Find<Node>("C8");
Ptr<Node> P1 = Names::Find<Node>("P1");
Ptr<Node> P2 = Names::Find<Node>("P2");
Ptr<Node> P3 = Names::Find<Node>("P3");
ndn::AppHelper ch1("ns3::ndn::ConsumerPcon");
ndn::AppHelper ch2("ns3::ndn::ConsumerPcon");
ndn::AppHelper ch3("ns3::ndn::ConsumerPcon");
ch1.SetAttribute("MaxSeq", UintegerValue(1000)); // set required data chunks (the number of Datas)
ch2.SetAttribute("MaxSeq", UintegerValue(1000)); // set required data chunks (the number of Datas)
ch3.SetAttribute("MaxSeq", UintegerValue(1000)); // set required data chunks (the number of Datas)
ch1.SetPrefix("/amazon");
ch2.SetPrefix("/google");
ch3.SetPrefix("/warner");
//consumerHelper.SetAttribute("Frequency", StringValue("100")); // 100 interests a second
// on the first consumer node install a Consumer application
// that will express interests in /dst1 namespace
// C1
ch1.Install("C1");
ch2.Install("C1");
ch3.Install("C1");
// C2
ch1.Install("C2");
ch2.Install("C2");
ch3.Install("C2");
// C3
ch1.Install("C3");
ch2.Install("C3");
ch3.Install("C3");
// C4
ch1.Install("C4");
ch2.Install("C4");
ch3.Install("C4");
// C5
ch1.Install("C5");
ch2.Install("C5");
ch3.Install("C5");
// C6
ch1.Install("C6");
ch2.Install("C6");
ch3.Install("C6");
// C7
ch1.Install("C7");
ch2.Install("C7");
ch3.Install("C7");
// C8
ch1.Install("C8");
ch2.Install("C8");
ch3.Install("C8");
ndn::AppHelper producerHelper("ns3::ndn::Producer");
producerHelper.SetAttribute("PayloadSize", StringValue("1024"));
// Register /dst1 prefix with global routing controller and
// install producer that will satisfy Interests in /dst1 namespace
// P1
ndnGlobalRoutingHelper.AddOrigins("/amazon", P1);
producerHelper.SetPrefix("/amazon");
producerHelper.Install(P1);
// P2
ndnGlobalRoutingHelper.AddOrigins("/google", P2);
producerHelper.SetPrefix("/google");
producerHelper.Install(P2);
// P3
ndnGlobalRoutingHelper.AddOrigins("/warner", P3);
producerHelper.SetPrefix("/warner");
producerHelper.Install(P3);
// Calculate and install FIBs
// ndn::GlobalRoutingHelper::CalculateRoutes();
ndn::GlobalRoutingHelper::CalculateAllPossibleRoutes();
Simulator::Stop(Seconds(60.0));
ndn::L3RateTracer::InstallAll("throughput_pcon_abilene_content_delivery.txt", Seconds(1));
ndn::AppDelayTracer::InstallAll("delay_pcon_abilene_content_delivery.txt");
L2RateTracer::InstallAll("drop_pcon_abilene_content_delivery.txt", Seconds(1));
Simulator::Run();
Simulator::Destroy();
return 0;
}
} // namespace ns3
int
main(int argc, char* argv[])
{
return ns3::main(argc, argv);
}
@@ -1,152 +0,0 @@
#include "ns3/core-module.h"
#include "ns3/network-module.h"
#include "ns3/ndnSIM-module.h"
namespace ns3 {
int
main(int argc, char* argv[])
{
CommandLine cmd;
cmd.Parse(argc, argv);
AnnotatedTopologyReader topologyReader("", 25);
topologyReader.SetFileName("topologies/topo_abilene.txt");
topologyReader.Read();
// Install NDN stack on all nodes
ndn::StackHelper ndnHelper;
ndnHelper.setPolicy("nfd::cs::lru");
ndnHelper.setCsSize(10000);
ndnHelper.InstallAll();
// Choosing forwarding strategy
ndn::StrategyChoiceHelper::InstallAll("/", "/localhost/nfd/strategy/best-route");
ndn::StrategyChoiceHelper::Install(Names::Find<Node>("R0"), "/", "/localhost/nfd/strategy/random/%FD%01");
ndn::StrategyChoiceHelper::Install(Names::Find<Node>("R1"), "/", "/localhost/nfd/strategy/random/%FD%01");
ndn::StrategyChoiceHelper::Install(Names::Find<Node>("R2"), "/", "/localhost/nfd/strategy/random/%FD%01");
ndn::StrategyChoiceHelper::Install(Names::Find<Node>("R3"), "/", "/localhost/nfd/strategy/random/%FD%01");
ndn::StrategyChoiceHelper::Install(Names::Find<Node>("R4"), "/", "/localhost/nfd/strategy/random/%FD%01");
ndn::StrategyChoiceHelper::Install(Names::Find<Node>("R5"), "/", "/localhost/nfd/strategy/random/%FD%01");
ndn::StrategyChoiceHelper::Install(Names::Find<Node>("R6"), "/", "/localhost/nfd/strategy/random/%FD%01");
ndn::StrategyChoiceHelper::Install(Names::Find<Node>("R7"), "/", "/localhost/nfd/strategy/random/%FD%01");
ndn::StrategyChoiceHelper::Install(Names::Find<Node>("R8"), "/", "/localhost/nfd/strategy/random/%FD%01");
ndn::StrategyChoiceHelper::Install(Names::Find<Node>("R9"), "/", "/localhost/nfd/strategy/random/%FD%01");
ndn::StrategyChoiceHelper::Install(Names::Find<Node>("R10"), "/", "/localhost/nfd/strategy/random/%FD%01");
// Installing global routing interface on all nodes
ndn::GlobalRoutingHelper ndnGlobalRoutingHelper;
ndnGlobalRoutingHelper.InstallAll();
// Getting containers for the consumer/producer
Ptr<Node> C1 = Names::Find<Node>("C1");
Ptr<Node> C2 = Names::Find<Node>("C2");
Ptr<Node> C3 = Names::Find<Node>("C3");
Ptr<Node> C4 = Names::Find<Node>("C4");
Ptr<Node> C5 = Names::Find<Node>("C5");
Ptr<Node> C6 = Names::Find<Node>("C6");
Ptr<Node> C7 = Names::Find<Node>("C7");
Ptr<Node> C8 = Names::Find<Node>("C8");
Ptr<Node> P1 = Names::Find<Node>("P1");
Ptr<Node> P2 = Names::Find<Node>("P2");
Ptr<Node> P3 = Names::Find<Node>("P3");
ndn::AppHelper ch1("ns3::ndn::ConsumerPcon");
ndn::AppHelper ch2("ns3::ndn::ConsumerPcon");
ndn::AppHelper ch3("ns3::ndn::ConsumerPcon");
ch1.SetPrefix("/amazon");
ch2.SetPrefix("/google");
ch3.SetPrefix("/warner");
//consumerHelper.SetAttribute("Frequency", StringValue("100")); // 100 interests a second
// on the first consumer node install a Consumer application
// that will express interests in /dst1 namespace
// C1
ch1.Install("C1");
ch2.Install("C1");
ch3.Install("C1");
// C2
ch1.Install("C2");
ch2.Install("C2");
ch3.Install("C2");
// C3
ch1.Install("C3");
ch2.Install("C3");
ch3.Install("C3");
// C4
ch1.Install("C4");
ch2.Install("C4");
ch3.Install("C4");
// C5
ch1.Install("C5");
ch2.Install("C5");
ch3.Install("C5");
// C6
ch1.Install("C6");
ch2.Install("C6");
ch3.Install("C6");
// C7
ch1.Install("C7");
ch2.Install("C7");
ch3.Install("C7");
// C8
ch1.Install("C8");
ch2.Install("C8");
ch3.Install("C8");
ndn::AppHelper producerHelper("ns3::ndn::Producer");
producerHelper.SetAttribute("PayloadSize", StringValue("1024"));
// Register /dst1 prefix with global routing controller and
// install producer that will satisfy Interests in /dst1 namespace
// P1
ndnGlobalRoutingHelper.AddOrigins("/amazon", P1);
producerHelper.SetPrefix("/amazon");
producerHelper.Install(P1);
// P2
ndnGlobalRoutingHelper.AddOrigins("/google", P2);
producerHelper.SetPrefix("/google");
producerHelper.Install(P2);
// P3
ndnGlobalRoutingHelper.AddOrigins("/warner", P3);
producerHelper.SetPrefix("/warner");
producerHelper.Install(P3);
// Calculate and install FIBs
// ndn::GlobalRoutingHelper::CalculateRoutes();
ndn::GlobalRoutingHelper::CalculateAllPossibleRoutes();
Simulator::Stop(Seconds(60.0));
ndn::L3RateTracer::InstallAll("throughput_pcon_abilene_continuous_flows.txt", Seconds(1));
ndn::AppDelayTracer::InstallAll("delay_pcon_abilene_continuous_flows.txt");
L2RateTracer::InstallAll("drop_pcon_abilene_continuous_flows.txt", Seconds(1));
Simulator::Run();
Simulator::Destroy();
return 0;
}
} // namespace ns3
int
main(int argc, char* argv[])
{
return ns3::main(argc, argv);
}
-29
View File
@@ -1,29 +0,0 @@
# topo1
router
# node comment yPos xPos
C1 NA 1 3
C2 NA 2 3
C3 NA 4 3
C4 NA 5 3
R1 NA 3 5
R2 NA 3 7
P1 NA 1 9
P2 NA 2 9
P3 NA 4 9
P4 NA 5 9
link
# srcNode dstNode bandwidth metric delay queue
C1 R1 10Mbps 1 10ms 20
C2 R1 10Mbps 1 10ms 20
C3 R1 10Mbps 1 10ms 20
C4 R1 10Mbps 1 10ms 20
R1 R2 1Mbps 1 10ms 20
R2 P1 10Mbps 1 10ms 20
R2 P2 10Mbps 1 10ms 20
R2 P3 10Mbps 1 10ms 20
R2 P4 10Mbps 1 10ms 20
@@ -1,29 +0,0 @@
# topo_experiment1.1
router
# node comment yPos xPos
C4 NA 1 3
C3 NA 2 3
C2 NA 4 3
C1 NA 5 3
R1 NA 3 5
R2 NA 3 7
P4 NA 1 9
P3 NA 2 9
P2 NA 4 9
P1 NA 5 9
link
# srcNode dstNode bandwidth metric delay queue
C1 R1 100Mbps 1 10ms 20
C2 R1 100Mbps 1 10ms 20
C3 R1 100Mbps 1 10ms 20
C4 R1 100Mbps 1 10ms 20
R1 R2 10Mbps 1 10ms 20
R2 P1 100Mbps 1 10ms 20
R2 P2 100Mbps 1 10ms 20
R2 P3 100Mbps 1 10ms 20
R2 P4 100Mbps 1 10ms 20
@@ -1,29 +0,0 @@
# topo_experiment1.2
router
# node comment yPos xPos
C4 NA 1 3
C3 NA 2 3
C2 NA 4 3
C1 NA 5 3
R1 NA 3 5
R2 NA 3 7
P4 NA 1 9
P3 NA 2 9
P2 NA 4 9
P1 NA 5 9
link
# srcNode dstNode bandwidth metric delay queue
C1 R1 100Mbps 1 10ms 20
C2 R1 100Mbps 1 10ms 20
C3 R1 100Mbps 1 10ms 20
C4 R1 100Mbps 1 10ms 20
R1 R2 10Mbps 1 10ms 20
R2 P1 100Mbps 1 35ms 20
R2 P2 100Mbps 1 20ms 20
R2 P3 100Mbps 1 10ms 20
R2 P4 100Mbps 1 5ms 20
@@ -1,29 +0,0 @@
# topo_experiment1.1
router
# node comment yPos xPos
C4 NA 1 3
C3 NA 2 3
C2 NA 4 3
C1 NA 5 3
R1 NA 3 5
R2 NA 3 7
P4 NA 1 9
P3 NA 2 9
P2 NA 4 9
P1 NA 5 9
link
# srcNode dstNode bandwidth metric delay queue
C1 R1 100Mbps 1 10ms 20
C2 R1 100Mbps 1 10ms 20
C3 R1 100Mbps 1 10ms 20
C4 R1 100Mbps 1 10ms 20
R1 R2 10Mbps 1 10ms 20
R2 P1 100Mbps 1 10ms 20
R2 P2 100Mbps 1 10ms 20
R2 P3 100Mbps 1 10ms 20
R2 P4 100Mbps 1 10ms 20
@@ -1,29 +0,0 @@
# topo_experiment1.1
router
# node comment yPos xPos
C4 NA 1 3
C3 NA 2 3
C2 NA 4 3
C1 NA 5 3
R1 NA 3 5
R2 NA 3 7
P4 NA 1 9
P3 NA 2 9
P2 NA 4 9
P1 NA 5 9
link
# srcNode dstNode bandwidth metric delay queue
C1 R1 100Mbps 1 10ms 20
C2 R1 100Mbps 1 10ms 20
C3 R1 100Mbps 1 10ms 20
C4 R1 100Mbps 1 10ms 20
R1 R2 10Mbps 1 10ms 20
R2 P1 100Mbps 1 10ms 20
R2 P2 100Mbps 1 10ms 20
R2 P3 100Mbps 1 10ms 20
R2 P4 100Mbps 1 10ms 20
@@ -1,29 +0,0 @@
# topo_experiment1.1
router
# node comment yPos xPos
C4 NA 1 3
C3 NA 2 3
C2 NA 4 3
C1 NA 5 3
R1 NA 3 5
R2 NA 3 7
P4 NA 1 9
P3 NA 2 9
P2 NA 4 9
P1 NA 5 9
link
# srcNode dstNode bandwidth metric delay queue
C1 R1 100Mbps 1 10ms 20
C2 R1 100Mbps 1 10ms 20
C3 R1 100Mbps 1 10ms 20
C4 R1 100Mbps 1 10ms 20
R1 R2 10Mbps 1 10ms 20
R2 P1 100Mbps 1 10ms 20
R2 P2 100Mbps 1 10ms 20
R2 P3 100Mbps 1 10ms 20
R2 P4 100Mbps 1 10ms 20
@@ -1,29 +0,0 @@
# topo_experiment1.6
router
# node comment yPos xPos
C4 NA 1 3
C3 NA 2 3
C2 NA 4 3
C1 NA 5 3
R1 NA 3 5
R2 NA 3 7
P4 NA 1 9
P3 NA 2 9
P2 NA 4 9
P1 NA 5 9
link
# srcNode dstNode bandwidth metric delay queue
C1 R1 10Mbps 1 30ms 20
C2 R1 10Mbps 1 20ms 20
C3 R1 10Mbps 1 20ms 20
C4 R1 10Mbps 1 10ms 20
R1 R2 8Mbps 1 10ms 20
R2 P1 4Mbps 1 10ms 20
R2 P2 3Mbps 1 10ms 20
R2 P3 3Mbps 1 10ms 20
R2 P4 1Mbps 1 10ms 20
-27
View File
@@ -1,27 +0,0 @@
# topo_experiment1.1
router
# node comment yPos xPos
C3 NA 1 3
C2 NA 3 3
C1 NA 5 3
R1 NA 3 5
R2 NA 4 7
P4 NA 1 9
P3 NA 3 9
P2 NA 4 9
P1 NA 5 9
link
# srcNode dstNode bandwidth metric delay queue
C1 R1 100Mbps 1 10ms 20
C2 R1 100Mbps 1 10ms 20
C3 R1 100Mbps 1 10ms 20
R1 R2 50Mbps 1 10ms 20
R2 P1 100Mbps 1 10ms 20
R2 P2 100Mbps 1 10ms 20
R2 P3 100Mbps 1 10ms 20
R1 P4 50Mbps 1 10ms 20
-27
View File
@@ -1,27 +0,0 @@
# topo1
router
# node comment yPos xPos
C1 NA 1 3
C2 NA 2 3
C3 NA 4 3
C4 NA 5 3
R1 NA 3 5
P1 NA 1 9
P2 NA 2 9
P3 NA 4 9
P4 NA 5 9
link
# srcNode dstNode bandwidth metric delay queue
C1 R1 100Mbps 1 10ms 20
C2 R1 100Mbps 1 10ms 20
#C3 R1 100Mbps 1 10ms 20
#C4 R1 10Mbps 1 10ms 20
R1 P1 10Mbps 1 10ms 20
R1 P2 10Mbps 1 10ms 20
R1 P3 10Mbps 1 10ms 20
R1 P4 10Mbps 1 10ms 20