forked from keithw/datagrump
-
Notifications
You must be signed in to change notification settings - Fork 0
/
controller.hh
47 lines (37 loc) · 1.12 KB
/
controller.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
#ifndef CONTROLLER_HH
#define CONTROLLER_HH
#include <stdint.h>
/* Flow controller interface */
class Controller
{
private:
bool debug_; /* Enables debugging output */
double cwnd;
uint64_t last_ack_timestamp;
uint64_t RTT_min;
double interarrival_average;
uint64_t timestamp_zero;
double ALPHA;
double BETA;
double GAMMA;
double DELTA;
public:
/* Public interface for the flow controller */
/* You can change these if you prefer, but will need to change
the call site as well (in datagrump-sender.cc) */
/* Default constructor */
Controller( const bool debug );
/* Get current window size, in packets */
unsigned int window_size( void );
/* A packet was sent */
void packet_was_sent( const uint64_t sequence_number,
const uint64_t send_timestamp );
/* An ack was received */
void ack_received( const uint64_t sequence_number_acked,
const uint64_t send_timestamp_acked,
const uint64_t recv_timestamp_acked,
const uint64_t timestamp_ack_received );
/* How long to wait if there are no acks before sending one more packet */
unsigned int timeout_ms( void );
};
#endif