Name | Description |
---|---|
SubHost (compound module) |
The Subscriber Host |
// // 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/>. // package pubsub_sim; import pubsub_sim.LinkMon.LinkMon; import pubsub_sim.PSetherApp.SEtherApp; import pubsub_sim.EthernetInterfaceThrMtr; import pubsub_sim.ForwTable.FwTable; import inet.base.NotificationBoard; import inet.networklayer.common.InterfaceTable; // // <b> The Subscriber Host </b> // // This is the subscriber host for the publish subscribe simulation. This host only // has a MAC and an application layer. No IP or other network layer protocol // is involved. Multiple application can be used, but each will use a different // ethernet interface, therefore, it will be characterized by a different FID. // This host is only capable of subscribing to Information Items, and receives // packets which are afterwards treated as in a sink.The InterfaceTable, the // FwTable and the NotificationBoard modules are present in order for the LinkMon // module to access the necessary information, needed by the TM. // // // @see SEtherApp, PEtherApp, EthernetInterface2 // // @author Nikolaos Vastardis // module SubHost { parameters: @node(); @labels(node,ethernet-node); @display("i=device/pc2;bgb=455,313"); gates: inout ethg[] @labels(EtherFrame-conn); submodules: notificationBoard: NotificationBoard { parameters: @display("p=77,56"); } interfaceTable: InterfaceTable { parameters: @display("p=224,56"); } fwTable: FwTable { @display("p=383,56"); } linkMon: LinkMon { @display("p=77,171"); } sub[sizeof(ethg)]: SEtherApp { parameters: @display("p=224,165,col"); gates: ifIn[1]; ifOut[1]; } eth[sizeof(ethg)]: EthernetInterfaceThrMtr { parameters: @display("p=224,256,row;q=l2queue"); } connections allowunconnected: for i=0..sizeof(ethg)-1 { ethg[i] <--> eth[i].phys; eth[i].netwOut --> sub[i].ifIn[0]; eth[i].netwIn <-- sub[i].ifOut[0]; } }