diff options
author | Alberto Compagno <acompagn+fdio@cisco.com> | 2020-02-05 16:34:32 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@fd.io> | 2020-02-05 16:34:32 +0000 |
commit | 2f6e378577c7976aeb4d0b054a15aa3964a2c9de (patch) | |
tree | d0be83e17b1a9b223e14246858b55d79a97d616e | |
parent | 36b58c1359947e6c9d372560641e34cce5ff9caf (diff) | |
parent | acc777f02b93244d4d85446e890e94dbff2d6ada (diff) |
Merge "[HICN-503] correctly compute drop probability in RAAQM"
-rw-r--r-- | libtransport/src/hicn/transport/protocols/raaqm.cc | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/libtransport/src/hicn/transport/protocols/raaqm.cc b/libtransport/src/hicn/transport/protocols/raaqm.cc index 21a59bc9a..a57eb7cd9 100644 --- a/libtransport/src/hicn/transport/protocols/raaqm.cc +++ b/libtransport/src/hicn/transport/protocols/raaqm.cc @@ -567,7 +567,8 @@ void RaaqmTransportProtocol::RAAQM() { // Change drop probability according to RTT statistics cur_path_->updateDropProb(); - if (std::rand() % 10000 <= cur_path_->getDropProb() * 10000) { + double coin = ((double) rand() / (RAND_MAX)); + if (coin <= cur_path_->getDropProb()) { decreaseWindow(); } } |