X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/a18117755285a374ec3d5830309c924f2830e3ba..9cca09ad88fcaeb49f2637de97df519c3920aaa4:/src/kernel/routing/VivaldiZone.hpp diff --git a/src/kernel/routing/VivaldiZone.hpp b/src/kernel/routing/VivaldiZone.hpp index 0998640236..64ea9bd5f2 100644 --- a/src/kernel/routing/VivaldiZone.hpp +++ b/src/kernel/routing/VivaldiZone.hpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2013-2016. The SimGrid Team. All rights reserved. */ +/* Copyright (c) 2013-2017. The SimGrid Team. All rights reserved. */ /* This program is free software; you can redistribute it and/or modify it * under the terms of the license (GNU LGPL) which comes with this package. */ @@ -12,21 +12,51 @@ namespace simgrid { namespace kernel { namespace routing { -/* This extends cluster because each host has a private link */ -class XBT_PRIVATE AsVivaldi : public AsCluster { +/** @ingroup ROUTING_API + * @brief NetZone modeling peers connected to the cloud through a private link + * + * This netzone model is particularly well adapted to Peer-to-Peer and Clouds platforms: + * each component is connected to the cloud through a private link of which the upload + * and download rate may be asymmetric. + * + * The network core (between the private links) is assumed to be over-sized so only the + * latency is taken into account. Instead of a matrix of latencies that would become too + * large when the amount of peers grows, Vivaldi netzones give a coordinate to each peer + * and compute the latency between host A=(xA,yA,zA) and host B=(xB,yB,zB) as follows: + * + * latency = sqrt( (xA-xB)² + (yA-yB)² ) + zA + zB + * + * The resulting value is assumed to be in milliseconds. + * + * So, to go from an host A to an host B, the following links would be used: + * private(A)_UP, private(B)_DOWN, with the additional latency computed above. + * The bandwidth of the UP and DOWN links is not symmetric (in contrary to usual SimGrid + * links), but naturally correspond to the values provided when the peer was created. + * More information in the relevant section of the XML reference guide: @ref pf_peer. + * + * You can find some Coordinate-based platforms from the OptorSim project, as well as a + * script to turn them into SimGrid platforms in examples/platforms/syscoord. + * + * Such Network Coordinate systems were shown to provide rather good latency estimations + * in a compact way. Other systems, such as + * + * were shown superior to the Vivaldi system and could be also implemented in SimGrid. + */ + +class XBT_PRIVATE VivaldiZone : public ClusterZone { public: - explicit AsVivaldi(As* father, const char* name); + explicit VivaldiZone(NetZone* father, std::string name); - void setPeerLink(NetCard* netcard, double bw_in, double bw_out, double lat, const char* coord); - void getLocalRoute(NetCard* src, NetCard* dst, sg_platf_route_cbarg_t into, double* latency) override; + void setPeerLink(NetPoint* netpoint, double bw_in, double bw_out, std::string coord); + void getLocalRoute(NetPoint* src, NetPoint* dst, sg_platf_route_cbarg_t into, double* latency) override; }; namespace vivaldi { class XBT_PRIVATE Coords { public: - static simgrid::xbt::Extension EXTENSION_ID; - explicit Coords(NetCard* host, const char* str); - virtual ~Coords(); + static simgrid::xbt::Extension EXTENSION_ID; + explicit Coords(NetPoint* host, std::string str); + virtual ~Coords() = default; std::vector coords; };