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) {
// 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
return;
}
@ -375,11 +375,11 @@ void Connection::processACK(std::unique_ptr<ControlPacket> controlPacket) {
// read the ACKed sequence number
SequenceNumber ack;
controlPacket->readPrimitive(&ack);
// validate that this isn't a BS ACK
if (ack > getSendQueue().getCurrentSequenceNumber()) {
// 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;
}
@ -388,7 +388,7 @@ void Connection::processACK(std::unique_ptr<ControlPacket> controlPacket) {
controlPacket->readPrimitive(&rtt);
if (ack < _lastReceivedACK) {
// Bail
// this is an out of order ACK, bail
return;
}
@ -396,7 +396,7 @@ void Connection::processACK(std::unique_ptr<ControlPacket> controlPacket) {
controlPacket->readPrimitive(&_flowWindowSize);
if (ack == _lastReceivedACK) {
// Bail
// processing an already received ACK, bail
return;
}
@ -455,6 +455,9 @@ void Connection::processLightACK(std::unique_ptr<ControlPacket> controlPacket) {
// update the last received ACK to the this one
_lastReceivedACK = ack;
// send light ACK to the send queue
getSendQueue().ack(ack);
}
_stats.recordReceivedLightACK();

View file

@ -42,7 +42,7 @@ const QCommandLineOption UNRELIABLE_PACKETS {
};
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) :
@ -228,7 +228,8 @@ void UDTTest::sampleStats() {
QString::number(stats.packetSendPeriod).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.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