Commit 892d8089 authored by Andreas Schmidt's avatar Andreas Schmidt

Cwnd in bytes. Proper pacing.

parent 90829abc
Pipeline #2112 failed with stages
in 21 seconds
......@@ -23,16 +23,17 @@ void BBR_EnterStartup(BBR* bbr)
void BBR_UpdateBtlBw(BBR* bbr, PrrtRateSample* rs, PrrtPacketTracking* tracking)
{
if (tracking->bytes_delivered >= bbr->next_round_delivered) {
if (tracking->delivered >= bbr->next_round_delivered) {
bbr->next_round_delivered = tracking->delivered;
bbr->round_count++;
bbr->round_start = true;
} else {
bbr->round_start = false;
}
if ((rs->delivery_rate >= bbr->bw || !rs->is_app_limited) && rs->delivery_rate != 0) {
bbr->bw = (uint32_t)WindowedFilter_push(bbr->btlBwFilter, (uint32_t)((float) rs->delivery_rate / 8));
debug(DEBUG_BBR, "Current BtlBw: %u, RS delivery rate: %u", bbr->bw, (uint32_t)rs->delivery_rate);
uint32_t delivery_rate_Bps = (uint32_t)((float) rs->delivery_rate / 8);
if ((delivery_rate_Bps >= bbr->bw || !rs->is_app_limited) && delivery_rate_Bps != 0) {
bbr->bw = (uint32_t)WindowedFilter_push(bbr->btlBwFilter, delivery_rate_Bps);
debug(DEBUG_BBR, "Current BtlBw: %u, RS delivery rate: %u", bbr->bw, delivery_rate_Bps);
}
}
......@@ -132,10 +133,10 @@ void BBR_EnterProbeRTT(BBR *bbr) {
}
void BBR_HandleProbeRTT(BBR *bbr, PrrtPacketTracking *tracking) {
tracking->app_limited = (tracking->delivered + tracking->packets_in_flight) ? : 1;
tracking->app_limited = (tracking->delivered + tracking->pipe) ? : 1;
/* Ignore low rate samples during ProbeRTT: */
prrtTimestamp_t now = PrrtClock_get_current_time_us();
if (bbr->probe_rtt_done_stamp == 0 && tracking->packets_in_flight <= BBRMinPipeCwnd) {
if (bbr->probe_rtt_done_stamp == 0 && tracking->pipe <= BBRMinPipeCwnd) {
bbr->probe_rtt_done_stamp = now + ProbeRTTDuration;
bbr->probe_rtt_round_done = false;
bbr->next_round_delivered = tracking->delivered;
......
......@@ -107,7 +107,7 @@ static bool send_packet(PrrtSocket *sock_ptr, PrrtPacket *packet) {
prrtTimestamp_t now = PrrtClock_get_current_time_us();
if (sock_ptr->pacingEnabled && BBR_getPacingRate(sock_ptr->receiver->bbr) != 0) {
debug(DEBUG_DATATRANSMITTER, "Payload: %u, PacingRate: %u, Pacing Time: %u", packet->payloadLength, BBR_getPacingRate(sock_ptr->receiver->bbr), packet->payloadLength / BBR_getPacingRate(sock_ptr->receiver->bbr));
sock_ptr->nextSendTime = now + ((prrtTimedelta_t) round((packet->payloadLength / ((double) 1000 * 1000 * BBR_getPacingRate(sock_ptr->receiver->bbr)))));
sock_ptr->nextSendTime = now + ((prrtTimedelta_t) round((((double) 1000 * 1000 * packet->payloadLength) / (BBR_getPacingRate(sock_ptr->receiver->bbr)))));
}
struct timespec timestamp;
......
......@@ -172,12 +172,10 @@ bool PrrtReceiver_updateAndGenerateRateSample(PrrtReceiver *recv, prrtSequenceNu
pthread_cond_wait(&recv->recordNotFoundCv, &recv->lock);
packet = PrrtInFlightPacketStore_get_packet(inflightPacketStore, seqnum);
}
recv->packetTracking->bytes_delivered = packet->delivered;
recv->packetTracking->pipe -= packet->payloadLength;
PrrtReceiver_updateRateSample(recv->rateSample, packet, receiveTime, recv->packetTracking);
bool result = PrrtReceiver_generateRateSample(recv->rateSample, recv->packetTracking);
recv->packetTracking->pipe -= packet->payloadLength;
PrrtInFlightPacketStore_remove_outstanding_packet(inflightPacketStore, seqnum);
check(pthread_mutex_unlock(&recv->lock) == 0, "Unlock failed.");
check(pthread_cond_broadcast(&recv->pipeNotFullCv) == 0, "Signal failed.");
......
......@@ -9,7 +9,6 @@ typedef struct packetTracking {
prrtTimestamp_t delivered_time;
prrtTimestamp_t first_sent_time;
prrtByteCount_t app_limited;
prrtByteCount_t bytes_delivered;
prrtSequenceNumber_t packets_lost;
prrtByteCount_t prior_inflight;
prrtSequenceNumber_t packets_in_flight;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment