Tasharen Entertainment Forum

Support => TNet 3 Support => Topic started by: Rexima on October 21, 2016, 06:49:14 AM

Title: How to simulate latency and packet loss?
Post by: Rexima on October 21, 2016, 06:49:14 AM
How can i simulate latency and packet loss in TNet, like in UNet?
Title: Re: How to simulate latency and packet loss?
Post by: cmifwdll on October 21, 2016, 07:17:33 PM
This is a really complicated question. TNet primarily uses TCP. TCP will re-transmit lost packets in order to ensure reliable transmission. So to realistically simulate packet loss using TCP I think you'd need to use a raw socket and mimic the behaviour of TCP. This would then give you control over retransmissions and a nice test bed to work with.

Latency, I think, is slightly easier to simulate, but I can't wrap my head around it at the moment. I don't think a stack + delayed popping would work, but you could try it.

Maybe I'm over-thinking it and there's a far simpler approach, like simulating the *effects* of latency and packet loss without actually simulating latency and packet loss. Who knows :-\
Title: Re: How to simulate latency and packet loss?
Post by: ArenMook on October 21, 2016, 08:55:39 PM
Yeah, as cmifwdll said there is no packetloss with TCP. You will never lose packets with TNet's primary means of communication.

Easiest way to simulate latency is to put a testing TNServer on a server somewhere on the other side of the world, such as Australia. :) As real (and as simple) as it gets!