File Overlay/Broose/Broose.ned

Contains:

//
// Copyright (C) 2007 Institut fuer Telematik, Universitaet Karlsruhe (TH)
//
// 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.
//

//
// The main module of the Broose implementation
//
// @author Jochen Schenk
//
simple Broose
    parameters:
        keyLength : numeric,    // overlay key length	
        localPort: numeric,    // port on which the node is listening
        debugOutput: bool,    // write debug information?
        iterativeLookup : bool,    // do iterative instead of recursive lookups
        collectPerHopDelay : bool,    // delay statistics for single hops
        joinOnApplicationRequest : bool,    // only join the overlay on application request
        useCommonAPIforward : bool,    // enable CommonAPI forward() calls
        useNextHopRpc : bool,            // use RPCs for route messages

        lookupRedundantNodes : numeric,    // number of next hops in each step
        lookupParallelPaths : numeric,    // number of parallel paths
        lookupParallelRpcs : numeric,    // number of nodes to ask in parallel
        lookupSecure : bool,    // true, if all nodes should be identified with a ping
        lookupMerge : bool,    // true, if parallel Rpc results should be merged
        lookupFailedNodeRpcs : bool,    // communicate failed Nodes

        hopCountMax: numeric,    // maximum hops for a lookup
        measureNetwInitPhase: bool,    // if true, some statistics are collected in init phase, too
        drawOverlayTopology: bool,    // draw arrow to successor node?
        bucketSize: numeric,    // number of nodes a bucket contains
        rBucketSize: numeric,    // number of nodes a right-bucket contains
        joinDelay: numeric,    // time to wait to join the overlay after simulation start 
        shiftingBits: numeric,    // number of bits shifted in/out each step
        userDist: numeric,    // number of hops that are added to the estimated hop count
        refreshTime: numeric,    // time interval between two pings
        pingDelay: numeric,    // time interval between bucket refreshs
        numberRetries: numeric,    // number of retries in case of timeout
        parallelRequests: numeric;    // number ob parallel requests

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

//
// This modul contains the buckets of the Broose implementation.
//
// @author Jochen Schenk
//
simple BrooseBucket
endsimple

//
// Implementation of the Broose overlay as described in
// "Broose: A Practical Distributed Hashtable based on the
// De-Bruijn Topology" by A. Gai and L. Viennot, published in
// "Technical report, INRIA, june 2004"
//
// @author Jochen Schenk
//
module BrooseModules

    parameters:
        keyLength: numeric,    // the length of overlay keys
        localPort: numeric,    // port on which the node is listening
        debugOutput: bool,    // debug output yes or no
        iterativeLookup : bool,    // do iterative instead of recursive lookups
        useCommonAPIforward : bool,    // enable CommonAPI forward() calls
        joinOnApplicationRequest : bool,    // only join the overlay on application request

        lookupRedundantNodes : numeric,    // number of next hops in each step
        lookupParallelPaths : numeric,    // number of parallel paths
        lookupParallelRpcs : numeric,     // number of nodes to ask in parallel
        lookupSecure : bool,    // true, if all nodes should be identified with a ping
        lookupMerge : bool,    // true, if parallel Rpc results should be merged
        lookupFailedNodeRpcs : bool,    // communicate failed Nodes

        shiftingBits : numeric,    // number of bits shifted in/out each step

        useNextHopRpc : bool,            // use RPCs for route messages
        hopCountMax: numeric,    // maximum hop count for a lookup
        measureNetwInitPhase: bool,    // if true, some statistics are collected in init phase, too
        collectPerHopDelay : bool,    // delay statistics for single hops
        drawOverlayTopology: bool;    // draw arrow to successor node?

    gates:
        in: from_udp;    // gate from the UDP layer
        out: to_udp;    // gate to the UDP layer
        in: from_app;    // gate from the application
        out: to_app;    // gate to the application
    submodules:
        rBucket : BrooseBucket[2^shiftingBits];
            display: "i=block/table";
        lBucket : BrooseBucket;
            display: "p=360,60;i=block/table";
        bBucket : BrooseBucket;
            display: "p=420,60;i=block/table";

        broose: Broose;
            parameters: 
                keyLength = keyLength,    // the length of overlay keys
                localPort = localPort,    // port on which the node is listening
                debugOutput = debugOutput,    // debug output yes or no
                iterativeLookup = iterativeLookup,    // do iterative instead of recursive lookups
                useCommonAPIforward = useCommonAPIforward,    // enable CommonAPI forward() calls
                joinOnApplicationRequest = joinOnApplicationRequest,    // only join the overlay on application request
                shiftingBits = shiftingBits,    // number of bits shifted in/out each step
                lookupRedundantNodes = lookupRedundantNodes,    // number of next hops in each step
                lookupParallelPaths = lookupParallelPaths,    // number of parallel paths
                lookupParallelRpcs = lookupParallelRpcs,     // number of nodes to ask in parallel
                lookupSecure = lookupSecure,    // true, if all nodes should be identified with a ping
                lookupMerge = lookupMerge,    // true, if parallel Rpc results should be merged
                lookupFailedNodeRpcs = lookupFailedNodeRpcs,    // communicate failed Nodes
                hopCountMax = hopCountMax,    // maximum hop count for a lookup
                measureNetwInitPhase = measureNetwInitPhase,    // if true, some statistics are collected in init phase, too
                collectPerHopDelay = collectPerHopDelay,    // delay statistics for single hops
                useNextHopRpc = useNextHopRpc,            // use RPCs for route messages
                drawOverlayTopology = drawOverlayTopology;    // draw arrow to successor node?
            display: "p=60,60;i=block/circle";

    connections nocheck:
        from_udp --> broose.from_udp++;
        to_udp <-- broose.to_udp++;
        from_app --> broose.from_app;
        to_app <-- broose.to_app;

endmodule