Name | Description |
---|---|
ICN_Network (network) |
The ICN Simulation Ground |
// // Copyright (C) 2011 Nikolaos Vastardis; University of Essex, Colchester // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public License // along with this program; if not, see <http://www.gnu.org/licenses/>. // import inet.nodes.inet.StandardHostWithDLThruputMeter; import pubsub_sim.TM.TMBoost; import pubsub_sim.IITable.IITable; import inet.nodes.inet.BurstHost; import inet.applications.udpapp.UDPSink; import inet.applications.generic.IPTrafSink; import inet.base.Sink; import inet.world.ChannelControl; import pubsub_sim.PSRouter; import pubsub_sim.PubHost; import pubsub_sim.SubHost; import inet.nodes.inet.Router; import inet.nodes.inet.ExtRouter; import inet.nodes.ethernet.EtherHost2; import inet.nodes.inet.StandardHost; import inet.nodes.ethernet.EtherHost; import inet.nodes.adhoc.MFMobileHost; import pubsub_sim.TM.TMInterface; // // <b> The ICN Simulation Ground </b> // // This simulation ground implements a publish subscribe network. The main // component is the PSRouter, which forwards the published messages towards // the proper destination. All the pub-sub functionality is incorporated // inside the Topology Manager. The general topology is created in the // initialization phase and it is random, according to the random seeds // given in the ini file of the simulation. // // @see PSRouter, PubHost, SubHost, TMInterface, IITable // // @author Nikolaos Vastardis // network ICN_Network { parameters: int numRouters; int numPubs; int numSubs; double connectedness; //0.0<x<1.0 int Datarate @unit(Mbps); double PubSubProportion = default(0.5); string TopManager = default("TMBoostLA"); bool FP_check = default(false); @display("bgb=756,491;i=old/earth1"); types: channel G extends ned.DatarateChannel { datarate = 1Gbps; } channel E extends ned.DatarateChannel { datarate = 10Mbps; delay = 450us; } submodules: psRouter[numRouters]: PSRouter; Publisher[numPubs]: PubHost; Subscriber[numSubs]: SubHost; iiTable: IITable { @display("p=31,373"); } tm: <TopManager> like TMInterface { @display("p=31,304"); } connections allowunconnected: for i=0..numRouters-1, for j=0..numRouters-1, if i<j && (j==i+1 || uniform(0,1) < connectedness) { psRouter[i].ethg++ <--> E <--> psRouter[j].ethg++; } for i=0..numPubs-1 { psRouter[intuniform(0,numRouters-1)].ethg++ <--> G <--> Publisher[i].ethg++; } for i=0..numSubs-1 { psRouter[intuniform(0,numRouters-1)].ethg++ <--> G <--> Subscriber[i].ethg++; } }