class NetworkProximityService : public wrench::Service

A network proximity service that continuously estimates inter-host latencies and can be queried for such estimates.

Public Functions

NetworkProximityService(std::string db_hostname, std::vector<std::string> hosts_in_network, WRENCH_PROPERTY_COLLECTION_TYPE property_list = {}, WRENCH_MESSAGE_PAYLOADCOLLECTION_TYPE messagepayload_list = {})


  • hostname – the name of the host on which to start the service

  • hosts_in_network – the hosts participating in network measurements

  • property_list – a property list ({} means “use all defaults”)

  • messagepayload_list – a message payload list ({} means “use all defaults”)

~NetworkProximityService() override


std::pair<std::pair<double, double>, double> getHostCoordinate(std::string)

Look up the current (x,y) coordinates of a given host (only for a Vivaldi network service type)


requested_host – the host whose coordinates are being requested

  • WorkFlowExecutionException

  • std::runtime_error


A pair:

  • a (x,y) coordinate pair

  • a timestamp (the oldest timestamp of measurements used to compute the coordinate)

std::vector<std::string> getHostnameList()

Gets the list of hosts monitored by this service (does not involve simulated network communications with the service)


a list of hostnames

std::pair<double, double> getHostPairDistance(std::pair<std::string, std::string> hosts)

Look up a proximity value in database.


hosts – the pair of hosts whose proximity is of interest


A pair:

  • The proximity value between the pair of hosts (or DBL_MAX if none)

  • The timestamp of the oldest measurement use to compute the proximity value (or -1.0 if none)

std::string getNetworkProximityServiceType()

Get the network proximity service type.


a string specifying the network proximity service type

Public Static Attributes

static constexpr double NOT_AVAILABLE = DBL_MAX

A convenient constant that is returned as a latency between two hosts when no latency estimates are available for this pair of hosts.