NED File src/PSetherApp/PEtherApp.ned

Name Description
PEtherApp (simple module)

The Ethernet Publisher Application

Source code:

//
// 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.PSetherApp;
import pubsub_sim.PSetherApp.BasePSApp;


//
// <b> The Ethernet Publisher Application </b>
//
// This publisher application needed in every publisher node in a publish
// subscribe network. It works just over the MAC layer, and this is why it
// is necessary to implement MAC encapsulation. This module extends the 
// BasePSApp module and adds the necessary functionality. For instance, 
// it is able only to publish new or existing Information Items, kept in 
// the Information item table.
//
// @see BasePSApp
//
// @author Nikolaos Vastardis
//
simple PEtherApp extends BasePSApp
{
    parameters:
        @class(PEtherApp);
        string destAddress = default("FF:FF:FF:FF:FF:FF");  	// destination MAC address, preferably broadcast
        double startTime @unit("s") = default(this.waitTime);	// time of sending the first request
        double pubInterval @unit("s") = default(10s);  			// time interval of making a new publication
        volatile double waitInterval @unit("s") = default(uniform(0s,1s));  // interval between sending requests
        volatile int reqLength @unit(B) = default(100B);  		// length of request packets
        volatile int respLength @unit(B) = default(1KB);  		// length of response packets
        volatile int fileSize @unit(Mb) = default(20Mb);		// the max size of the published files
        @display("i=block/app");
}