send a light ACK every 64, not each after 64

This commit is contained in:
Stephen Birarda 2015-07-31 20:12:48 -07:00
parent 826c8d5150
commit bc5ddd3837
2 changed files with 8 additions and 1 deletions

View file

@ -73,6 +73,9 @@ void Connection::sendReliablePacket(unique_ptr<Packet> packet) {
void Connection::sync() {
if (_hasReceivedFirstPacket) {
// reset the number of light ACKS during this sync interval
_lightACKsDuringSYN = 1;
// we send out a periodic ACK every rate control interval
sendACK();
@ -322,8 +325,10 @@ bool Connection::processReceivedSequenceNumber(SequenceNumber sequenceNumber, in
// check if we need to send an ACK, according to CC params
if (_congestionControl->_ackInterval > 0 && _packetsSinceACK >= _congestionControl->_ackInterval) {
sendACK(false);
} else if (_congestionControl->_lightACKInterval > 0 && _packetsSinceACK >= _congestionControl->_lightACKInterval) {
} else if (_congestionControl->_lightACKInterval > 0
&& _packetsSinceACK >= _congestionControl->_lightACKInterval * _lightACKsDuringSYN) {
sendLightACK();
++_lightACKsDuringSYN;
}
if (wasDuplicate) {

View file

@ -97,6 +97,8 @@ private:
SequenceNumber _lastSentACK; // The last sent ACK
SequenceNumber _lastSentACK2; // The last sent ACK sub-sequence number in an ACK2
int _lightACKsDuringSYN { 1 }; // The number of lite ACKs sent during SYN interval
int32_t _rtt; // RTT, in microseconds
int32_t _rttVariance; // RTT variance
int _flowWindowSize { udt::MAX_PACKETS_IN_FLIGHT }; // Flow control window size