Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Merge branch 'toufic' of github.com:Takishipp/simgrid
[simgrid.git] / doc / doxygen / platform.doc
index 21ae38a..f9601f9 100644 (file)
@@ -2,72 +2,68 @@
 
 @tableofcontents
 
-In order to run any simulation, SimGrid must be provided with three things:
-something to run (i.e., your code), a description of the platform on which you want to simulate your application, and 
-information about the deployment of the application: Which process should be executed onto which processor/core?
-
-For the last two items, there are essentially three possible ways you can provide
-this information as an input:
-\li You can program, if you're using MSG, some of the platform and
-    deployment functions. If you choose to follow this approach, check the dedicated documentation
-    (\ref msg_simulation).
-\li You can use two XML files: one for the platform description and the other for the deployment. 
-\li You can program the description of your platform  in Lua format.
-
-For more information on SimGrid's deployment features, please refer to the \ref deployment section.
-
-The platform description may be intricate. This documentation is all about how to write this file. First, the basic 
-concepts are introduced. Then, advanced options are explained. Finally, some hints and tips on how to write a better 
-platform description are given.
-
-\section pf_overview Some words about XML and DTD
-
-We opted for XML not only because it is extensible but also because many tools (and plugins for existing tools) are 
-available that facilitate editing and validating XML files. Furthermore, libraries that parse XML are often already
-available and very well tested.
-
-The XML checking is done based on the [simgrid.dtd](http://simgrid.gforge.inria.fr/simgrid/simgrid.dtd) Document Type 
-Definition (DTD) file.
-
-If you read the DTD, you should notice the following:
-\li The platform tag has a version attribute. The current version is <b>4</b>. This attribute might be used in the 
-    provide backward compatibility.
-\li The DTD contains definitions for both the platform description and deployment files used by SimGrid.
-
-\section pf_basics Basic concepts
-
-Nowadays, the Internet is composed of a bunch of independently managed
-networks. Within each of those networks, there are entry and exit
-points (most of the time, you can both enter and exit through the same
-point); this allows to leave the current network and reach other
-networks, possibly even in other locations. At the upper level, such a
-network is called <b>Autonomous System (AS)</b>, while at the lower
-level it is named sub-network, or LAN (local area network). They are
-indeed autonomous: routing is defined (within the limits of his
-network) by the administrator, and so, those networks can operate
-without a connection to other networks. So-called gateways allow you
-to go from one network to another, if such a (physical) connection
-exists. Every node in one network that can be directly reached (i.e.,
-without traversing other nodes) from another network is called a
-gateway. Each autonomous system consists of equipment such as cables
-(network links), routers and switches as well as computers.
-
-The structure of the SimGrid platform description relies exactly on
-the same concept as a real-life platform (see above).  Every resource
-(computers, network equipment etc.) belongs to an AS, which can be
-defined by using the \<AS\> tag. Within an AS, the routing between its
-elements can be defined abitrarily. There are several modes for
-routing, and exactly one mode must be selected by specifying the
-routing attribute in the AS tag:
+As @ref starting_components "explained in the introduction," any
+SimGrid study must entail the description of the platform on which you
+want to simulate your application. You have to describe **each element
+of your platform**, such as computing hosts, clusters, each disks,
+links, etc. You must also define the **routing on your platform**, ie
+which path is taken between two hosts. Finally, you may also describe
+an **experimental scenario**, with qualitative changes (e.g.,
+bandwidth changes representing an external load) and qualitative
+changes (representing how some elements fail and restart over time).
+
+You should really separate your application from the platform
+description, as it will ease your experimental campain afterward.
+Mixing them is seen as a really bad experimental practice. The easiest
+to enforce this split is to put the platform description in a XML
+file. Many example platforms are provided in the archive, and this
+page gives all needed details to write such files, as well as some
+hints and tricks about describing your platform.
+
+On the other side, XML is sometimes not expressive enough for some
+platforms, in particular large platforms exhibiting repetitive
+patterns that are not simply expressed in XML.  In practice, many
+users end up generating their XML platform files from some sort of
+scripts. It is probably preferable to rewrite your XML @ref
+platform_lua "platform using the lua scripting language" instead.
+In the future, it should be possible to describe the platform directly
+in C++, but this is not possible yet.
+
+As usual, SimGrid is a versatile framework, and you should find the
+way of describing your platform that best fits your experimental
+practice. 
+
+\section pf_overview Describing the platform with XML
+
+Your platform description should follow the specification presented in
+the [simgrid.dtd](http://simgrid.gforge.inria.fr/simgrid/simgrid.dtd)
+DTD file. The same DTD is used for both the platform and deployment
+files.
+
+From time to time, this DTD evolves to introduce possibly
+backward-incompatible changes. That is why each platform desciption is
+enclosed within a @c platform tag, that have a @c version attribute. 
+The current version is <b>4</b>. The @c simgrid_update_xml program can
+upgrade most of the past platform files to the recent formalism.
+
+\section pf_netzones Defining a NetZone
+
+In SimGrid, any resource must be located within a given **NetZone**.
+Each netzone is in charge of the routing between its resources. It
+means that when an host wants to communicate with another host of the
+same NetZone, it is the NetZone's duty to find the list of links that
+are involved in the communication. If the hosts are not in the same
+NetZone, @ref routing_basics "things are slightly more complex" to
+determine the links involved in a time- and space-efficient manner.
+
+But only one NetZone is really sufficient to begin with. The following
+chunk describes a simplistic NetZone using the Full routing (we will
+have to specify each and every routes manually). 
 
 \verbatim
-<AS id="AS0" routing="Full">
+<AS id="netzone0" routing="Full">
 \endverbatim
 
-\remark
-  Other supported values for the routing attribute can be found below, Section
-  \ref pf_raf.
-
 There is also the ``<route>`` tag; this tag takes two attributes,
 ``src`` (source) and ``dst`` (destination). Both source and
 destination must be valid identifiers for routers (these will be
@@ -79,7 +75,7 @@ how to reach a router from another router.
 \remark
   More information and (code-)examples can be found in Section \ref pf_rm.
 
-An AS can also contain itself one or more AS; this allows you to model
+A netzone can also contain itself one or more netzone; this allows you to model
 the hierarchy of your platform.
 
 ### Within each AS, the following types of resources exist:
@@ -122,10 +118,10 @@ Here is an illustration of these concepts:
 
 \subsection  pf_As Platform: The &lt;AS&gt; tag
 
-The concept of an AS was already outlined above (Section \ref pf_basics);
-recall that the AS is so important because it groups other resources (such
-as routers/hosts) together (in fact, these resources must be contained by
-an AS).
+For historical reasons, the XML files use the expression AS for
+NetZones. Netzones are very important because they group other resources (such
+as routers/hosts) together (in fact, any such resource must be
+contained in a NetZone).
 
 Available attributes :
 
@@ -150,7 +146,7 @@ between the hosts goes through link1.
 
 \subsection pf_Cr Computing resources: hosts, clusters and peers.
 
-\subsubsection pf_host &lt;host/&gt;
+\subsubsection pf_host &lt;host&gt;
 
 A <b>host</b> represents a computer/node card. Every host is able to execute
 code and it can send and receive data to/from other hosts. Most importantly,
@@ -333,14 +329,14 @@ limiter_link      | no        | int    | Bandwidth for limiter link (if any). Th
 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".
 loopback_lat      | no      | int    | Latency for loopback (if any). See <b>link</b> section for syntax/details. See loopback_bw for more info.
 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.
-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. For fat trees, refer to \ref simgrid::kernel::routing::AsClusterFatTree "AsClusterFatTree documentation". For dragonfly, refer to \ref simgrid::kernel::routing::AsClusterDragonfly "AsClusterDragonfly documentation".
+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".
 
 
 the router name is defined as the resulting String in the following
 java line of code:
 
 @verbatim
-router_name = prefix + clusterId + _router + suffix;
+router_name = prefix + clusterId + "_router" + suffix;
 @endverbatim
 
 
@@ -423,20 +419,16 @@ The hosts generated in the above example are named host-1.cluster, host-2.cluste
 etc.
 
 
-\subsubsection pf_peer The &lt;peer&gt; tag
+\subsubsection pf_peer \<peer\> (Vivaldi netzones only)
 
-This tag represents a peer, as in Peer-to-Peer (P2P) networks. However, internally,
-SimGrid transforms a peer into an AS (similar to Cluster). Hence, this tag
-is virtually only a shortcut that comes with some pre-defined resources
-and values. These are:
+This tag represents a peer, as in Peer-to-Peer (P2P) networks. This
+can only be used in Vivaldi NetZones. It creates the following
+resources to the NetZone:
 
-\li A tiny AS whose routing type is cluster is created
 \li A host
 \li Two links: One for download and one for upload. This is
     convenient to use and simulate stuff under the last mile model (e.g., ADSL peers).
 \li It connects the two links to the host
-\li It creates a router (a gateway) that serves as an entry point for this peer zone.
-    This router has coordinates.
 
 #### Attributes ####
 
@@ -444,36 +436,22 @@ Attribute name  | Mandatory | Values | Description
 --------------- | --------- | ------ | -----------
 id              | yes       | string | The identifier of the peer. Facilitates referring to this peer.
 speed           | yes       | int    | See the description of the ``host`` tag for this attribute
-bw_in           | yes       | int    | Bandwidth downstream
-bw_out          | yes       | int    | Bandwidth upstream
-lat             | yes       | double | Latency for both up- and downstream, in seconds.
+bw_in           | yes       | int    | Bandwidth of the private downstream link
+bw_out          | yes       | int    | Bandwidth of the private upstream link
 coordinates     | no        | string | Coordinates of the gateway for this peer. Example value: 12.8 14.4 6.4
 sharing_policy  | no        | SHARED\|FULLDUPLEX (default: FULLDUPLEX) | Sharing policy for links. See <b>link</b> description for details.
 availability_file| no       | string | Availability file for the peer. Same as host availability file. See <b>host</b> description for details.
 state_file      | no        | string | State file for the peer. Same as host state file. See <b>host</b> description for details.
 
-Internally, SimGrid transforms any ``\<peer/\>`` construct such as
-\verbatim
-<peer id="FOO"
-  coordinates="12.8 14.4 6.4"
-  speed="1.5Gf"
-  bw_in="2.25GBps"
-  bw_out="2.25GBps"
-  lat="500us" />
-\endverbatim
-into an ``\<AS\>`` (see Sections \ref pf_basics and \ref pf_As). In fact, this example of the ``\<peer/\>`` tag
-is completely equivalent to the following declaration:
 
-\verbatim
-<AS id="as_FOO" routing="Cluster">
-   <host id="peer_FOO" speed="1.5Gf"/>
-   <link id="link_FOO_UP" bandwidth="2.25GBps" latency="500us"/>
-   <link id="link_FOO_DOWN" bandwidth="2.25GBps" latency="500us"/>
-   <router id="router_FOO" coordinates="25.5 9.4 1.4"/>
-   <host_link id="peer_FOO" up="link_FOO_UP" down="link_FOO_DOWN"/>
-</AS>
-\endverbatim
+The communication latency between an host A=(xA,yA,zA) and an host
+B=(xB,yB,zB) is computed as follows:
+ latency = sqrt( (xA-xB)² + (yA-yB)² ) + zA + zB
 
+See the documentation of simgrid::kernel::routing::VivaldiZone for
+details on how the latency is computed from the coordinate, and on the
+the up and down bandwidth are used.
 
 \subsection pf_ne Network equipments: links and routers
 
@@ -1204,12 +1182,9 @@ routing model (the path is given relative to SimGrid's source directory):
 For more information on how to use the [Vivaldi Coordinates](https://en.wikipedia.org/wiki/Vivaldi_coordinates),
 see also Section \ref pf_P2P_tags "P2P tags".
 
-For documentation on how to activate this model (as some initialization must be done
-in the simulator), see Section \ref options_model_network_coord "Activating Coordinate Based Routing".
-
 Note that it is possible to combine the Vivaldi routing model with other routing models;
 an example can be found in the file \c examples/platforms/cloud.xml. This
-examples models an AS using Vivaldi that contains other ASes that use different
+examples models a NetZone using Vivaldi that contains other NetZones that use different
 routing models.
 
 #### Example platform files ####