internet: Test case for handling of SACK blocks in PRR recovery algorithm
RFC 6937 defines prr_delivered variable of Proportional Rate Reduction (PRR) algorithm as the total number of bytes delivered during recovery.
On receiving 3 duplicate ACKs for a packet we enter into the recovery phase and if the recovery algorithm is set as PRR, then the value of prr_delivered variable is required to be calculated. If SACK is enabled and we receive a 3rd dupack containing some SACK block, then the number of bytes SACKed by this dupack should be added in prr_delivered variable. But ns-3 does not handle this condition.
In ns-3 implementation of PRR, if we receive a 3rd dupack, EnterRecovery () method is called and inside this method we set the value of m_previousSackedBytes as follows:
m_previousSackedBytes = lastSackedBytes;
Now, DoRecovery () method is called from inside EnterRecovery () method and DoRecovery () method calculates the value of m_prrDelivered variable as follows:
uint32_t lastDeliveredBytes;
int changeInSackedBytes = int (lastSackedBytes - m_previousSackedBytes);
lastDeliveredBytes = lastAckedBytes + changeInSackedBytes > 0 ? lastAckedBytes + changeInSackedBytes : 0;
m_previousSackedBytes = lastSackedBytes;
m_prrDelivered += lastDeliveredBytes;
Since the value of m_previousSackedBytes and lastSackedBytes will always be equal on entering the recovery phase, m_prrDelivered value will turn out to be zero no matter how many bytes are SACKed by 3rd dupack.