Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Small improvements to the doc
[simgrid.git] / doc / doxygen / platform.doc
1 /*! @page platform Describing the virtual platform
2
3
4 @section pf_res Resource description
5
6 @subsection pf_res_computing Computing Resources
7
8
9 @subsubsection pf_tag_cluster <cluster>
10
11 ``<cluster />`` represents a machine-cluster. It is most commonly used
12 when one wants to define many hosts and a network quickly. Technically,
13 ``cluster`` is a meta-tag: <b>from the inner SimGrid point of
14 view, a cluster is a network zone where some optimized routing is defined</b>.
15 The default inner organization of the cluster is as follow:
16
17 @verbatim
18                  __________
19                 |          |
20                 |  router  |
21     ____________|__________|_____________ backbone
22       |   |   |              |     |   |
23     l0| l1| l2|           l97| l96 |   | l99
24       |   |   |   ........   |     |   |
25       |                                |
26     c-0.me                             c-99.me
27 @endverbatim
28
29 Here, a set of <b>host</b>s is defined. Each of them has a <b>link</b>
30 to a central backbone (backbone is a link itself, as a link can
31 be used to represent a switch, see the switch / link section
32 below for more details about it). A <b>router</b> allows one to connect a
33 <b>cluster</b> to the outside world. Internally,
34 SimGrid treats a cluster as a network zone containing all hosts: the router is the default
35 gateway for the cluster.
36
37 There is an alternative organization, which is as follows:
38 @verbatim
39                  __________
40                 |          |
41                 |  router  |
42                 |__________|
43                     / | @
44                    /  |  @
45                l0 / l1|   @l2
46                  /    |    @
47                 /     |     @
48             host0   host1   host2
49 @endverbatim
50
51 The principle is the same, except that there is no backbone. This representation
52 can be obtained easily: just do not set the bb_* attributes.
53
54
55 Attribute name  | Mandatory | Values | Description
56 --------------- | --------- | ------ | -----------
57 id              | yes       | string | The identifier of the cluster. Facilitates referring to this cluster.
58 prefix          | yes       | string | Each node of the cluster has to have a name. This name will be prefixed with this prefix.
59 suffix          | yes       | string | Each node of the cluster will be suffixed with this suffix
60 radical         | yes       | string | Regexp used to generate cluster nodes name. Syntax: "10-20" will give you 11 machines numbered from 10 to 20, "10-20;2" will give you 12 machines, one with the number 2, others numbered as before. The produced number is concatenated between prefix and suffix to form machine names.
61 speed           | yes       | int    | Same as the ``speed`` attribute of the ``@<host@>`` tag.
62 core            | no        | int (default: 1) | Same as the ``core`` attribute of the ``@<host@>`` tag.
63 bw              | yes       | int    | Bandwidth for the links between nodes and backbone (if any). See the @ref pf_tag_link "link section" for syntax/details.
64 lat             | yes       | int    | Latency for the links between nodes and backbone (if any). See <b>link</b> section for syntax/details.
65 sharing_policy  | no        | string | Sharing policy for the links between nodes and backbone (if any). See <b>link</b> section for syntax/details.
66 bb_bw           | no        | int    | Bandwidth for backbone (if any). See <b>link</b> section for syntax/details. If bb_bw and bb_lat (see below) attributes are omitted, no backbone is created (alternative cluster architecture <b>described before</b>).
67 bb_lat          | no        | int    | Latency for backbone (if any). See <b>link</b> section for syntax/details. If bb_lat and bb_bw (see above) attributes are omitted, no backbone is created (alternative cluster architecture <b>described before</b>).
68 bb_sharing_policy | no      | string | Sharing policy for the backbone (if any). See <b>link</b> section for syntax/details.
69 limiter_link      | no        | int    | Bandwidth for limiter link (if any). This adds a specific link for each node, to set the maximum bandwidth reached when communicating in both directions at the same time. In theory this value should be 2*bw for splitduplex links, but in reality this might be less. This value will depend heavily on the communication model, and on the cluster's hardware, so no default value can be set, this has to be measured. More details can be obtained in <a href="https://hal.inria.fr/hal-00919507/"> "Toward Better Simulation of MPI Applications on Ethernet/TCP Networks"</a>
70 loopback_bw       | no      | int    | Bandwidth for loopback (if any). See <b>link</b> section for syntax/details. If loopback_bw and loopback_lat (see below) attributes are omitted, no loopback link is created and all intra-node communication will use the main network link of the node. Loopback link is a @ref pf_sharing_policy_fatpipe "@b FATPIPE".
71 loopback_lat      | no      | int    | Latency for loopback (if any). See <b>link</b> section for syntax/details. See loopback_bw for more info.
72 topology          | no      | FLAT@|TORUS@|FAT_TREE@|DRAGONFLY (default: FLAT) | Network topology to use. SimGrid currently supports FLAT (with or without backbone, as described before), <a href="http://en.wikipedia.org/wiki/Torus_interconnect">TORUS </a>, FAT_TREE, and DRAGONFLY attributes for this tag.
73 topo_parameters   | no      | string | Specific parameters to pass for the topology defined in the topology tag. For torus networks, comma-separated list of the number of nodes in each dimension of the torus. Please refer to the specific documentation for @ref simgrid::kernel::routing::FatTreeZone "FatTree NetZone", @ref simgrid::kernel::routing::DragonflyZone "Dragonfly NetZone".
74
75
76 the router name is defined as the resulting String in the following
77 java line of code:
78
79 @verbatim
80 router_name = prefix + clusterId + "_router" + suffix;
81 @endverbatim
82
83
84 #### Cluster example ####
85
86 Consider the following two (and independent) uses of the ``cluster`` tag:
87
88 @verbatim
89 <cluster id="my_cluster_1" prefix="" suffix="" radical="0-262144"
90          speed="1e9" bw="125e6" lat="5E-5"/>
91
92 <cluster id="my_cluster_2" prefix="c-" suffix=".me" radical="0-99"
93          speed="1e9" bw="125e6" lat="5E-5"
94          bb_bw="2.25e9" bb_lat="5E-4"/>
95 @endverbatim
96
97 The second example creates one router and 100 machines with the following names:
98 @verbatim
99 c-my_cluster_2_router.me
100 c-0.me
101 c-1.me
102 c-2.me
103 ...
104 c-99.me
105 @endverbatim
106
107 @subsubsection pf_cabinet &lt;cabinet&gt;
108
109 @note
110     This tag is only available when the routing mode of the network zone
111     is set to ``Cluster``.
112
113 The ``&lt;cabinet /&gt;`` tag is, like the @ref pf_tag_cluster "&lt;cluster&gt;" tag,
114 a meta-tag. This means that it is simply a shortcut for creating a set of (homogeneous) hosts and links quickly;
115 unsurprisingly, this tag was introduced to setup cabinets in data centers quickly. Unlike
116 &lt;cluster&gt;, however, the &lt;cabinet&gt; assumes that you create the backbone
117 and routers yourself; see our examples below.
118
119 #### Attributes ####
120
121 Attribute name  | Mandatory | Values | Description
122 --------------- | --------- | ------ | -----------
123 id              | yes       | string | The identifier of the cabinet. Facilitates referring to this cluster.
124 prefix          | yes       | string | Each node of the cabinet has to have a name. This name will be prefixed with this prefix.
125 suffix          | yes       | string | Each node of the cabinet will be suffixed with this suffix
126 radical         | yes       | string | Regexp used to generate cabinet nodes name. Syntax: "10-20" will give you 11 machines numbered from 10 to 20, "10-20;2" will give you 12 machines, one with the number 2, others numbered as before. The produced number is concatenated between prefix and suffix to form machine names.
127 speed           | yes       | int    | Same as the ``speed`` attribute of the @ref pf_tag_host "&lt;host&gt;" tag.
128 bw              | yes       | int    | Bandwidth for the links between nodes and backbone (if any). See the @ref pf_tag_link "link section" for syntax/details.
129 lat             | yes       | int    | Latency for the links between nodes and backbone (if any). See the @ref pf_tag_link "link section" for syntax/details.
130
131 @note
132     Please note that as of now, it is impossible to change attributes such as,
133     amount of cores (always set to 1), the sharing policy of the links (always set to @ref pf_sharing_policy_splitduplex "SPLITDUPLEX").
134
135 #### Example ####
136
137 The following example was taken from ``examples/platforms/meta_cluster.xml`` and
138 shows how to use the cabinet tag.
139
140 @verbatim
141   <zone  id="my_cluster1"  routing="Cluster">
142     <cabinet id="cabinet1" prefix="host-" suffix=".cluster1"
143       speed="1Gf" bw="125MBps" lat="100us" radical="1-10"/>
144     <cabinet id="cabinet2" prefix="host-" suffix=".cluster1"
145       speed="1Gf" bw="125MBps" lat="100us" radical="11-20"/>
146     <cabinet id="cabinet3" prefix="host-" suffix=".cluster1"
147       speed="1Gf" bw="125MBps" lat="100us" radical="21-30"/>
148
149     <backbone id="backbone1" bandwidth="2.25GBps" latency="500us"/>
150   </zone>
151 @endverbatim
152
153 @note
154    Please note that you must specify the @ref pf_backbone "&lt;backbone&gt;"
155    tag by yourself; this is not done automatically and there are no checks
156    that ensure this backbone was defined.
157
158 The hosts generated in the above example are named host-1.cluster, host-2.cluster1
159 etc.
160
161
162 @subsection pf_ne Network equipment
163
164 There are two tags at all times available to represent network entities and
165 several other tags that are available only in certain contexts.
166 1. ``<link>``:
167
168 2. ``<router/>``: Represents an entity that a message can be routed
169     to, but that is unable to execute any code. In SimGrid, routers have also
170     no impact on the performance: Routers do not limit any bandwidth nor
171     do they increase latency. As a matter of fact, routers are (almost) ignored
172     by the simulator when the simulation has begun.
173
174 3. ``<backbone/>``: This tag is only available when the containing network zone is
175                     used as a cluster (i.e., mode="Cluster")
176
177 @remark
178     If you want to represent an entity like a switch, you must use ``<link>`` (see section). Routers are used
179     to run some routing algorithm and determine routes (see Section @ref pf_routing for details).
180
181 @subsubsection pf_backbone <backbone/>
182
183 @note
184   This tag is <b>only available</b> when the containing network zone uses the "Cluster" routing mode!
185
186 Using this tag, you can designate an already existing link to be a backbone.
187
188 Attribute name  | Mandatory | Values | Description
189 --------------- | --------- | ------ | -----------
190 id              | yes       | string | Name of the link that is supposed to act as a backbone.
191
192 @subsection pf_storage Storage
193
194 @note
195   This is a prototype version that should evolve quickly, hence this
196   is just some doc valuable only at the time of writing.
197   This section describes the storage management under SimGrid ; nowadays
198   it's only usable with MSG. It relies basically on linux-like concepts.
199   You also may want to have a look to its corresponding section in
200   @ref msg_file ; access functions are organized as a POSIX-like
201   interface.
202
203
204 @section pf_routing Routing
205
206 To achieve high performance, the routing tables used within SimGrid are
207 static. This means that routing between two nodes is calculated once
208 and will not change during execution. The SimGrid team chose to use this
209 approach as it is rare to have a real deficiency of a resource;
210 most of the time, a communication fails because the links experience too much
211 congestion and hence, your connection stops before the timeout or
212 because the computer designated to be the destination of that message
213 is not responding.
214
215 We also chose to use shortest paths algorithms in order to emulate
216 routing. Doing so is consistent with the reality: [RIP](https://en.wikipedia.org/wiki/Routing_Information_Protocol),
217 [OSPF](https://en.wikipedia.org/wiki/Open_Shortest_Path_First), [BGP](https://en.wikipedia.org/wiki/Border_Gateway_Protocol)
218 are all calculating shortest paths. They do require some time to converge, but
219 eventually, when the routing tables have stabilized, your packets will follow
220 the shortest paths.
221
222 @subsection  pf_tag_zone &lt;zone&gt;
223
224 @subsection pf_rm Routing models
225
226 For each network zone, you must define explicitly which routing model will
227 be used. There are 3 different categories for routing models:
228
229 1. @ref pf_routing_model_shortest_path "Shortest-path" based models: SimGrid calculates shortest
230    paths and manages them. Behaves more or less like most real life
231    routing mechanisms.
232 2. @ref pf_routing_model_manual "Manually-entered" route models: you have to define all routes
233    manually in the platform description file; this can become
234    tedious very quickly, as it is very verbose.
235    Consistent with some manually managed real life routing.
236 3. @ref pf_routing_model_simple "Simple/fast models": those models offer fast, low memory routing
237    algorithms. You should consider to use this type of model if
238    you can make some assumptions about your network zone.
239    Routing in this case is more or less ignored.
240
241 @subsubsection pf_raf The router affair
242
243 Using routers becomes mandatory when using shortest-path based
244 models or when using the bindings to the ns-3 packet-level
245 simulator instead of the native analytical network model implemented
246 in SimGrid.
247
248 For graph-based shortest path algorithms, routers are mandatory, because these
249 algorithms require a graph as input and so we need to have source and
250 destination for each edge.
251
252 Routers are naturally an important concept ns-3 since the
253 way routers run the packet routing algorithms is actually simulated.
254 SimGrid's analytical models however simply aggregate the routing time
255 with the transfer time.
256
257 So why did we incorporate routers in SimGrid? Rebuilding a graph representation
258 only from the route information turns out to be a very difficult task, because
259 of the missing information about how routes intersect. That is why we
260 introduced routers, which are simply used to express these intersection points.
261 It is important to understand that routers are only used to provide topological
262 information.
263
264 To express this topological information, a <b>route</b> has to be
265 defined in order to declare which link is connected to a router.
266
267
268 @subsubsection pf_routing_model_shortest_path Shortest-path based models
269
270 The following table shows all the models that compute routes using
271 shortest-paths algorithms are currently available in SimGrid. More detail on how
272 to choose the best routing model is given in the Section called @"@ref pf_routing_howto_choose_wisely@".
273
274 | Name                                                | Description                                                                |
275 | --------------------------------------------------- | -------------------------------------------------------------------------- |
276 | @ref pf_routing_model_floyd "Floyd"                 | Floyd routing data. Pre-calculates all routes once                         |
277 | @ref pf_routing_model_dijkstra "Dijkstra"           | Dijkstra routing data. Calculates routes only when needed                  |
278 | @ref pf_routing_model_dijkstracache "DijkstraCache" | Dijkstra routing data. Handles some cache for already calculated routes.   |
279
280 All those shortest-path models are instantiated in the same way and are
281 completely interchangeable. Here are some examples:
282
283 @anchor pf_routing_model_floyd
284 ### Floyd ###
285
286 Floyd example:
287 @verbatim
288 <zone  id="zone0"  routing="Floyd">
289
290   <cluster id="my_cluster_1" prefix="c-" suffix=""
291            radical="0-1" speed="1000000000" bw="125000000" lat="5E-5"
292            router_id="router1"/>
293
294   <zone id="zone1" routing="None">
295     <host id="host1" speed="1000000000"/>
296   </zone>
297
298   <link id="link1" bandwidth="100000" latency="0.01"/>
299
300   <zoneroute src="my_cluster_1" dst="zone1"
301     gw_src="router1"
302     gw_dst="host1">
303     <link_ctn id="link1"/>
304   </zoneroute>
305
306 </zone>
307 @endverbatim
308
309 zoneroute given at the end gives a topological information: link1 is
310 between router1 and host1.
311
312 #### Example platform files ####
313
314 This is an automatically generated list of example files that use the Floyd
315 routing model (the path is given relative to SimGrid's source directory)
316
317 @verbinclude example_filelist_routing_floyd
318
319 @anchor pf_routing_model_dijkstra
320 ### Dijkstra ###
321
322 #### Example platform files ####
323
324 This is an automatically generated list of example files that use the Dijkstra
325 routing model (the path is given relative to SimGrid's source directory)
326
327 @verbinclude example_filelist_routing_dijkstra
328
329 Dijkstra example:
330 @verbatim
331  <zone id="zone_2" routing="Dijkstra">
332      <host id="zone_2_host1" speed="1000000000"/>
333      <host id="zone_2_host2" speed="1000000000"/>
334      <host id="zone_2_host3" speed="1000000000"/>
335      <link id="zone_2_link1" bandwidth="1250000000" latency="5E-4"/>
336      <link id="zone_2_link2" bandwidth="1250000000" latency="5E-4"/>
337      <link id="zone_2_link3" bandwidth="1250000000" latency="5E-4"/>
338      <link id="zone_2_link4" bandwidth="1250000000" latency="5E-4"/>
339      <router id="central_router"/>
340      <router id="zone_2_gateway"/>
341      <!-- routes providing topological information -->
342      <route src="central_router" dst="zone_2_host1"><link_ctn id="zone_2_link1"/></route>
343      <route src="central_router" dst="zone_2_host2"><link_ctn id="zone_2_link2"/></route>
344      <route src="central_router" dst="zone_2_host3"><link_ctn id="zone_2_link3"/></route>
345      <route src="central_router" dst="zone_2_gateway"><link_ctn id="zone_2_link4"/></route>
346   </zone>
347 @endverbatim
348
349 @anchor pf_routing_model_dijkstracache
350 ### DijkstraCache ###
351
352 DijkstraCache example:
353 @verbatim
354 <zone id="zone_2" routing="DijkstraCache">
355      <host id="zone_2_host1" speed="1000000000"/>
356      ...
357 (platform unchanged compared to upper example)
358 @endverbatim
359
360 #### Example platform files ####
361
362 This is an automatically generated list of example files that use the DijkstraCache
363 routing model (the path is given relative to SimGrid's source directory):
364
365 Editor's note: At the time of writing, no platform file used this routing model - so
366 if there are no example files listed here, this is likely to be correct.
367
368 @verbinclude example_filelist_routing_dijkstra_cache
369
370 @subsubsection pf_routing_model_manual Manually-entered route models
371
372 | Name                               | Description                                                                    |
373 | ---------------------------------- | ------------------------------------------------------------------------------ |
374 | @ref pf_routing_model_full "Full"  | You have to enter all necessary routers manually; that is, every single route. This may consume a lot of memory when the XML is parsed and might be tedious to write; i.e., this is only recommended (if at all) for small platforms. |
375
376 @anchor pf_routing_model_full
377 ### Full ###
378
379 Full example:
380 @verbatim
381 <zone  id="zone0"  routing="Full">
382    <host id="host1" speed="1000000000"/>
383    <host id="host2" speed="1000000000"/>
384    <link id="link1" bandwidth="125000000" latency="0.000100"/>
385    <route src="host1" dst="host2"><link_ctn id="link1"/></route>
386  </zone>
387 @endverbatim
388
389 #### Example platform files ####
390
391 This is an automatically generated list of example files that use the Full
392 routing model (the path is given relative to SimGrid's source directory):
393
394 @verbinclude example_filelist_routing_full
395
396 @subsubsection pf_routing_model_simple Simple/fast models
397
398 | Name                                     | Description                                                                                                                         |
399 | ---------------------------------------- | ------------------------------------------------------------------------------                                                      |
400 | @ref pf_routing_model_cluster "Cluster"  | This is specific to the @ref pf_tag_cluster "&lt;cluster/&gt;" tag and should not be used by the user, as several assumptions are made. |
401 | @ref pf_routing_model_none    "None"     | No routing at all. Unless you know what you're doing, avoid using this mode in combination with a non-constant network model.       |
402 | @ref pf_routing_model_vivaldi "Vivaldi"  | Perfect when you want to use coordinates. Also see the corresponding @ref pf_P2P_tags "P2P section" below.                          |
403
404 @anchor pf_routing_model_cluster
405 ### Cluster ###
406
407 @note
408  In this mode, the @ref pf_cabinet "&lt;cabinet/&gt;" tag is available.
409
410 #### Example platform files ####
411
412 This is an automatically generated list of example files that use the Cluster
413 routing model (the path is given relative to SimGrid's source directory):
414
415 @verbinclude example_filelist_routing_cluster
416
417 @anchor pf_routing_model_none
418
419 ### None ###
420
421 This model does exactly what it's name advertises: Nothing. There is no routing
422 available within this model and if you try to communicate within the zone that
423 uses this model, SimGrid will fail unless you have explicitly activated the
424 @ref options_model_select_network_constant "Constant Network Model" (this model charges
425 the same for every single communication). It should
426 be noted, however, that you can still attach an @ref pf_tag_zoneroute "ZoneRoute",
427 as is demonstrated in the example below:
428
429 @verbinclude platforms/cluster_and_one_host.xml
430
431 #### Example platform files ####
432
433 This is an automatically generated list of example files that use the None
434 routing model (the path is given relative to SimGrid's source directory):
435
436 @verbinclude example_filelist_routing_none
437
438
439 @anchor pf_routing_model_vivaldi
440 ### Vivaldi ###
441
442 For more information on how to use the [Vivaldi Coordinates](https://en.wikipedia.org/wiki/Vivaldi_coordinates),
443 see also Section @ref pf_P2P_tags "P2P tags".
444
445 Note that it is possible to combine the Vivaldi routing model with other routing models;
446 an example can be found in the file @c examples/platforms/cloud.xml. This
447 examples models a NetZone using Vivaldi that contains other NetZones that use different
448 routing models.
449
450 #### Example platform files ####
451
452 This is an automatically generated list of example files that use the None
453 routing model (the path is given relative to SimGrid's source directory):
454
455 @verbinclude example_filelist_routing_vivaldi
456
457
458 @subsection ps_dec Defining routes
459
460 There are currently four different ways to define routes:
461
462 | Name                                              | Description                                                                         |
463 | ------------------------------------------------- | ----------------------------------------------------------------------------------- |
464 | @ref pf_tag_route "route"                 | Used to define route between host/router                                            |
465 | @ref pf_tag_zoneroute "zoneRoute"             | Used to define route between different zones                                           |
466 | @ref pf_tag_bypassroute "bypassRoute"     | Used to supersede normal routes as calculated by the network model between host/router; e.g., can be used to use a route that is not the shortest path for any of the shortest-path routing models. |
467 | @ref pf_tag_bypassasroute "bypassZoneRoute"  | Used in the same way as bypassRoute, but for zones                                     |
468
469 Basically all those tags will contain an (ordered) list of references
470 to link that compose the route you want to define.
471
472 Consider the example below:
473
474 @subsubsection pf_tag_bypassasroute bypasszoneroute
475
476 As said before, once you choose
477 a model, it (most likely; the constant network model, for example, doesn't) calculates routes for you. But maybe you want to
478 define some of your routes, which will be specific. You may also want
479 to bypass some routes defined in lower level zone at an upper stage:
480 <b>bypasszoneroute</b> is the tag you're looking for. It allows one to
481 bypass routes defined between already defined between zone (if you want
482 to bypass route for a specific host, you should just use byPassRoute).
483 The principle is the same as zoneroute: <b>bypasszoneroute</b> contains
484 list of links that are in the path between src and dst.
485
486 #### Attributes ####
487
488 | Attribute name  | Mandatory | Values                  | Description                                                                                                  |
489 | --------------- | --------- | ----------------------  | -----------                                                                                                  |
490 | src             | yes       | String                  | The value given to the source zone's "id" attribute                                                            |
491 | dst             | yes       | String                  | The value given to the destination zone's "id" attribute.                                                      |
492 | gw_src          | yes       | String                  | The value given to the source gateway's "id" attribute; this can be any host or router within the src zone     |
493 | gw_dst          | yes       | String                  | The value given to the destination gateway's "id" attribute; this can be any host or router within the dst zone|
494 | symmetrical     | no        | YES@| NO (Default: YES) | If this route is symmetric, the opposite route (from dst to src) will also be declared implicitly. |
495
496 #### Example ####
497
498 @verbatim
499 <bypasszoneRoute src="my_cluster_1" dst="my_cluster_2"
500   gw_src="my_cluster_1_router"
501   gw_dst="my_cluster_2_router">
502     <link_ctn id="link_tmp"/>
503 </bypasszoneroute>
504 @endverbatim
505
506 This example shows that link @c link_tmp (definition not displayed here) directly
507 connects the router @c my_cluster_1_router in the source cluster to the router
508 @c my_cluster_2_router in the destination router. Additionally, as the @c symmetrical
509 attribute was not given, this route is presumed to be symmetrical.
510
511 @subsubsection pf_tag_bypassroute bypassRoute
512
513 As said before, once you choose
514 a model, it (most likely; the constant network model, for example, doesn't) calculates routes for you. But maybe you want to
515 define some of your routes, which will be specific. You may also want
516 to bypass some routes defined in lower level zone at an upper stage:
517 <b>bypassRoute</b> is the tag you're looking for. It allows one to bypass
518 routes defined between <b>host/router</b>. The principle is the same
519 as route: <b>bypassRoute</b> contains list of links references of
520 links that are in the path between src and dst.
521
522 #### Attributes ####
523
524 | Attribute name  | Mandatory | Values                  | Description                                                                                                  |
525 | --------------- | --------- | ----------------------  | -----------                                                                                                  |
526 | src             | yes       | String                  | The value given to the source zone's "id" attribute                                                            |
527 | dst             | yes       | String                  | The value given to the destination zone's "id" attribute.                                                      |
528 | symmetrical     | no        | YES @| NO (Default: YES) | If this route is symmetric, the opposite route (from dst to src) will also be declared implicitly. |
529
530 #### Examples ####
531
532 @verbatim
533 <bypassRoute src="host_1" dst="host_2">
534    <link_ctn id="link_tmp"/>
535 </bypassRoute>
536 @endverbatim
537
538 This example shows that link @c link_tmp (definition not displayed here) directly
539 connects host @c host_1 to host @c host_2. Additionally, as the @c symmetrical
540 attribute was not given, this route is presumed to be symmetrical.
541
542 @subsection pb_baroex Basic Routing Example
543
544 Let's say you have a zone named zone_Big that contains two other zones, zone_1
545 and zone_2. If you want to make a host (h1) from zone_1 with another one
546 (h2) from zone_2 then you'll have to proceed as follows:
547 @li First, you have to ensure that a route is defined from h1 to the
548     zone_1's exit gateway and from h2 to zone_2's exit gateway.
549 @li Then, you'll have to define a route between zone_1 to zone_2. As those
550     zone are both resources belonging to zone_Big, then it has to be done
551     at zone_big level. To define such a route, you have to give the
552     source zone (zone_1), the destination zone (zone_2), and their respective
553     gateway (as the route is effectively defined between those two
554     entry/exit points). Elements of this route can only be elements
555     belonging to zone_Big, so links and routers in this route should be
556     defined inside zone_Big. If you choose some shortest-path model,
557     this route will be computed automatically.
558
559 As said before, there are mainly 2 tags for routing:
560 @li <b>zoneroute</b>: to define routes between two  <b>zone</b>
561 @li <b>route</b>: to define routes between two <b>host/router</b>
562
563 As we are dealing with routes between zone, it means that those we'll
564 have some definition at zone_Big level. Let consider zone_1 contains 1
565 host, 1 link and one router and zone_2 3 hosts, 4 links and one router.
566 There will be a central router, and a cross-like topology. At the end
567 of the crosses arms, you'll find the 3 hosts and the router that will
568 act as a gateway. We have to define routes inside those two zone. Let
569 say that zone_1 contains full routes, and zone_2 contains some Floyd
570 routing (as we don't want to bother with defining all routes). As
571 we're using some shortest path algorithms to route into zone_2, we'll
572 then have to define some <b>route</b> to gives some topological
573 information to SimGrid. Here is a file doing it all:
574
575 @verbatim
576 <zone  id="zone_Big"  routing="Dijkstra">
577   <zone id="zone_1" routing="Full">
578      <host id="zone_1_host1" speed="1000000000"/>
579      <link id="zone_1_link" bandwidth="1250000000" latency="5E-4"/>
580      <router id="zone_1_gateway"/>
581      <route src="zone_1_host1" dst="zone_1_gateway">
582             <link_ctn id="zone_1_link"/>
583      </route>
584   </zone>
585   <zone id="zone_2" routing="Floyd">
586      <host id="zone_2_host1" speed="1000000000"/>
587      <host id="zone_2_host2" speed="1000000000"/>
588      <host id="zone_2_host3" speed="1000000000"/>
589      <link id="zone_2_link1" bandwidth="1250000000" latency="5E-4"/>
590      <link id="zone_2_link2" bandwidth="1250000000" latency="5E-4"/>
591      <link id="zone_2_link3" bandwidth="1250000000" latency="5E-4"/>
592      <link id="zone_2_link4" bandwidth="1250000000" latency="5E-4"/>
593      <router id="central_router"/>
594      <router id="zone_2_gateway"/>
595      <!-- routes providing topological information -->
596      <route src="central_router" dst="zone_2_host1"><link_ctn id="zone_2_link1"/></route>
597      <route src="central_router" dst="zone_2_host2"><link_ctn id="zone_2_link2"/></route>
598      <route src="central_router" dst="zone_2_host3"><link_ctn id="zone_2_link3"/></route>
599      <route src="central_router" dst="zone_2_gateway"><link_ctn id="zone_2_link4"/></route>
600   </zone>
601     <link id="backbone" bandwidth="1250000000" latency="5E-4"/>
602
603      <zoneroute src="zone_1" dst="zone_2"
604          gw_src="zone_1_gateway"
605          gw_dst="zone_2_gateway">
606                 <link_ctn id="backbone"/>
607      </zoneroute>
608 </zone>
609 @endverbatim
610
611 @section pf_other Other tags
612
613 The following tags can be used inside a @<platform@> tag even if they are not
614 directly describing the platform:
615
616   - @ref pf_tag_config passes configuration options, e.g. to change the network model;
617   - @ref pf_tag_prop gives user-defined properties to various elements
618
619 @subsection pf_trace trace and trace_connect
620
621 Both tags are an alternate way to pass files containing information on
622 availability, state etc. to an entity. (See also @ref howto_churn).
623 Instead of referring to the file directly in the host, link, or
624 cluster tag, you proceed by defining a trace with an id corresponding
625 to a file, later a host/link/cluster, and finally using trace_connect
626 you say that the file trace must be used by the entity.
627
628
629 #### Example ####
630
631 @verbatim
632 <zone  id="zone0"  routing="Full">
633   <host id="bob" speed="1000000000"/>
634 </zone>
635 <trace id="myTrace" file="bob.trace" periodicity="1.0"/>
636 <trace_connect trace="myTrace" element="bob" kind="POWER"/>
637 @endverbatim
638
639 @note
640     The order here is important.  @c trace_connect must come
641     after the elements @c trace and @c host, as both the host
642     and the trace definition must be known when @c trace_connect
643     is parsed; the order of @c trace and @c host is arbitrary.
644
645
646 #### @c trace attributes ####
647
648
649 | Attribute name  | Mandatory | Values                 | Description                                                                                       |
650 | --------------- | --------- | ---------------------- | -----------                                                                                       |
651 | id              | yes       | String                 | Identifier of this trace; this is the name you pass on to @c trace_connect.                       |
652 | file            | no        | String                 | Filename of the file that contains the information - the path must follow the style of your OS. You can omit this, but then you must specify the values inside of &lt;trace&gt; and &lt;/trace&gt; - see the example below. |
653 | trace_periodicity | yes | String | This is the same as for @ref pf_tag_host "hosts" (see there for details) |
654
655 Here is an example  of trace when no file name is provided:
656
657 @verbatim
658  <trace id="myTrace" periodicity="1.0">
659     0.0 1.0
660     11.0 0.5
661     20.0 0.8
662  </trace>
663 @endverbatim
664
665 #### @c trace_connect attributes ####
666
667 | Attribute name  | Mandatory | Values                 | Description                                                                                       |
668 | --------------- | --------- | ---------------------- | -----------                                                                                       |
669 | kind            | no        | HOST_AVAIL@|POWER@|<br/>LINK_AVAIL@|BANDWIDTH@|LATENCY (Default: HOST_AVAIL)   | Describes the kind of trace.                   |
670 | trace           | yes       | String                 | Identifier of the referenced trace (specified of the trace's @c id attribute)                     |
671 | element         | yes       | String                 | The identifier of the referenced entity as given by its @c id attribute                           |
672
673 @section pf_hints Hints, tips and frequently requested features
674
675 Now you should know at least the syntax and be able to create a
676 platform by your own. However, after having ourselves wrote some platforms, there
677 are some best practices you should pay attention to in order to
678 produce good platform and some choices you can make in order to have
679 faster simulations. Here's some hints and tips, then.
680
681 @subsection pf_hints_search Finding the platform example that you need
682
683 Most platform files that we ship are in the @c examples/platforms
684 folder. The good old @c grep tool can find the examples you need when
685 wondering on a specific XML tag. Here is an example session searching
686 for @ref pf_trace "trace_connect":
687
688 @verbatim
689 % cd examples/platforms
690 % grep -R -i -n --include="*.xml" "trace_connect" .
691 ./two_hosts_platform_with_availability_included.xml:26:<trace_connect kind="SPEED" trace="A" element="Cpu A"/>
692 ./two_hosts_platform_with_availability_included.xml:27:<trace_connect kind="HOST_AVAIL" trace="A_failure" element="Cpu A"/>
693 ./two_hosts_platform_with_availability_included.xml:28:<trace_connect kind="SPEED" trace="B" element="Cpu B"/>
694 ./two_hosts.xml:17:  <trace_connect trace="Tremblay_power" element="Tremblay" kind="SPEED"/>
695 @endverbatim
696
697 @subsection pf_hint_generating How to generate different platform files?
698
699 This is actually a good idea to search for a better platform file,
700 that better fit the need of your study. To be honest, the provided
701 examples are not representative of anything. They exemplify our XML
702 syntax, but that's all. small_platform.xml for example was generated
703 without much thought beyond that.
704
705 The best thing to do when possible is to write your own platform file,
706 that model the platform on which you run your code. For that, you
707 could use <a href="https://gitlab.inria.fr/simgrid/platform-calibration">our
708 calibration scripts</a>. This leads to very good fits between the
709 platform, the model and the needs.  The g5k.xml example resulted of
710 such an effort, which also lead to <a href="https://github.com/lpouillo/topo5k/">an
711 ongoing attempt</a> to automatically extract the SimGrid platform from
712 the <a href="http://grid5000.fr/">Grid'5000</a> experimental platform.
713 But it's hard to come up with generic models. Don't take these files
714 too seriously. Actually, you should always challenge our models and
715 your instantiation if the accuracy really matters to you (see <a
716 href="https://hal.inria.fr/hal-00907887">this discussion</a>).
717
718 But such advices only hold if you have a real platform and a real
719 application at hand. It's moot for more abstract studies working on
720 ideas and algorithms instead of technical artefacts. Well, in this
721 case, there unfortunately is nothing better than this old and rusty
722 <a href="http://pda.gforge.inria.fr/tools/download.html">simulacrum</a>.
723 This project is dormant since over 10 years (and you will have to
724 update the generated platforms with <tt>bin/simgrid_update_xml</tt> to
725 use them), but that's the best we have for this right now....
726
727 @subsection pf_zone_h Zone Hierarchy
728 The network zone design allows SimGrid to go fast, because computing route is
729 done only for the set of resources defined in the current zone. If you're using
730 only a big zone containing all resource with no zone into it and you're
731 using Full model, then ... you'll loose all interest into it. On the
732 other hand, designing a binary tree of zone with, at the lower level,
733 only one host, then you'll also loose all the good zone hierarchy can
734 give you. Remind you should always be "reasonable" in your platform
735 definition when choosing the hierarchy. A good choice if you try to
736 describe a real life platform is to follow the zone described in
737 reality, since this kind of trade-off works well for real life
738 platforms.
739
740 @subsection pf_exit_zone Exit Zone: why and how
741 Users that have looked at some of our platforms may have notice a
742 non-intuitive schema ... Something like that:
743
744
745 @verbatim
746 <zone id="zone_4"  routing="Full">
747 <zone id="exitzone_4"  routing="Full">
748         <router id="router_4"/>
749 </zone>
750 <cluster id="cl_4_1" prefix="c_4_1-" suffix="" radical="1-20" speed="1000000000" bw="125000000" lat="5E-5" bb_bw="2250000000" bb_lat="5E-4"/>
751 <cluster id="cl_4_2" prefix="c_4_2-" suffix="" radical="1-20" speed="1000000000" bw="125000000" lat="5E-5" bb_bw="2250000000" bb_lat="5E-4"/>
752 <link id="4_1" bandwidth="2250000000" latency="5E-5"/>
753 <link id="4_2" bandwidth="2250000000" latency="5E-5"/>
754 <link id="bb_4" bandwidth="2250000000" latency="5E-4"/>
755 <zoneroute src="cl_4_1"
756         dst="cl_4_2"
757         gw_src="c_4_1-cl_4_1_router"
758         gw_dst="c_4_2-cl_4_2_router">
759                 <link_ctn id="4_1"/>
760                 <link_ctn id="bb_4"/>
761                 <link_ctn id="4_2"/>
762 </zoneroute>
763 <zoneroute src="cl_4_1"
764         dst="exitzone_4"
765         gw_src="c_4_1-cl_4_1_router"
766         gw_dst="router_4">
767                 <link_ctn id="4_1"/>
768                 <link_ctn id="bb_4"/>
769 </zoneroute>
770 <zoneroute src="cl_4_2"
771         dst="exitzone_4"
772         gw_src="c_4_2-cl_4_2_router"
773         gw_dst="router_4">
774                 <link_ctn id="4_2"/>
775                 <link_ctn id="bb_4"/>
776 </zoneroute>
777 </zone>
778 @endverbatim
779
780 In the zone_4, you have an exitzone_4 defined, containing only one router,
781 and routes defined to that zone from all other zone (as cluster is only a
782 shortcut for a zone, see cluster description for details). If there was
783 an upper zone, it would define routes to and from zone_4 with the gateway
784 router_4. It's just because, as we did not allowed (for performances
785 issues) to have routes from a zone to a single host/router, you have to
786 enclose your gateway, when you have zone included in your zone, within a
787 zone to define routes to it.
788
789 @subsection pf_P2P_tags P2P or how to use coordinates
790 SimGrid allows you to use some coordinated-based system, like vivaldi,
791 to describe a platform. The main concept is that you have some peers
792 that are located somewhere: this is the function of the
793 <b>coordinates</b> of the @<peer@> or @<host@> tag. There's nothing
794 complicated in using it, here is an example:
795
796 @verbatim
797 <?xml version='1.0'?>
798 <!DOCTYPE platform SYSTEM "https://simgrid.org/simgrid.dtd">
799 <platform version="4">
800
801  <zone  id="zone0"  routing="Vivaldi">
802         <host id="100030591" coordinates="25.5 9.4 1.4" speed="1.5Gf" />
803         <host id="100036570" coordinates="-12.7 -9.9 2.1" speed="7.3Gf" />
804         ...
805         <host id="100429957" coordinates="17.5 6.7 18.8" speed="8.3Gf" />
806  </zone>
807 </platform>
808 @endverbatim
809
810 Coordinates are then used to calculate latency (in microseconds)
811 between two hosts by calculating the distance between the two hosts
812 coordinates with the following formula: distance( (x1, y1, z1), (x2,
813 y2, z2) ) = euclidian( (x1,y1), (x2,y2) ) + abs(z1) + abs(z2)
814
815 In other words, we take the euclidian distance on the two first
816 dimensions, and then add the absolute values found on the third
817 dimension. This may seem strange, but it was found to allow better
818 approximations of the latency matrices (see the paper describing
819 Vivaldi).
820
821 Note that the previous example defines a routing directly between hosts but it could be also used to define a routing between zone.
822 That is for example what is commonly done when using peers (see Section @ref pf_peer).
823 @verbatim
824 <?xml version='1.0'?>
825 <!DOCTYPE platform SYSTEM "https://simgrid.org/simgrid.dtd">
826 <platform version="4">
827
828  <zone  id="zone0"  routing="Vivaldi">
829    <peer id="peer-0" coordinates="173.0 96.8 0.1" speed="730Mf" bw_in="13.38MBps" bw_out="1.024MBps" lat="500us"/>
830    <peer id="peer-1" coordinates="247.0 57.3 0.6" speed="730Mf" bw_in="13.38MBps" bw_out="1.024MBps" lat="500us" />
831    <peer id="peer-2" coordinates="243.4 58.8 1.4" speed="730Mf" bw_in="13.38MBps" bw_out="1.024MBps" lat="500us" />
832 </zone>
833 </platform>
834 @endverbatim
835 In such a case though, we connect the zone created by the <b>peer</b> tag with the Vivaldi routing mechanism.
836 This means that to route between zone1 and zone2, it will use the coordinates of router_zone1 and router_zone2.
837 This is currently a convention and we may offer to change this convention in the DTD later if needed.
838 You may have noted that conveniently, a peer named FOO defines a zone named FOO and a router named router_FOO, which is why it works seamlessly with the <b>peer</b> tag.
839
840
841 @subsection pf_routing_howto_choose_wisely Choosing wisely the routing model to use
842
843
844 Choosing wisely the routing model to use can significantly fasten your
845 simulation/save your time when writing the platform/save tremendous
846 disk space. Here is the list of available model and their
847 characteristics (lookup: time to resolve a route):
848
849 @li <b>Full</b>: Full routing data (fast, large memory requirements,
850     fully expressive)
851 @li <b>Floyd</b>: Floyd routing data (slow initialization, fast
852     lookup, lesser memory requirements, shortest path routing only).
853     Calculates all routes at once at the beginning.
854 @li <b>Dijkstra</b>: Dijkstra routing data (fast initialization, slow
855     lookup, small memory requirements, shortest path routing only).
856     Calculates a route when necessary.
857 @li <b>DijkstraCache</b>: Dijkstra routing data (fast initialization,
858     fast lookup, small memory requirements, shortest path routing
859     only). Same as Dijkstra, except it handles a cache for latest used
860     routes.
861 @li <b>None</b>: No routing (usable with Constant network only).
862     Defines that there is no routes, so if you try to determine a
863     route without constant network within this zone, SimGrid will raise
864     an exception.
865 @li <b>Vivaldi</b>: Vivaldi routing, so when you want to use coordinates
866 @li <b>Cluster</b>: Cluster routing, specific to cluster tag, should
867     not be used.
868
869 @subsection pf_loopback I want to specify the characteristics of the loopback link!
870
871 Each routing model automatically adds a loopback link for each declared host, i.e.,
872 a network route from the host to itself, if no such route is declared in the XML
873 file. This default link has a bandwidth of 498 Mb/s, a latency of 15 microseconds,
874 and is <b>not</b> shared among network flows.
875
876 If you want to specify the characteristics of the loopback link for a given host, you
877 just have to specify a route from this host to itself with the desired characteristics
878 in the XML file. This will prevent the routing model to add and use the default
879 loopback link.
880
881 @subsection pf_switch I want to describe a switch but there is no switch tag!
882
883 Actually we did not include switch tag. But when you're trying to
884 simulate a switch, assuming
885 fluid bandwidth models are used (which SimGrid uses by default unless
886 ns-3 or constant network models are activated), the limiting factor is
887 switch backplane bandwidth. So, essentially, at least from
888 the simulation perspective, a switch is similar to a
889 link: some device that is traversed by flows and with some latency and
890 so,e maximum bandwidth. Thus, you can simply simulate a switch as a
891 link. Many links
892 can be connected to this "switch", which is then included in routes just
893 as a normal link.
894
895
896 @subsection pf_multicabinets I want to describe multi-cabinets clusters!
897
898 You have several possibilities, as usual when modeling things. If your
899 cabinets are homogeneous and the intercabinet network negligible for
900 your study, you should just create a larger cluster with all hosts at
901 the same layer.
902
903 In the rare case where your hosts are not homogeneous between the
904 cabinets, you can create your cluster completely manually. For that,
905 create an As using the Cluster routing, and then use one
906 &lt;cabinet&gt; for each cabinet. This cabinet tag can only be used an
907 As using the Cluster routing schema, and creating
908
909 Be warned that creating a cluster manually from the XML with
910 &lt;cabinet&gt;, &lt;backbone&gt; and friends is rather tedious. The
911 easiest way to retrieve some control of your model without diving into
912 the &lt;cluster&gt; internals is certainly to create one separate
913 &lt;cluster&gt; per cabinet and interconnect them together. This is
914 what we did in the G5K example platform for the Graphen cluster.
915
916 @subsection pf_platform_multipath I want to express multipath routing in platform files!
917
918 It is unfortunately impossible to express the fact that there is more
919 than one routing path between two given hosts. Let's consider the
920 following platform file:
921
922 @verbatim
923 <route src="A" dst="B">
924    <link_ctn id="1"/>
925 </route>
926 <route src="B" dst="C">
927   <link_ctn id="2"/>
928 </route>
929 <route src="A" dst="C">
930   <link_ctn id="3"/>
931 </route>
932 @endverbatim
933
934 Although it is perfectly valid, it does not mean that data traveling
935 from A to C can either go directly (using link 3) or through B (using
936 links 1 and 2). It simply means that the routing on the graph is not
937 trivial, and that data do not following the shortest path in number of
938 hops on this graph. Another way to say it is that there is no implicit
939 in these routing descriptions. The system will only use the routes you
940 declare (such as &lt;route src="A" dst="C"&gt;&lt;link_ctn
941 id="3"/&gt;&lt;/route&gt;), without trying to build new routes by aggregating
942 the provided ones.
943
944 You are also free to declare platform where the routing is not
945 symmetrical. For example, add the following to the previous file:
946
947 @verbatim
948 <route src="C" dst="A">
949   <link_ctn id="2"/>
950   <link_ctn id="1"/>
951 </route>
952 @endverbatim
953
954 This makes sure that data from C to A go through B where data from A
955 to C go directly. Don't worry about realism of such settings since
956 we've seen ways more weird situation in real settings (in fact, that's
957 the realism of very regular platforms which is questionable, but
958 that's another story).
959
960 */