Indeed. What I am actually doing, now, is just using the time it takes
for a packet to be acknowledged.

On Fri, Apr 07, 2006 at 10:01:31PM +0100, Michael Rogers wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> > - We should send one packet to each node every <fixed interval>, so as
> >   not to give away information about them.
> > - So we should send one ping every 5 seconds to each node.
> > - Will this cause it to take a long time for a node to recognize that it
> >   is no longer overloaded?
> 
> Do pings necessarily have to be sent at fixed intervals, as long as
> there's a maximum interval between successive pings? Rather than sending
> dedicated pings, how about adding a ping header to an outgoing data
> packet where possible? For example if the max interval between pings is
> 5 seconds, start looking for a suitable data packet after 4 seconds, and
> if a ping still hasn't been sent after 5 seconds then send a dedicated
> ping. Either way the neighbour responds immediately with a pong.
> 
> In fact pings, coalescing and keepalives can be handled with a single
> mechanism:
> 
> to queue a non-urgent message:
>       add message to tail of queue
>       data in queue += size of message
>       while (data in queue >= sensible packet size) send a packet
>       set coalescing timer for message at head of queue
> 
> to queue an urgent message: /* eg a pong */
>       add message to tail of queue
>       data in queue += size of message
>       while (data in queue > 0) send a packet
>       set keepalive timer
> 
> to send a packet:
>       cancel coalescing timer
>       cancel keepalive timer
>       size of packet = 0
>       if (ping flag is raised)
>               add ping header to packet
>               lower ping flag
>               cancel ping end timer
>               set ping start timer /* eg 4 seconds */
>       while (size of packet + size of message at head of queue <= max)
>               remove message from head of queue
>               data in queue -= size of message
>               add message to packet
>               data in packet += size of message
>       transmit packet /* may be empty */
> 
> when coalescing timer expires:
>       send a packet
> 
> when keepalive timer expires:
>       send a packet
> 
> when ping start timer expires: /* eg 4 seconds */
>       raise ping flag
>       set ping end timer /* eg another second */
> 
> when ping end timer expires:
>       send a packet
> 
> 
> I think it's possible to handle all the timers for all neighbours with a
> single thread (PacketSender). If the keepalive interval is higher than
> the maximum ping interval then there's no need for a keepalive timer.
> 
> Cheers,
> Michael
> 
> 
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.2.2 (GNU/Linux)
> 
> iD8DBQFENtMryua14OQlJ3sRAmYIAKDBOjL2CJsbjqXrC3eFPuPTssN9cACfUNKt
> DoOi07JsMvvgj7P59sRxBuI=
> =48DF
> -----END PGP SIGNATURE-----
> _______________________________________________
> Devl mailing list
> Devl at freenetproject.org
> http://emu.freenetproject.org/cgi-bin/mailman/listinfo/devl
> 

-- 
Matthew J Toseland - toad at amphibian.dyndns.org
Freenet Project Official Codemonkey - http://freenetproject.org/
ICTHUS - Nothing is impossible. Our Boss says so.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: 
<https://emu.freenetproject.org/pipermail/devl/attachments/20060407/7169fa79/attachment.pgp>

Reply via email to