[ENet-discuss] When is the ping stable ?

Ruud van Gaal ruud at racer.nl
Mon Jan 11 02:49:47 PST 2010


The ENet ping is indeed very slow to stabilize.
What I do (even though I do use the ENet ping here & there) is to add a
'server time' to each outgoing server packet. One of my commands to clients
is an explicit ping, which is sent out now & then. The client responds with
the same server time (pseudocode):
 
Server:
  pkt.cmd=PING;
  pkt.time=serverTime;
  sendpacket();
 
Client:
  read(pkt);
  if(pkt.cmd==PING)
  {
    sendToServer(pkt);
  }
 
Server:
  read(pkt)
  if(pkt.cmd==PING)
  {
    pingTime=serverTime-pkt.time;
  }
 
You can send these periodically to keep ping time uptodate (add more code to
deal with jittering ping times now & then). In the beginning, when trying to
figure out ping time, you can increase the number of pings going out the
machine. Actually, I use an accumulator for the ping time which moves
towards a sort of average, so you need a bunch of packets.
 
Fortunately, in my game I have a small period of inactiveness at the start
where the ping time (my ping packets) can settle down nicely.
 
Cheers,
Ruud
 


  _____  

Van: enet-discuss-bounces at cubik.org [mailto:enet-discuss-bounces at cubik.org]
Namens Uj
Verzonden: Monday, January 11, 2010 11:15
Aan: Discussion of the ENet library
Onderwerp: [ENet-discuss] When is the ping stable ?


Hi all,
I agree with Ruud :-)

I changed the subject because another question came to my mind (and I dont
want to interfere with Jay's topic).
How do you guys know when the ping is "stable" ?

At connection the ping starts with a default value and then converge to the
right value.
Do you know some tricks to obtain the more accurate ping possible in a given
time ?

I'd like one peer to be able to map all ping values in a mesh network and
use those values as soon as possible.
So maybe I could set up a mechanism where everyone is sending its ping
values with other peers when he knows those values are stable.
Did anyone already implement something like this ?

Thanks by advance for your help,
best regards,
Julien




On Mon, Jan 11, 2010 at 10:37 AM, Ruud van Gaal <ruud at racer.nl> wrote:


Hi,
 
Isn't the ping time more important? In that case, keep ping times on the
server (probably already done by ENet, search the ENetPeer class) and get
the list from the server ordered by ping.
I wouldn't say the distance in computers is of much use for most situations.
 
Cheers,
Ruud


  _____  

Van: enet-discuss-bounces at cubik.org [mailto:enet-discuss-bounces at cubik.org]
Namens Jay Sprenkle
Verzonden: Sunday, January 10, 2010 20:09
Aan: Discussion of the ENet library
Onderwerp: [ENet-discuss] icmp/tracert/discovering network topology?


Good morning,

I'm considering adding some extra features to my enet based peer to peer
application. I'd like the main server to be smart enough to discover which
peers have the shortest connection path to each other. When a peer requests
a list of other peers to connect to then the server can deliver an optimal
list. The only way I could think of to implement this would be to do a
tracert to each peer and sort the list of peers by what common paths they
share. Has anyone done icmp packets with enet? I know it's not it's intended
function but it doesn't seem like it would be difficult to hack together. If
anyone has any better ideas on how to implement this I'd love to hear them.

Thanks!
Have a good weekend





_______________________________________________
ENet-discuss mailing list
ENet-discuss at cubik.org
http://lists.cubik.org/mailman/listinfo/enet-discuss




-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.cubik.org/pipermail/enet-discuss/attachments/20100111/1b3720c4/attachment-0001.htm>


More information about the ENet-discuss mailing list