Compare commits

...
4 Commits
Author SHA1 Message Date
SunnyQjm ec68a55321 update 2022-12-06 23:02:56 +08:00
SunnyQjm 813636cf29 remove: 策略删除时间统计 2022-07-01 06:45:39 -07:00
SunnyQjm 31c8a1d47b Merge branch 'main' into fast-mircc 2022-07-01 06:23:52 -07:00
Lv 8dfa4ffef4 fast-mircc 2022-07-01 06:12:20 -07:00
16 changed files with 839 additions and 393 deletions

No files matched your search

+69 -1
View File
@@ -3,6 +3,74 @@
"*.txt": "cpp",
"fstream": "cpp",
"limits": "cpp",
"ostream": "cpp"
"ostream": "cpp",
"cctype": "cpp",
"clocale": "cpp",
"cmath": "cpp",
"csignal": "cpp",
"cstdarg": "cpp",
"cstddef": "cpp",
"cstdio": "cpp",
"cstdlib": "cpp",
"cstring": "cpp",
"ctime": "cpp",
"cwchar": "cpp",
"cwctype": "cpp",
"any": "cpp",
"array": "cpp",
"atomic": "cpp",
"hash_map": "cpp",
"strstream": "cpp",
"bit": "cpp",
"*.tcc": "cpp",
"bitset": "cpp",
"chrono": "cpp",
"codecvt": "cpp",
"complex": "cpp",
"condition_variable": "cpp",
"cstdint": "cpp",
"deque": "cpp",
"list": "cpp",
"map": "cpp",
"set": "cpp",
"unordered_map": "cpp",
"unordered_set": "cpp",
"vector": "cpp",
"exception": "cpp",
"algorithm": "cpp",
"functional": "cpp",
"iterator": "cpp",
"memory": "cpp",
"memory_resource": "cpp",
"numeric": "cpp",
"optional": "cpp",
"random": "cpp",
"ratio": "cpp",
"regex": "cpp",
"string": "cpp",
"string_view": "cpp",
"system_error": "cpp",
"tuple": "cpp",
"type_traits": "cpp",
"utility": "cpp",
"future": "cpp",
"initializer_list": "cpp",
"iomanip": "cpp",
"iosfwd": "cpp",
"iostream": "cpp",
"istream": "cpp",
"mutex": "cpp",
"new": "cpp",
"shared_mutex": "cpp",
"sstream": "cpp",
"stdexcept": "cpp",
"streambuf": "cpp",
"thread": "cpp",
"cfenv": "cpp",
"cinttypes": "cpp",
"typeindex": "cpp",
"typeinfo": "cpp",
"valarray": "cpp",
"variant": "cpp"
}
}
+10 -35
View File
@@ -11,6 +11,7 @@
#include "ns3/double.h"
#include <fstream>
#include <iostream>
NS_LOG_COMPONENT_DEFINE("ndn.ConsumerMIRCC");
@@ -67,23 +68,6 @@ ConsumerMIRCC::~ConsumerMIRCC()
}
void
ConsumerMIRCC::ScheduleNextPacket()
{
std::printf("");
// double mean = 8.0 * m_payloadSize / m_desiredRate.GetBitRate ();
// std::cout << "next: " << Simulator::Now().ToDouble(Time::S) + mean << "s\n";
/*
if (m_firstTime) {
m_sendEvent = Simulator::Schedule(Seconds(0.0), &Consumer::, this);
m_firstTime = false;
}
else if (!m_sendEvent.IsRunning())
m_sendEvent = Simulator::Schedule((m_random == 0) ? Seconds(1.0 / m_frequency)
: Seconds(m_random->GetValue()),
&Consumer::SendPacket, this);*/
}
void
ConsumerMIRCC:: StopApplication()
{
@@ -248,8 +232,6 @@ ConsumerMIRCC::SendPacket(uint64_t pathId,uint64_t classId)
seq = m_seq++;
}
//
seq2ClassId[seq] = classId;
seq2PathId[seq] = pathId;
if (classId == 1)
@@ -291,14 +273,11 @@ ConsumerMIRCC::SendPacket(uint64_t pathId,uint64_t classId)
recordSeq(seq,tmpRandId);
}
WillSendOutInterest(seq);
m_transmittedInterests(interest, this, m_face);
m_appLink->onReceiveInterest(*interest);
//这个函数只负责发包,不在负责调用下一个包的发送
//ScheduleNextPacket();
}
uint64_t
@@ -387,7 +366,6 @@ ConsumerMIRCC:: PathExplorate()
}
explore_event = Simulator::Schedule(Seconds(0.1), &ConsumerMIRCC::PathExplorate, this);
//PathId为0表示正在进行路径探索
SendPacket(0,1);
@@ -490,18 +468,9 @@ ConsumerMIRCC::OnData(shared_ptr<const Data> data)
{
tryBindRandId(seq, *tmpPathid);
}
//if (appid == 1)
//NS_LOG_DEBUG("seq " << seq << " ClassId " << seq2ClassId[seq]);
if (seq2ClassId[seq] == 1)
{
pktcnt_p += 1;
}else
{
pktcnt_s += 1;
}
seq2ClassId.erase(seq);
seq2RandomId.erase(seq);
seq2PathId.erase(seq);
@@ -568,7 +537,13 @@ ConsumerMIRCC::OnTimeout(uint32_t sequenceNumber) {
m_rtt->SentSeq(SequenceNumber32(sequenceNumber),
1); // make sure to disable RTT calculation for this sample
m_retxSeqs.insert(sequenceNumber);
SchedulePacketForPathId(seq2PathId[sequenceNumber], seq2ClassId[sequenceNumber]);
}
void
ConsumerMIRCC::ScheduleNextPacket()
{
uint64_t a = 1;
}
}// namespace ndn
} // namespace ns3
+4 -2
View File
@@ -34,8 +34,7 @@ protected:
* \brief Constructs the Interest packet and sends it using a callback to the underlying NDN
* protocol
*/
virtual void
ScheduleNextPacket();
void
@@ -63,6 +62,9 @@ protected:
Ptr<RandomVariableStream> m_random;
std::string m_randomType;
virtual void
ScheduleNextPacket();
private:
//路径id到发送事件id的一一映射关系
std:: unordered_map <uint64_t,EventId> pathId2EventId_p,pathId2EventId_s;
+5 -2
View File
@@ -36,6 +36,7 @@
#include <boost/lexical_cast.hpp>
#include <boost/ref.hpp>
#include <iostream>
NS_LOG_COMPONENT_DEFINE("ndn.Consumer");
@@ -115,10 +116,12 @@ Consumer::CheckRetxTimeout()
Time rto = m_rtt->RetransmitTimeout();
// NS_LOG_DEBUG ("Current RTO: " << rto.ToDouble (Time::S) << "s");
Time span = rto < m_interestLifeTime ? rto : m_interestLifeTime;
while (!m_seqTimeouts.empty()) {
SeqTimeoutsContainer::index<i_timestamp>::type::iterator entry =
m_seqTimeouts.get<i_timestamp>().begin();
if (entry->time + rto <= now) // timeout expired?
if (entry->time + span <= now) // timeout expired?
{
uint32_t seqNo = entry->seq;
m_seqTimeouts.get<i_timestamp>().erase(entry);
@@ -127,7 +130,7 @@ Consumer::CheckRetxTimeout()
else
break; // nothing else to do. All later packets need not be retransmitted
}
m_retxEvent = Simulator::Schedule(m_retxTimer, &Consumer::CheckRetxTimeout, this);
}
+167 -34
View File
@@ -44,7 +44,8 @@ namespace nfd {
m_d[inface(tmp.getId())] = 0.03;
sendQueueInterest(tmp.getId());
m_running[inface(tmp.getId())] = 0;
//sendQueueInterest(tmp.getId());
calcRt(tmp.getId());
@@ -53,49 +54,112 @@ namespace nfd {
void
MIRCCStrategy::sendQueueInterest(FaceId mface)
{
{
//设置下一次发送,根据兴趣包与数据包的大小之比,计算出兴趣包可用带宽,进而计算出每发送一个兴趣包需要的时间,最小为1ms
time::nanoseconds ttime(std::max((uint64_t)1,(uint64_t)1000000000 * DATA_SIZE / m_linkC[inface(mface)]));
getScheduler().schedule(ttime, bind(&MIRCCStrategy::sendQueueInterest, this, mface));
//分三种情况讨论,只有第一类兴趣包可以发,只有第二类兴趣包可以发,两类可以发(选择最早到达的)
if (m_Queue[inface(mface)].qp.size() > 0 and m_Queue[inface(mface)].qs.size() == 0)
if (m_Queue[inface(mface)].qp.size() + m_Queue[inface(mface)].qs.size() > 1)
{//
time::nanoseconds ttime(std::max((uint64_t)1,(uint64_t)1000000000 * DATA_SIZE / m_linkC[inface(mface)]));
getScheduler().schedule(ttime, bind(&MIRCCStrategy::sendQueueInterest, this, mface));
}else
{
m_running[inface(mface)] = 0;
}
//std::cout << (uint64_t)1000000000 * DATA_SIZE / m_linkC[inface(mface)] << std::endl;
if (!m_Queue[inface(mface)].qp.empty()) {
// 第一类包有就发第一类
shared_ptr<Interest> interest = m_Queue[inface(mface)].qp.front();
sendInterest(m_Queue[inface(mface)].pp.front(),FaceEndpoint(*getFaceTable().get(mface),0),*interest);
m_Queue[inface(mface)].qp.pop_front();
m_Queue[inface(mface)].tp.pop_front();
m_Queue[inface(mface)].pp.pop_front();
}else if (m_Queue[inface(mface)].qs.size() > 0 and m_Queue[inface(mface)].qp.size() == 0)
{
m_on++;
} else if (!m_Queue[inface(mface)].qs.empty()) {
// 只有第二类包就发第二类
shared_ptr<Interest> interest = m_Queue[inface(mface)].qs.front();
sendInterest(m_Queue[inface(mface)].ps.front(),FaceEndpoint(*getFaceTable().get(mface),0),*interest);
m_Queue[inface(mface)].qs.pop_front();
m_Queue[inface(mface)].ts.pop_front();
m_Queue[inface(mface)].ps.pop_front();
}else if (m_Queue[inface(mface)].qs.size() > 0 and m_Queue[inface(mface)].qp.size() > 0)
m_on++;
} else {
m_miss++;
}
// //分三种情况讨论,只有第一类兴趣包可以发,只有第二类兴趣包可以发,两类可以发(选择最早到达的)
// if (m_Queue[inface(mface)].qp.size() > 0 and m_Queue[inface(mface)].qs.size() == 0)
// {
// shared_ptr<Interest> interest = m_Queue[inface(mface)].qp.front();
// sendInterest(m_Queue[inface(mface)].pp.front(),FaceEndpoint(*getFaceTable().get(mface),0),*interest);
// m_Queue[inface(mface)].qp.pop_front();
// m_Queue[inface(mface)].tp.pop_front();
// m_Queue[inface(mface)].pp.pop_front();
// m_on++;
// }else if (m_Queue[inface(mface)].qs.size() > 0 and m_Queue[inface(mface)].qp.size() == 0)
// {
// shared_ptr<Interest> interest = m_Queue[inface(mface)].qs.front();
// sendInterest(m_Queue[inface(mface)].ps.front(),FaceEndpoint(*getFaceTable().get(mface),0),*interest);
// m_Queue[inface(mface)].qs.pop_front();
// m_Queue[inface(mface)].ts.pop_front();
// m_Queue[inface(mface)].ps.pop_front();
// m_on++;
// }else if (m_Queue[inface(mface)].qs.size() > 0 and m_Queue[inface(mface)].qp.size() > 0)
// {
// m_on++;
// if (m_Queue[inface(mface)].tp.front() < m_Queue[inface(mface)].ts.front())
// {
// shared_ptr<Interest> interest =m_Queue[inface(mface)].qp.front();
// sendInterest(m_Queue[inface(mface)].pp.front(),FaceEndpoint(*getFaceTable().get(mface),0),*interest);
// m_Queue[inface(mface)].qp.pop_front();
// m_Queue[inface(mface)].tp.pop_front();
// m_Queue[inface(mface)].pp.pop_front();
// }else
// {
// shared_ptr<Interest> interest = m_Queue[inface(mface)].qs.front();
// sendInterest(m_Queue[inface(mface)].ps.front(),FaceEndpoint(*getFaceTable().get(mface),0),*interest);
// m_Queue[inface(mface)].qs.pop_front();
// m_Queue[inface(mface)].ts.pop_front();
// m_Queue[inface(mface)].ps.pop_front();
// }
// }else
// {
// m_miss++;
// }
/*
//设置下一次发送,根据兴趣包与数据包的大小之比,计算出兴趣包可用带宽,进而计算出每发送一个兴趣包需要的时间,最小为1ms
time::nanoseconds ttime(std::max((uint64_t)1,(uint64_t)1000000000 * DATA_SIZE / m_linkC[inface(mface)]));
getScheduler().schedule(ttime, bind(&MIRCCStrategy::sendQueueInterest, this, mface));
shared_ptr<Interest> fi,si;
time::steady_clock::TimePoint ft,st;
shared_ptr<pit::Entry> fp,sp;
m_Queue[inface(mface)].f.getHead(fi,ft,fp);
m_Queue[inface(mface)].s.getHead(si,st,sp);
//分三种情况讨论,只有第一类兴趣包可以发,只有第二类兴趣包可以发,两类可以发(选择最早到达的)
if (m_Queue[inface(mface)].f.getSize() > 0 and m_Queue[inface(mface)].s.getSize() == 0)
{
if (m_Queue[inface(mface)].tp.front() < m_Queue[inface(mface)].ts.front())
sendInterest(fp,FaceEndpoint(*getFaceTable().get(mface),0),*fi);
m_Queue[inface(mface)].f.deQueueFront();
}else if (m_Queue[inface(mface)].s.getSize() > 0 and m_Queue[inface(mface)].f.getSize() == 0)
{
sendInterest(sp,FaceEndpoint(*getFaceTable().get(mface),0),*si);
m_Queue[inface(mface)].s.deQueueFront();
}else if (m_Queue[inface(mface)].f.getSize() > 0 and m_Queue[inface(mface)].s.getSize() > 0)
{
if (ft < st)
{
shared_ptr<Interest> interest =m_Queue[inface(mface)].qp.front();
sendInterest(m_Queue[inface(mface)].pp.front(),FaceEndpoint(*getFaceTable().get(mface),0),*interest);
m_Queue[inface(mface)].qp.pop_front();
m_Queue[inface(mface)].tp.pop_front();
m_Queue[inface(mface)].pp.pop_front();
sendInterest(fp,FaceEndpoint(*getFaceTable().get(mface),0),*fi);
m_Queue[inface(mface)].f.deQueueFront();
}else
{
shared_ptr<Interest> interest = m_Queue[inface(mface)].qs.front();
sendInterest(m_Queue[inface(mface)].ps.front(),FaceEndpoint(*getFaceTable().get(mface),0),*interest);
m_Queue[inface(mface)].qs.pop_front();
m_Queue[inface(mface)].ts.pop_front();
m_Queue[inface(mface)].ps.pop_front();
sendInterest(sp,FaceEndpoint(*getFaceTable().get(mface),0),*si);
m_Queue[inface(mface)].s.deQueueFront();
}
}else
{
}
}*/
}
@@ -105,12 +169,12 @@ namespace nfd {
//每100ms自动重新计算Rt
time::nanoseconds ttime(100000000);
getScheduler().schedule(ttime, std::bind(&MIRCCStrategy::calcRt, this, mface));
// std::cout << (double)m_miss / std::max(m_on,(uint64_t)1) << std::endl;
long long ia,ib,Rp,Rs;
double db;
Rp = m_Rp_base[inface(mface)] + m_Rp_ex[inface(mface)];
Rs = m_Rs_base[inface(mface)] + m_Rs_ex[inface(mface)];
// NS_LOG_DEBUG("face:" << mface << "d:" << m_d[inface(mface)]);
// NS_LOG_DEBUG("Rp: " << Rp << " Rs: " << Rs << " Yt: " << m_Yp[inface(mface)] << " C:" << m_linkC[inface(mface)]);
@@ -210,11 +274,13 @@ namespace nfd {
//返回兴趣包个数*兴趣包大小*数据包与兴趣包大小之比
uint64_t time = 10;//保持Rt计算周期一致
return (m_Queue[inface(mface)].qp.size() + m_Queue[inface(mface)].qs.size()) * DATA_SIZE * time;
//return (m_Queue[inface(mface)].f.getSize() + m_Queue[inface(mface)].s.getSize()) * DATA_SIZE * time;
}
void
MIRCCStrategy::pushQueueInterest(FaceId mface,const shared_ptr<Interest>& interest,const shared_ptr<pit::Entry>& pitEntry)
{
//// NS_LOG_DEBUG("MIRCC pushQueueInterest");
uint64_t p = *(interest->getTag<lp::PTag>());
//如果是第一类兴趣包
@@ -228,11 +294,18 @@ namespace nfd {
{
//删掉第二类兴趣包最后一个,把当前第一类兴趣包加入
m_Queue[inface(mface)].qs.pop_back();
m_Queue[inface(mface)].ts.pop_back();
// m_Queue[inface(mface)].ts.pop_back();
m_Queue[inface(mface)].ps.pop_back();
m_Queue[inface(mface)].qp.push_back(interest);
m_Queue[inface(mface)].tp.push_back(time::steady_clock::now());
// m_Queue[inface(mface)].tp.push_back(time::steady_clock::now());
m_Queue[inface(mface)].pp.push_back(pitEntry);
if (m_running[inface(mface)] == 0)
{
m_running[inface(mface)] = 1;
time::nanoseconds ttime(std::max((uint64_t)1,(uint64_t)1000000000 * DATA_SIZE / m_linkC[inface(mface)]));
getScheduler().schedule(ttime, bind(&MIRCCStrategy::sendQueueInterest, this, mface));
}
}else
{
//否则当前兴趣包丢失
@@ -244,8 +317,15 @@ namespace nfd {
{
//直接将当前兴趣包加入第一类兴趣包队列末尾
m_Queue[inface(mface)].qp.push_back(interest);
m_Queue[inface(mface)].tp.push_back(time::steady_clock::now());
// m_Queue[inface(mface)].tp.push_back(time::steady_clock::now());
m_Queue[inface(mface)].pp.push_back(pitEntry);
if (m_running[inface(mface)] == 0)
{
m_running[inface(mface)] = 1;
time::nanoseconds ttime(std::max((uint64_t)1,(uint64_t)1000000000 * DATA_SIZE / m_linkC[inface(mface)]));
getScheduler().schedule(ttime, bind(&MIRCCStrategy::sendQueueInterest, this, mface));
}
}
}else
{
@@ -259,11 +339,64 @@ namespace nfd {
{
//将但钱兴趣包加入第二类末尾
m_Queue[inface(mface)].qs.push_back(interest);
m_Queue[inface(mface)].ts.push_back(time::steady_clock::now());
// m_Queue[inface(mface)].ts.push_back(time::steady_clock::now());
m_Queue[inface(mface)].ps.push_back(pitEntry);
if (m_running[inface(mface)] == 0)
{
m_running[inface(mface)] = 1;
time::nanoseconds ttime(std::max((uint64_t)1,(uint64_t)1000000000 * DATA_SIZE / m_linkC[inface(mface)]));
getScheduler().schedule(ttime, bind(&MIRCCStrategy::sendQueueInterest, this, mface));
}
}
}
/*
uint64_t p = *(interest->getTag<lp::PTag>());
//如果是第一类兴趣包
if (p == 1)
{
//如果队列已经满了
if (m_Queue[inface(mface)].f.getSize() + m_Queue[inface(mface)].s.getSize() >= 10)
{
//如果存在第二类兴趣包可以删除
if (m_Queue[inface(mface)].s.getSize() > 0)
{
//删掉第二类兴趣包最后一个,把当前第一类兴趣包加入
m_Queue[inface(mface)].s.deQueueBack();
m_Queue[inface(mface)].f.enQueue(interest,time::steady_clock::now(),pitEntry);
}else
{
//否则当前兴趣包丢失
//这里应该回传Nack,还没有写完
this->rejectPendingInterest(pitEntry);
}
}else
{
//直接将当前兴趣包加入第一类兴趣包队列末尾
m_Queue[inface(mface)].f.enQueue(interest,time::steady_clock::now(),pitEntry);
}
}else
{
//如果队列已经满了
if (m_Queue[inface(mface)].f.getSize() + m_Queue[inface(mface)].s.getSize() >= 10)
{
//当前兴趣包丢失
this->rejectPendingInterest(pitEntry);
//这里是否应该回传Nack不确定,需要回去看论文,第二类兴趣包处理方式似乎与第一类不同,还没有写完
}else
{
//将但钱兴趣包加入第二类末尾
m_Queue[inface(mface)].s.enQueue(interest,time::steady_clock::now(),pitEntry);
}
}*/
}
void
@@ -369,7 +502,7 @@ namespace nfd {
{
hashVal = 0;
}
hashVal = (hashVal * 10 + (ingress.face.getId() - 257));
hashVal = (hashVal * MAX_FACE + (ingress.face.getId() - 257));
//给data设置新的hash值
data.setTag(make_shared<lp::PathidTag>(hashVal));
+64 -4
View File
@@ -17,13 +17,68 @@ namespace nfd {
{
public:
std:: deque<shared_ptr<Interest>> qp,qs;
//记录的是过期时间,非达到时间
std:: deque<time::steady_clock::TimePoint> tp,ts;
// //记录的是过期时间,非达到时间
// std:: deque<time::steady_clock::TimePoint> tp,ts;
std:: deque<shared_ptr<pit::Entry>> pp,ps;
};
class cirQueue
{
public:
bool enQueue(shared_ptr<Interest> interest,time::steady_clock::TimePoint tim,shared_ptr<pit::Entry> entry)
{
if ((rear + 1) % 10 == front)
return false;
i[rear] = interest;
t[rear] = tim;
p[rear] = entry;
rear = (rear + 1) % 10;
siz += 1;
return true;
}
bool deQueueFront()
{
if (front == rear)
return false;
front = (front + 1) % 10;
siz -= 1;
return true;
}
bool deQueueBack()
{
if (front == rear)
return false;
rear = (rear + 10 - 1) % 10;
siz -= 1;
return true;
}
bool getHead(shared_ptr<Interest> &interest,time::steady_clock::TimePoint &tim,shared_ptr<pit::Entry> &entry)
{
if (front == rear)
return false;
interest = i[front];
tim = t[front];
entry = p[front];
return true;
}
uint64_t getSize()
{
return siz;
}
private:
shared_ptr<Interest> i[20];
time::steady_clock::TimePoint t[20];
shared_ptr<pit::Entry> p[20];
uint64_t rear = 0,front = 0,siz = 0;
};
class MIRCCQueueF
{
public:
cirQueue f,s;
};
/*
MIRCC 策略实现
*/
@@ -59,10 +114,11 @@ namespace nfd {
const double m_B = 0.1;//公式B系数
const double m_a = 0.8;//速率更新系数
const double m_miu = 0.99;//链路利用率
const double m_miu = 0.95;//链路利用率
const double m_rtt_a = 0.7;//RTT更新系数
uint64_t m_miss = 0,m_on = 0;
uint64_t m_Rp_base[MAX_FACE];//Rp的base速率
uint64_t m_Rp_ex[MAX_FACE];//Rp的ex速率
uint64_t m_Rs_base[MAX_FACE];//Rs的base速率
@@ -72,12 +128,16 @@ namespace nfd {
uint64_t m_Ys[MAX_FACE];//本周起的Ys(t)
uint64_t m_Ys_old[MAX_FACE];//上一个周期的Ys(t)
uint64_t m_linkC[MAX_FACE];//每一个链路的带宽,单位为比特
uint64_t m_running[MAX_FACE];
double m_d[MAX_FACE];//维护每一个face的RTT 秒
//注意,此处没有维护数据包/兴趣包,算法中采用固定的数据包大小
MIRCCQueue m_Queue[MAX_FACE];//用于出口排队转发兴趣
//MIRCCQueueF m_Queue[MAX_FACE];//用于出口排队转发兴趣
//发送mface端口1个正在排队的兴趣包,并设置下一次发送时间
void
sendQueueInterest(FaceId mface);
+131
View File
@@ -0,0 +1,131 @@
#include "ns3/core-module.h"
#include "ns3/network-module.h"
#include "ns3/ndnSIM-module.h"
#include "../extensions/mircc-strategy.hpp"
namespace ns3
{
int
main(int argc, char *argv[])
{
CommandLine cmd;
cmd.Parse(argc, argv);
AnnotatedTopologyReader topologyReader("", 25);
topologyReader.SetFileName("topologies/dsccp3-1-test.txt");
topologyReader.Read();
// Install NDN stack on all nodes
ndn::StackHelper ndnHelper;
ndnHelper.setPolicy("nfd::cs::lru");
// ndnHelper.setCsSize(10000);
ndnHelper.setCsSize(0);
ndnHelper.InstallAll();
// Choosing forwarding strategy
ndn::StrategyChoiceHelper::InstallAll<nfd::fw::MIRCCStrategy>("/");
// 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::ConsumerMIRCC");
consumerHelper.SetAttribute("logtms",StringValue("0"));
consumerHelper.SetAttribute("start_ms",StringValue("0"));
consumerHelper.SetAttribute("end_ms",StringValue("320000"));
// C1
consumerHelper.SetPrefix("/A");
consumerHelper.Install("C1");
// C2
consumerHelper.SetPrefix("/B");
consumerHelper.SetAttribute("start_ms",StringValue("80000"));
consumerHelper.SetAttribute("end_ms",StringValue("320000"));
consumerHelper.Install("C2");
// C3
consumerHelper.SetPrefix("/C");
consumerHelper.SetAttribute("start_ms",StringValue("160000"));
consumerHelper.SetAttribute("end_ms",StringValue("320000"));
consumerHelper.SetAttribute("greedy_ms",StringValue("240000"));
consumerHelper.SetAttribute("greedy_rate",StringValue("10000000"));
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);
ndnGlobalRoutingHelper.AddOrigins("/B", P2);
ndnGlobalRoutingHelper.AddOrigins("/C", P3);
ndnGlobalRoutingHelper.AddOrigins("/A", P4);
ndnGlobalRoutingHelper.AddOrigins("/B", P4);
ndnGlobalRoutingHelper.AddOrigins("/C", P4);
producerHelper.SetPrefix("/A");
producerHelper.Install(P1);
producerHelper.Install(P4);
producerHelper.SetPrefix("/B");
producerHelper.Install(P2);
producerHelper.Install(P4);
producerHelper.SetPrefix("/C");
producerHelper.Install(P3);
producerHelper.Install(P4);
// Calculate all possible routes and install FIBs
ndn::GlobalRoutingHelper::CalculateRoutes();
ndn::FibHelper::AddRoute("R2", "/A", "R3", 0);
ndn::FibHelper::AddRoute("R2", "/B", "R3", 0);
ndn::FibHelper::AddRoute("R2", "/C", "R3", 0);
ndn::FibHelper::AddRoute("R2", "/A", "R4", 0);
ndn::FibHelper::AddRoute("R2", "/B", "R4", 0);
ndn::FibHelper::AddRoute("R2", "/C", "R4", 0);
ndn::FibHelper::AddRoute("R2", "/A", "R5", 0);
ndn::FibHelper::AddRoute("R2", "/B", "R5", 0);
ndn::FibHelper::AddRoute("R2", "/C", "R5", 0);
ndn::FibHelper::AddRoute("R4", "/A", "R3", 0);
ndn::FibHelper::AddRoute("R4", "/B", "R3", 0);
ndn::FibHelper::AddRoute("R4", "/C", "R3", 0);
ndn::FibHelper::AddRoute("R4", "/A", "R5", 0);
ndn::FibHelper::AddRoute("R4", "/B", "R5", 0);
ndn::FibHelper::AddRoute("R4", "/C", "R5", 0);
Simulator::Stop(Seconds(320.0));
ndn::L3RateTracer::InstallAll("dsccp3-1-throughput-320-test.txt", Seconds(0.5));
ndn::AppDelayTracer::InstallAll("dsccp3-1-delay-320-test.txt");
L2RateTracer::InstallAll("dsccp3-1-drop-320-test.txt", Seconds(0.5));
Simulator::Run();
Simulator::Destroy();
return 0;
}
} // namespace ns3
int main(int argc, char *argv[])
{
return ns3::main(argc, argv);
}
+12 -12
View File
@@ -13,7 +13,7 @@ namespace ns3
cmd.Parse(argc, argv);
AnnotatedTopologyReader topologyReader("", 25);
topologyReader.SetFileName("topologies/dsccp3-1.txt");
topologyReader.SetFileName("topologies/dsccp3-1-ton.txt");
topologyReader.Read();
// Install NDN stack on all nodes
@@ -43,7 +43,7 @@ namespace ns3
ndn::AppHelper consumerHelper("ns3::ndn::ConsumerMIRCC");
consumerHelper.SetAttribute("logtms",StringValue("0"));
consumerHelper.SetAttribute("start_ms",StringValue("0"));
consumerHelper.SetAttribute("end_ms",StringValue("200000"));
consumerHelper.SetAttribute("end_ms",StringValue("320000"));
// C1
consumerHelper.SetPrefix("/A");
@@ -51,16 +51,16 @@ namespace ns3
// C2
consumerHelper.SetPrefix("/B");
consumerHelper.SetAttribute("start_ms",StringValue("30000"));
consumerHelper.SetAttribute("end_ms",StringValue("200000"));
consumerHelper.SetAttribute("start_ms",StringValue("80000"));
consumerHelper.SetAttribute("end_ms",StringValue("320000"));
consumerHelper.Install("C2");
// C3
consumerHelper.SetPrefix("/C");
consumerHelper.SetAttribute("start_ms",StringValue("60000"));
consumerHelper.SetAttribute("end_ms",StringValue("200000"));
consumerHelper.SetAttribute("greedy_ms",StringValue("150000"));
consumerHelper.SetAttribute("greedy_rate",StringValue("6000000"));
consumerHelper.SetAttribute("start_ms",StringValue("160000"));
consumerHelper.SetAttribute("end_ms",StringValue("320000"));
consumerHelper.SetAttribute("greedy_ms",StringValue("240000"));
consumerHelper.SetAttribute("greedy_rate",StringValue("10000000"));
consumerHelper.Install("C3");
@@ -112,11 +112,11 @@ namespace ns3
ndn::FibHelper::AddRoute("R4", "/B", "R5", 0);
ndn::FibHelper::AddRoute("R4", "/C", "R5", 0);
Simulator::Stop(Seconds(200.0));
Simulator::Stop(Seconds(320.0));
ndn::L3RateTracer::InstallAll("dsccp3-1_throughput.txt", Seconds(0.1));
ndn::AppDelayTracer::InstallAll("dsccp3-1_delay.txt");
L2RateTracer::InstallAll("dsccp3-1_drop.txt", Seconds(0.1));
ndn::L3RateTracer::InstallAll("dsccp3-1-throughput-320-ton.txt", Seconds(0.5));
ndn::AppDelayTracer::InstallAll("dsccp3-1-delay-320-ton.txt");
L2RateTracer::InstallAll("dsccp3-1-drop-320-ton.txt", Seconds(0.5));
Simulator::Run();
Simulator::Destroy();
+11 -11
View File
@@ -43,7 +43,7 @@ namespace ns3
ndn::AppHelper consumerHelper("ns3::ndn::ConsumerMIRCC");
consumerHelper.SetAttribute("logtms",StringValue("0"));
consumerHelper.SetAttribute("start_ms",StringValue("0"));
consumerHelper.SetAttribute("end_ms",StringValue("200000"));
consumerHelper.SetAttribute("end_ms",StringValue("320000"));
// C1
consumerHelper.SetPrefix("/A");
@@ -51,16 +51,16 @@ namespace ns3
// C2
consumerHelper.SetPrefix("/B");
consumerHelper.SetAttribute("start_ms",StringValue("30000"));
consumerHelper.SetAttribute("end_ms",StringValue("200000"));
consumerHelper.SetAttribute("start_ms",StringValue("80000"));
consumerHelper.SetAttribute("end_ms",StringValue("320000"));
consumerHelper.Install("C2");
// C3
consumerHelper.SetPrefix("/C");
consumerHelper.SetAttribute("start_ms",StringValue("60000"));
consumerHelper.SetAttribute("end_ms",StringValue("200000"));
consumerHelper.SetAttribute("greedy_ms",StringValue("150000"));
consumerHelper.SetAttribute("greedy_rate",StringValue("6000000"));
consumerHelper.SetAttribute("start_ms",StringValue("160000"));
consumerHelper.SetAttribute("end_ms",StringValue("320000"));
consumerHelper.SetAttribute("greedy_ms",StringValue("240000"));
consumerHelper.SetAttribute("greedy_rate",StringValue("10000000"));
consumerHelper.Install("C3");
@@ -112,11 +112,11 @@ namespace ns3
ndn::FibHelper::AddRoute("R4", "/B", "R5", 0);
ndn::FibHelper::AddRoute("R4", "/C", "R5", 0);
Simulator::Stop(Seconds(200.0));
Simulator::Stop(Seconds(320.0));
ndn::L3RateTracer::InstallAll("dsccp3-2_throughput.txt", Seconds(0.1));
ndn::AppDelayTracer::InstallAll("dsccp3-2_delay.txt");
L2RateTracer::InstallAll("dsccp3-2_drop.txt", Seconds(0.1));
ndn::L3RateTracer::InstallAll("dsccp3-2-throughput-320.txt", Seconds(0.5));
ndn::AppDelayTracer::InstallAll("dsccp3-2-delay-320.txt");
L2RateTracer::InstallAll("dsccp3-2-drop-320.txt", Seconds(0.5));
Simulator::Run();
Simulator::Destroy();
+60 -60
View File
@@ -50,93 +50,93 @@ namespace ns3
consumerHelper.SetAttribute("start_ms",StringValue("0"));
consumerHelper.SetAttribute("end_ms",StringValue("60000"));
// // /Amazon
// consumerHelper.SetPrefix("/Amazon");
// consumerHelper.Install(C1);
// consumerHelper.Install(C2);
// consumerHelper.Install(C3);
// consumerHelper.Install(C4);
// consumerHelper.Install(C5);
// consumerHelper.Install(C6);
// consumerHelper.Install(C7);
// consumerHelper.Install(C8);
// // /Google
// consumerHelper.SetPrefix("/Google");
// consumerHelper.Install(C1);
// consumerHelper.Install(C2);
// consumerHelper.Install(C3);
// consumerHelper.Install(C4);
// consumerHelper.Install(C5);
// consumerHelper.Install(C6);
// consumerHelper.Install(C7);
// consumerHelper.Install(C8);
// // /Warner
// consumerHelper.SetPrefix("/Warner");
// consumerHelper.Install(C1);
// consumerHelper.Install(C2);
// consumerHelper.Install(C3);
// consumerHelper.Install(C4);
// consumerHelper.Install(C5);
// consumerHelper.Install(C6);
// consumerHelper.Install(C7);
// consumerHelper.Install(C8);
// /Amazon
consumerHelper.SetPrefix("/Amazon/1");
consumerHelper.SetPrefix("/Amazon");
consumerHelper.Install(C1);
consumerHelper.SetPrefix("/Amazon/2");
consumerHelper.Install(C2);
consumerHelper.SetPrefix("/Amazon/3");
consumerHelper.Install(C3);
consumerHelper.SetPrefix("/Amazon/4");
consumerHelper.Install(C4);
consumerHelper.SetPrefix("/Amazon/5");
consumerHelper.Install(C5);
consumerHelper.SetPrefix("/Amazon/6");
consumerHelper.Install(C6);
consumerHelper.SetPrefix("/Amazon/7");
consumerHelper.Install(C7);
consumerHelper.SetPrefix("/Amazon/8");
consumerHelper.Install(C8);
// /Google
consumerHelper.SetPrefix("/Google/1");
consumerHelper.SetPrefix("/Google");
consumerHelper.Install(C1);
consumerHelper.SetPrefix("/Google/2");
consumerHelper.Install(C2);
consumerHelper.SetPrefix("/Google/3");
consumerHelper.Install(C3);
consumerHelper.SetPrefix("/Google/4");
consumerHelper.Install(C4);
consumerHelper.SetPrefix("/Google/5");
consumerHelper.Install(C5);
consumerHelper.SetPrefix("/Google/6");
consumerHelper.Install(C6);
consumerHelper.SetPrefix("/Google/7");
consumerHelper.Install(C7);
consumerHelper.SetPrefix("/Google/8");
consumerHelper.Install(C8);
// /Warner
consumerHelper.SetPrefix("/Warner/1");
consumerHelper.SetPrefix("/Warner");
consumerHelper.Install(C1);
consumerHelper.SetPrefix("/Warner/2");
consumerHelper.Install(C2);
consumerHelper.SetPrefix("/Warner/3");
consumerHelper.Install(C3);
consumerHelper.SetPrefix("/Warner/4");
consumerHelper.Install(C4);
consumerHelper.SetPrefix("/Warner/5");
consumerHelper.Install(C5);
consumerHelper.SetPrefix("/Warner/6");
consumerHelper.Install(C6);
consumerHelper.SetPrefix("/Warner/7");
consumerHelper.Install(C7);
consumerHelper.SetPrefix("/Warner/8");
consumerHelper.Install(C8);
//// /Amazon
//consumerHelper.SetPrefix("/Amazon/1");
//consumerHelper.Install(C1);
//consumerHelper.SetPrefix("/Amazon/2");
//consumerHelper.Install(C2);
//consumerHelper.SetPrefix("/Amazon/3");
//consumerHelper.Install(C3);
//consumerHelper.SetPrefix("/Amazon/4");
//consumerHelper.Install(C4);
//consumerHelper.SetPrefix("/Amazon/5");
//consumerHelper.Install(C5);
//consumerHelper.SetPrefix("/Amazon/6");
//consumerHelper.Install(C6);
//consumerHelper.SetPrefix("/Amazon/7");
//consumerHelper.Install(C7);
//consumerHelper.SetPrefix("/Amazon/8");
//consumerHelper.Install(C8);
//// /Google
//consumerHelper.SetPrefix("/Google/1");
//consumerHelper.Install(C1);
//consumerHelper.SetPrefix("/Google/2");
//consumerHelper.Install(C2);
//consumerHelper.SetPrefix("/Google/3");
//consumerHelper.Install(C3);
//consumerHelper.SetPrefix("/Google/4");
//consumerHelper.Install(C4);
//consumerHelper.SetPrefix("/Google/5");
//consumerHelper.Install(C5);
//consumerHelper.SetPrefix("/Google/6");
//consumerHelper.Install(C6);
//consumerHelper.SetPrefix("/Google/7");
//consumerHelper.Install(C7);
//consumerHelper.SetPrefix("/Google/8");
//consumerHelper.Install(C8);
//// /Warner
//consumerHelper.SetPrefix("/Warner/1");
//consumerHelper.Install(C1);
//consumerHelper.SetPrefix("/Warner/2");
//consumerHelper.Install(C2);
//consumerHelper.SetPrefix("/Warner/3");
//consumerHelper.Install(C3);
//consumerHelper.SetPrefix("/Warner/4");
//consumerHelper.Install(C4);
//consumerHelper.SetPrefix("/Warner/5");
//consumerHelper.Install(C5);
//consumerHelper.SetPrefix("/Warner/6");
//consumerHelper.Install(C6);
//consumerHelper.SetPrefix("/Warner/7");
//consumerHelper.Install(C7);
//consumerHelper.SetPrefix("/Warner/8");
//consumerHelper.Install(C8);
ndn::AppHelper producerHelper("ns3::ndn::Producer");
producerHelper.SetAttribute("PayloadSize", StringValue("1024"));
@@ -260,9 +260,9 @@ namespace ns3
Simulator::Stop(Seconds(60.0));
ndn::L3RateTracer::InstallAll("dsccp4-1-mircc-no-pit-merge-throughput.txt", Seconds(0.1));
ndn::AppDelayTracer::InstallAll("dsccp4-1-mircc-no-pit-merge-delay.txt");
L2RateTracer::InstallAll("dsccp4-1-mircc-no-pit-merge-drop.txt", Seconds(0.1));
ndn::L3RateTracer::InstallAll("mircc-single-throughput.txt", Seconds(0.1));
ndn::AppDelayTracer::InstallAll("mircc-single-delay.txt");
L2RateTracer::InstallAll("mircc-single-drop.txt", Seconds(0.1));
Simulator::Run();
Simulator::Destroy();
+61 -61
View File
@@ -50,93 +50,93 @@ namespace ns3
consumerHelper.SetAttribute("start_ms",StringValue("0"));
consumerHelper.SetAttribute("end_ms",StringValue("60000"));
// // /Amazon
// consumerHelper.SetPrefix("/Amazon");
// consumerHelper.Install(C1);
// consumerHelper.Install(C2);
// consumerHelper.Install(C3);
// consumerHelper.Install(C4);
// consumerHelper.Install(C5);
// consumerHelper.Install(C6);
// consumerHelper.Install(C7);
// consumerHelper.Install(C8);
// // /Google
// consumerHelper.SetPrefix("/Google");
// consumerHelper.Install(C1);
// consumerHelper.Install(C2);
// consumerHelper.Install(C3);
// consumerHelper.Install(C4);
// consumerHelper.Install(C5);
// consumerHelper.Install(C6);
// consumerHelper.Install(C7);
// consumerHelper.Install(C8);
// // /Warner
// consumerHelper.SetPrefix("/Warner");
// consumerHelper.Install(C1);
// consumerHelper.Install(C2);
// consumerHelper.Install(C3);
// consumerHelper.Install(C4);
// consumerHelper.Install(C5);
// consumerHelper.Install(C6);
// consumerHelper.Install(C7);
// consumerHelper.Install(C8);
// /Amazon
consumerHelper.SetPrefix("/Amazon/1");
consumerHelper.SetPrefix("/Amazon");
consumerHelper.Install(C1);
consumerHelper.SetPrefix("/Amazon/2");
consumerHelper.Install(C2);
consumerHelper.SetPrefix("/Amazon/3");
consumerHelper.Install(C3);
consumerHelper.SetPrefix("/Amazon/4");
consumerHelper.Install(C4);
consumerHelper.SetPrefix("/Amazon/5");
consumerHelper.Install(C5);
consumerHelper.SetPrefix("/Amazon/6");
consumerHelper.Install(C6);
consumerHelper.SetPrefix("/Amazon/7");
consumerHelper.Install(C7);
consumerHelper.SetPrefix("/Amazon/8");
consumerHelper.Install(C8);
// /Google
consumerHelper.SetPrefix("/Google/1");
consumerHelper.SetPrefix("/Google");
consumerHelper.Install(C1);
consumerHelper.SetPrefix("/Google/2");
consumerHelper.Install(C2);
consumerHelper.SetPrefix("/Google/3");
consumerHelper.Install(C3);
consumerHelper.SetPrefix("/Google/4");
consumerHelper.Install(C4);
consumerHelper.SetPrefix("/Google/5");
consumerHelper.Install(C5);
consumerHelper.SetPrefix("/Google/6");
consumerHelper.Install(C6);
consumerHelper.SetPrefix("/Google/7");
consumerHelper.Install(C7);
consumerHelper.SetPrefix("/Google/8");
consumerHelper.Install(C8);
// /Warner
consumerHelper.SetPrefix("/Warner/1");
consumerHelper.SetPrefix("/Warner");
consumerHelper.Install(C1);
consumerHelper.SetPrefix("/Warner/2");
consumerHelper.Install(C2);
consumerHelper.SetPrefix("/Warner/3");
consumerHelper.Install(C3);
consumerHelper.SetPrefix("/Warner/4");
consumerHelper.Install(C4);
consumerHelper.SetPrefix("/Warner/5");
consumerHelper.Install(C5);
consumerHelper.SetPrefix("/Warner/6");
consumerHelper.Install(C6);
consumerHelper.SetPrefix("/Warner/7");
consumerHelper.Install(C7);
consumerHelper.SetPrefix("/Warner/8");
consumerHelper.Install(C8);
//// /Amazon
//consumerHelper.SetPrefix("/Amazon/1");
//consumerHelper.Install(C1);
//consumerHelper.SetPrefix("/Amazon/2");
//consumerHelper.Install(C2);
//consumerHelper.SetPrefix("/Amazon/3");
//consumerHelper.Install(C3);
//consumerHelper.SetPrefix("/Amazon/4");
//consumerHelper.Install(C4);
//consumerHelper.SetPrefix("/Amazon/5");
//consumerHelper.Install(C5);
//consumerHelper.SetPrefix("/Amazon/6");
//consumerHelper.Install(C6);
//consumerHelper.SetPrefix("/Amazon/7");
//consumerHelper.Install(C7);
//consumerHelper.SetPrefix("/Amazon/8");
//consumerHelper.Install(C8);
//// /Google
//consumerHelper.SetPrefix("/Google/1");
//consumerHelper.Install(C1);
//consumerHelper.SetPrefix("/Google/2");
//consumerHelper.Install(C2);
//consumerHelper.SetPrefix("/Google/3");
//consumerHelper.Install(C3);
//consumerHelper.SetPrefix("/Google/4");
//consumerHelper.Install(C4);
//consumerHelper.SetPrefix("/Google/5");
//consumerHelper.Install(C5);
//consumerHelper.SetPrefix("/Google/6");
//consumerHelper.Install(C6);
//consumerHelper.SetPrefix("/Google/7");
//consumerHelper.Install(C7);
//consumerHelper.SetPrefix("/Google/8");
//consumerHelper.Install(C8);
//// /Warner
//consumerHelper.SetPrefix("/Warner/1");
//consumerHelper.Install(C1);
//consumerHelper.SetPrefix("/Warner/2");
//consumerHelper.Install(C2);
//consumerHelper.SetPrefix("/Warner/3");
//consumerHelper.Install(C3);
//consumerHelper.SetPrefix("/Warner/4");
//consumerHelper.Install(C4);
//consumerHelper.SetPrefix("/Warner/5");
//consumerHelper.Install(C5);
//consumerHelper.SetPrefix("/Warner/6");
//consumerHelper.Install(C6);
//consumerHelper.SetPrefix("/Warner/7");
//consumerHelper.Install(C7);
//consumerHelper.SetPrefix("/Warner/8");
//consumerHelper.Install(C8);
ndn::AppHelper producerHelper("ns3::ndn::Producer");
producerHelper.SetAttribute("PayloadSize", StringValue("1024"));
@@ -260,9 +260,9 @@ namespace ns3
Simulator::Stop(Seconds(60.0));
ndn::L3RateTracer::InstallAll("dsccp4-2-mircc-no-pit-merge-throughput.txt", Seconds(0.1));
ndn::AppDelayTracer::InstallAll("dsccp4-2-mircc-no-pit-merge-delay.txt");
L2RateTracer::InstallAll("dsccp4-2-mircc-no-pit-merge-drop.txt", Seconds(0.1));
ndn::L3RateTracer::InstallAll("mircc-multi-throughput.txt", Seconds(0.1));
ndn::AppDelayTracer::InstallAll("mircc-multi-delay.txt");
L2RateTracer::InstallAll("mircc-multi-drop.txt", Seconds(0.1));
Simulator::Run();
Simulator::Destroy();
@@ -274,4 +274,4 @@ namespace ns3
int main(int argc, char *argv[])
{
return ns3::main(argc, argv);
}
}
+155 -155
View File
@@ -39,238 +39,238 @@ namespace ns3
// consumerHelper.SetAttribute("NumberOfContents", UintegerValue(100000));
// // /C1
// consumerHelper.SetPrefix("/C1");
// consumerHelper.Install("n18");
// consumerHelper.Install("n4");
// consumerHelper.Install("n3");
// consumerHelper.Install("n25");
// consumerHelper.Install("n40");
// consumerHelper.Install("n45");
// consumerHelper.Install("n41");
// consumerHelper.Install("n37");
// // /C2
// consumerHelper.SetPrefix("/C2");
// consumerHelper.Install("n18");
// consumerHelper.Install("n4");
// consumerHelper.Install("n3");
// consumerHelper.Install("n25");
// consumerHelper.Install("n40");
// consumerHelper.Install("n45");
// consumerHelper.Install("n41");
// consumerHelper.Install("n37");
// // /C3
// consumerHelper.SetPrefix("/C3");
// consumerHelper.Install("n18");
// consumerHelper.Install("n4");
// consumerHelper.Install("n3");
// consumerHelper.Install("n25");
// consumerHelper.Install("n40");
// consumerHelper.Install("n45");
// consumerHelper.Install("n41");
// consumerHelper.Install("n37");
// // /C4
// consumerHelper.SetPrefix("/C4");
// consumerHelper.Install("n18");
// consumerHelper.Install("n4");
// consumerHelper.Install("n3");
// consumerHelper.Install("n25");
// consumerHelper.Install("n40");
// consumerHelper.Install("n45");
// consumerHelper.Install("n41");
// consumerHelper.Install("n37");
// // /C5
// consumerHelper.SetPrefix("/C5");
// consumerHelper.Install("n18");
// consumerHelper.Install("n4");
// consumerHelper.Install("n3");
// consumerHelper.Install("n25");
// consumerHelper.Install("n40");
// consumerHelper.Install("n45");
// consumerHelper.Install("n41");
// consumerHelper.Install("n37");
// // /C6
// consumerHelper.SetPrefix("/C6");
// consumerHelper.Install("n18");
// consumerHelper.Install("n4");
// consumerHelper.Install("n3");
// consumerHelper.Install("n25");
// consumerHelper.Install("n40");
// consumerHelper.Install("n45");
// consumerHelper.Install("n41");
// consumerHelper.Install("n37");
// // /C7
// consumerHelper.SetPrefix("/C7");
// consumerHelper.Install("n18");
// consumerHelper.Install("n4");
// consumerHelper.Install("n3");
// consumerHelper.Install("n25");
// consumerHelper.Install("n40");
// consumerHelper.Install("n45");
// consumerHelper.Install("n41");
// consumerHelper.Install("n37");
// // /C8
// consumerHelper.SetPrefix("/C8");
// consumerHelper.Install("n18");
// consumerHelper.Install("n4");
// consumerHelper.Install("n3");
// consumerHelper.Install("n25");
// consumerHelper.Install("n40");
// consumerHelper.Install("n45");
// consumerHelper.Install("n41");
// consumerHelper.Install("n37");
// /C1
consumerHelper.SetPrefix("/C1/1");
consumerHelper.SetPrefix("/C1");
consumerHelper.Install("n18");
consumerHelper.SetPrefix("/C1/2");
consumerHelper.Install("n4");
consumerHelper.SetPrefix("/C1/3");
consumerHelper.Install("n3");
consumerHelper.SetPrefix("/C1/4");
consumerHelper.Install("n25");
consumerHelper.SetPrefix("/C1/5");
consumerHelper.Install("n40");
consumerHelper.SetPrefix("/C1/6");
consumerHelper.Install("n45");
consumerHelper.SetPrefix("/C1/7");
consumerHelper.Install("n41");
consumerHelper.SetPrefix("/C1/8");
consumerHelper.Install("n37");
// /C2
consumerHelper.SetPrefix("/C2/1");
consumerHelper.SetPrefix("/C2");
consumerHelper.Install("n18");
consumerHelper.SetPrefix("/C2/2");
consumerHelper.Install("n4");
consumerHelper.SetPrefix("/C2/3");
consumerHelper.Install("n3");
consumerHelper.SetPrefix("/C2/4");
consumerHelper.Install("n25");
consumerHelper.SetPrefix("/C2/5");
consumerHelper.Install("n40");
consumerHelper.SetPrefix("/C2/6");
consumerHelper.Install("n45");
consumerHelper.SetPrefix("/C2/7");
consumerHelper.Install("n41");
consumerHelper.SetPrefix("/C2/8");
consumerHelper.Install("n37");
// /C3
consumerHelper.SetPrefix("/C3/1");
consumerHelper.SetPrefix("/C3");
consumerHelper.Install("n18");
consumerHelper.SetPrefix("/C3/2");
consumerHelper.Install("n4");
consumerHelper.SetPrefix("/C3/3");
consumerHelper.Install("n3");
consumerHelper.SetPrefix("/C3/4");
consumerHelper.Install("n25");
consumerHelper.SetPrefix("/C3/5");
consumerHelper.Install("n40");
consumerHelper.SetPrefix("/C3/6");
consumerHelper.Install("n45");
consumerHelper.SetPrefix("/C3/7");
consumerHelper.Install("n41");
consumerHelper.SetPrefix("/C3/8");
consumerHelper.Install("n37");
// /C4
consumerHelper.SetPrefix("/C4/1");
consumerHelper.SetPrefix("/C4");
consumerHelper.Install("n18");
consumerHelper.SetPrefix("/C4/2");
consumerHelper.Install("n4");
consumerHelper.SetPrefix("/C4/3");
consumerHelper.Install("n3");
consumerHelper.SetPrefix("/C4/4");
consumerHelper.Install("n25");
consumerHelper.SetPrefix("/C4/5");
consumerHelper.Install("n40");
consumerHelper.SetPrefix("/C4/6");
consumerHelper.Install("n45");
consumerHelper.SetPrefix("/C4/7");
consumerHelper.Install("n41");
consumerHelper.SetPrefix("/C4/8");
consumerHelper.Install("n37");
// /C5
consumerHelper.SetPrefix("/C5/1");
consumerHelper.SetPrefix("/C5");
consumerHelper.Install("n18");
consumerHelper.SetPrefix("/C5/2");
consumerHelper.Install("n4");
consumerHelper.SetPrefix("/C5/3");
consumerHelper.Install("n3");
consumerHelper.SetPrefix("/C5/4");
consumerHelper.Install("n25");
consumerHelper.SetPrefix("/C5/5");
consumerHelper.Install("n40");
consumerHelper.SetPrefix("/C5/6");
consumerHelper.Install("n45");
consumerHelper.SetPrefix("/C5/7");
consumerHelper.Install("n41");
consumerHelper.SetPrefix("/C5/8");
consumerHelper.Install("n37");
// /C6
consumerHelper.SetPrefix("/C6/1");
consumerHelper.SetPrefix("/C6");
consumerHelper.Install("n18");
consumerHelper.SetPrefix("/C6/2");
consumerHelper.Install("n4");
consumerHelper.SetPrefix("/C6/3");
consumerHelper.Install("n3");
consumerHelper.SetPrefix("/C6/4");
consumerHelper.Install("n25");
consumerHelper.SetPrefix("/C6/5");
consumerHelper.Install("n40");
consumerHelper.SetPrefix("/C6/6");
consumerHelper.Install("n45");
consumerHelper.SetPrefix("/C6/7");
consumerHelper.Install("n41");
consumerHelper.SetPrefix("/C6/8");
consumerHelper.Install("n37");
// /C7
consumerHelper.SetPrefix("/C7/1");
consumerHelper.SetPrefix("/C7");
consumerHelper.Install("n18");
consumerHelper.SetPrefix("/C7/2");
consumerHelper.Install("n4");
consumerHelper.SetPrefix("/C7/3");
consumerHelper.Install("n3");
consumerHelper.SetPrefix("/C7/4");
consumerHelper.Install("n25");
consumerHelper.SetPrefix("/C7/5");
consumerHelper.Install("n40");
consumerHelper.SetPrefix("/C7/6");
consumerHelper.Install("n45");
consumerHelper.SetPrefix("/C7/7");
consumerHelper.Install("n41");
consumerHelper.SetPrefix("/C7/8");
consumerHelper.Install("n37");
// /C8
consumerHelper.SetPrefix("/C8/1");
consumerHelper.SetPrefix("/C8");
consumerHelper.Install("n18");
consumerHelper.SetPrefix("/C8/2");
consumerHelper.Install("n4");
consumerHelper.SetPrefix("/C8/3");
consumerHelper.Install("n3");
consumerHelper.SetPrefix("/C8/4");
consumerHelper.Install("n25");
consumerHelper.SetPrefix("/C8/5");
consumerHelper.Install("n40");
consumerHelper.SetPrefix("/C8/6");
consumerHelper.Install("n45");
consumerHelper.SetPrefix("/C8/7");
consumerHelper.Install("n41");
consumerHelper.SetPrefix("/C8/8");
consumerHelper.Install("n37");
//// /C1
//consumerHelper.SetPrefix("/C1/1");
//consumerHelper.Install("n18");
//consumerHelper.SetPrefix("/C1/2");
//consumerHelper.Install("n4");
//consumerHelper.SetPrefix("/C1/3");
//consumerHelper.Install("n3");
//consumerHelper.SetPrefix("/C1/4");
//consumerHelper.Install("n25");
//consumerHelper.SetPrefix("/C1/5");
//consumerHelper.Install("n40");
//consumerHelper.SetPrefix("/C1/6");
//consumerHelper.Install("n45");
//consumerHelper.SetPrefix("/C1/7");
//consumerHelper.Install("n41");
//consumerHelper.SetPrefix("/C1/8");
//consumerHelper.Install("n37");
//// /C2
//consumerHelper.SetPrefix("/C2/1");
//consumerHelper.Install("n18");
//consumerHelper.SetPrefix("/C2/2");
//consumerHelper.Install("n4");
//consumerHelper.SetPrefix("/C2/3");
//consumerHelper.Install("n3");
//consumerHelper.SetPrefix("/C2/4");
//consumerHelper.Install("n25");
//consumerHelper.SetPrefix("/C2/5");
//consumerHelper.Install("n40");
//consumerHelper.SetPrefix("/C2/6");
//consumerHelper.Install("n45");
//consumerHelper.SetPrefix("/C2/7");
//consumerHelper.Install("n41");
//consumerHelper.SetPrefix("/C2/8");
//consumerHelper.Install("n37");
//// /C3
//consumerHelper.SetPrefix("/C3/1");
//consumerHelper.Install("n18");
//consumerHelper.SetPrefix("/C3/2");
//consumerHelper.Install("n4");
//consumerHelper.SetPrefix("/C3/3");
//consumerHelper.Install("n3");
//consumerHelper.SetPrefix("/C3/4");
//consumerHelper.Install("n25");
//consumerHelper.SetPrefix("/C3/5");
//consumerHelper.Install("n40");
//consumerHelper.SetPrefix("/C3/6");
//consumerHelper.Install("n45");
//consumerHelper.SetPrefix("/C3/7");
//consumerHelper.Install("n41");
//consumerHelper.SetPrefix("/C3/8");
//consumerHelper.Install("n37");
//// /C4
//consumerHelper.SetPrefix("/C4/1");
//consumerHelper.Install("n18");
//consumerHelper.SetPrefix("/C4/2");
//consumerHelper.Install("n4");
//consumerHelper.SetPrefix("/C4/3");
//consumerHelper.Install("n3");
//consumerHelper.SetPrefix("/C4/4");
//consumerHelper.Install("n25");
//consumerHelper.SetPrefix("/C4/5");
//consumerHelper.Install("n40");
//consumerHelper.SetPrefix("/C4/6");
//consumerHelper.Install("n45");
//consumerHelper.SetPrefix("/C4/7");
//consumerHelper.Install("n41");
//consumerHelper.SetPrefix("/C4/8");
//consumerHelper.Install("n37");
//// /C5
//consumerHelper.SetPrefix("/C5/1");
//consumerHelper.Install("n18");
//consumerHelper.SetPrefix("/C5/2");
//consumerHelper.Install("n4");
//consumerHelper.SetPrefix("/C5/3");
//consumerHelper.Install("n3");
//consumerHelper.SetPrefix("/C5/4");
//consumerHelper.Install("n25");
//consumerHelper.SetPrefix("/C5/5");
//consumerHelper.Install("n40");
//consumerHelper.SetPrefix("/C5/6");
//consumerHelper.Install("n45");
//consumerHelper.SetPrefix("/C5/7");
//consumerHelper.Install("n41");
//consumerHelper.SetPrefix("/C5/8");
//consumerHelper.Install("n37");
//// /C6
//consumerHelper.SetPrefix("/C6/1");
//consumerHelper.Install("n18");
//consumerHelper.SetPrefix("/C6/2");
//consumerHelper.Install("n4");
//consumerHelper.SetPrefix("/C6/3");
//consumerHelper.Install("n3");
//consumerHelper.SetPrefix("/C6/4");
//consumerHelper.Install("n25");
//consumerHelper.SetPrefix("/C6/5");
//consumerHelper.Install("n40");
//consumerHelper.SetPrefix("/C6/6");
//consumerHelper.Install("n45");
//consumerHelper.SetPrefix("/C6/7");
//consumerHelper.Install("n41");
//consumerHelper.SetPrefix("/C6/8");
//consumerHelper.Install("n37");
//// /C7
//consumerHelper.SetPrefix("/C7/1");
//consumerHelper.Install("n18");
//consumerHelper.SetPrefix("/C7/2");
//consumerHelper.Install("n4");
//consumerHelper.SetPrefix("/C7/3");
//consumerHelper.Install("n3");
//consumerHelper.SetPrefix("/C7/4");
//consumerHelper.Install("n25");
//consumerHelper.SetPrefix("/C7/5");
//consumerHelper.Install("n40");
//consumerHelper.SetPrefix("/C7/6");
//consumerHelper.Install("n45");
//consumerHelper.SetPrefix("/C7/7");
//consumerHelper.Install("n41");
//consumerHelper.SetPrefix("/C7/8");
//consumerHelper.Install("n37");
//// /C8
//consumerHelper.SetPrefix("/C8/1");
//consumerHelper.Install("n18");
//consumerHelper.SetPrefix("/C8/2");
//consumerHelper.Install("n4");
//consumerHelper.SetPrefix("/C8/3");
//consumerHelper.Install("n3");
//consumerHelper.SetPrefix("/C8/4");
//consumerHelper.Install("n25");
//consumerHelper.SetPrefix("/C8/5");
//consumerHelper.Install("n40");
//consumerHelper.SetPrefix("/C8/6");
//consumerHelper.Install("n45");
//consumerHelper.SetPrefix("/C8/7");
//consumerHelper.Install("n41");
//consumerHelper.SetPrefix("/C8/8");
//consumerHelper.Install("n37");
ndn::AppHelper producerHelper("ns3::ndn::Producer");
producerHelper.SetAttribute("PayloadSize", StringValue("1024"));
@@ -965,9 +965,9 @@ namespace ns3
Simulator::Stop(Seconds(120.0));
ndn::L3RateTracer::InstallAll("dsccp5_throughput-0.1.txt", Seconds(0.1));
ndn::AppDelayTracer::InstallAll("dsccp5_delay-0.1.txt");
L2RateTracer::InstallAll("dsccp5_drop-0.1.txt", Seconds(0.1));
ndn::L3RateTracer::InstallAll("mircc-throughput.txt", Seconds(0.1));
ndn::AppDelayTracer::InstallAll("mircc-delay.txt");
L2RateTracer::InstallAll("mircc-drop.txt", Seconds(0.1));
Simulator::Run();
Simulator::Destroy();
+36
View File
@@ -0,0 +1,36 @@
router
# node comment yPos xPos
R1 NA 5 3
R2 NA 5 5
R4 NA 5 7
R6 NA 5 9
C1 NA 7 1
C2 NA 5 1
C3 NA 3 1
P1 NA 8 11
P2 NA 6 11
P3 NA 4 11
P4 NA 2 11
R3 NA 7 8
R5 NA 3 8
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
R6 P1 100Mbps 1 10ms 20
R6 P2 100Mbps 1 10ms 20
R6 P3 100Mbps 1 10ms 20
R6 P4 100Mbps 1 10ms 20
R1 R2 20Mbps 1 10ms 20
R2 R3 1Mbps 1 10ms 20
R5 R6 7Mbps 1 10ms 20
R4 R3 6Mbps 1 5ms 20
R4 R5 2Mbps 1 5ms 20
R2 R5 5Mbps 1 10ms 20
R2 R4 8Mbps 1 5ms 20
R3 R6 7Mbps 1 10ms 20
+36
View File
@@ -0,0 +1,36 @@
router
# node comment yPos xPos
R1 NA 5 3
R2 NA 5 5
R4 NA 5 7
R6 NA 5 9
C1 NA 7 1
C2 NA 5 1
C3 NA 3 1
P1 NA 8 11
P2 NA 6 11
P3 NA 4 11
P4 NA 2 11
R3 NA 7 8
R5 NA 3 8
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
R6 P1 100Mbps 1 10ms 20
R6 P2 100Mbps 1 10ms 20
R6 P3 100Mbps 1 10ms 20
R6 P4 100Mbps 1 10ms 20
R2 R4 7Mbps 1 5ms 20
R1 R2 40Mbps 1 10ms 20
R2 R3 4Mbps 1 10ms 20
R4 R3 10Mbps 1 5ms 20
R4 R5 2Mbps 1 5ms 20
R2 R5 16Mbps 1 10ms 20
R3 R6 14Mbps 1 10ms 20
R5 R6 18Mbps 1 10ms 20
+9 -8
View File
@@ -25,11 +25,12 @@ R6 P1 100Mbps 1 10ms 20
R6 P2 100Mbps 1 10ms 20
R6 P3 100Mbps 1 10ms 20
R6 P4 100Mbps 1 10ms 20
R1 R2 8Mbps 1 10ms 20
R2 R3 1Mbps 1 10ms 20
R4 R3 2Mbps 1 5ms 20
R3 R6 3Mbps 1 10ms 20
R4 R5 3Mbps 1 5ms 20
R2 R4 5Mbps 1 5ms 20
R2 R5 4Mbps 1 10ms 20
R5 R6 7Mbps 1 10ms 20
R1 R2 20Mbps 1 10ms 20
R2 R3 2Mbps 1 10ms 20
R4 R3 3Mbps 1 5ms 20
R3 R6 5Mbps 1 10ms 20
R4 R5 4Mbps 1 5ms 20
R2 R4 7Mbps 1 5ms 20
R2 R5 5Mbps 1 10ms 20
R5 R6 9Mbps 1 10ms 20
+9 -8
View File
@@ -25,11 +25,12 @@ R6 P1 100Mbps 1 10ms 20
R6 P2 100Mbps 1 10ms 20
R6 P3 100Mbps 1 10ms 20
R6 P4 100Mbps 1 10ms 20
R1 R2 8Mbps 1 10ms 20
R5 R6 5Mbps 1 10ms 20
R2 R3 2.5Mbps 1 10ms 20
R2 R4 5Mbps 1 10ms 20
R3 R6 5Mbps 1 5ms 20
R4 R3 2.5Mbps 1 5ms 20
R4 R5 2.5Mbps 1 5ms 20
R2 R5 2.5Mbps 1 20ms 20
R1 R2 20Mbps 1 10ms 20
R2 R3 3.5Mbps 1 10ms 20
R2 R4 7Mbps 1 10ms 20
R2 R5 3.5Mbps 1 20ms 20
R4 R3 3.5Mbps 1 5ms 20
R4 R5 3.5Mbps 1 5ms 20
R3 R6 7Mbps 1 5ms 20
R5 R6 7Mbps 1 10ms 20