mirror of
https://github.com/overte-org/overte.git
synced 2025-04-23 01:13:32 +02:00
support max bandwidth in congestion control
This commit is contained in:
parent
6c4a36fb7f
commit
0ea1bb578f
2 changed files with 10 additions and 1 deletions
|
@ -112,6 +112,14 @@ void DefaultCC::onACK(SequenceNumber ackNum) {
|
|||
}
|
||||
|
||||
_packetSendPeriod = (_packetSendPeriod * synInterval()) / (_packetSendPeriod * increase + synInterval());
|
||||
|
||||
if (_maxBandwidth > 0) {
|
||||
// anytime the packet send period is about to be increased, make sure it stays below the minimum period,
|
||||
// calculated based on the maximum desired bandwidth
|
||||
int minPacketSendPeriod = USECS_PER_SECOND / (double(_maxBandwidth) / _mss);
|
||||
_packetSendPeriod = std::max(_packetSendPeriod, (double) minPacketSendPeriod);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void DefaultCC::onLoss(SequenceNumber rangeStart, SequenceNumber rangeEnd) {
|
||||
|
|
|
@ -47,15 +47,16 @@ protected:
|
|||
void setMSS(int mss) { _mss = mss; }
|
||||
void setMaxCongestionWindowSize(int window) { _maxCongestionWindowSize = window; }
|
||||
void setBandwidth(int bandwidth) { _bandwidth = bandwidth; }
|
||||
void setMaxBandwidth(int maxBandwidth) { _maxBandwidth = maxBandwidth; }
|
||||
void setSendCurrentSequenceNumber(SequenceNumber seqNum) { _sendCurrSeqNum = seqNum; }
|
||||
void setReceiveRate(int rate) { _receiveRate = rate; }
|
||||
void setRTT(int rtt) { _rtt = rtt; }
|
||||
|
||||
|
||||
double _packetSendPeriod { 1.0 }; // Packet sending period, in microseconds
|
||||
double _congestionWindowSize { 16.0 }; // Congestion window size, in packets
|
||||
|
||||
int _bandwidth { 0 }; // estimated bandwidth, packets per second
|
||||
int _maxBandwidth { -1 }; // Maximum desired bandwidth, packets per second
|
||||
double _maxCongestionWindowSize { 0.0 }; // maximum cwnd size, in packets
|
||||
|
||||
int _mss { 0 }; // Maximum Packet Size, including all packet headers
|
||||
|
|
Loading…
Reference in a new issue