On Fri, Apr 07, 2006 at 01:26:35PM +0100, Michael Rogers wrote: > This thread on p2p-hackers seems to conclude that one packet each way > every 20 seconds is enough to keep a UDP hole open:
We send one keepalive to each peer every 2.5 seconds at present (unless there has been other traffic in that time). If we don't get anything from a node in 60 seconds, we assume it is down. We can increase this significantly, which is good. > > http://zgp.org/pipermail/p2p-hackers/2005-June/002659.html However the subject at hand is a different one. Here's how it works: - Every 200ms, we send a ping to a node. - We keep an average of the average ping times of all nodes we are connected to, and also the time taken to send a throttled data packet for each. - If the average is under 1000ms, we don't pre-emptively reject any requests. - If it is over 2000ms, we pre-emptively reject all requests. (Except for one every 10 seconds which we allow anyway). - If it is in the middle, we accept a proportion of requests. Now: - The above will give away how many active peers we have. This is a bad thing. - Nodes with many connections will receive many pings. - It's a bit excessive anyway. What we should therefore do: - We can't just use the sequence number on an incoming packet's acknowledgement, because this will be too slow; these may be queued for some time. - 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? > > Cheers, > Michael -- 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/7f5bae1c/attachment.pgp>
