close Warning: BrowserModule failed with ConfigurationError: Look in the Trac log for more information.

Changes between Version 4 and Version 5 of OverSimDevelop


Ignore:
Timestamp:
Aug 15, 2008, 12:16:48 PM (16 years ago)
Author:
heep
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • OverSimDevelop

    v4 v5  
    1919
    2020!OverSim nodes are the equivalent of individual terminals in the simulation environment. Nodes are based on a multi-tiered module hierarchy similar to OSI network layers (e.g. transport, overlay, application). The most used node type is called SimpleOverlayHost, and its tiers are structured as follows:
     21
     22PICTURE MISSING
    2123
    2224The UDP module is an implementation of the transport layer, and is in charge of communication between nodes. Above it is the overlay (KBR) tier, where the overlay module will be located. It communicates with other overlay nodes through the UDP layer, and exposes its services to the application layer above it. On the third tier is the application layer, which uses the services provided by the overlay module. Application modules may also use UDP directly if necessary. Other tiers may be activated above the application if required, these connect to the tier below and to the UDP module.
     
    6870
    6971The user can set custom values for module parameters in the file omnetpp.ini, or in default.ini for general default values, both located in the Simulation folder (see Section 5). Parameters are hierarchic, separated by dots for each layer. For example, setting a parameter for a specific overlay module in a node can be done as follows:
    70 
    71 {{{ SimpleOverlay.overlayTerminal[5].overlay.myParam1 = 1024 }}}
    72 
    73 In this example, we are working with the network SimpleOverlay. From there, we need node number 5, and then its overlay module. For that module, we'll set the parameter myParam1 to 1024.  This case, however, is too specific. We may not always work with the SimpleOverlay network. Or we may need that parameter to be set for all nodes. For those cases the wildcards “*” and “**” are of use. For example:
    74 
    75 {{{ *.overlayTerminal[5].overlay.myParam1 = 1024 }}}[[BR]]
    76 {{{ **.overlay.myParam1 = 1024 }}}
    77 
    78 “*” replaces exactly one step of the hierarchy (or a part of a name), while “**” replaces any number of steps. In the first case, “*” means that the parameter is set for any network (first step). In the second case, “**” means the parameter is set for any network, and any node in it (first and second steps). Wildcards should be used sparingly, since it makes complicated for other users to calculate the scope, and may end up causing unexpected results (including rewriting other parameters).
     72{{{
     73SimpleOverlay.overlayTerminal[5].overlay.myParam1 = 1024
     74}}}
     75
     76In this example, we are working with the network SimpleOverlay. From there, we need node number 5, and then its overlay module. For that module, we'll set the parameter myParam1 to 1024.  This case, however, is too specific. We may not always work with the SimpleOverlay network. Or we may need that parameter to be set for all nodes. For those cases the wildcards * and ** are of use. For example:
     77
     78{{{
     79*.overlayTerminal[5].overlay.myParam1 = 1024
     80**.overlay.myParam1 = 1024
     81}}}
     82
     83* replaces exactly one step of the hierarchy (or a part of a name), while ** replaces any number of steps. In the first case, * means that the parameter is set for any network (first step). In the second case, ** means the parameter is set for any network, and any node in it (first and second steps). Wildcards should be used sparingly, since it makes complicated for other users to calculate the scope, and may end up causing unexpected results (including rewriting other parameters).
    7984
    8085Should a module parameter not be set in either omnetpp.ini or default.ini, or match any wildcard, !OverSim will prompt the user to enter a value for each instance of the module. For simulations with a big amount of nodes, setting each parameter individually quickly becomes overwhelming. Therefore, it is recommended that every module parameter be assigned a default value in default.ini.
     
    8691== 3.1 Important attributes ==
    8792
    88 {{{ cModule *thisTerminal; }}}: Pointer to the overlay module.[[BR]]
    89 {{{ NodeHandle thisNode; }}}: Information about the overlay node (IP address, port and overlay key).[[BR]]
    90 {{{ BootstrapOracle* bootstrapOracle; }}} : Pointer to a database of registered overlay nodes, to be used for bootstrapping.[[BR]]
    91 {{{ NotificationBoard* notificationBoard; }}} : Pointer to the notification board, which is used to generate node events.[[BR]]
     93{{{
     94#!cpp
     95cModule *thisTerminal;
     96}}}
     97Pointer to the overlay module.
     98
     99{{{
     100#!cpp
     101NodeHandle thisNode;
     102}}}
     103Information about the overlay node (IP address, port and overlay key).[[BR]]
     104
     105{{{
     106#!cpp
     107BootstrapOracle* bootstrapOracle;
     108}}}
     109Pointer to a database of registered overlay nodes, to be used for bootstrapping.[[BR]]
     110
     111{{{
     112#!cpp
     113NotificationBoard* notificationBoard;
     114}}}
     115Pointer to the notification board, which is used to generate node events.[[BR]]
    92116
    93117== 3.2 Initialization and finalization ==
     
    96120
    97121{{{
     122#!cpp
    98123void initialize(int stage);
    99124}}}
     
    102127
    103128{{{
     129#!cpp
    104130void initializeOverlay(int stage);
    105131}}}
     
    107133
    108134{{{
     135#!cpp
    109136void join(OverlayKey nodeID);
    110137}}}
     
    112139
    113140{{{
     141#!cpp
    114142void joinOverlay();
    115143}}}
     
    117145
    118146{{{
     147#!cpp
    119148void setOverlayReady(bool ready);
    120149}}}
     
    122151
    123152{{{
     153#!cpp
    124154void finishOverlay();
    125155}}}
     
    131161
    132162{{{
     163#!cpp
    133164sendMessageToUDP(const TransportAddress& dest, BaseOverlayMessage* msg);
    134165}}}
     
    136167
    137168{{{
     169#!cpp
    138170void handleUDPMessage(BaseOverlayMessage* msg);
    139171}}}
     
    141173
    142174{{{
     175#!cpp
    143176void sendMessageToApp(cMessage *msg);
    144177}}}
     
    146179
    147180{{{
     181#!cpp
    148182void handleAppMessage(cMessage* msg);
    149183}}}
     
    156190
    157191{{{
     192#!cpp
    158193void sendToKey(const OverlayKey& key, BaseOverlayMessage* message,
    159194               int numSiblings = 1,
     
    166201
    167202{{{
     203#!cpp
    168204NodeVector* findNode( const OverlayKey& key, int numRedundantNodes, int numSiblings, BaseOverlayMessage* msg = NULL);
    169205}}}
     
    171207
    172208{{{
     209#!cpp
    173210bool isSiblingFor(const NodeHandle& node, const OverlayKey& key, int numSiblings, bool* err);
    174211}}}
     
    177214
    178215{{{
     216#!cpp
    179217bool handleFailedNode(const TransportAddress& failed);
    180218}}}
     
    189227
    190228{{{
     229#!cpp
    191230inline uint32_t sendUdpRpcCall(const TransportAddress& dest,
    192231                                   BaseCallMessage* msg,
     
    200239Timeout is the time to wait until a call is declared as lost, retries is the amount of times to retry a lost call.
    201240!RpcId is an RPC identifier to differentiate between calls.
    202 !RpcListener is a listener that will be notified for call events.
    203 
    204 {{{
     241!RpcListener is a listener object that will be notified for responses and timout events.
     242
     243{{{
     244#!cpp
    205245inline uint32_t sendRouteRpcCall(CompType destComp,
    206246                                 const TransportAddress& dest,
     
    221261Timeout is the time to wait until a call is declared as lost, retries is the amount of times to retry a lost call.
    222262!RpcId is an RPC identifier to differentiate between calls.
    223 !RpcListener is a listener that will be notified for call events.
    224 
    225 {{{
     263!RpcListener is a listener object that will be notified for responses and timout events.
     264
     265{{{
     266#!cpp
    226267inline uint32_t sendInternalRpcCall(CompType destComp,
    227268                                    BaseCallMessage* msg,
     
    236277Timeout is the time to wait until a call is declared as lost, retries is the amount of times to retry a lost call.
    237278!RpcId is an RPC identifier to differentiate between calls.
    238 !RpcListener is a listener that will be notified for call events.
     279!RpcListener is a listener object that will be notified for responses and timout events.
    239280
    240281== 3.5.2 Receiving Remote Procedure Calls ==
    241282
    242283{{{
     284#!cpp
    243285bool handleRpc(BaseCallMessage* msg);
    244286}}}
     
    247289
    248290{{{
     291#!cpp
    249292    RPC_SWITCH_START( msg )
    250293    RPC_DELEGATE( Join, rpcJoin );
     
    255298
    256299{{{
     300#!cpp
    257301void handleRpcTimeout( BaseCallMessage* msg, const TransportAddress& dest, int rpcId, const OverlayKey& destKey);
    258302}}}
     
    260304
    261305
     306
    262307== 3.5.3 Replying to Remote Procedure Calls ==
    263308
    264309{{{
     310#!cpp
    265311void sendRpcResponse(BaseCallMessage* call, BaseResponseMessage* response);
    266312}}}
     
    268314
    269315{{{
     316#!cpp
    270317void handleRpcResponse( BaseResponseMessage* msg, int rpcId, simtime_t rtt );
    271318}}}
     
    277324
    278325{{{
     326#!cpp
    279327void pingNode(const TransportAddress& dest,
    280328              simtime_t timeout = -1,
     
    292340
    293341{{{
     342#!cpp
    294343void pingResponse(PingResponse* response, cPolymorphic* context, int rpcId, simtime_t rtt);
    295344}}}
     
    298347
    299348{{{
     349#!cpp
    300350void pingTimeout(PingCall* call, const TransportAddress& dest, cPolymorphic* context, int rpcId);
    301351}}}
     
    309359
    310360The first line of the configuration file is the inclusion of the default values. That is done by adding the following line:
    311 
    312 {{{ include ./default.ini }}}[[BR]]
     361{{{
     362include ./default.ini
     363}}}
    313364
    314365Each simulation environment class is defined as a run. A configuration file can contain different amounts of runs, each with a different number. We need to set up the network in that run. There are two base networks: SimpleUnderlay and Ipv4Underlay. !SimpleUnderlay is a simplified flat network where each node is assigned coordinates, packet latencies are calculated based on the distance of the source and destination node coordinates, and each nodes are directly connected to one another. Ipv4Underlay emulates real-life networks and contain hierarchies of nodes, routers, and backbones.  The network type is set with the first-tier parameter network. Network modules can be accessed under the names of !SimpleNetwork for !SimpleUnderlay and Ipv4Network for Ipv4Underlay.  The module in charge of building the network is called underlayConfigurator.
     
    343394
    344395# First churn
    345 *.churnGenerator[0].tier1Type = "MyClientModule"        // module name of the application tier
    346 *.churnGenerator[0].overlayType = "MyOverlay"   // module name of the overlay
     396*.churnGenerator[0].tier1Type = "MyClientModule"  // module name of the application tier
     397*.churnGenerator[0].overlayType = "MyOverlay"     // module name of the overlay
    347398
    348399# Second churn
    349 *.churnGenerator[1].tier1Type = "MyServerModule"        // module name of the application tier
    350 *.churnGenerator[1].overlayType = "MyOverlay"   // module name of the overlay
     400*.churnGenerator[1].tier1Type = "MyServerModule"  // module name of the application tier
     401*.churnGenerator[1].overlayType = "MyOverlay"     // module name of the overlay
    351402}}}
    352403
     
    357408Change the “all:” section accordingly by adding your folder to the list.
    358409
    359 Now run “./makemake” and “make” in the root folder. That should compile your new modules.
     410Now run {{{ ./makemake }}} and {{{ make }}} in the root folder. That should compile your new modules.
    360411
    361412In order to run it, you need to setup your simulation run in omnetpp.ini as explained in Section 5. Make sure that you selected default values for all parameters in default.ini, or you'll be prompted for a value when the simulation begins - for each instance of the parameter. To start !OverSim, enter the directory Simulations and run :
    362 
    363 {{{ ../bin/OverSim [-f customConfigFile] [-r runNumber] }}}[[BR]]
     413{{{
     414../bin/OverSim [-f customConfigFile] [-r runNumber]
     415}}}
    364416
    365417If you don't select a run number, if the GUI is enabled, you'll be prompted for a run number. If not, all the runs in omnetpp.ini (or the given custom config file) will be run.
     418
     419'''Have fun!