mirror of
https://github.com/lubosz/overte.git
synced 2025-04-09 00:02:39 +02:00
go back to previous PacketTimeWindow code
This commit is contained in:
parent
d937cf1cc7
commit
b5ec02bd01
4 changed files with 16 additions and 8 deletions
|
@ -77,8 +77,9 @@ void Connection::sendReliablePacket(unique_ptr<Packet> packet) {
|
|||
|
||||
void Connection::sync() {
|
||||
if (_hasReceivedFirstPacket) {
|
||||
// reset the number of light ACKS during this sync interval
|
||||
// reset the number of light ACKs or non SYN ACKs during this sync interval
|
||||
_lightACKsDuringSYN = 1;
|
||||
_acksDuringSYN = 1;
|
||||
|
||||
// we send out a periodic ACK every rate control interval
|
||||
sendACK();
|
||||
|
@ -327,7 +328,8 @@ bool Connection::processReceivedSequenceNumber(SequenceNumber sequenceNumber, in
|
|||
++_packetsSinceACK;
|
||||
|
||||
// check if we need to send an ACK, according to CC params
|
||||
if (_congestionControl->_ackInterval > 0 && _packetsSinceACK >= _congestionControl->_ackInterval) {
|
||||
if (_congestionControl->_ackInterval > 0 && _packetsSinceACK >= _congestionControl->_ackInterval * _acksDuringSYN) {
|
||||
_acksDuringSYN++;
|
||||
sendACK(false);
|
||||
} else if (_congestionControl->_lightACKInterval > 0
|
||||
&& _packetsSinceACK >= _congestionControl->_lightACKInterval * _lightACKsDuringSYN) {
|
||||
|
|
|
@ -96,7 +96,8 @@ private:
|
|||
|
||||
SequenceNumber _lastSentACK; // The last sent ACK
|
||||
SequenceNumber _lastSentACK2; // The last sent ACK sub-sequence number in an ACK2
|
||||
|
||||
|
||||
int _acksDuringSYN { 1 }; // The number of non-SYN ACKs sent during SYN
|
||||
int _lightACKsDuringSYN { 1 }; // The number of lite ACKs sent during SYN interval
|
||||
|
||||
int32_t _rtt; // RTT, in microseconds
|
||||
|
|
|
@ -11,7 +11,6 @@
|
|||
|
||||
#include "PacketTimeWindow.h"
|
||||
|
||||
#include <numeric>
|
||||
#include <cmath>
|
||||
|
||||
#include <NumericalConstants.h>
|
||||
|
@ -49,11 +48,16 @@ int median(Iterator begin, Iterator end) {
|
|||
|
||||
int32_t meanOfMedianFilteredValues(std::vector<int> intervals, int numValues, int valuesRequired = 0) {
|
||||
// grab the median value of the intervals vector
|
||||
int intervalsMedian = median(intervals.begin(), intervals.end());
|
||||
int median = 0;
|
||||
if (numValues % 2 == 0) {
|
||||
median = intervals[numValues / 2];
|
||||
} else {
|
||||
median = (intervals[(numValues / 2) - 1] + intervals[numValues / 2]) / 2;
|
||||
}
|
||||
|
||||
static const int MEDIAN_FILTERING_BOUND_MULTIPLIER = 8;
|
||||
int upperBound = intervalsMedian * MEDIAN_FILTERING_BOUND_MULTIPLIER;
|
||||
int lowerBound = intervalsMedian / MEDIAN_FILTERING_BOUND_MULTIPLIER;
|
||||
int upperBound = median * MEDIAN_FILTERING_BOUND_MULTIPLIER;
|
||||
int lowerBound = median / MEDIAN_FILTERING_BOUND_MULTIPLIER;
|
||||
|
||||
int sum = 0;
|
||||
int count = 0;
|
||||
|
|
|
@ -42,7 +42,7 @@ const QCommandLineOption UNRELIABLE_PACKETS {
|
|||
};
|
||||
|
||||
const QStringList CLIENT_STATS_TABLE_HEADERS {
|
||||
"Send Rate (P/s)", "RTT(ms)", "CW (P)", "Send Period (us)",
|
||||
"Send Rate (P/s)", "Bandwidth (P/s)", "RTT(ms)", "CW (P)", "Send Period (us)",
|
||||
"Received ACK", "Processed ACK", "Received LACK", "Received NAK", "Received TNAK",
|
||||
"Sent ACK2", "Sent Packets", "Re-sent Packets"
|
||||
};
|
||||
|
@ -237,6 +237,7 @@ void UDTTest::sampleStats() {
|
|||
// setup a list of left justified values
|
||||
QStringList values {
|
||||
QString::number(stats.sendRate).leftJustified(CLIENT_STATS_TABLE_HEADERS[++headerIndex].size()),
|
||||
QString::number(stats.estimatedBandwith).leftJustified(CLIENT_STATS_TABLE_HEADERS[++headerIndex].size()),
|
||||
QString::number(stats.rtt / USECS_PER_MSEC).leftJustified(CLIENT_STATS_TABLE_HEADERS[++headerIndex].size()),
|
||||
QString::number(stats.congestionWindowSize).leftJustified(CLIENT_STATS_TABLE_HEADERS[++headerIndex].size()),
|
||||
QString::number(stats.packetSendPeriod).leftJustified(CLIENT_STATS_TABLE_HEADERS[++headerIndex].size()),
|
||||
|
|
Loading…
Reference in a new issue