Commit 92e34718 authored by Andreas Schmidt's avatar Andreas Schmidt
Browse files

Btlbw is now also available at the receiver.

parent 18429509
Loading
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -33,9 +33,9 @@ void PrrtChannelStateInformation_update_plr(PrrtChannelStateInformation *csi, pr
}


void PrrtChannelStateInformation_update_delivery_rate(PrrtChannelStateInformation *csi, PrrtRateSample *rateSample) {
void PrrtChannelStateInformation_update_delivery_rate(PrrtChannelStateInformation *csi, prrtDeliveryRate_t rate) {
    pthread_mutex_lock(&csi->lock);
    csi->deliveryRate = rateSample->delivery_rate;
    csi->deliveryRate = rate;
    pthread_mutex_unlock(&csi->lock);
}
void PrrtChannelStateInformation_update_app_limited(PrrtChannelStateInformation *csi, bool appLimited) {
+1 −1
Original line number Diff line number Diff line
@@ -22,7 +22,7 @@ bool PrrtChannelStateInformation_get_app_limited(PrrtChannelStateInformation *cs
prrtPacketLossRate_t PrrtChannelStateInformation_get_plr(PrrtChannelStateInformation* csi);
void PrrtChannelStateInformation_update_plr(PrrtChannelStateInformation *csi, prrtSequenceNumber_t erasures,
                                                   prrtSequenceNumber_t packets);
void PrrtChannelStateInformation_update_delivery_rate(PrrtChannelStateInformation *csi, PrrtRateSample *rate);
void PrrtChannelStateInformation_update_delivery_rate(PrrtChannelStateInformation *csi, prrtDeliveryRate_t rate);
void PrrtChannelStateInformation_update_app_limited(PrrtChannelStateInformation *csi, bool appLimited);
bool PrrtChannelStateInformation_destroy(PrrtChannelStateInformation* csi);

+1 −0
Original line number Diff line number Diff line
@@ -141,6 +141,7 @@ handle_data_packet(PrrtSocket *sock_ptr, PrrtPacket *packet) {
               false) {
        PrrtPacket_destroy(packet);
    } else {
        PrrtChannelStateInformation_update_delivery_rate(sock_ptr->senderChannelStateInformation, payload->btlbw);
        prrtSequenceNumber_t baseSequenceNumber = packet->sequenceNumber - packet->index;

        PrrtPacket *reference = PrrtPacket_copy(packet);
+1 −0
Original line number Diff line number Diff line
@@ -117,6 +117,7 @@ static bool send_packet(PrrtSocket *sock_ptr, PrrtPacket *packet) {
    // Update timestamp
    if(PrrtPacket_type(packet) == PACKET_TYPE_DATA) {
        ((PrrtPacketDataPayload*) (packet->payload))->timestamp = PrrtClock_get_current_time_us();
        ((PrrtPacketDataPayload*) (packet->payload))->btlbw = BBR_getBtlBw(sock_ptr->receiver->bbr);
    } else if(PrrtPacket_type(packet) == PACKET_TYPE_REDUNDANCY) {
        ((PrrtPacketRedundancyPayload*) (packet->payload))->timestamp = PrrtClock_get_current_time_us();
    }
+1 −1
Original line number Diff line number Diff line
@@ -190,7 +190,7 @@ void PrrtReceiver_on_ack(PrrtReceiver *receiver, PrrtPacketFeedbackPayload * fee

    bool valid_sample = PrrtReceiver_updateAndGenerateRateSample(receiver, feedbackPayload->ackSequenceNumber, feedbackPayload->ackPacketType, receiveTime, rtt);
    if(valid_sample) {
        PrrtChannelStateInformation_update_delivery_rate(receiver->csi, receiver->rateSample);
        PrrtChannelStateInformation_update_delivery_rate(receiver->csi, receiver->rateSample->delivery_rate);
    }
    PrrtChannelStateInformation_update_app_limited(receiver->csi, receiver->rateSample->is_app_limited);

Loading