Loading prrt/cprrt.pxd +2 −0 Original line number Diff line number Diff line Loading @@ -152,6 +152,8 @@ cdef extern from "proto/socket.h": bint PrrtSocket_get_filled_pipe(PrrtSocket *s) uint32_t PrrtSocket_get_cycle_index(PrrtSocket *s) float PrrtSocket_get_pacing_gain(PrrtSocket *s) uint32_t PrrtSocket_get_cwnd(PrrtSocket *s) uint32_t PrrtSocket_get_inflight(PrrtSocket *s) bint PrrtSocket_get_app_limited(PrrtSocket *socket) Loading prrt/proto/bbr.c +9 −5 Original line number Diff line number Diff line Loading @@ -2,6 +2,7 @@ #include "../util/dbg.h" #include "../util/common.h" #include "receiver.h" #include <math.h> prrtByteCount_t BBR_Inflight(BBR* bbr, float gain) Loading @@ -9,7 +10,7 @@ prrtByteCount_t BBR_Inflight(BBR* bbr, float gain) if (bbr->rtprop == Inf) return InitialCwnd; /* no valid RTT samples yet */ uint32_t quanta = 3 * bbr->send_quantum; uint32_t estimated_bdp = (bbr->bw * bbr->rtprop) / (1000 * 1000 * 8); uint32_t estimated_bdp = (uint32_t) round(((double)bbr->bw * bbr->rtprop) / (1000 * 1000)); return (uint32_t)(gain * estimated_bdp + quanta); } Loading @@ -30,7 +31,7 @@ void BBR_UpdateBtlBw(BBR* bbr, PrrtRateSample* rs, PrrtPacketTracking* tracking) 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)(rs->delivery_rate)); 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); } } Loading Loading @@ -131,10 +132,10 @@ void BBR_EnterProbeRTT(BBR *bbr) { } void BBR_HandleProbeRTT(BBR *bbr, PrrtPacketTracking *tracking) { tracking->app_limited = (tracking->delivered + tracking->pipe) ? : 1; tracking->app_limited = (tracking->delivered + tracking->packets_in_flight) ? : 1; /* Ignore low rate samples during ProbeRTT: */ prrtTimestamp_t now = PrrtClock_get_current_time_us(); if (bbr->probe_rtt_done_stamp == 0 && tracking->pipe <= BBRMinPipeCwnd) { if (bbr->probe_rtt_done_stamp == 0 && tracking->packets_in_flight <= BBRMinPipeCwnd) { bbr->probe_rtt_done_stamp = now + ProbeRTTDuration; bbr->probe_rtt_round_done = false; bbr->next_round_delivered = tracking->delivered; Loading Loading @@ -211,7 +212,7 @@ void BBR_SetCwnd(BBR* bbr, PrrtPacketTracking* packetTracking) void BBR_SetPacingRateWithGain(BBR* bbr, float pacing_gain) { uint32_t rate = (uint32_t) (pacing_gain * ((float)bbr->bw) / (1000*1000*8)); uint32_t rate = (uint32_t) (pacing_gain * ((float)bbr->bw)); debug(DEBUG_BBR, "Current rate: %u, Pacing gain: %f, BtlBw: %u, Calc Rate: %u, Filled pipe: %u", bbr->pacing_rate, pacing_gain, bbr->bw, rate, bbr->filled_pipe); if (rate != 0 && (bbr->filled_pipe || rate > bbr->pacing_rate)) Loading Loading @@ -312,3 +313,6 @@ uint64_t BBR_getFullBw(BBR* bbr) { return bbr->full_bw; } prrtByteCount_t BBR_getInflight(BBR* bbr) { return BBR_Inflight(bbr, bbr->pacing_gain); } No newline at end of file prrt/proto/bbr.h +3 −3 Original line number Diff line number Diff line Loading @@ -10,12 +10,11 @@ #include "types/rateSample.h" #include "../util/windowedFilter.h" #define MTU 1500 #define RTpropFilterLen 10000000 //10s #define BBRHighGain ((2885 / 1000) + 1) #define InitialCwnd (10 * MTU) #define InitialCwnd 10 #define BBRGainCycleLen 8 #define BBRMinPipeCwnd (4 * MTU) #define BBRMinPipeCwnd 4 #define ProbeRTTDuration 200000 //200ms #define Inf UINT32_MAX Loading Loading @@ -82,5 +81,6 @@ float BBR_getPacingGain(BBR* bbr); uint32_t BBR_getCycleIndex(BBR* bbr); bool BBR_getFilledPipe(BBR* bbr); uint32_t BBR_getRTProp(BBR* bbr); prrtByteCount_t BBR_getInflight(BBR* bbr); #endif //PRRT_BBR_H prrt/proto/socket.c +9 −0 Original line number Diff line number Diff line Loading @@ -624,6 +624,15 @@ uint64_t PrrtSocket_get_full_bw(PrrtSocket *s) { return BBR_getFullBw(s->receiver->bbr); } uint32_t PrrtSocket_get_cwnd(PrrtSocket *s) { return BBR_getCwnd(s->receiver->bbr); } uint32_t PrrtSocket_get_inflight(PrrtSocket *s) { return BBR_getInflight(s->receiver->bbr); } float PrrtSocket_get_pacing_gain(PrrtSocket *s) { return BBR_getPacingGain(s->receiver->bbr); } Loading prrt/proto/socket.h +2 −0 Original line number Diff line number Diff line Loading @@ -143,6 +143,8 @@ uint32_t PrrtSocket_get_bbr_state(PrrtSocket *s); bool PrrtSocket_get_app_limited(PrrtSocket *s); uint32_t PrrtSocket_get_cycle_index(PrrtSocket *s); float PrrtSocket_get_pacing_gain(PrrtSocket *s); uint32_t PrrtSocket_get_cwnd(PrrtSocket *s); uint32_t PrrtSocket_get_inflight(PrrtSocket *s); #endif // PRRT_SOCKET_H Loading
prrt/cprrt.pxd +2 −0 Original line number Diff line number Diff line Loading @@ -152,6 +152,8 @@ cdef extern from "proto/socket.h": bint PrrtSocket_get_filled_pipe(PrrtSocket *s) uint32_t PrrtSocket_get_cycle_index(PrrtSocket *s) float PrrtSocket_get_pacing_gain(PrrtSocket *s) uint32_t PrrtSocket_get_cwnd(PrrtSocket *s) uint32_t PrrtSocket_get_inflight(PrrtSocket *s) bint PrrtSocket_get_app_limited(PrrtSocket *socket) Loading
prrt/proto/bbr.c +9 −5 Original line number Diff line number Diff line Loading @@ -2,6 +2,7 @@ #include "../util/dbg.h" #include "../util/common.h" #include "receiver.h" #include <math.h> prrtByteCount_t BBR_Inflight(BBR* bbr, float gain) Loading @@ -9,7 +10,7 @@ prrtByteCount_t BBR_Inflight(BBR* bbr, float gain) if (bbr->rtprop == Inf) return InitialCwnd; /* no valid RTT samples yet */ uint32_t quanta = 3 * bbr->send_quantum; uint32_t estimated_bdp = (bbr->bw * bbr->rtprop) / (1000 * 1000 * 8); uint32_t estimated_bdp = (uint32_t) round(((double)bbr->bw * bbr->rtprop) / (1000 * 1000)); return (uint32_t)(gain * estimated_bdp + quanta); } Loading @@ -30,7 +31,7 @@ void BBR_UpdateBtlBw(BBR* bbr, PrrtRateSample* rs, PrrtPacketTracking* tracking) 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)(rs->delivery_rate)); 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); } } Loading Loading @@ -131,10 +132,10 @@ void BBR_EnterProbeRTT(BBR *bbr) { } void BBR_HandleProbeRTT(BBR *bbr, PrrtPacketTracking *tracking) { tracking->app_limited = (tracking->delivered + tracking->pipe) ? : 1; tracking->app_limited = (tracking->delivered + tracking->packets_in_flight) ? : 1; /* Ignore low rate samples during ProbeRTT: */ prrtTimestamp_t now = PrrtClock_get_current_time_us(); if (bbr->probe_rtt_done_stamp == 0 && tracking->pipe <= BBRMinPipeCwnd) { if (bbr->probe_rtt_done_stamp == 0 && tracking->packets_in_flight <= BBRMinPipeCwnd) { bbr->probe_rtt_done_stamp = now + ProbeRTTDuration; bbr->probe_rtt_round_done = false; bbr->next_round_delivered = tracking->delivered; Loading Loading @@ -211,7 +212,7 @@ void BBR_SetCwnd(BBR* bbr, PrrtPacketTracking* packetTracking) void BBR_SetPacingRateWithGain(BBR* bbr, float pacing_gain) { uint32_t rate = (uint32_t) (pacing_gain * ((float)bbr->bw) / (1000*1000*8)); uint32_t rate = (uint32_t) (pacing_gain * ((float)bbr->bw)); debug(DEBUG_BBR, "Current rate: %u, Pacing gain: %f, BtlBw: %u, Calc Rate: %u, Filled pipe: %u", bbr->pacing_rate, pacing_gain, bbr->bw, rate, bbr->filled_pipe); if (rate != 0 && (bbr->filled_pipe || rate > bbr->pacing_rate)) Loading Loading @@ -312,3 +313,6 @@ uint64_t BBR_getFullBw(BBR* bbr) { return bbr->full_bw; } prrtByteCount_t BBR_getInflight(BBR* bbr) { return BBR_Inflight(bbr, bbr->pacing_gain); } No newline at end of file
prrt/proto/bbr.h +3 −3 Original line number Diff line number Diff line Loading @@ -10,12 +10,11 @@ #include "types/rateSample.h" #include "../util/windowedFilter.h" #define MTU 1500 #define RTpropFilterLen 10000000 //10s #define BBRHighGain ((2885 / 1000) + 1) #define InitialCwnd (10 * MTU) #define InitialCwnd 10 #define BBRGainCycleLen 8 #define BBRMinPipeCwnd (4 * MTU) #define BBRMinPipeCwnd 4 #define ProbeRTTDuration 200000 //200ms #define Inf UINT32_MAX Loading Loading @@ -82,5 +81,6 @@ float BBR_getPacingGain(BBR* bbr); uint32_t BBR_getCycleIndex(BBR* bbr); bool BBR_getFilledPipe(BBR* bbr); uint32_t BBR_getRTProp(BBR* bbr); prrtByteCount_t BBR_getInflight(BBR* bbr); #endif //PRRT_BBR_H
prrt/proto/socket.c +9 −0 Original line number Diff line number Diff line Loading @@ -624,6 +624,15 @@ uint64_t PrrtSocket_get_full_bw(PrrtSocket *s) { return BBR_getFullBw(s->receiver->bbr); } uint32_t PrrtSocket_get_cwnd(PrrtSocket *s) { return BBR_getCwnd(s->receiver->bbr); } uint32_t PrrtSocket_get_inflight(PrrtSocket *s) { return BBR_getInflight(s->receiver->bbr); } float PrrtSocket_get_pacing_gain(PrrtSocket *s) { return BBR_getPacingGain(s->receiver->bbr); } Loading
prrt/proto/socket.h +2 −0 Original line number Diff line number Diff line Loading @@ -143,6 +143,8 @@ uint32_t PrrtSocket_get_bbr_state(PrrtSocket *s); bool PrrtSocket_get_app_limited(PrrtSocket *s); uint32_t PrrtSocket_get_cycle_index(PrrtSocket *s); float PrrtSocket_get_pacing_gain(PrrtSocket *s); uint32_t PrrtSocket_get_cwnd(PrrtSocket *s); uint32_t PrrtSocket_get_inflight(PrrtSocket *s); #endif // PRRT_SOCKET_H