File Underlay/SimpleUnderlay/SimpleMultiOverlayHost.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.
//


import
    "NotificationBoard",
    "InterfaceTable",
    "Overlay",
    "BootstrapList",
    "Tiers",
    "SimpleUDP",
    "NeighborCache";

//
// Host in the simple network that participates in the overlay
//
// @author Stephan Krause, Bernhard Heep
//
module SimpleMultiOverlayHost
    parameters:
        IPForward: bool, // ?
        overlayType: string, // overlay protocol compound module to use
        tier1Type : string, // tier 1 application to use
        tier2Type: string,// tier 2 module to use
        tier3Type: string, // tier 3 module to use
        numTiers: numeric const, // number of tiers
        numOverlayModulesPerNode: numeric const, // number of parallel overlays
        routingFile: string; // ?

    gates:
        in: overlayNeighborArrowIn[]; // incoming gate for visualizing overlay neighborship with connection arrows
        out: overlayNeighborArrowOut[], // incoming gate for visualizing overlay neighborship with connection arrows
             out; // Dummy gate for storing channel informations

    submodules:
        notificationBoard: NotificationBoard;
            display: "p=212,296;i=block/control";
        tier3: tier3Type[numOverlayModulesPerNode] like Tier;
            display: "p=64,64;i=block/segm";
        tier2: tier2Type[numOverlayModulesPerNode] like Tier;
            display: "p=179,104;i=block/segm";
        tier1: tier1Type[numOverlayModulesPerNode] like Tier;
            display: "p=290,162;i=block/segm";
        overlay: overlayType[numOverlayModulesPerNode] like Overlay;
            display: "p=370,216;i=block/network2";
        udp: SimpleUDP;
            display: "p=370,342;i=block/transport";
        interfaceTable: InterfaceTable;
            display: "p=108,294;i=block/table";
        neighborCache: NeighborCache;
            display: "p=76,224;i=block/table";
        bootstrapList: BootstrapList;
            display: "p=168,224;i=block/table";

    connections nocheck:
        bootstrapList.to_udp --> udp.from_app++;
        bootstrapList.from_udp <-- udp.to_app++;
        
        for i=0..numOverlayModulesPerNode-1 do
            tier1[i].to_lowerTier --> overlay[i].from_app if numTiers > 0;
            tier1[i].from_lowerTier <-- overlay[i].to_app if numTiers > 0;
            tier1[i].to_udp --> udp.from_app++ if numTiers > 0;
            udp.to_app++ --> tier1[i].from_udp if numTiers > 0;

            tier2[i].to_lowerTier --> tier1[i].from_upperTier if numTiers > 1;
            tier2[i].from_lowerTier <-- tier1[i].to_upperTier if numTiers > 1;
            tier2[i].to_udp --> udp.from_app++ if numTiers > 1;
            udp.to_app++ --> tier2[i].from_udp if numTiers > 1;

            tier3[i].to_lowerTier --> tier2[i].from_upperTier if numTiers > 2;
            tier3[i].from_lowerTier <-- tier2[i].to_upperTier if numTiers > 2;
            tier3[i].to_udp --> udp.from_app++ if numTiers > 2;
            udp.to_app++ --> tier3[i].from_udp if numTiers > 2;

            overlay[i].to_udp --> udp.from_app++;
            overlay[i].from_udp <-- udp.to_app++;
    
endfor;

    display: "b=433,386";
endmodule