Commit e4cd39e1 authored by Andreas Schmidt's avatar Andreas Schmidt

Fix bps conversion. Add missing tracking field.

parent 02539561
Pipeline #2061 failed with stages
in 21 seconds
include "posix/time.pxd" include "posix/time.pxd"
from libc.stdint cimport uint32_t, uint16_t, uint8_t, int32_t from libc.stdint cimport uint32_t, uint16_t, uint8_t, int32_t, uint64_t
from libc.string cimport const_char from libc.string cimport const_char
cdef extern from "pthread.h" nogil: cdef extern from "pthread.h" nogil:
...@@ -147,6 +147,10 @@ cdef extern from "proto/socket.h": ...@@ -147,6 +147,10 @@ cdef extern from "proto/socket.h":
float PrrtSocket_get_plr(PrrtSocket *socket) float PrrtSocket_get_plr(PrrtSocket *socket)
uint32_t PrrtSocket_get_delivery_rate(PrrtSocket *socket) uint32_t PrrtSocket_get_delivery_rate(PrrtSocket *socket)
uint32_t PrrtSocket_get_btlbw(PrrtSocket *socket) uint32_t PrrtSocket_get_btlbw(PrrtSocket *socket)
uint32_t PrrtSocket_get_bbr_state(PrrtSocket *s)
uint64_t PrrtSocket_get_full_bw(PrrtSocket *s)
bint PrrtSocket_get_filled_pipe(PrrtSocket *s)
bint PrrtSocket_get_app_limited(PrrtSocket *socket) bint PrrtSocket_get_app_limited(PrrtSocket *socket)
bint PrrtSocket_enable_thread_pinning(PrrtSocket *socket) bint PrrtSocket_enable_thread_pinning(PrrtSocket *socket)
......
...@@ -9,7 +9,7 @@ uint32_t BBR_Inflight(BBR* bbr, float gain) ...@@ -9,7 +9,7 @@ uint32_t BBR_Inflight(BBR* bbr, float gain)
if (bbr->rtprop == Inf) if (bbr->rtprop == Inf)
return InitialCwnd; /* no valid RTT samples yet */ return InitialCwnd; /* no valid RTT samples yet */
uint32_t quanta = 3 * bbr->send_quantum; uint32_t quanta = 3 * bbr->send_quantum;
uint32_t estimated_bdp = bbr->bw * bbr->rtprop; uint32_t estimated_bdp = (bbr->bw * bbr->rtprop) / (1000 * 1000 * 8);
return (uint32_t)(gain * estimated_bdp + quanta); return (uint32_t)(gain * estimated_bdp + quanta);
} }
...@@ -30,7 +30,7 @@ void BBR_UpdateBtlBw(BBR* bbr, PrrtRateSample* rs, prrtByteCount_t packet_delive ...@@ -30,7 +30,7 @@ void BBR_UpdateBtlBw(BBR* bbr, PrrtRateSample* rs, prrtByteCount_t packet_delive
bbr->round_start = false; bbr->round_start = false;
} }
if ((rs->delivery_rate >= bbr->bw || !rs->is_app_limited) && rs->delivery_rate != 0) { 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)(rs->delivery_rate));
debug(DEBUG_BBR, "Current BtlBw: %u, RS delivery rate: %u", bbr->bw, (uint32_t)rs->delivery_rate); debug(DEBUG_BBR, "Current BtlBw: %u, RS delivery rate: %u", bbr->bw, (uint32_t)rs->delivery_rate);
} }
} }
...@@ -197,7 +197,7 @@ void BBR_SetCwnd(BBR* bbr, PrrtPacketTracking* packetTracking) ...@@ -197,7 +197,7 @@ void BBR_SetCwnd(BBR* bbr, PrrtPacketTracking* packetTracking)
void BBR_SetPacingRateWithGain(BBR* bbr, float pacing_gain) void BBR_SetPacingRateWithGain(BBR* bbr, float pacing_gain)
{ {
uint32_t rate = (uint32_t) (pacing_gain * (float)bbr->bw); uint32_t rate = (uint32_t) (pacing_gain * ((float)bbr->bw) / (1000*1000*8));
debug(DEBUG_BBR, "Current rate: %u, Pacing gain: %f, BtlBw: %u, Calc Rate: %u, Filled pipe: %u", bbr->pacing_rate, 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); pacing_gain, bbr->bw, rate, bbr->filled_pipe);
if (rate != 0 && (bbr->filled_pipe || rate > bbr->pacing_rate)) if (rate != 0 && (bbr->filled_pipe || rate > bbr->pacing_rate))
...@@ -277,4 +277,17 @@ prrtDeliveryRate_t BBR_getBtlBw(BBR* bbr) ...@@ -277,4 +277,17 @@ prrtDeliveryRate_t BBR_getBtlBw(BBR* bbr)
uint32_t BBR_getRTProp(BBR* bbr) uint32_t BBR_getRTProp(BBR* bbr)
{ {
return bbr->rtprop; return bbr->rtprop;
} }
\ No newline at end of file
uint32_t BBR_getState(BBR* bbr) {
return bbr->state;
}
bool BBR_getFilledPipe(BBR* bbr) {
return bbr->filled_pipe;
}
uint64_t BBR_getFullBw(BBR* bbr) {
return bbr->full_bw;
}
...@@ -78,6 +78,9 @@ void BBR_destroy(BBR* bbr); ...@@ -78,6 +78,9 @@ void BBR_destroy(BBR* bbr);
uint32_t BBR_getPacingRate(BBR* bbr); uint32_t BBR_getPacingRate(BBR* bbr);
uint32_t BBR_getCwnd(BBR* bbr); uint32_t BBR_getCwnd(BBR* bbr);
prrtDeliveryRate_t BBR_getBtlBw(BBR* bbr); prrtDeliveryRate_t BBR_getBtlBw(BBR* bbr);
uint32_t BBR_getState(BBR* bbr);
uint64_t BBR_getFullBw(BBR* bbr);
bool BBR_getFilledPipe(BBR* bbr);
uint32_t BBR_getRTProp(BBR* bbr); uint32_t BBR_getRTProp(BBR* bbr);
#endif //PRRT_BBR_H #endif //PRRT_BBR_H
...@@ -173,6 +173,7 @@ bool PrrtReceiver_updateAndGenerateRateSample(PrrtReceiver *recv, prrtSequenceNu ...@@ -173,6 +173,7 @@ bool PrrtReceiver_updateAndGenerateRateSample(PrrtReceiver *recv, prrtSequenceNu
pthread_cond_wait(&recv->recordNotFoundCv, &recv->lock); pthread_cond_wait(&recv->recordNotFoundCv, &recv->lock);
packet = PrrtInFlightPacketStore_get_packet(inflightPacketStore, seqnum); packet = PrrtInFlightPacketStore_get_packet(inflightPacketStore, seqnum);
} }
recv->packetTracking->bytes_delivered = packet->delivered;
PrrtReceiver_updateRateSample(recv->rateSample, packet, receiveTime, recv->packetTracking); PrrtReceiver_updateRateSample(recv->rateSample, packet, receiveTime, recv->packetTracking);
...@@ -185,7 +186,7 @@ bool PrrtReceiver_updateAndGenerateRateSample(PrrtReceiver *recv, prrtSequenceNu ...@@ -185,7 +186,7 @@ bool PrrtReceiver_updateAndGenerateRateSample(PrrtReceiver *recv, prrtSequenceNu
recv->packetTracking->packets_delivered++; recv->packetTracking->packets_delivered++;
recv->packetTracking->packets_in_flight = (prrtSequenceNumber_t) (PrrtInFlightPacketStore_get_queue_size(recv->dataInflightPacketStore) + PrrtInFlightPacketStore_get_queue_size(recv->redundancyInflightPacketStore)); recv->packetTracking->packets_in_flight = (prrtSequenceNumber_t) (PrrtInFlightPacketStore_get_queue_size(recv->dataInflightPacketStore) + PrrtInFlightPacketStore_get_queue_size(recv->redundancyInflightPacketStore));
recv->packetTracking->prior_inflight = recv->packetTracking->packets_in_flight; recv->packetTracking->prior_inflight = recv->packetTracking->packets_in_flight;
if(recv->rateSample != NULL) { if(recv->rateSample != NULL && result) {
BBR_OnACK(recv->bbr, recv->csi, recv->rateSample, recv->packetTracking); BBR_OnACK(recv->bbr, recv->csi, recv->rateSample, recv->packetTracking);
} }
return result; return result;
......
...@@ -586,7 +586,7 @@ bool PrrtSocket_uses_thread_pinning(PrrtSocket *s) { ...@@ -586,7 +586,7 @@ bool PrrtSocket_uses_thread_pinning(PrrtSocket *s) {
} }
uint32_t PrrtSocket_get_rtprop(PrrtSocket *s) { uint32_t PrrtSocket_get_rtprop(PrrtSocket *s) {
return PrrtChannelStateInformation_get_rtprop(s->receiver->csi); return BBR_getRTProp(s->receiver->bbr);
} }
prrtPacketLossRate_t PrrtSocket_get_plr(PrrtSocket *s) { prrtPacketLossRate_t PrrtSocket_get_plr(PrrtSocket *s) {
...@@ -601,6 +601,20 @@ prrtDeliveryRate_t PrrtSocket_get_btlbw(PrrtSocket *s) { ...@@ -601,6 +601,20 @@ prrtDeliveryRate_t PrrtSocket_get_btlbw(PrrtSocket *s) {
return BBR_getBtlBw(s->receiver->bbr); return BBR_getBtlBw(s->receiver->bbr);
} }
uint32_t PrrtSocket_get_bbr_state(PrrtSocket *s) {
return BBR_getState(s->receiver->bbr);
}
bool PrrtSocket_get_filled_pipe(PrrtSocket *s) {
return BBR_getFilledPipe(s->receiver->bbr);
}
uint64_t PrrtSocket_get_full_bw(PrrtSocket *s) {
return BBR_getFullBw(s->receiver->bbr);
}
bool PrrtSocket_get_app_limited(PrrtSocket *s) { bool PrrtSocket_get_app_limited(PrrtSocket *s) {
return PrrtChannelStateInformation_get_app_limited(s->receiver->csi); return PrrtChannelStateInformation_get_app_limited(s->receiver->csi);
} }
...@@ -134,6 +134,9 @@ uint32_t PrrtSocket_get_rtprop(PrrtSocket *s); ...@@ -134,6 +134,9 @@ uint32_t PrrtSocket_get_rtprop(PrrtSocket *s);
prrtPacketLossRate_t PrrtSocket_get_plr(PrrtSocket *s); prrtPacketLossRate_t PrrtSocket_get_plr(PrrtSocket *s);
prrtDeliveryRate_t PrrtSocket_get_delivery_rate(PrrtSocket *s); prrtDeliveryRate_t PrrtSocket_get_delivery_rate(PrrtSocket *s);
prrtDeliveryRate_t PrrtSocket_get_btlbw(PrrtSocket *s); prrtDeliveryRate_t PrrtSocket_get_btlbw(PrrtSocket *s);
uint64_t PrrtSocket_get_full_bw(PrrtSocket *s);
bool PrrtSocket_get_filled_pipe(PrrtSocket *s);
uint32_t PrrtSocket_get_bbr_state(PrrtSocket *s);
bool PrrtSocket_get_app_limited(PrrtSocket *s); bool PrrtSocket_get_app_limited(PrrtSocket *s);
#endif // PRRT_SOCKET_H #endif // PRRT_SOCKET_H
...@@ -192,6 +192,24 @@ cdef class PrrtSocket: ...@@ -192,6 +192,24 @@ cdef class PrrtSocket:
raise Exception("Not a sender.") raise Exception("Not a sender.")
return cprrt.PrrtSocket_get_btlbw(self._c_socket) return cprrt.PrrtSocket_get_btlbw(self._c_socket)
property bbr_state:
def __get__(self):
if not self.isSender:
raise Exception("Not a sender.")
return cprrt.PrrtSocket_get_bbr_state(self._c_socket)
property bbr_filled_pipe:
def __get__(self):
if not self.isSender:
raise Exception("Not a sender.")
return cprrt.PrrtSocket_get_filled_pipe(self._c_socket)
property bbr_full_bw:
def __get__(self):
if not self.isSender:
raise Exception("Not a sender.")
return cprrt.PrrtSocket_get_full_bw(self._c_socket)
property app_limited: property app_limited:
def __get__(self): def __get__(self):
if not self.isSender: if not self.isSender:
......
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