网络的拓扑结构是哑铃形的,NED 文件如下:
simple Txc18 extends Txc16
{
}
network TicToc18
{
parameters:
int numCentralNodes = default(2);
types:
channel Channel extends ned.DelayChannel {
delay = 100ms;
}
submodules:
tic[numCentralNodes+4]: Txc18;
connections:
// connect the 2 nodes in one side to the central nodes
tic[0].gate++ <--> Channel <--> tic[2].gate++;
tic[1].gate++ <--> Channel <--> tic[2].gate++;
// connect the central nodes together
for i=2..numCentralNodes+1 {
tic[i].gate++ <--> Channel <--> tic[i+1].gate++;
}
// connect the 2 nodes on the other side to the central nodes
tic[numCentralNodes+2].gate++ <--> Channel <--> tic[numCentralNodes+1].gate++;
tic[numCentralNodes+3].gate++ <--> Channel <--> tic[numCentralNodes+1].gate++;
INI 文件中:
*.numCentralNodes = ${N=2..100 step 2}
指定中心节点的数量 N 从 2 到 100,步长为 2,产生 50 次仿真。
repeat = 4
每次仿真执行 4 次,每次都使用不同的 RNG 种子值。这就产生了更多的样本,可以取平均值。随着重复次数的增加,结果将逐渐向期望值收敛。
可以得到平均跳数和中心节点数 N,数据包的平均数量和中心节点数 N的关系。N 越大,平均跳数越大;数据包的平均数量 Y 轴是对数的,随着 N 的增加,到达的数据包的平均数量多项式地减少,网络变大。