File Underlay/SimpleUnderlay/SimpleOverlayHost.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",
    "Tiers",
    "SimpleUDP";

//
// Host in the simple network that participates in the overlay
//
// @author Stephan Krause, Bernhard Heep
//
module SimpleOverlayHost
    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
        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

    submodules:
        notificationBoard: NotificationBoard;
            display: "p=212,296;i=block/control";
        tier3: tier3Type like Tier;
            display: "p=64,64;i=block/segm";
        tier2: tier2Type like Tier;
            display: "p=179,104;i=block/segm";
        tier1: tier1Type like Tier;
            display: "p=290,162;i=block/segm";
        overlay: overlayType 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";

    connections nocheck:
        tier1.to_lowerTier --> overlay.from_app if numTiers > 0;
        tier1.from_lowerTier <-- overlay.to_app if numTiers > 0;
        tier1.to_udp --> udp.from_app++ if numTiers > 0;
        udp.to_app++ --> tier1.from_udp if numTiers > 0;

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

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

        overlay.to_udp --> udp.from_app++;
        overlay.from_udp <-- udp.to_app++;

    display: "b=433,386";
endmodule