File Overlay/Gia/Gia.ned

Contains:

//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU 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 General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
//

// @file Gia.ned
// @author Robert Palmer, Bernhard Heep

// The main module of the GIA implementation
// @author Robert Palmer
simple Gia
    parameters:
        localPort : numeric,               // local UDP Port for overlay
        debugOutput : bool,                // output debug messages?
        maxNeighbors : numeric,            // maximum number of neighbors
        minNeighbors : numeric,            // minimum number of neighbors
        maxTopAdaptionInterval : numeric,  // maximum topology adaption interval
        topAdaptionAggressiveness : numeric, // topology adaption aggressiveness
        maxLevelOfSatisfaction : numeric,  // maximum level of satisfaction
        maxHopCount : numeric,             // maximum TTL for sent messages
        messageTimeout : numeric,          // message timeout
        neighborTimeout : numeric,         // neighbor timeout
        sendTokenTimeout : numeric,        // token timeout
        tokenWaitTime : numeric,           // delay when sending new token
        // delay when sending new key list to our neighbors
        keyListDelay : numeric,            
        updateDelay : numeric,             // delay between two update messages
        outputNodeDetails : bool,          // output node details
        optimizeReversePath : bool,        // use optimized reverse path?
        // do iterative instead of recursive lookups
        iterativeLookup : bool,            
        useCommonAPIforward : bool,        // enable CommonAPI forward() calls
        useNextHopRpc : bool,              // use RPCs for route messages
        collectPerHopDelay : bool,         // delay statistics for single hops
        // only join the overlay on application request
        joinOnApplicationRequest : bool,   
        lookupRedundantNodes : numeric,    // number of next hops in each step
        lookupParallelPaths : numeric,     // number of parallel paths
        lookupParallelRpcs : numeric,      // number of nodes to ask in parallel
        // true, if all nodes should be identified with a ping
        lookupSecure : bool,               
        // true, if parallel Rpc results should be merged
        lookupMerge : bool,                
        lookupFailedNodeRpcs : bool,       // communicate failed nodes
        measureNetwInitPhase : bool,       // gather stats when bootstrapping
        hopCountMax : numeric,             // maximum number of overlay hops
        drawOverlayTopology : numeric,     // draw arrow to successor node?
        keyLength : numeric;               // overlay key length in bits

    gates:
        in: from_udp[]; // gate from UDP
        out: to_udp[];  // gate to UDP
        in: from_app;   // gate from application
        out: to_app;    // gate to application
        in: direct_in;  // gate for sendDirect
endsimple

//
// Module which handles all current neighbors of the node. Contains capacity,
// connection degree, sent and received token count and the keylist of all
// neighbors
// @author Robert Palmer
simple GiaNeighbors
endsimple

//
// Module for visualizing the keylist
// @author Robert Palmer
simple GiaKeyListModule
endsimple

//
// Module for sending new tokens to direct neighbors
// @author Robert Palmer
simple GiaTokenFactory
endsimple

//
// Implementation of the Gia overlay as described in
// "Making Gnutella-like P2P Systems Scalable"
// by Yatin Chawathe, Sylvia Ratnasamy, Lee Breslau, Nick Lanham
// and Scott Shenker, published in "In Proc. ACM SIGCOMM (Aug. 2003)".
// @author Robert Palmer
//
module GiaModules

     parameters:
        localPort : numeric,             // local UDP-Port
        debugOutput : bool,              // use debug-output?
        // only join the overlay on application request
        joinOnApplicationRequest : bool, 
        lookupRedundantNodes : numeric,  // number of next hops in each step
        lookupParallelPaths : numeric,   // number of parallel paths
        lookupParallelRpcs : numeric,    // number of nodes to ask in parallel
        // true, if all nodes should be identified with a ping
        lookupSecure : bool,             
        // true, if parallel Rpc results should be merged
        lookupMerge : bool,              
        lookupFailedNodeRpcs : bool,     // communicate failed nodes
        useCommonAPIforward : bool,      // enable CommonAPI forward() calls
        iterativeLookup : bool,            
        collectPerHopDelay : bool,       // delay statistics for single hops
        useNextHopRpc : bool,            // use RPCs for route messages
        measureNetwInitPhase : bool,     // gather statistics when bootstrapping
        drawOverlayTopology : numeric,   // draw arrow to successor node?
        hopCountMax : numeric,           // maximum number of overlay hops
        keyLength : numeric;             // overlay key length in bits

    gates:
        in: from_udp;  // gate from UDP
        out: to_udp;   // gate to UDP
        in: from_app;  // gate from application
        out: to_app;   // gate to application

    submodules:
        gia: Gia;                          // gia main module
            parameters: 
                localPort = localPort,     // local UDP-Port
                debugOutput = debugOutput, // use debug output?
                // gather statistics when bootstrapping
                measureNetwInitPhase = measureNetwInitPhase,
                useCommonAPIforward = useCommonAPIforward,
                iterativeLookup = iterativeLookup,
                collectPerHopDelay = collectPerHopDelay,
                useNextHopRpc = useNextHopRpc,
                // only join the overlay on application request
                joinOnApplicationRequest = joinOnApplicationRequest,
                // number of next hops in each step
                lookupRedundantNodes = lookupRedundantNodes,      
                // number of parallel paths  
                lookupParallelPaths = lookupParallelPaths,         
                // number of nodes to ask in parallel 
                lookupParallelRpcs = lookupParallelRpcs,            
                // true, if all nodes should be identified with a ping
                lookupSecure = lookupSecure,                        
                // true, if parallel Rpc results should be merged
                lookupMerge = lookupMerge,                          
                // communicate failed nodes
                lookupFailedNodeRpcs = lookupFailedNodeRpcs,        

                // maximum number of overlay hops
                hopCountMax = hopCountMax,      
                // draw arrow to successor node?
                drawOverlayTopology = drawOverlayTopology,    
                // overlay key length in bits      
                keyLength = keyLength;                              

            display: "p=60,60;i=block/circle";  // display icon
        keyListModule: GiaKeyListModule;        // KeyList-Module
            display: "p=150,60;i=block/table";  // display icon
        neighbors: GiaNeighbors;                // Neigbors-Module
            display: "p=240,60;i=block/table";  // display icon
        tokenFactory: GiaTokenFactory;          // TokenFactory-Module
            display: "p=330,60;i=block/table";  // display icon
    connections nocheck:
        from_udp --> gia.from_udp++; // connect from_udp with gia.from_udp
        to_udp <-- gia.to_udp++;     // connect to_upd with gia.to_udp
        from_app --> gia.from_app;   // connect from_app with gia.from_app
        to_app <-- gia.to_app;       // connect to_app with gia.to_app

endmodule