OMNeT 例程 Tictoc18 学习笔记

网络的拓扑结构是哑铃形的,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 的增加,到达的数据包的平均数量多项式地减少,网络变大。

  • 1
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值