Add Delivery Rate Estimation
Details
- A PrrtReceiver is equivalent to a BBR "Connection".
ToDo (Common)
- Introduce new type:
typedef uint32_t prrtByteCount_t;
ToDo (Sender)
- Make PrrtReceiver thread-safe (add a mutex that is locked upon changes). Extend it as follows:
typedef struct PrrtReceiver {
...
pthread_mutex_t lock;
prrtByteCount_t delivered; // tracked in octets
prrtTimestamp_t delivered_time;
prrtTimestamp_t first_sent_time;
bool app_limited;
BPTreeNode* outstandingPacketStates; // PrrtPacketStates are managed here
}
- Introduce a PacketState structure:
typedef struct PrrtPacketState {
prrtByteCount_t delivered;
prrtTimestamp_t expiry_time;
prrtPacketLength_t payload_length;
prrtTimestamp_t delivered_time;
prrtTimestamp_t first_sent_time;
bool is_app_limited;
prrtTimestamp_t sent_time;
} PrrtPacketState;
-
For each Receiver, we add a B-tree to keep track of PrrtPacketStates. The process works as follows:
- Upon sending of the packet, the PrrtPacketState is added to the
outstandingPacketStates
. - When a feedback is received, and a packet is ACKed, the PacketState is removed and the rate sample is generated https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/net/ipv4/tcp_rate.c.
- Upon sending of the packet, the PrrtPacketState is added to the
-
Introduce a PrrtRateSample structure (see http://elixir.free-electrons.com/linux/latest/source/include/net/tcp.h:
typedef struct PrrtRateSample {
...
prrtTimedelta_t interval;
prrtByteCount_t delivered;
bool is_app_limited;
} PrrtRateSample;
- For now, printing out rate samples is sufficient.
ToDo (Receiver)
- Extend send_feedback() method to also include the packet sequence number that is to be acked.
- Extend feedback packet to include a prrtSequenceNumber to ACK a certain packet.