forked from venkatarun95/genericCC
-
Notifications
You must be signed in to change notification settings - Fork 0
/
remycc.hh
48 lines (35 loc) · 1.03 KB
/
remycc.hh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#ifndef REMYCC_HH
#define REMYCC_HH
#include <chrono>
#include <unordered_map>
#include <vector>
#include "ccc.hh"
#include "configs.hh"
#include "rat.hh"
#include "whiskertree.hh"
#include "packet.hh"
class RemyCC: public CCC {
private:
WhiskerTree tree;
Rat rat;
std::chrono::high_resolution_clock::time_point start_time_point;
std::unordered_map<int, double> unacknowledged_packets;
int flow_id;
double current_timestamp();
double measured_link_rate;
protected:
public:
virtual void init();
virtual void onACK(int ack, double receiver_timestamp, double sender_timestamp __attribute((unused))) override ;
virtual void onPktSent(int seq_num) override ;
virtual void onTimeout() override { std::cerr << "Ack timed out!\n"; }
virtual void onLinkRateMeasurement( double s_measured_link_rate ) override;
RemyCC( WhiskerTree & s_tree )
: tree( s_tree ), rat( tree ), start_time_point(), unacknowledged_packets(), flow_id( 0 ), measured_link_rate( -1 )
{
_the_window = 2;
_intersend_time = 0;
_timeout = 1000;
}
};
#endif