10 #ifndef WRENCH_NETWORKPROXIMITYSERVICE_H
11 #define WRENCH_NETWORKPROXIMITYSERVICE_H
16 #include "wrench/services/Service.h"
17 #include "wrench/services/network_proximity/NetworkProximityServiceProperty.h"
18 #include "wrench/services/network_proximity/NetworkProximityDaemon.h"
29 WRENCH_PROPERTY_COLLECTION_TYPE default_property_values = {
40 WRENCH_MESSAGE_PAYLOADCOLLECTION_TYPE default_messagepayload_values = {
59 static constexpr
double NOT_AVAILABLE = DBL_MAX;
68 std::vector<std::string> hosts_in_network,
69 WRENCH_PROPERTY_COLLECTION_TYPE property_list = {},
70 WRENCH_MESSAGE_PAYLOADCOLLECTION_TYPE messagepayload_list = {}
77 std::vector<std::string> getHostnameList();
79 std::pair<double, double> getHostPairDistance(std::pair<std::string, std::string> hosts);
81 std::pair<std::pair<double, double>,
double> getHostCoordinate(std::string);
83 std::string getNetworkProximityServiceType();
92 std::vector<std::shared_ptr<NetworkProximityDaemon>> network_daemons;
93 std::vector<std::string> hosts_in_network;
95 std::default_random_engine master_rng;
99 bool processNextMessage();
101 void addEntryToDatabase(std::pair<std::string, std::string> pair_hosts,
double proximity_value);
103 std::map<std::pair<std::string, std::string>, std::pair<double, double>> entries;
105 std::map<std::string, std::pair<std::complex<double>,
double>> coordinate_lookup_table;
107 std::shared_ptr<NetworkProximityDaemon>
108 getCommunicationPeer(
const std::shared_ptr<NetworkProximityDaemon> sender_daemon);
110 void vivaldiUpdate(
double proximityValue, std::string sender_hostname, std::string peer_hostname);
112 void validateProperties();
116 #endif //WRENCH_NETWORKPROXIMITYSERVICE_H
static const std::string NETWORK_PROXIMITY_MEASUREMENT_PERIOD
The inter-measurement period (in seconds) to be used (default: 60)
Definition: NetworkProximityServiceProperty.h:37
static const std::string NETWORK_PROXIMITY_MESSAGE_SIZE
The message size (in bytes) to be used in RTT measurements (default: 1024)
Definition: NetworkProximityServiceProperty.h:34
static const std::string NETWORK_DAEMON_CONTACT_ANSWER_PAYLOAD
The number of bytes in the message sent by the service to a network proximity daemon in answer to a r...
Definition: NetworkProximityServiceMessagePayload.h:37
static const std::string DAEMON_STOPPED_MESSAGE_PAYLOAD
The number of bytes in the control message sent by the daemon to confirm it has terminated.
Definition: ServiceMessagePayload.h:37
static const std::string NETWORK_PROXIMITY_MEASUREMENT_PERIOD_NOISE_SEED
The seed for the noise random number generator.
Definition: NetworkProximityServiceProperty.h:44
static const std::string NETWORK_DAEMON_CONTACT_REQUEST_PAYLOAD
The number of bytes in the message sent by a network proximity daemon to the network proximity servic...
Definition: NetworkProximityServiceMessagePayload.h:32
NetworkProximityService(std::string db_hostname, std::vector< std::string > hosts_in_network, WRENCH_PROPERTY_COLLECTION_TYPE property_list={}, WRENCH_MESSAGE_PAYLOADCOLLECTION_TYPE messagepayload_list={})
Constructor.
Definition: NetworkProximityService.cpp:48
static const std::string NETWORK_PROXIMITY_PEER_LOOKUP_SEED
The random (integer) number generator seed used by the service to pick RTT measurement peers (default...
Definition: NetworkProximityServiceProperty.h:50
Definition: Action.cpp:28
static const std::string NETWORK_DB_LOOKUP_ANSWER_MESSAGE_PAYLOAD
The number of bytes in the message sent by the service in answer to a request for a proximity value l...
Definition: NetworkProximityServiceMessagePayload.h:27
static const std::string NETWORK_DAEMON_MEASUREMENT_REPORTING_PAYLOAD
The number of bytes in the message sent by a network proximity daemon to the network proximity servic...
Definition: NetworkProximityServiceMessagePayload.h:41
static const std::string NETWORK_DB_LOOKUP_REQUEST_MESSAGE_PAYLOAD
The number of bytes in the message sent to the service to request a proximity value lookup.
Definition: NetworkProximityServiceMessagePayload.h:24
static const std::string NETWORK_PROXIMITY_MEASUREMENT_PERIOD_MAX_NOISE
The maximum random uniformly distributed noise (in seconds) to be added to the measurement period (us...
Definition: NetworkProximityServiceProperty.h:41
static const std::string NETWORK_DAEMON_COMMUNICATION_COVERAGE
The percentage of other network proximity daemons that each network proximity daemon will conduct RTT...
Definition: NetworkProximityServiceProperty.h:47
static const std::string LOOKUP_OVERHEAD
The overhead, in seconds, of looking up entries for a file (default: 0)
Definition: NetworkProximityServiceProperty.h:25
static const std::string STOP_DAEMON_MESSAGE_PAYLOAD
The number of bytes in the control message sent to the daemon to terminate it.
Definition: ServiceMessagePayload.h:35
A class that provides basic simulation methods. Once the simulation object has been explicitly or imp...
Definition: Simulation.h:48
A service that can be added to the simulation and that can be used by a WMS when executing a workflow...
Definition: Service.h:31
A network proximity service that continuously estimates inter-host latencies and can be queried for s...
Definition: NetworkProximityService.h:26
static const std::string NETWORK_PROXIMITY_SERVICE_TYPE
The type of network proximity implementation to be used:
Definition: NetworkProximityServiceProperty.h:31