• 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];

        }

    }

        

  • 相关阅读:
    NEC的学习笔记
    MVC过滤器中获取实体类属性值
    Facebook Hack 语言 简介
    6.格式化输出(转)
    ProcessBuilder 和 Runtime(转)
    JAVA I/O使用方法(转)
    java中输出流OutputStream 类应用实例(转)
    InputStream、OutputStream、String的相互转换(转)
    海茶3 らぶデス3 入门经典教程
    天将降大任于斯人也,必先苦其心志,劳其筋骨,饿其体肤,空乏其身,行拂乱其所为,所以动心忍性,增益其所不能
  • 原文地址:https://www.cnblogs.com/Duxue/p/13776537.html
Copyright © 2020-2023  润新知