zoukankan      html  css  js  c++  java
  • OMNeT++网络节点的定义

    一、网络

    network Network

      {

        submodules:

          node1:Node;

          node2:Node;

          node3:Node;

        ……

        connection:

          node1.port++<-->{datarate+100Mbps;}<-->node2.port++;

          node2.port++<-->{datarate+100Mbps;}<-->node4.port++;

          node4.port++<-->{datarate+100Mbps;}<-->node6.port++;

          ……

      }

    二、引入信道

    network Network

      {

        type:

          channel C extends ned.DatarateChannel{

          datarate = 100Mbps;

        }

       submodules:

        node1:Node;

        node2:Node;

        node3:Node;

        ……

        connection:

          node1.port++<-->C<-->node2.port++;

          node2.port++<-->C<-->node4.port++;

          node4.port++<-->C<-->node6.port++;

          ……

      }

     三、App、Routing和Queue简单模块

    将节点看作复合模块,其中包含产生流量的基本模块(App),选路的基本模块(Routing)和一个用于给等候发送的包进行排队的基本模块(Queue)。

    simple App

      {

        parameters:

          int destAddress;

          ……

          @display("i=block/browser");

        gates:

          input in;

          output out;

      }

    simple Routing

      {

        ……

      }

    simple Queue

      {

        ……

      }

    四、节点复合模块

    module Node

    {

      parameters:

        @display("i=mmisc/node_vs,gold");

      gates:

        inout port[];

      submodules:

        app:App;

        routing:Routing;

        queue[sizeof(port)]:Queue;

      connections:

        routing.localOut-->queue[i].in;

        routing.localIn<--app.out;

        for i-0..sizeof(port)-1{

          routing.out[i]-->queue[i].in;

          routing.in[i]<--queue[i].out;

          queue[i].line<-->port[i];

        }

    }

        

  • 相关阅读:
    【常用】source insight常用设置及快捷键
    【Linux学习】配置环境:实现【VirtualBox + ubuntu】+【开启ssh服务】+【putty远程连接到虚拟机】
    javascript:区别浏览器
    linux 之centos6.3 安装中文输入法
    前端优化(静态资源)
    javascript 学习心得!
    编程总结
    2019年春季学期第二周作业
    HTTP could not register URL http://+:8000/testservice/. Your process does not have access rights to this namespace 解决方案
    [原]ASP.NET MVC 3 Razor + jqGrid 示例
  • 原文地址:https://www.cnblogs.com/Duxue/p/13776537.html
Copyright © 2011-2022 走看看