tell the send queue about ACKs on light ACK

This commit is contained in:
Stephen Birarda 2015-07-31 19:17:02 -07:00
parent 3833623cfe
commit 74a2d985eb
2 changed files with 11 additions and 7 deletions

View file

@ -102,7 +102,7 @@ void Connection::sendACK(bool wasCausedBySyncTimeout) {
if (nextACKNumber == _lastSentACK) { if (nextACKNumber == _lastSentACK) {
// We already sent this ACK, but check if we should re-send it. // We already sent this ACK, but check if we should re-send it.
if (nextACKNumber <= _lastReceivedAcknowledgedACK) { if (nextACKNumber < _lastReceivedAcknowledgedACK) {
// we already got an ACK2 for this ACK we would be sending, don't bother // we already got an ACK2 for this ACK we would be sending, don't bother
return; return;
} }
@ -379,7 +379,7 @@ void Connection::processACK(std::unique_ptr<ControlPacket> controlPacket) {
// validate that this isn't a BS ACK // validate that this isn't a BS ACK
if (ack > getSendQueue().getCurrentSequenceNumber()) { if (ack > getSendQueue().getCurrentSequenceNumber()) {
// in UDT they specifically break the connection here - do we want to do anything? // in UDT they specifically break the connection here - do we want to do anything?
Q_ASSERT_X(true, "Connection::processACK", "ACK recieved higher than largest sent sequence number"); Q_ASSERT_X(false, "Connection::processACK", "ACK recieved higher than largest sent sequence number");
return; return;
} }
@ -388,7 +388,7 @@ void Connection::processACK(std::unique_ptr<ControlPacket> controlPacket) {
controlPacket->readPrimitive(&rtt); controlPacket->readPrimitive(&rtt);
if (ack < _lastReceivedACK) { if (ack < _lastReceivedACK) {
// Bail // this is an out of order ACK, bail
return; return;
} }
@ -396,7 +396,7 @@ void Connection::processACK(std::unique_ptr<ControlPacket> controlPacket) {
controlPacket->readPrimitive(&_flowWindowSize); controlPacket->readPrimitive(&_flowWindowSize);
if (ack == _lastReceivedACK) { if (ack == _lastReceivedACK) {
// Bail // processing an already received ACK, bail
return; return;
} }
@ -455,6 +455,9 @@ void Connection::processLightACK(std::unique_ptr<ControlPacket> controlPacket) {
// update the last received ACK to the this one // update the last received ACK to the this one
_lastReceivedACK = ack; _lastReceivedACK = ack;
// send light ACK to the send queue
getSendQueue().ack(ack);
} }
_stats.recordReceivedLightACK(); _stats.recordReceivedLightACK();

View file

@ -42,7 +42,7 @@ const QCommandLineOption UNRELIABLE_PACKETS {
}; };
const QStringList STATS_TABLE_HEADERS { const QStringList STATS_TABLE_HEADERS {
"Send Rate (P/s)", "RTT(ms)", "CW (P)", "Send Period (us)", "Received ACK", "Received NAK", "Sent ACK2" "Send Rate (P/s)", "RTT(ms)", "CW (P)", "Send Period (us)", "Received ACK", "Received NAK", "Sent ACK2", "Re-sent Packets"
}; };
UDTTest::UDTTest(int& argc, char** argv) : UDTTest::UDTTest(int& argc, char** argv) :
@ -228,7 +228,8 @@ void UDTTest::sampleStats() {
QString::number(stats.packetSendPeriod).leftJustified(STATS_TABLE_HEADERS[++headerIndex].size()), QString::number(stats.packetSendPeriod).leftJustified(STATS_TABLE_HEADERS[++headerIndex].size()),
QString::number(stats.receivedACKs).leftJustified(STATS_TABLE_HEADERS[++headerIndex].size()), QString::number(stats.receivedACKs).leftJustified(STATS_TABLE_HEADERS[++headerIndex].size()),
QString::number(stats.receivedNAKs).leftJustified(STATS_TABLE_HEADERS[++headerIndex].size()), QString::number(stats.receivedNAKs).leftJustified(STATS_TABLE_HEADERS[++headerIndex].size()),
QString::number(stats.sentACK2s).leftJustified(STATS_TABLE_HEADERS[++headerIndex].size()) QString::number(stats.sentACK2s).leftJustified(STATS_TABLE_HEADERS[++headerIndex].size()),
QString::number(stats.retransmissions).leftJustified(STATS_TABLE_HEADERS[++headerIndex].size())
}; };
// output this line of values // output this line of values