From: Arnaud Legrand Date: Wed, 21 Aug 2013 15:44:04 +0000 (+0200) Subject: Peers should be within an AS if we want this construction to be compatible with other... X-Git-Tag: v3_9_90~123^2~49 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/c3b8f97d9a04b20bdf7e924d5976f93249cf1cc2 Peers should be within an AS if we want this construction to be compatible with other kind of AS. --- diff --git a/ChangeLog b/ChangeLog index 1f98654688..0c478e6686 100644 --- a/ChangeLog +++ b/ChangeLog @@ -59,7 +59,10 @@ SimGrid (3.10) NOT RELEASED; urgency=low * Remove rule based routing (no more pcre dependency) * Add a limiter_link option to cluster tag, to specify a maximum reachable bandwidth in fullduplex mode when it is < 2*nominal bw - * Add a loopback_bw and loopback_lat options to cluster tag. + * Add a loopback_bw and loopback_lat options to cluster tag. + * Fix the peer tag that could not be mixed with other AS within a vivaldi + routing. Now peers are encapsulated in an AS and have their own private + router but this is transparent. -- $date Da SimGrid team diff --git a/doc/doxygen/platform.doc b/doc/doxygen/platform.doc index 0987ed6b9e..c2891d873b 100644 --- a/doc/doxygen/platform.doc +++ b/doc/doxygen/platform.doc @@ -391,11 +391,13 @@ A peer represents a peer, as in Peer-to-Peer (P2P). Basically, as cluster, A PEER IS INTERNALLY INTERPRETED AS AN \. It's just a kind of shortcut that does the following : +\li It creates a tiny AS whose routing type is cluster \li It creates an host \li Two links : one for download and one for upload. This is convenient to use and simulate stuff under the last mile model (as - ADSL peers). -\li It creates a gateway that serve as entry point for this peer zone. + ADSL peers). +\li It connects the two links to the host +\li It creates a router (a gateway) that serve as entry point for this peer zone. This router has coordinates. peer attributes : @@ -414,6 +416,27 @@ just a kind of shortcut that does the following : \li state_file : state file for the peer. Same as host state file. See host description for details. +In term of XML, the peer construct can be explained as follows: it transforms +\verbatim + +\endverbatim +into +\verbatim + + + + + + + +\endverbatim + + \subsection pf_ne Network equipments: links and routers You have basically two entities available to represent network entities: @@ -1328,6 +1351,29 @@ Coordinates are then used to calculate latency between two hosts by calculating the euclidian distance between the two hosts coordinates. The results express the latency in ms. +Note that the previous example defines a routing directly between hosts but it could be also used to define a routing between AS. +That is for example what is commonly done when using peers (see Section \ref pf_peer). +\verbatim + + + + + + + + + + + + + +\endverbatim +In such a case though, we connect the AS created by the peer tag with the Vivaldi routing mechanism. +This means that to route between AS1 and AS2, it will use the coordinates of router_AS1 and router_AS2. +This is currently a convention and we may offer to change this convention in the DTD later if needed. +You may have noted that conveniently, a peer named FOO defines an AS named FOO and a router named router_FOO, which is why it works seamlessly with the peer tag. + + \subsection pf_wisely Choosing wisely the routing model to use diff --git a/src/surf/surf_routing.c b/src/surf/surf_routing.c index 7380bf694a..32f9bfa64b 100644 --- a/src/surf/surf_routing.c +++ b/src/surf/surf_routing.c @@ -1003,11 +1003,22 @@ static void routing_parse_postparse(void) { static void routing_parse_peer(sg_platf_peer_cbarg_t peer) { char *host_id = NULL; - char *link_id; + char *link_id = NULL; + char *router_id = NULL; XBT_DEBUG(" "); host_id = HOST_PEER(peer->id); link_id = LINK_PEER(peer->id); + router_id = ROUTER_PEER(peer->id); + + XBT_DEBUG("", peer->id); + s_sg_platf_AS_cbarg_t AS = SG_PLATF_AS_INITIALIZER; + AS.id = peer->id; + AS.routing = A_surfxml_AS_routing_Cluster; + sg_platf_new_AS_begin(&AS); + + current_routing->link_up_down_list + = xbt_dynar_new(sizeof(s_surf_parsing_link_up_down_t),NULL); XBT_DEBUG("", host_id, peer->power); s_sg_platf_host_cbarg_t host; @@ -1024,7 +1035,6 @@ static void routing_parse_peer(sg_platf_peer_cbarg_t peer) host.power_trace = peer->availability_trace; host.state_trace = peer->state_trace; host.core_amount = 1; - host.coord = peer->coord; sg_platf_new_host(&host); s_sg_platf_link_cbarg_t link; @@ -1055,6 +1065,16 @@ static void routing_parse_peer(sg_platf_peer_cbarg_t peer) host_link.link_down= link_down; sg_platf_new_host_link(&host_link); + XBT_DEBUG("", router_id); + s_sg_platf_router_cbarg_t router; + memset(&router, 0, sizeof(router)); + router.id = router_id; + router.coord = peer->coord; + sg_platf_new_router(&router); + ((as_cluster_t)current_routing)->router = xbt_lib_get_or_null(as_router_lib, router.id, ROUTING_ASR_LEVEL); + + XBT_DEBUG(""); + sg_platf_new_AS_end(); XBT_DEBUG(" "); //xbt_dynar_free(&tab_elements_num);