lsd0004

LSD0004: R5N Distributed Hash Table
Log | Files | Refs

commit 07db1165214920e669f1d50f62e54010474858a0
parent ef1c2f2c8dda3d39026241e967ea0a48d055bf82
Author: Martin Schanzenbach <schanzen@gnunet.org>
Date:   Tue, 24 May 2022 21:41:13 +0200

update wire format get/hello

Diffstat:
Mdraft-schanzen-r5n.xml | 71++++++++++++++++++++++++++++++++++++++++++++++-------------------------
1 file changed, 46 insertions(+), 25 deletions(-)

diff --git a/draft-schanzen-r5n.xml b/draft-schanzen-r5n.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="utf-8"?> -<!DOCTYPE rfc SYSTEM "rfc2629-xhtml.ent" [ +<!DOCTYPE rfc [ <!ENTITY RFC2119 PUBLIC "" "http://xml.resource.org/public/rfc/bibxml/reference.RFC.2119.xml"> <!ENTITY RFC2782 PUBLIC "" "http://xml.resource.org/public/rfc/bibxml/reference.RFC.2782.xml"> <!ENTITY RFC3629 PUBLIC "" "http://xml.resource.org/public/rfc/bibxml/reference.RFC.3629.xml"> @@ -1507,19 +1507,18 @@ BEGIN +-----+-----+-----+-----+-----+-----+-----+-----+ | MSIZE | MTYPE | BTYPE | +-----+-----+-----+-----+-----+-----+-----+-----+ -| FLAGS | HOPCOUNT | REPL_LVL | XQ_SIZE | +| FLAGS | HOPCOUNT | REPL_LVL | RF_SIZE | +-----+-----+-----+-----+-----+-----+-----+-----+ | PEER_BF / / (128 byte) | +-----+-----+-----+-----+-----+-----+-----+-----+ -| QUERY_HASH / +| QUERY_HASH / / (64 byte) | +-----+-----+-----+-----+-----+-----+-----+-----+ -/ BF_MUTATOR | XQUERY / -+-----+-----+-----+-----+ / +| RESULT_FILTER / / (variable length) / +-----+-----+-----+-----+-----+-----+-----+-----+ -/ BF_RESULT (variable length) / +/ XQUERY (variable length) / +-----+-----+-----+-----+-----+-----+-----+-----+ ]]></artwork> </figure> @@ -1553,10 +1552,10 @@ BEGIN is a 16-bit number indicating the desired replication level of the data. In network byte order. </dd> - <dt>XQ_SIZE</dt> + <dt>RF_SIZE</dt> <dd> - is a 16-bit number indicating the length of the optional - extended query XQUERY. In network byte order. + is a 16-bit number indicating the length of the + result filter RESULT_FILTER. In network byte order. </dd> <dt>PEER_BF</dt> <dd> @@ -1569,6 +1568,10 @@ BEGIN The block type may use a different evaluation logic to determine applicable result blocks. </dd> + <dt>RESULT_FILTER</dt> + <dd> + the variable-length result filter, described in <xref target="result_filter"/>. + </dd> <dt>XQUERY</dt> <dd> the variable-length extended query. Optional. @@ -1577,10 +1580,6 @@ BEGIN <dd> The 32-bit mutator for the result filter. </dd> - <dt>RESULT_FILTER</dt> - <dd> - the variable-length result filter, described in <xref target="result_filter"/>. - </dd> </dl> </section> <section anchor="result_filter"> @@ -2176,18 +2175,40 @@ gnunet+tcp://12.3.4.5/ \ against the public key from the peer ID field. </t> <t> - The result filter for HELLO blocks is implemented using a - Bloom filter. The <tt>K</tt>-value for the Bloom filter - is always 16. The size <tt>S</tt> of the Bloom filter in bytes depends on - the number of elements <tt>F</tt> known to be filtered at the - initiator. If <tt>F</tt> is zero, the size <tt>S</tt> is just 8 (bytes). - Otherwise, <tt>S</tt> is set to the minimum of - 2<sup>15</sup> and the lowest power - of 2 that is strictly larger than <tt>K*F/4</tt> - (in bytes). The wire format of a HELLO block Bloom filter - is just the resulting byte array. In particular, <tt>K</tt> - is not transmitted. - </t> + The RESULT_FILTER for HELLO blocks is implemented using a + Bloom filter. + </t> + <figure anchor="hello_rf" title="The HELLO Block Result Filter."> + <artwork name="" type="" align="left" alt=""><![CDATA[ +0 8 16 24 32 40 48 56 ++-----+-----+-----+-----+-----+-----+-----+-----+ +| MUTATOR | HELLO_BF / ++-----+-----+-----+-----+ (variable length) / +/ / ++-----+-----+-----+-----+-----+-----+-----+-----+ +]]></artwork> + </figure> + + <t>where:</t> + <dl> + <dt>MUTATOR</dt> + <dd> + The 32-bit mutator for the result filter. + </dd> + <dt>HELLO_BF</dt> + <dd> + The <tt>K</tt>-value for the HELLO_BF Bloom filter + is always 16. The size <tt>S</tt> of the Bloom filter in bytes depends on + the number of elements <tt>F</tt> known to be filtered at the + initiator. If <tt>F</tt> is zero, the size <tt>S</tt> is just 8 (bytes). + Otherwise, <tt>S</tt> is set to the minimum of + 2<sup>15</sup> and the lowest power + of 2 that is strictly larger than <tt>K*F/4</tt> + (in bytes). The wire format of HELLO_BF is the resulting byte + array. In particular, <tt>K</tt> is never transmitted. + </dd> + </dl> + <t> To filter results of HELLO blocks using the Bloom filter, the <tt>H_ADDRS</tt> field (as computed using SHA-512 over