diff options
author | Mic Bowman | 2014-12-29 23:19:10 -0800 |
---|---|---|
committer | Mic Bowman | 2014-12-29 23:19:10 -0800 |
commit | bda8f2a2c1d702adc9e61869195a4dbcd3c6751f (patch) | |
tree | c75af4bc8f664bebebfa0aaccca178a74b728f39 /OpenSim/Region/ClientStack/Linden/UDP | |
parent | Enable runtime configuration of the minimum rate for adaptive (diff) | |
download | opensim-SC_OLD-bda8f2a2c1d702adc9e61869195a4dbcd3c6751f.zip opensim-SC_OLD-bda8f2a2c1d702adc9e61869195a4dbcd3c6751f.tar.gz opensim-SC_OLD-bda8f2a2c1d702adc9e61869195a4dbcd3c6751f.tar.bz2 opensim-SC_OLD-bda8f2a2c1d702adc9e61869195a4dbcd3c6751f.tar.xz |
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.
Diffstat (limited to 'OpenSim/Region/ClientStack/Linden/UDP')
3 files changed, 7 insertions, 7 deletions
diff --git a/OpenSim/Region/ClientStack/Linden/UDP/Tests/ThrottleTests.cs b/OpenSim/Region/ClientStack/Linden/UDP/Tests/ThrottleTests.cs index 0560b9b..17e1af6 100644 --- a/OpenSim/Region/ClientStack/Linden/UDP/Tests/ThrottleTests.cs +++ b/OpenSim/Region/ClientStack/Linden/UDP/Tests/ThrottleTests.cs | |||
@@ -141,7 +141,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP.Tests | |||
141 | 141 | ||
142 | udpServer.Throttle.DebugLevel = 1; | 142 | udpServer.Throttle.DebugLevel = 1; |
143 | udpClient.ThrottleDebugLevel = 1; | 143 | udpClient.ThrottleDebugLevel = 1; |
144 | 144 | ||
145 | int resendBytes = 1000; | 145 | int resendBytes = 1000; |
146 | int landBytes = 2000; | 146 | int landBytes = 2000; |
147 | int windBytes = 3000; | 147 | int windBytes = 3000; |
@@ -208,7 +208,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP.Tests | |||
208 | textureBytes * commitRatio, assetBytes * commitRatio, udpClient.FlowThrottle.AdjustedDripRate, totalBytes, 0); | 208 | textureBytes * commitRatio, assetBytes * commitRatio, udpClient.FlowThrottle.AdjustedDripRate, totalBytes, 0); |
209 | 209 | ||
210 | // Test an increase in target throttle | 210 | // Test an increase in target throttle |
211 | udpClient.FlowThrottle.AcknowledgePackets(35000); | 211 | udpClient.FlowThrottle.AcknowledgePackets(25); |
212 | commitRatio = 0.2; | 212 | commitRatio = 0.2; |
213 | 213 | ||
214 | AssertThrottles( | 214 | AssertThrottles( |
diff --git a/OpenSim/Region/ClientStack/Linden/UDP/TokenBucket.cs b/OpenSim/Region/ClientStack/Linden/UDP/TokenBucket.cs index c0cdff6..e67c0f5 100644 --- a/OpenSim/Region/ClientStack/Linden/UDP/TokenBucket.cs +++ b/OpenSim/Region/ClientStack/Linden/UDP/TokenBucket.cs | |||
@@ -61,7 +61,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
61 | 61 | ||
62 | /// <summary> | 62 | /// <summary> |
63 | /// </summary> | 63 | /// </summary> |
64 | protected const Int32 m_minimumDripRate = 1400; | 64 | protected const Int32 m_minimumDripRate = LLUDPServer.MTU; |
65 | 65 | ||
66 | /// <summary>Time of the last drip, in system ticks</summary> | 66 | /// <summary>Time of the last drip, in system ticks</summary> |
67 | protected Int32 m_lastDrip; | 67 | protected Int32 m_lastDrip; |
@@ -447,12 +447,12 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
447 | 447 | ||
448 | /// <summary> | 448 | /// <summary> |
449 | /// Reliable packets acked by the client adjust the drip rate up. | 449 | /// Reliable packets acked by the client adjust the drip rate up. |
450 | /// <param name="bytes">Number of bytes acknowledged</param> | 450 | /// <param name="packets">Number of packets successfully acknowledged</param> |
451 | /// </summary> | 451 | /// </summary> |
452 | public void AcknowledgePackets(Int32 bytes) | 452 | public void AcknowledgePackets(Int32 packets) |
453 | { | 453 | { |
454 | if (AdaptiveEnabled) | 454 | if (AdaptiveEnabled) |
455 | AdjustedDripRate = AdjustedDripRate + bytes; | 455 | AdjustedDripRate = AdjustedDripRate + packets * LLUDPServer.MTU; |
456 | } | 456 | } |
457 | } | 457 | } |
458 | } \ No newline at end of file | 458 | } \ No newline at end of file |
diff --git a/OpenSim/Region/ClientStack/Linden/UDP/UnackedPacketCollection.cs b/OpenSim/Region/ClientStack/Linden/UDP/UnackedPacketCollection.cs index 9d6c09e..adf019f 100644 --- a/OpenSim/Region/ClientStack/Linden/UDP/UnackedPacketCollection.cs +++ b/OpenSim/Region/ClientStack/Linden/UDP/UnackedPacketCollection.cs | |||
@@ -192,7 +192,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
192 | 192 | ||
193 | // As with other network applications, assume that an acknowledged packet is an | 193 | // As with other network applications, assume that an acknowledged packet is an |
194 | // indication that the network can handle a little more load, speed up the transmission | 194 | // indication that the network can handle a little more load, speed up the transmission |
195 | ackedPacket.Client.FlowThrottle.AcknowledgePackets(ackedPacket.Buffer.DataLength); | 195 | ackedPacket.Client.FlowThrottle.AcknowledgePackets(1); |
196 | 196 | ||
197 | // Update stats | 197 | // Update stats |
198 | Interlocked.Add(ref ackedPacket.Client.UnackedBytes, -ackedPacket.Buffer.DataLength); | 198 | Interlocked.Add(ref ackedPacket.Client.UnackedBytes, -ackedPacket.Buffer.DataLength); |