Transport.preview 0.2.3 UnreliableSequencedPipelineStage not working as expected?

Hi all,

I am working with the transport layer by sending simple messages across the wire. I’ve set up my project to use pipelines (specifically UnreliableSequencedPipelineStage with the SimulatorPipelineStage):

m_Pipeline = m_Driver.CreatePipeline(typeof(UnreliableSequencedPipelineStage), typeof(SimulatorPipelineStage));

My configuration for the simulator stage:

var simParams = new SimulatorUtility.Parameters {
            MaxPacketSize = k_PacketSize,
            PacketDelayMs = 200,
            PacketDropPercentage = 50,
            PacketJitterMs = 10
        };

With a 50% drop rate, I would expect the server to miss messages, and thus not be able to sync. This is not what is happening. With the 50% droprate, the server still receives every single message (and in order!). I’ve tested this by passing a tick number to the server, and the server logging it to console. I can see every single tick number.

Am I doing something wrong here? Or am I dealing with “preview” issues on the transport layer?

Been stuck on this for awhile, so if anyone could help assist. It would be very much appreciated.

Thanks!

Quinn Le

Sorry for the necro post, but I ran into this issue and this came up in search with no answer.

The problem Quinn seems to have had 3 years ago (and is still relevant in UTP today!), was that they did not specify the MaxPacketCount. It gets the default value from struct initialization instead, which is 0. This value is the max number of packets the stage will add simulated network conditions to at any given time, so naturally you’d want a value greater than 0, otherwise it will not affect any packets.

This is probably why if you use the extension method WithSimulatorStageParameters, maxPacketCount and maxPacketSize are not optional parameters, they must be specified as some useful positive integer or your simulation pipeline stage will do nothing.

1 Like