Commit 4c2bedbc authored by Andreas Schmidt's avatar Andreas Schmidt

Call OnAck for all ACKs.

* Expose delivered variable.
parent 5bb63d08
Pipeline #2113 failed with stages
in 21 seconds
...@@ -157,6 +157,7 @@ cdef extern from "proto/socket.h": ...@@ -157,6 +157,7 @@ cdef extern from "proto/socket.h":
uint32_t PrrtSocket_get_pacing_rate(PrrtSocket *s) uint32_t PrrtSocket_get_pacing_rate(PrrtSocket *s)
uint32_t PrrtSocket_get_send_quantum(PrrtSocket *s) uint32_t PrrtSocket_get_send_quantum(PrrtSocket *s)
uint32_t PrrtSocket_get_pipe(PrrtSocket *s) uint32_t PrrtSocket_get_pipe(PrrtSocket *s)
uint32_t PrrtSocket_get_delivered(PrrtSocket *s)
bint PrrtSocket_get_app_limited(PrrtSocket *socket) bint PrrtSocket_get_app_limited(PrrtSocket *socket)
......
...@@ -81,8 +81,4 @@ prrtPacketLossRate_t PrrtChannelStateInformation_get_plr(PrrtChannelStateInforma ...@@ -81,8 +81,4 @@ prrtPacketLossRate_t PrrtChannelStateInformation_get_plr(PrrtChannelStateInforma
prrtDeliveryRate_t PrrtChannelStateInformation_get_delivery_rate(PrrtChannelStateInformation *csi) { prrtDeliveryRate_t PrrtChannelStateInformation_get_delivery_rate(PrrtChannelStateInformation *csi) {
return csi->deliveryRate; return csi->deliveryRate;
}
bool PrrtChannelStateInformation_get_app_limited(PrrtChannelStateInformation *csi) {
return csi->appLimited;
} }
\ No newline at end of file
...@@ -39,17 +39,20 @@ static void handle_feedback(PrrtSocket *prrtSocket, const size_t length) ...@@ -39,17 +39,20 @@ static void handle_feedback(PrrtSocket *prrtSocket, const size_t length)
PrrtPacketFeedbackPayload *feedbackPayload = (PrrtPacketFeedbackPayload *) prrtPacket->payload; PrrtPacketFeedbackPayload *feedbackPayload = (PrrtPacketFeedbackPayload *) prrtPacket->payload;
prrtTimestamp_t forwardTripTimestamp = feedbackPayload->forwardTripTimestamp_us; prrtTimestamp_t forwardTripTimestamp = feedbackPayload->forwardTripTimestamp_us;
PrrtChannelStateInformation_update_rtprop(prrtSocket->receiver->csi,
(prrtTimedelta_t) (receiveTime - forwardTripTimestamp));
PrrtChannelStateInformation_update_plr(prrtSocket->receiver->csi, feedbackPayload->erasureCount, feedbackPayload->packetCount);
bool valid_sample = PrrtReceiver_updateAndGenerateRateSample(prrtSocket->receiver, feedbackPayload->ackSequenceNumber, feedbackPayload->ackPacketType, receiveTime);
bool valid_sample = PrrtReceiver_updateAndGenerateRateSample(prrtSocket->receiver, feedbackPayload->ackSequenceNumber, feedbackPayload->ackPacketType, receiveTime);
if(prrtSocket->receiver->rateSample != NULL) {
BBR_OnACK(prrtSocket->receiver->bbr, prrtSocket->receiver->csi, prrtSocket->receiver->rateSample, prrtSocket->receiver->packetTracking);
}
if(valid_sample) { if(valid_sample) {
PrrtChannelStateInformation_update_delivery_rate(prrtSocket->receiver->csi, prrtPacket, prrtSocket->receiver->rateSample); PrrtChannelStateInformation_update_delivery_rate(prrtSocket->receiver->csi, prrtPacket, prrtSocket->receiver->rateSample);
} }
PrrtChannelStateInformation_update_app_limited(prrtSocket->receiver->csi, prrtSocket->receiver->rateSample->is_app_limited); PrrtChannelStateInformation_update_app_limited(prrtSocket->receiver->csi, prrtSocket->receiver->rateSample->is_app_limited);
PrrtChannelStateInformation_update_rtprop(prrtSocket->receiver->csi,
(prrtTimedelta_t) (receiveTime - forwardTripTimestamp));
PrrtChannelStateInformation_update_plr(prrtSocket->receiver->csi, feedbackPayload->erasureCount, feedbackPayload->packetCount);
error: error:
if(prrtPacket != NULL) { PrrtPacket_destroy(prrtPacket); } if(prrtPacket != NULL) { PrrtPacket_destroy(prrtPacket); }
......
...@@ -129,7 +129,7 @@ void PrrtReceiver_on_application_write(PrrtReceiver *receiver, uint32_t send_que ...@@ -129,7 +129,7 @@ void PrrtReceiver_on_application_write(PrrtReceiver *receiver, uint32_t send_que
bool PrrtReceiver_generateRateSample(PrrtRateSample *rateSample, PrrtPacketTracking *packetTracking) { bool PrrtReceiver_generateRateSample(PrrtRateSample *rateSample, PrrtPacketTracking *packetTracking) {
/* Clear app-limited field */ /* Clear app-limited field */
if (packetTracking->app_limited && packetTracking->delivered > packetTracking->app_limited) if (packetTracking->app_limited > 0 && packetTracking->delivered > packetTracking->app_limited)
packetTracking->app_limited = 0; packetTracking->app_limited = 0;
if (rateSample->prior_time == 0) { if (rateSample->prior_time == 0) {
...@@ -183,9 +183,6 @@ bool PrrtReceiver_updateAndGenerateRateSample(PrrtReceiver *recv, prrtSequenceNu ...@@ -183,9 +183,6 @@ bool PrrtReceiver_updateAndGenerateRateSample(PrrtReceiver *recv, prrtSequenceNu
check(pthread_cond_broadcast(&recv->pipeNotFullCv) == 0, "Signal failed."); check(pthread_cond_broadcast(&recv->pipeNotFullCv) == 0, "Signal failed.");
recv->packetTracking->prior_inflight = recv->packetTracking->pipe; recv->packetTracking->prior_inflight = recv->packetTracking->pipe;
if(recv->rateSample != NULL && result) {
BBR_OnACK(recv->bbr, recv->csi, recv->rateSample, recv->packetTracking);
}
return result; return result;
error: error:
......
...@@ -640,6 +640,11 @@ prrtByteCount_t PrrtSocket_get_pipe(PrrtSocket *s) { ...@@ -640,6 +640,11 @@ prrtByteCount_t PrrtSocket_get_pipe(PrrtSocket *s) {
return s->receiver->packetTracking->pipe; return s->receiver->packetTracking->pipe;
}; };
prrtByteCount_t PrrtSocket_get_delivered(PrrtSocket *s) {
return s->receiver->packetTracking->delivered;
};
float PrrtSocket_get_pacing_gain(PrrtSocket *s) { float PrrtSocket_get_pacing_gain(PrrtSocket *s) {
return BBR_getPacingGain(s->receiver->bbr); return BBR_getPacingGain(s->receiver->bbr);
} }
...@@ -653,5 +658,5 @@ uint32_t PrrtSocket_get_cycle_index(PrrtSocket *s) { ...@@ -653,5 +658,5 @@ uint32_t PrrtSocket_get_cycle_index(PrrtSocket *s) {
} }
bool PrrtSocket_get_app_limited(PrrtSocket *s) { bool PrrtSocket_get_app_limited(PrrtSocket *s) {
return PrrtChannelStateInformation_get_app_limited(s->receiver->csi); return s->receiver->rateSample->is_app_limited;
} }
...@@ -148,6 +148,7 @@ uint32_t PrrtSocket_get_inflight(PrrtSocket *s); ...@@ -148,6 +148,7 @@ uint32_t PrrtSocket_get_inflight(PrrtSocket *s);
uint32_t PrrtSocket_get_pacing_rate(PrrtSocket *s); uint32_t PrrtSocket_get_pacing_rate(PrrtSocket *s);
prrtByteCount_t PrrtSocket_get_send_quantum(PrrtSocket *s); prrtByteCount_t PrrtSocket_get_send_quantum(PrrtSocket *s);
prrtByteCount_t PrrtSocket_get_pipe(PrrtSocket *s); prrtByteCount_t PrrtSocket_get_pipe(PrrtSocket *s);
prrtByteCount_t PrrtSocket_get_delivered(PrrtSocket *s);
#endif // PRRT_SOCKET_H #endif // PRRT_SOCKET_H
...@@ -253,6 +253,12 @@ cdef class PrrtSocket: ...@@ -253,6 +253,12 @@ cdef class PrrtSocket:
raise Exception("Not a sender.") raise Exception("Not a sender.")
return cprrt.PrrtSocket_get_pipe(self._c_socket) return cprrt.PrrtSocket_get_pipe(self._c_socket)
property bbr_delivered:
def __get__(self):
if not self.isSender:
raise Exception("Not a sender.")
return cprrt.PrrtSocket_get_delivered(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