mirror of
https://github.com/overte-org/overte.git
synced 2025-08-07 18:30:42 +02:00
fix case where TCP Vegas would not re-send lost ACK
This commit is contained in:
parent
d68815ba27
commit
dce9cb0404
1 changed files with 23 additions and 18 deletions
|
@ -239,7 +239,7 @@ void Connection::sync() {
|
||||||
sendACK();
|
sendACK();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_lossList.getLength() > 0) {
|
if (_congestionControl->shouldNAK() && _lossList.getLength() > 0) {
|
||||||
// check if we need to re-transmit a loss list
|
// check if we need to re-transmit a loss list
|
||||||
// we do this if it has been longer than the current nakInterval since we last sent
|
// we do this if it has been longer than the current nakInterval since we last sent
|
||||||
auto now = p_high_resolution_clock::now();
|
auto now = p_high_resolution_clock::now();
|
||||||
|
@ -271,10 +271,13 @@ void Connection::sendACK(bool wasCausedBySyncTimeout) {
|
||||||
|
|
||||||
SequenceNumber nextACKNumber = nextACK();
|
SequenceNumber nextACKNumber = nextACK();
|
||||||
Q_ASSERT_X(nextACKNumber >= _lastSentACK, "Connection::sendACK", "Sending lower ACK, something is wrong");
|
Q_ASSERT_X(nextACKNumber >= _lastSentACK, "Connection::sendACK", "Sending lower ACK, something is wrong");
|
||||||
|
|
||||||
if (nextACKNumber == _lastSentACK) {
|
// if our congestion control doesn't want to send an ACK for every packet received
|
||||||
// We already sent this ACK, but check if we should re-send it.
|
// check if we already sent this ACK
|
||||||
if (nextACKNumber < _lastReceivedAcknowledgedACK) {
|
if (_congestionControl->_ackInterval > 1 && nextACKNumber == _lastSentACK) {
|
||||||
|
|
||||||
|
// if we use ACK2s, check if the receiving side already confirmed receipt of this ACK
|
||||||
|
if (_congestionControl->shouldACK2() && 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;
|
||||||
}
|
}
|
||||||
|
@ -287,11 +290,11 @@ void Connection::sendACK(bool wasCausedBySyncTimeout) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// we have received new packets since the last sent ACK
|
// we have received new packets since the last sent ACK
|
||||||
|
// or our congestion control dictates that we always send ACKs
|
||||||
|
|
||||||
// update the last sent ACK
|
// update the last sent ACK
|
||||||
_lastSentACK = nextACKNumber;
|
_lastSentACK = nextACKNumber;
|
||||||
|
|
||||||
|
|
||||||
_ackPacket->reset(); // We need to reset it every time.
|
_ackPacket->reset(); // We need to reset it every time.
|
||||||
|
|
||||||
// pack in the ACK sub-sequence number
|
// pack in the ACK sub-sequence number
|
||||||
|
@ -448,20 +451,22 @@ bool Connection::processReceivedSequenceNumber(SequenceNumber sequenceNumber, in
|
||||||
|
|
||||||
// mark our last receive time as now (to push the potential expiry farther)
|
// mark our last receive time as now (to push the potential expiry farther)
|
||||||
_lastReceiveTime = p_high_resolution_clock::now();
|
_lastReceiveTime = p_high_resolution_clock::now();
|
||||||
|
|
||||||
// check if this is a packet pair we should estimate bandwidth from, or just a regular packet
|
if (_congestionControl->shouldProbe()) {
|
||||||
if (((uint32_t) sequenceNumber & 0xF) == 0) {
|
// check if this is a packet pair we should estimate bandwidth from, or just a regular packet
|
||||||
_receiveWindow.onProbePair1Arrival();
|
if (((uint32_t) sequenceNumber & 0xF) == 0) {
|
||||||
} else if (((uint32_t) sequenceNumber & 0xF) == 1) {
|
_receiveWindow.onProbePair1Arrival();
|
||||||
// only use this packet for bandwidth estimation if we didn't just receive a control packet in its place
|
} else if (((uint32_t) sequenceNumber & 0xF) == 1) {
|
||||||
if (!_receivedControlProbeTail) {
|
// only use this packet for bandwidth estimation if we didn't just receive a control packet in its place
|
||||||
_receiveWindow.onProbePair2Arrival();
|
if (!_receivedControlProbeTail) {
|
||||||
} else {
|
_receiveWindow.onProbePair2Arrival();
|
||||||
// reset our control probe tail marker so the next probe that comes with data can be used
|
} else {
|
||||||
_receivedControlProbeTail = false;
|
// reset our control probe tail marker so the next probe that comes with data can be used
|
||||||
|
_receivedControlProbeTail = false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
_receiveWindow.onPacketArrival();
|
_receiveWindow.onPacketArrival();
|
||||||
|
|
||||||
// If this is not the next sequence number, report loss
|
// If this is not the next sequence number, report loss
|
||||||
|
|
Loading…
Reference in a new issue