Change the effect of successfully acknowledged packets to bump the

adaptive throttle by a full MTU. This is consistent with some implementations
of congestion control algorithms and certainly has the effect of opening
the throttle window more quickly after errors. This is especially important
after initial scene load when the number and size of packets is small.
mb-throttle-test
Mic Bowman 2014-12-29 23:19:10 -08:00
parent 041a09ecb9
commit bda8f2a2c1
3 changed files with 7 additions and 7 deletions

View File

@ -208,7 +208,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP.Tests
textureBytes * commitRatio, assetBytes * commitRatio, udpClient.FlowThrottle.AdjustedDripRate, totalBytes, 0); textureBytes * commitRatio, assetBytes * commitRatio, udpClient.FlowThrottle.AdjustedDripRate, totalBytes, 0);
// Test an increase in target throttle // Test an increase in target throttle
udpClient.FlowThrottle.AcknowledgePackets(35000); udpClient.FlowThrottle.AcknowledgePackets(25);
commitRatio = 0.2; commitRatio = 0.2;
AssertThrottles( AssertThrottles(

View File

@ -61,7 +61,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
/// <summary> /// <summary>
/// </summary> /// </summary>
protected const Int32 m_minimumDripRate = 1400; protected const Int32 m_minimumDripRate = LLUDPServer.MTU;
/// <summary>Time of the last drip, in system ticks</summary> /// <summary>Time of the last drip, in system ticks</summary>
protected Int32 m_lastDrip; protected Int32 m_lastDrip;
@ -447,12 +447,12 @@ namespace OpenSim.Region.ClientStack.LindenUDP
/// <summary> /// <summary>
/// Reliable packets acked by the client adjust the drip rate up. /// Reliable packets acked by the client adjust the drip rate up.
/// <param name="bytes">Number of bytes acknowledged</param> /// <param name="packets">Number of packets successfully acknowledged</param>
/// </summary> /// </summary>
public void AcknowledgePackets(Int32 bytes) public void AcknowledgePackets(Int32 packets)
{ {
if (AdaptiveEnabled) if (AdaptiveEnabled)
AdjustedDripRate = AdjustedDripRate + bytes; AdjustedDripRate = AdjustedDripRate + packets * LLUDPServer.MTU;
} }
} }
} }

View File

@ -192,7 +192,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
// As with other network applications, assume that an acknowledged packet is an // As with other network applications, assume that an acknowledged packet is an
// indication that the network can handle a little more load, speed up the transmission // indication that the network can handle a little more load, speed up the transmission
ackedPacket.Client.FlowThrottle.AcknowledgePackets(ackedPacket.Buffer.DataLength); ackedPacket.Client.FlowThrottle.AcknowledgePackets(1);
// Update stats // Update stats
Interlocked.Add(ref ackedPacket.Client.UnackedBytes, -ackedPacket.Buffer.DataLength); Interlocked.Add(ref ackedPacket.Client.UnackedBytes, -ackedPacket.Buffer.DataLength);