lsd0004

LSD0004: R5N Distributed Hash Table
Log | Files | Refs

commit 04b2cc19d62a5594377b99f81f489f2aacd94663
parent 9356b1848f2f858ffff3bb9912ef7fb9d85c545d
Author: Martin Schanzenbach <schanzen@gnunet.org>
Date:   Tue,  7 Dec 2021 22:54:34 +0100

add wip

Diffstat:
Mdraft-schanzen-r5n.xml | 34++++++++++++++++++++++++++++++++--
1 file changed, 32 insertions(+), 2 deletions(-)

diff --git a/draft-schanzen-r5n.xml b/draft-schanzen-r5n.xml @@ -323,6 +323,7 @@ peer-public-key := [A-HJ-NP-Z1-9]+ The following is a non-normative example of a HELLO containing three HELLO URIs: </t> + <!-- FIXME peer id type | length | id payload | 0-terminated strings for addresses --> <figure> <artwork name="" type="" align="left" alt=""><![CDATA[ Y924NSHMMZ1N1SQCE5TXF93ED6S6JY311K0QT86G9WJC68F6XVZ0 \ @@ -469,6 +470,35 @@ PEER-SELECT(key, bloomfilter) END ]]></artwork> </figure> + <t> + The procedure to determine if we are the closest know peer for a given + message key and bloomfilter is defined as follows: + </t> + <figure> + <artwork name="" type="" align="left" alt=""><![CDATA[ +FIND-BUCKET(peerID, key, buckets) + N := MATCHING-BITS (peerID, key) + return Nth bucket FROM buckets +END +AM-CLOSEST-PEER(key, myPeerID, bloomfilter, buckets) + closestPeersBucket := FIND-BUCKET (myPeerID, key, buckets) + IF key == myPeerID + return TRUE + END + myDistance := XOR(myPeerID, key) + FOR EACH p IN closestPeersBucket + IF XOR(p, key) < myDistance + return FALSE + END + XOR(p, key) == myDistance + return TRUE + END + END + return TRUE +END + ]]></artwork> + </figure> + </section> </section> @@ -811,10 +841,10 @@ END implementation MUST periodically send HELLO GET queries for its own peer ID. </t> - <t>FIXME: Periodically -> more specific</t> + <t>FIXME: Periodically -> more specific? No. Frequency may be adapted depending on network conditions, known peers, busy/idle etc.</t> <t> Any implementation encountering a HELLO GET request initially - considers sending its own peer ID (FIXME: What does this mean?). + sends its own peer ID if it. </t> </section> <section anchor="security" numbered="true" toc="default">