1 /*! @page platform Describing the virtual platform
4 @section pf_res Resource description
6 @subsection pf_res_computing Computing Resources
8 @subsubsection pf_cabinet <cabinet>
11 This tag is only available when the routing mode of the network zone
12 is set to ``Cluster``.
14 The ``<cabinet />`` tag is, like the @ref pf_tag_cluster "<cluster>" tag,
15 a meta-tag. This means that it is simply a shortcut for creating a set of (homogeneous) hosts and links quickly;
16 unsurprisingly, this tag was introduced to setup cabinets in data centers quickly. Unlike
17 <cluster>, however, the <cabinet> assumes that you create the backbone
18 and routers yourself; see our examples below.
22 Attribute name | Mandatory | Values | Description
23 --------------- | --------- | ------ | -----------
24 id | yes | string | The identifier of the cabinet. Facilitates referring to this cluster.
25 prefix | yes | string | Each node of the cabinet has to have a name. This name will be prefixed with this prefix.
26 suffix | yes | string | Each node of the cabinet will be suffixed with this suffix
27 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.
28 speed | yes | int | Same as the ``speed`` attribute of the @ref pf_tag_host "<host>" tag.
29 bw | yes | int | Bandwidth for the links between nodes and backbone (if any). See the @ref pf_tag_link "link section" for syntax/details.
30 lat | yes | int | Latency for the links between nodes and backbone (if any). See the @ref pf_tag_link "link section" for syntax/details.
33 Please note that as of now, it is impossible to change attributes such as,
34 amount of cores (always set to 1), the sharing policy of the links (always set to @ref pf_sharing_policy_splitduplex "SPLITDUPLEX").
38 The following example was taken from ``examples/platforms/meta_cluster.xml`` and
39 shows how to use the cabinet tag.
42 <zone id="my_cluster1" routing="Cluster">
43 <cabinet id="cabinet1" prefix="host-" suffix=".cluster1"
44 speed="1Gf" bw="125MBps" lat="100us" radical="1-10"/>
45 <cabinet id="cabinet2" prefix="host-" suffix=".cluster1"
46 speed="1Gf" bw="125MBps" lat="100us" radical="11-20"/>
47 <cabinet id="cabinet3" prefix="host-" suffix=".cluster1"
48 speed="1Gf" bw="125MBps" lat="100us" radical="21-30"/>
50 <backbone id="backbone1" bandwidth="2.25GBps" latency="500us"/>
55 Please note that you must specify the @ref pf_backbone "<backbone>"
56 tag by yourself; this is not done automatically and there are no checks
57 that ensure this backbone was defined.
59 The hosts generated in the above example are named host-1.cluster, host-2.cluster1
63 @subsection pf_ne Network equipment
65 There are two tags at all times available to represent network entities and
66 several other tags that are available only in certain contexts.
70 3. ``<backbone/>``: This tag is only available when the containing network zone is
71 used as a cluster (i.e., mode="Cluster")
74 If you want to represent an entity like a switch, you must use ``<link>`` (see section). Routers are used
75 to run some routing algorithm and determine routes (see Section @ref pf_routing for details).
77 @subsubsection pf_backbone <backbone/>
80 This tag is <b>only available</b> when the containing network zone uses the "Cluster" routing mode!
82 Using this tag, you can designate an already existing link to be a backbone.
84 Attribute name | Mandatory | Values | Description
85 --------------- | --------- | ------ | -----------
86 id | yes | string | Name of the link that is supposed to act as a backbone.
90 @section pf_routing Routing
93 @subsubsection pf_routing_model_simple Simple/fast models
95 | Name | Description |
96 | ---------------------------------------- | ------------------------------------------------------------------------------ |
97 | @ref pf_routing_model_cluster "Cluster" | This is specific to the @ref pf_tag_cluster "<cluster/>" tag and should not be used by the user, as several assumptions are made. |
98 | @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. |
99 | @ref pf_routing_model_vivaldi "Vivaldi" | Perfect when you want to use coordinates. Also see the corresponding @ref pf_P2P_tags "P2P section" below. |
101 @anchor pf_routing_model_cluster
105 In this mode, the @ref pf_cabinet "<cabinet/>" tag is available.
107 #### Example platform files ####
109 This is an automatically generated list of example files that use the Cluster
110 routing model (the path is given relative to SimGrid's source directory):
112 @verbinclude example_filelist_routing_cluster
114 @anchor pf_routing_model_none
118 This model does exactly what it's name advertises: Nothing. There is no routing
119 available within this model and if you try to communicate within the zone that
120 uses this model, SimGrid will fail unless you have explicitly activated the
121 @ref options_model_select_network_constant "Constant Network Model" (this model charges
122 the same for every single communication). It should
123 be noted, however, that you can still attach an @ref pf_tag_zoneroute "ZoneRoute",
124 as is demonstrated in the example below:
126 @verbinclude platforms/cluster_and_one_host.xml
128 #### Example platform files ####
130 This is an automatically generated list of example files that use the None
131 routing model (the path is given relative to SimGrid's source directory):
133 @verbinclude example_filelist_routing_none
138 @anchor pf_routing_model_vivaldi
141 For more information on how to use the [Vivaldi Coordinates](https://en.wikipedia.org/wiki/Vivaldi_coordinates),
142 see also Section @ref pf_P2P_tags "P2P tags".
144 Note that it is possible to combine the Vivaldi routing model with other routing models;
145 an example can be found in the file @c examples/platforms/cloud.xml. This
146 examples models a NetZone using Vivaldi that contains other NetZones that use different
149 #### Example platform files ####
151 This is an automatically generated list of example files that use the None
152 routing model (the path is given relative to SimGrid's source directory):
154 @verbinclude example_filelist_routing_vivaldi
157 @subsection ps_dec Defining routes
159 There are currently four different ways to define routes:
161 | Name | Description |
162 | ------------------------------------------------- | ----------------------------------------------------------------------------------- |
163 | @ref pf_tag_route "route" | Used to define route between host/router |
164 | @ref pf_tag_zoneroute "zoneRoute" | Used to define route between different zones |
165 | @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. |
166 | @ref pf_tag_bypassasroute "bypassZoneRoute" | Used in the same way as bypassRoute, but for zones |
168 Basically all those tags will contain an (ordered) list of references
169 to link that compose the route you want to define.
171 Consider the example below:
173 @subsubsection pf_tag_bypassasroute bypasszoneroute
175 As said before, once you choose
176 a model, it (most likely; the constant network model, for example, doesn't) calculates routes for you. But maybe you want to
177 define some of your routes, which will be specific. You may also want
178 to bypass some routes defined in lower level zone at an upper stage:
179 <b>bypasszoneroute</b> is the tag you're looking for. It allows one to
180 bypass routes defined between already defined between zone (if you want
181 to bypass route for a specific host, you should just use byPassRoute).
182 The principle is the same as zoneroute: <b>bypasszoneroute</b> contains
183 list of links that are in the path between src and dst.
187 | Attribute name | Mandatory | Values | Description |
188 | --------------- | --------- | ---------------------- | ----------- |
189 | src | yes | String | The value given to the source zone's "id" attribute |
190 | dst | yes | String | The value given to the destination zone's "id" attribute. |
191 | 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 |
192 | 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|
193 | symmetrical | no | YES@| NO (Default: YES) | If this route is symmetric, the opposite route (from dst to src) will also be declared implicitly. |
198 <bypasszoneRoute src="my_cluster_1" dst="my_cluster_2"
199 gw_src="my_cluster_1_router"
200 gw_dst="my_cluster_2_router">
201 <link_ctn id="link_tmp"/>
205 This example shows that link @c link_tmp (definition not displayed here) directly
206 connects the router @c my_cluster_1_router in the source cluster to the router
207 @c my_cluster_2_router in the destination router. Additionally, as the @c symmetrical
208 attribute was not given, this route is presumed to be symmetrical.
210 @subsubsection pf_tag_bypassroute bypassRoute
212 As said before, once you choose
213 a model, it (most likely; the constant network model, for example, doesn't) calculates routes for you. But maybe you want to
214 define some of your routes, which will be specific. You may also want
215 to bypass some routes defined in lower level zone at an upper stage:
216 <b>bypassRoute</b> is the tag you're looking for. It allows one to bypass
217 routes defined between <b>host/router</b>. The principle is the same
218 as route: <b>bypassRoute</b> contains list of links references of
219 links that are in the path between src and dst.
223 | Attribute name | Mandatory | Values | Description |
224 | --------------- | --------- | ---------------------- | ----------- |
225 | src | yes | String | The value given to the source zone's "id" attribute |
226 | dst | yes | String | The value given to the destination zone's "id" attribute. |
227 | symmetrical | no | YES @| NO (Default: YES) | If this route is symmetric, the opposite route (from dst to src) will also be declared implicitly. |
232 <bypassRoute src="host_1" dst="host_2">
233 <link_ctn id="link_tmp"/>
237 This example shows that link @c link_tmp (definition not displayed here) directly
238 connects host @c host_1 to host @c host_2. Additionally, as the @c symmetrical
239 attribute was not given, this route is presumed to be symmetrical.
241 @section pf_other Other tags
243 The following tags can be used inside a @<platform@> tag even if they are not
244 directly describing the platform:
246 - @ref pf_tag_config passes configuration options, e.g. to change the network model;
247 - @ref pf_tag_prop gives user-defined properties to various elements
249 @subsection pf_trace trace and trace_connect
251 Both tags are an alternate way to pass files containing information on
252 availability, state etc. to an entity. (See also @ref howto_churn).
253 Instead of referring to the file directly in the host, link, or
254 cluster tag, you proceed by defining a trace with an id corresponding
255 to a file, later a host/link/cluster, and finally using trace_connect
256 you say that the file trace must be used by the entity.
262 <zone id="zone0" routing="Full">
263 <host id="bob" speed="1000000000"/>
265 <trace id="myTrace" file="bob.trace" periodicity="1.0"/>
266 <trace_connect trace="myTrace" element="bob" kind="POWER"/>
270 The order here is important. @c trace_connect must come
271 after the elements @c trace and @c host, as both the host
272 and the trace definition must be known when @c trace_connect
273 is parsed; the order of @c trace and @c host is arbitrary.
276 #### @c trace attributes ####
279 | Attribute name | Mandatory | Values | Description |
280 | --------------- | --------- | ---------------------- | ----------- |
281 | id | yes | String | Identifier of this trace; this is the name you pass on to @c trace_connect. |
282 | 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 <trace> and </trace> - see the example below. |
283 | trace_periodicity | yes | String | This is the same as for @ref pf_tag_host "hosts" (see there for details) |
285 Here is an example of trace when no file name is provided:
288 <trace id="myTrace" periodicity="1.0">
295 #### @c trace_connect attributes ####
297 | Attribute name | Mandatory | Values | Description |
298 | --------------- | --------- | ---------------------- | ----------- |
299 | kind | no | HOST_AVAIL@|POWER@|<br/>LINK_AVAIL@|BANDWIDTH@|LATENCY (Default: HOST_AVAIL) | Describes the kind of trace. |
300 | trace | yes | String | Identifier of the referenced trace (specified of the trace's @c id attribute) |
301 | element | yes | String | The identifier of the referenced entity as given by its @c id attribute |
303 @section pf_hints Hints, tips and frequently requested features
305 Now you should know at least the syntax and be able to create a
306 platform by your own. However, after having ourselves wrote some platforms, there
307 are some best practices you should pay attention to in order to
308 produce good platform and some choices you can make in order to have
309 faster simulations. Here's some hints and tips, then.
311 @subsection pf_hints_search Finding the platform example that you need
313 Most platform files that we ship are in the @c examples/platforms
314 folder. The good old @c grep tool can find the examples you need when
315 wondering on a specific XML tag. Here is an example session searching
316 for @ref pf_trace "trace_connect":
319 % cd examples/platforms
320 % grep -R -i -n --include="*.xml" "trace_connect" .
321 ./two_hosts_platform_with_availability_included.xml:26:<trace_connect kind="SPEED" trace="A" element="Cpu A"/>
322 ./two_hosts_platform_with_availability_included.xml:27:<trace_connect kind="HOST_AVAIL" trace="A_failure" element="Cpu A"/>
323 ./two_hosts_platform_with_availability_included.xml:28:<trace_connect kind="SPEED" trace="B" element="Cpu B"/>
324 ./two_hosts.xml:17: <trace_connect trace="Tremblay_power" element="Tremblay" kind="SPEED"/>
327 @subsection pf_hint_generating How to generate different platform files?
329 This is actually a good idea to search for a better platform file,
330 that better fit the need of your study. To be honest, the provided
331 examples are not representative of anything. They exemplify our XML
332 syntax, but that's all. small_platform.xml for example was generated
333 without much thought beyond that.
335 The best thing to do when possible is to write your own platform file,
336 that model the platform on which you run your code. For that, you
337 could use <a href="https://gitlab.inria.fr/simgrid/platform-calibration">our
338 calibration scripts</a>. This leads to very good fits between the
339 platform, the model and the needs. The g5k.xml example resulted of
340 such an effort, which also lead to <a href="https://github.com/lpouillo/topo5k/">an
341 ongoing attempt</a> to automatically extract the SimGrid platform from
342 the <a href="http://grid5000.fr/">Grid'5000</a> experimental platform.
343 But it's hard to come up with generic models. Don't take these files
344 too seriously. Actually, you should always challenge our models and
345 your instantiation if the accuracy really matters to you (see <a
346 href="https://hal.inria.fr/hal-00907887">this discussion</a>).
348 But such advices only hold if you have a real platform and a real
349 application at hand. It's moot for more abstract studies working on
350 ideas and algorithms instead of technical artefacts. Well, in this
351 case, there unfortunately is nothing better than this old and rusty
352 <a href="http://pda.gforge.inria.fr/tools/download.html">simulacrum</a>.
353 This project is dormant since over 10 years (and you will have to
354 update the generated platforms with <tt>bin/simgrid_update_xml</tt> to
355 use them), but that's the best we have for this right now....
357 @subsection pf_zone_h Zone Hierarchy
358 The network zone design allows SimGrid to go fast, because computing route is
359 done only for the set of resources defined in the current zone. If you're using
360 only a big zone containing all resource with no zone into it and you're
361 using Full model, then ... you'll loose all interest into it. On the
362 other hand, designing a binary tree of zone with, at the lower level,
363 only one host, then you'll also loose all the good zone hierarchy can
364 give you. Remind you should always be "reasonable" in your platform
365 definition when choosing the hierarchy. A good choice if you try to
366 describe a real life platform is to follow the zone described in
367 reality, since this kind of trade-off works well for real life
370 @subsection pf_exit_zone Exit Zone: why and how
371 Users that have looked at some of our platforms may have notice a
372 non-intuitive schema ... Something like that:
376 <zone id="zone_4" routing="Full">
377 <zone id="exitzone_4" routing="Full">
378 <router id="router_4"/>
380 <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"/>
381 <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"/>
382 <link id="4_1" bandwidth="2250000000" latency="5E-5"/>
383 <link id="4_2" bandwidth="2250000000" latency="5E-5"/>
384 <link id="bb_4" bandwidth="2250000000" latency="5E-4"/>
385 <zoneroute src="cl_4_1"
387 gw_src="c_4_1-cl_4_1_router"
388 gw_dst="c_4_2-cl_4_2_router">
390 <link_ctn id="bb_4"/>
393 <zoneroute src="cl_4_1"
395 gw_src="c_4_1-cl_4_1_router"
398 <link_ctn id="bb_4"/>
400 <zoneroute src="cl_4_2"
402 gw_src="c_4_2-cl_4_2_router"
405 <link_ctn id="bb_4"/>
410 In the zone_4, you have an exitzone_4 defined, containing only one router,
411 and routes defined to that zone from all other zone (as cluster is only a
412 shortcut for a zone, see cluster description for details). If there was
413 an upper zone, it would define routes to and from zone_4 with the gateway
414 router_4. It's just because, as we did not allowed (for performances
415 issues) to have routes from a zone to a single host/router, you have to
416 enclose your gateway, when you have zone included in your zone, within a
417 zone to define routes to it.
419 @subsection pf_routing_howto_choose_wisely Choosing wisely the routing model to use
422 Choosing wisely the routing model to use can significantly fasten your
423 simulation/save your time when writing the platform/save tremendous
424 disk space. Here is the list of available model and their
425 characteristics (lookup: time to resolve a route):
427 @li <b>Full</b>: Full routing data (fast, large memory requirements,
429 @li <b>Floyd</b>: Floyd routing data (slow initialization, fast
430 lookup, lesser memory requirements, shortest path routing only).
431 Calculates all routes at once at the beginning.
432 @li <b>Dijkstra</b>: Dijkstra routing data (fast initialization, slow
433 lookup, small memory requirements, shortest path routing only).
434 Calculates a route when necessary.
435 @li <b>DijkstraCache</b>: Dijkstra routing data (fast initialization,
436 fast lookup, small memory requirements, shortest path routing
437 only). Same as Dijkstra, except it handles a cache for latest used
439 @li <b>None</b>: No routing (usable with Constant network only).
440 Defines that there is no routes, so if you try to determine a
441 route without constant network within this zone, SimGrid will raise
443 @li <b>Vivaldi</b>: Vivaldi routing, so when you want to use coordinates
444 @li <b>Cluster</b>: Cluster routing, specific to cluster tag, should
447 @subsection pf_loopback I want to specify the characteristics of the loopback link!
449 Each routing model automatically adds a loopback link for each declared host, i.e.,
450 a network route from the host to itself, if no such route is declared in the XML
451 file. This default link has a bandwidth of 498 Mb/s, a latency of 15 microseconds,
452 and is <b>not</b> shared among network flows.
454 If you want to specify the characteristics of the loopback link for a given host, you
455 just have to specify a route from this host to itself with the desired characteristics
456 in the XML file. This will prevent the routing model to add and use the default
459 @subsection pf_switch I want to describe a switch but there is no switch tag!
461 Actually we did not include switch tag. But when you're trying to
462 simulate a switch, assuming
463 fluid bandwidth models are used (which SimGrid uses by default unless
464 ns-3 or constant network models are activated), the limiting factor is
465 switch backplane bandwidth. So, essentially, at least from
466 the simulation perspective, a switch is similar to a
467 link: some device that is traversed by flows and with some latency and
468 so,e maximum bandwidth. Thus, you can simply simulate a switch as a
470 can be connected to this "switch", which is then included in routes just
474 @subsection pf_multicabinets I want to describe multi-cabinets clusters!
476 You have several possibilities, as usual when modeling things. If your
477 cabinets are homogeneous and the intercabinet network negligible for
478 your study, you should just create a larger cluster with all hosts at
481 In the rare case where your hosts are not homogeneous between the
482 cabinets, you can create your cluster completely manually. For that,
483 create an As using the Cluster routing, and then use one
484 <cabinet> for each cabinet. This cabinet tag can only be used an
485 As using the Cluster routing schema, and creating
487 Be warned that creating a cluster manually from the XML with
488 <cabinet>, <backbone> and friends is rather tedious. The
489 easiest way to retrieve some control of your model without diving into
490 the <cluster> internals is certainly to create one separate
491 <cluster> per cabinet and interconnect them together. This is
492 what we did in the G5K example platform for the Graphen cluster.
494 @subsection pf_platform_multipath I want to express multipath routing in platform files!
496 It is unfortunately impossible to express the fact that there is more
497 than one routing path between two given hosts. Let's consider the
498 following platform file:
501 <route src="A" dst="B">
504 <route src="B" dst="C">
507 <route src="A" dst="C">
512 Although it is perfectly valid, it does not mean that data traveling
513 from A to C can either go directly (using link 3) or through B (using
514 links 1 and 2). It simply means that the routing on the graph is not
515 trivial, and that data do not following the shortest path in number of
516 hops on this graph. Another way to say it is that there is no implicit
517 in these routing descriptions. The system will only use the routes you
518 declare (such as <route src="A" dst="C"><link_ctn
519 id="3"/></route>), without trying to build new routes by aggregating
522 You are also free to declare platform where the routing is not
523 symmetrical. For example, add the following to the previous file:
526 <route src="C" dst="A">
532 This makes sure that data from C to A go through B where data from A
533 to C go directly. Don't worry about realism of such settings since
534 we've seen ways more weird situation in real settings (in fact, that's
535 the realism of very regular platforms which is questionable, but
536 that's another story).