X-Git-Url: http://bilbo.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/84402e8e2ee2a2d0bef25fdceb0a263ed8b471f6..4dacd75d844c59d9dc7b5dd7754067020fceb9d4:/src/surf/network_wifi.hpp diff --git a/src/surf/network_wifi.hpp b/src/surf/network_wifi.hpp index a7887c1dd6..f0d2cce6c0 100644 --- a/src/surf/network_wifi.hpp +++ b/src/surf/network_wifi.hpp @@ -19,6 +19,8 @@ namespace simgrid { namespace kernel { namespace resource { +class XBT_PRIVATE NetworkWifiAction; + class NetworkWifiLink : public LinkImpl { /** @brief Hold every rates association between host and links (host name, rates id) */ std::map host_rates_; @@ -26,6 +28,19 @@ class NetworkWifiLink : public LinkImpl { /** @brief A link can have several bandwith attach to it (mostly use by wifi model) */ std::vector bandwidths_; + /** @brief Should we use the decay model ? */ + bool use_decay_model_=false; + /** @brief Wifi maximal bit rate according to the ns-3 802.11n standard */ + const double wifi_max_rate_ = 54 * 1e6 / 8; + /** @brief minimum bit rate observed with ns3 during our calibration experiments */ + const double wifi_min_rate_ = 41.70837 * 1e6 / 8; + /** @brief Amount of stations used in the reference point to rescale SimGrid predictions to fit ns-3 ones */ + const int model_n_=5; + /** @brief Bit rate observed on ns3 at the reference point used for rescaling */ + const double model_rate_=42.61438*1e6 / 8; + /** @brief The bandwidth to use for each SNR level, corrected with the decay rescale mechanism */ + std::vector decay_bandwidths_; + public: NetworkWifiLink(NetworkCm02Model* model, const std::string& name, std::vector bandwidths, lmm::System* system); @@ -38,6 +53,24 @@ public: void apply_event(kernel::profile::Event*, double) override { THROW_UNIMPLEMENTED; } void set_bandwidth(double) override { THROW_UNIMPLEMENTED; } void set_latency(double) override { THROW_UNIMPLEMENTED; } + void refresh_decay_bandwidths(); + bool toggle_decay_model(); +}; + +class NetworkWifiAction : public NetworkCm02Action { + NetworkWifiLink* src_wifi_link_; + NetworkWifiLink* dst_wifi_link_; + +public: + NetworkWifiAction(Model* model, s4u::Host& src, s4u::Host& dst, double cost, bool failed, + NetworkWifiLink* src_wifi_link, NetworkWifiLink* dst_wifi_link) + : NetworkCm02Action(model, src, dst, cost, failed) + , src_wifi_link_(src_wifi_link) + , dst_wifi_link_(dst_wifi_link) + {} + + NetworkWifiLink* get_src_link() const { return src_wifi_link_; } + NetworkWifiLink* get_dst_link() const { return dst_wifi_link_; } }; } // namespace resource