close
Warning:
BrowserModule failed with ConfigurationError: Look in the Trac log for more information.
- Timestamp:
-
Aug 15, 2008, 12:16:48 PM (16 years ago)
- Author:
-
heep
- Comment:
-
--
Legend:
- Unmodified
- Added
- Removed
- Modified
-
v4
|
v5
|
|
19 | 19 | |
20 | 20 | !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 | |
| 22 | PICTURE MISSING |
21 | 23 | |
22 | 24 | The 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. |
… |
… |
|
68 | 70 | |
69 | 71 | The 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 | {{{ |
| 73 | SimpleOverlay.overlayTerminal[5].overlay.myParam1 = 1024 |
| 74 | }}} |
| 75 | |
| 76 | 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: |
| 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). |
79 | 84 | |
80 | 85 | Should 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. |
… |
… |
|
86 | 91 | == 3.1 Important attributes == |
87 | 92 | |
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 |
| 95 | cModule *thisTerminal; |
| 96 | }}} |
| 97 | Pointer to the overlay module. |
| 98 | |
| 99 | {{{ |
| 100 | #!cpp |
| 101 | NodeHandle thisNode; |
| 102 | }}} |
| 103 | Information about the overlay node (IP address, port and overlay key).[[BR]] |
| 104 | |
| 105 | {{{ |
| 106 | #!cpp |
| 107 | BootstrapOracle* bootstrapOracle; |
| 108 | }}} |
| 109 | Pointer to a database of registered overlay nodes, to be used for bootstrapping.[[BR]] |
| 110 | |
| 111 | {{{ |
| 112 | #!cpp |
| 113 | NotificationBoard* notificationBoard; |
| 114 | }}} |
| 115 | Pointer to the notification board, which is used to generate node events.[[BR]] |
92 | 116 | |
93 | 117 | == 3.2 Initialization and finalization == |
… |
… |
|
96 | 120 | |
97 | 121 | {{{ |
| 122 | #!cpp |
98 | 123 | void initialize(int stage); |
99 | 124 | }}} |
… |
… |
|
102 | 127 | |
103 | 128 | {{{ |
| 129 | #!cpp |
104 | 130 | void initializeOverlay(int stage); |
105 | 131 | }}} |
… |
… |
|
107 | 133 | |
108 | 134 | {{{ |
| 135 | #!cpp |
109 | 136 | void join(OverlayKey nodeID); |
110 | 137 | }}} |
… |
… |
|
112 | 139 | |
113 | 140 | {{{ |
| 141 | #!cpp |
114 | 142 | void joinOverlay(); |
115 | 143 | }}} |
… |
… |
|
117 | 145 | |
118 | 146 | {{{ |
| 147 | #!cpp |
119 | 148 | void setOverlayReady(bool ready); |
120 | 149 | }}} |
… |
… |
|
122 | 151 | |
123 | 152 | {{{ |
| 153 | #!cpp |
124 | 154 | void finishOverlay(); |
125 | 155 | }}} |
… |
… |
|
131 | 161 | |
132 | 162 | {{{ |
| 163 | #!cpp |
133 | 164 | sendMessageToUDP(const TransportAddress& dest, BaseOverlayMessage* msg); |
134 | 165 | }}} |
… |
… |
|
136 | 167 | |
137 | 168 | {{{ |
| 169 | #!cpp |
138 | 170 | void handleUDPMessage(BaseOverlayMessage* msg); |
139 | 171 | }}} |
… |
… |
|
141 | 173 | |
142 | 174 | {{{ |
| 175 | #!cpp |
143 | 176 | void sendMessageToApp(cMessage *msg); |
144 | 177 | }}} |
… |
… |
|
146 | 179 | |
147 | 180 | {{{ |
| 181 | #!cpp |
148 | 182 | void handleAppMessage(cMessage* msg); |
149 | 183 | }}} |
… |
… |
|
156 | 190 | |
157 | 191 | {{{ |
| 192 | #!cpp |
158 | 193 | void sendToKey(const OverlayKey& key, BaseOverlayMessage* message, |
159 | 194 | int numSiblings = 1, |
… |
… |
|
166 | 201 | |
167 | 202 | {{{ |
| 203 | #!cpp |
168 | 204 | NodeVector* findNode( const OverlayKey& key, int numRedundantNodes, int numSiblings, BaseOverlayMessage* msg = NULL); |
169 | 205 | }}} |
… |
… |
|
171 | 207 | |
172 | 208 | {{{ |
| 209 | #!cpp |
173 | 210 | bool isSiblingFor(const NodeHandle& node, const OverlayKey& key, int numSiblings, bool* err); |
174 | 211 | }}} |
… |
… |
|
177 | 214 | |
178 | 215 | {{{ |
| 216 | #!cpp |
179 | 217 | bool handleFailedNode(const TransportAddress& failed); |
180 | 218 | }}} |
… |
… |
|
189 | 227 | |
190 | 228 | {{{ |
| 229 | #!cpp |
191 | 230 | inline uint32_t sendUdpRpcCall(const TransportAddress& dest, |
192 | 231 | BaseCallMessage* msg, |
… |
… |
|
200 | 239 | Timeout is the time to wait until a call is declared as lost, retries is the amount of times to retry a lost call. |
201 | 240 | !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 |
205 | 245 | inline uint32_t sendRouteRpcCall(CompType destComp, |
206 | 246 | const TransportAddress& dest, |
… |
… |
|
221 | 261 | Timeout is the time to wait until a call is declared as lost, retries is the amount of times to retry a lost call. |
222 | 262 | !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 |
226 | 267 | inline uint32_t sendInternalRpcCall(CompType destComp, |
227 | 268 | BaseCallMessage* msg, |
… |
… |
|
236 | 277 | Timeout is the time to wait until a call is declared as lost, retries is the amount of times to retry a lost call. |
237 | 278 | !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. |
239 | 280 | |
240 | 281 | == 3.5.2 Receiving Remote Procedure Calls == |
241 | 282 | |
242 | 283 | {{{ |
| 284 | #!cpp |
243 | 285 | bool handleRpc(BaseCallMessage* msg); |
244 | 286 | }}} |
… |
… |
|
247 | 289 | |
248 | 290 | {{{ |
| 291 | #!cpp |
249 | 292 | RPC_SWITCH_START( msg ) |
250 | 293 | RPC_DELEGATE( Join, rpcJoin ); |
… |
… |
|
255 | 298 | |
256 | 299 | {{{ |
| 300 | #!cpp |
257 | 301 | void handleRpcTimeout( BaseCallMessage* msg, const TransportAddress& dest, int rpcId, const OverlayKey& destKey); |
258 | 302 | }}} |
… |
… |
|
260 | 304 | |
261 | 305 | |
| 306 | |
262 | 307 | == 3.5.3 Replying to Remote Procedure Calls == |
263 | 308 | |
264 | 309 | {{{ |
| 310 | #!cpp |
265 | 311 | void sendRpcResponse(BaseCallMessage* call, BaseResponseMessage* response); |
266 | 312 | }}} |
… |
… |
|
268 | 314 | |
269 | 315 | {{{ |
| 316 | #!cpp |
270 | 317 | void handleRpcResponse( BaseResponseMessage* msg, int rpcId, simtime_t rtt ); |
271 | 318 | }}} |
… |
… |
|
277 | 324 | |
278 | 325 | {{{ |
| 326 | #!cpp |
279 | 327 | void pingNode(const TransportAddress& dest, |
280 | 328 | simtime_t timeout = -1, |
… |
… |
|
292 | 340 | |
293 | 341 | {{{ |
| 342 | #!cpp |
294 | 343 | void pingResponse(PingResponse* response, cPolymorphic* context, int rpcId, simtime_t rtt); |
295 | 344 | }}} |
… |
… |
|
298 | 347 | |
299 | 348 | {{{ |
| 349 | #!cpp |
300 | 350 | void pingTimeout(PingCall* call, const TransportAddress& dest, cPolymorphic* context, int rpcId); |
301 | 351 | }}} |
… |
… |
|
309 | 359 | |
310 | 360 | The 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 | {{{ |
| 362 | include ./default.ini |
| 363 | }}} |
313 | 364 | |
314 | 365 | Each 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. |
… |
… |
|
343 | 394 | |
344 | 395 | # 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 |
347 | 398 | |
348 | 399 | # 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 |
351 | 402 | }}} |
352 | 403 | |
… |
… |
|
357 | 408 | Change the “all:” section accordingly by adding your folder to the list. |
358 | 409 | |
359 | | Now run “./makemake” and “make” in the root folder. That should compile your new modules. |
| 410 | Now run {{{ ./makemake }}} and {{{ make }}} in the root folder. That should compile your new modules. |
360 | 411 | |
361 | 412 | In 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 | }}} |
364 | 416 | |
365 | 417 | If 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! |