diff options
author | Christian Grothoff <christian@grothoff.org> | 2022-07-07 20:40:22 +0200 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2022-07-07 20:41:47 +0200 |
commit | 2124404d5749bf30e89f7ebec7cec2355107b8cb (patch) | |
tree | c17f4d9f1b89175816b05798b120b01bb35176ac | |
parent | 54ccf1c6a9e40cabad0b0328070d4a1042ad6104 (diff) | |
download | lsd0004-2124404d5749bf30e89f7ebec7cec2355107b8cb.tar.gz lsd0004-2124404d5749bf30e89f7ebec7cec2355107b8cb.zip |
add new truncated origin signed fields to messages
-rw-r--r-- | draft-schanzen-r5n.xml | 214 |
1 files changed, 139 insertions, 75 deletions
diff --git a/draft-schanzen-r5n.xml b/draft-schanzen-r5n.xml index 641397c..c662e87 100644 --- a/draft-schanzen-r5n.xml +++ b/draft-schanzen-r5n.xml | |||
@@ -133,7 +133,7 @@ | |||
133 | permissionless participation and support for | 133 | permissionless participation and support for |
134 | topologies in restricted-route environments. R<sup>5</sup>N also | 134 | topologies in restricted-route environments. R<sup>5</sup>N also |
135 | includes advanced features like tracing paths messages take through the | 135 | includes advanced features like tracing paths messages take through the |
136 | network, response filters and on-path application-specific data validation. | 136 | network, response filters and on-path application-specific data validation. |
137 | </t> | 137 | </t> |
138 | <t> | 138 | <t> |
139 | This document defines the normative wire format of peer-to-peer | 139 | This document defines the normative wire format of peer-to-peer |
@@ -195,7 +195,7 @@ | |||
195 | a peer in the underlay. | 195 | a peer in the underlay. |
196 | The Peer ID is the public key of the corresponding | 196 | The Peer ID is the public key of the corresponding |
197 | Ed25519<xref target="ed25519" /> peer private key. | 197 | Ed25519<xref target="ed25519" /> peer private key. |
198 | 198 | ||
199 | </dd> | 199 | </dd> |
200 | <dt>Peer Address:</dt> | 200 | <dt>Peer Address:</dt> |
201 | <dd> | 201 | <dd> |
@@ -619,7 +619,7 @@ Connectivity | |Underlay| |Underlay| | |||
619 | <t> | 619 | <t> |
620 | These signals then drive updates of the routing table, local storage | 620 | These signals then drive updates of the routing table, local storage |
621 | and message transmission. | 621 | and message transmission. |
622 | </t> | 622 | </t> |
623 | </section> | 623 | </section> |
624 | <section anchor="bootstrapping"> | 624 | <section anchor="bootstrapping"> |
625 | <name>Bootstrapping</name> | 625 | <name>Bootstrapping</name> |
@@ -630,7 +630,7 @@ Connectivity | |Underlay| |Underlay| | |||
630 | least one working HELLO to the DHT for bootstrapping. | 630 | least one working HELLO to the DHT for bootstrapping. |
631 | While details on how the first connection is established <bcp14>MAY</bcp14> | 631 | While details on how the first connection is established <bcp14>MAY</bcp14> |
632 | depend on the specific implementation, this <bcp14>SHOULD</bcp14> usually be done | 632 | depend on the specific implementation, this <bcp14>SHOULD</bcp14> usually be done |
633 | by an out-of-band exchange of the information from a HELLO block. | 633 | by an out-of-band exchange of the information from a HELLO block. |
634 | For this, section <xref target="hello_url"/> specifies a URL format for encoding HELLO | 634 | For this, section <xref target="hello_url"/> specifies a URL format for encoding HELLO |
635 | blocks as text strings which <bcp14>SHOULD</bcp14> be supported by implementations. | 635 | blocks as text strings which <bcp14>SHOULD</bcp14> be supported by implementations. |
636 | </t> | 636 | </t> |
@@ -654,20 +654,20 @@ Connectivity | |Underlay| |Underlay| | |||
654 | </t> | 654 | </t> |
655 | <t> | 655 | <t> |
656 | The frequency of advertisement and peer discovery messages | 656 | The frequency of advertisement and peer discovery messages |
657 | <bcp14>MAY</bcp14> be adapted according to network conditions, | 657 | <bcp14>MAY</bcp14> be adapted according to network conditions, |
658 | the set of already connected neighbors, | 658 | the set of already connected neighbors, |
659 | the workload of the system and other factors which are at the discretion of | 659 | the workload of the system and other factors which are at the discretion of |
660 | the developer. | 660 | the developer. |
661 | </t> | 661 | </t> |
662 | <t> | 662 | <t> |
663 | Any implementation encountering a HELLO GET request <bcp14>MUST</bcp14> respond | 663 | Any implementation encountering a HELLO GET request <bcp14>MUST</bcp14> respond |
664 | with its own HELLO block except if that block is | 664 | with its own HELLO block except if that block is |
665 | filtered by the request's result filter (see <xref target="result_filter"/>). | 665 | filtered by the request's result filter (see <xref target="result_filter"/>). |
666 | Implementations <bcp14>MAY</bcp14> respond | 666 | Implementations <bcp14>MAY</bcp14> respond |
667 | with additional valid HELLO blocks of other peers with keys | 667 | with additional valid HELLO blocks of other peers with keys |
668 | closest to the key of the GET request. A HELLO block is "valid" | 668 | closest to the key of the GET request. A HELLO block is "valid" |
669 | if it is non-expired and | 669 | if it is non-expired and |
670 | is not excluded by the result filter. "closest" is defined | 670 | is not excluded by the result filter. "closest" is defined |
671 | by considering the distances between the request's key and the | 671 | by considering the distances between the request's key and the |
672 | peer addresses of all of the valid HELLO blocks known at the local node. | 672 | peer addresses of all of the valid HELLO blocks known at the local node. |
673 | </t> | 673 | </t> |
@@ -678,7 +678,7 @@ Connectivity | |Underlay| |Underlay| | |||
678 | as the scheme, followed by "hello/" for the name | 678 | as the scheme, followed by "hello/" for the name |
679 | of the GNUnet subsystem, followed by "/"-separated values | 679 | of the GNUnet subsystem, followed by "/"-separated values |
680 | with the GNS | 680 | with the GNS |
681 | Base32 encoding (FIXME: described here or reference GNS draft?) of | 681 | Base32 encoding (FIXME: described here or reference GNS draft?) of |
682 | the <tt>Peer ID</tt>, a Base32-encoded EdDSA signature, and an expiration | 682 | the <tt>Peer ID</tt>, a Base32-encoded EdDSA signature, and an expiration |
683 | time in seconds since the UNIX Epoch in decimal format. | 683 | time in seconds since the UNIX Epoch in decimal format. |
684 | After this a "?" begins a list of key-value pairs where the key | 684 | After this a "?" begins a list of key-value pairs where the key |
@@ -700,7 +700,7 @@ ZFK0G9BWETY3CCE2QWGVT4WA7JN5M9HMWG\ | |||
700 | FIXME: signature is invalid, should | 700 | FIXME: signature is invalid, should |
701 | maybe generate proper test vector. | 701 | maybe generate proper test vector. |
702 | ]]> | 702 | ]]> |
703 | </artwork> | 703 | </artwork> |
704 | </figure> | 704 | </figure> |
705 | <t> | 705 | <t> |
706 | It specifies that the peer with the ID "RH1M...6Y3G" | 706 | It specifies that the peer with the ID "RH1M...6Y3G" |
@@ -728,7 +728,7 @@ addr-name = scheme | |||
728 | addr-value = *pchar | 728 | addr-value = *pchar |
729 | bchar = *(ALPHA / DIGIT) | 729 | bchar = *(ALPHA / DIGIT) |
730 | ]]> | 730 | ]]> |
731 | </artwork> | 731 | </artwork> |
732 | </figure> | 732 | </figure> |
733 | <t> | 733 | <t> |
734 | 'scheme' is defined in <xref target="RFC3986" /> in Section 3.1. | 734 | 'scheme' is defined in <xref target="RFC3986" /> in Section 3.1. |
@@ -787,10 +787,10 @@ bchar = *(ALPHA / DIGIT) | |||
787 | follows an XOR-based peer distance calculation. | 787 | follows an XOR-based peer distance calculation. |
788 | </t> | 788 | </t> |
789 | <t> | 789 | <t> |
790 | To enable routing, any R<sup>5</sup>N implementation must keep | 790 | To enable routing, any R<sup>5</sup>N implementation must keep |
791 | information about its current set of neighbors. | 791 | information about its current set of neighbors. |
792 | Upon receiving a connection notification from the Underlay through | 792 | Upon receiving a connection notification from the Underlay through |
793 | <tt>PEER_CONNECTED</tt>, information on the new neighbor | 793 | <tt>PEER_CONNECTED</tt>, information on the new neighbor |
794 | <bcp14>MUST</bcp14> be added, and similarly when | 794 | <bcp14>MUST</bcp14> be added, and similarly when |
795 | a disconnect is indicated by the Underlay through | 795 | a disconnect is indicated by the Underlay through |
796 | <tt>PEER_DISCONNECTED</tt> the peer <bcp14>MUST</bcp14> be removed. | 796 | <tt>PEER_DISCONNECTED</tt> the peer <bcp14>MUST</bcp14> be removed. |
@@ -826,7 +826,7 @@ bchar = *(ALPHA / DIGIT) | |||
826 | signalling to indicate that they are merely a client utilizing a | 826 | signalling to indicate that they are merely a client utilizing a |
827 | DHT and not able to participate in routing. DHT peers receiving | 827 | DHT and not able to participate in routing. DHT peers receiving |
828 | such connections <bcp14>MUST NOT</bcp14> include connections to | 828 | such connections <bcp14>MUST NOT</bcp14> include connections to |
829 | such restricted systems in their k-buckets, thereby effectively | 829 | such restricted systems in their k-buckets, thereby effectively |
830 | excluding them when making routing decisions. | 830 | excluding them when making routing decisions. |
831 | </t> | 831 | </t> |
832 | <t> | 832 | <t> |
@@ -843,7 +843,7 @@ bchar = *(ALPHA / DIGIT) | |||
843 | To build its routing table, a peer will send out requests | 843 | To build its routing table, a peer will send out requests |
844 | asking for blocks of type HELLO using its own location as the key, | 844 | asking for blocks of type HELLO using its own location as the key, |
845 | but filtering all of its neighbors via the Bloom filter described | 845 | but filtering all of its neighbors via the Bloom filter described |
846 | in <xref target="result_filter"/>. | 846 | in <xref target="result_filter"/>. |
847 | These requests <bcp14>MUST</bcp14> use the FindApproximate and DemultiplexEverywhere | 847 | These requests <bcp14>MUST</bcp14> use the FindApproximate and DemultiplexEverywhere |
848 | flags. FindApproximate will ensure that other peers will reply | 848 | flags. FindApproximate will ensure that other peers will reply |
849 | with keys they merely consider close-enough, while DemultiplexEverywhere | 849 | with keys they merely consider close-enough, while DemultiplexEverywhere |
@@ -885,7 +885,7 @@ bchar = *(ALPHA / DIGIT) | |||
885 | <t> | 885 | <t> |
886 | The peer Bloom filter is always a 128 byte field. The elements | 886 | The peer Bloom filter is always a 128 byte field. The elements |
887 | hashed into the Bloom filter are the 32 byte peer IDs. We note | 887 | hashed into the Bloom filter are the 32 byte peer IDs. We note |
888 | that the peer Bloom filter may exclude peers due to false-postive | 888 | that the peer Bloom filter may exclude peers due to false-postive |
889 | matches. This is acceptable as routing should nevertheless | 889 | matches. This is acceptable as routing should nevertheless |
890 | terminate (with high probability) in close vicinity of the key. | 890 | terminate (with high probability) in close vicinity of the key. |
891 | </t> | 891 | </t> |
@@ -893,9 +893,9 @@ bchar = *(ALPHA / DIGIT) | |||
893 | <section anchor="routing_functions"> | 893 | <section anchor="routing_functions"> |
894 | <name>Routing Functions</name> | 894 | <name>Routing Functions</name> |
895 | <t> | 895 | <t> |
896 | Using the data structures described so far, | 896 | Using the data structures described so far, |
897 | the R<sup>5</sup>N routing component provides | 897 | the R<sup>5</sup>N routing component provides |
898 | the following functions for | 898 | the following functions for |
899 | message processing (<xref target="p2p_messages"/>): | 899 | message processing (<xref target="p2p_messages"/>): |
900 | </t> | 900 | </t> |
901 | <dl> | 901 | <dl> |
@@ -915,16 +915,16 @@ bchar = *(ALPHA / DIGIT) | |||
915 | routing table with the shortest XOR-distance to the key <tt>K</tt>. | 915 | routing table with the shortest XOR-distance to the key <tt>K</tt>. |
916 | This means that for all other peers <tt>N'</tt> in the routing table | 916 | This means that for all other peers <tt>N'</tt> in the routing table |
917 | <tt>GetDistance(N, K) < GetDistance(N',K)</tt>. | 917 | <tt>GetDistance(N, K) < GetDistance(N',K)</tt>. |
918 | Peers with a positive test against the peer Bloom | 918 | Peers with a positive test against the peer Bloom |
919 | filter <tt>B</tt> are not considered. | 919 | filter <tt>B</tt> are not considered. |
920 | </dd> | 920 | </dd> |
921 | <dt> | 921 | <dt> |
922 | <tt>SelectRandompeer(B) -> N</tt> | 922 | <tt>SelectRandompeer(B) -> N</tt> |
923 | </dt> | 923 | </dt> |
924 | <dd> | 924 | <dd> |
925 | This function selects a random peer <tt>N</tt> from | 925 | This function selects a random peer <tt>N</tt> from |
926 | all neighbors. | 926 | all neighbors. |
927 | Peers with a positive test in the peer Bloom | 927 | Peers with a positive test in the peer Bloom |
928 | filter <tt>B</tt> are not considered. | 928 | filter <tt>B</tt> are not considered. |
929 | </dd> | 929 | </dd> |
930 | <dt> | 930 | <dt> |
@@ -974,7 +974,7 @@ BEGIN | |||
974 | if (REPL_LEVEL > 16) | 974 | if (REPL_LEVEL > 16) |
975 | REPL_LEVEL = 16 | 975 | REPL_LEVEL = 16 |
976 | RM1 = REPL_LEVEL - 1 | 976 | RM1 = REPL_LEVEL - 1 |
977 | return 1 + (RM1 / (L2NSE + RM1 * HOPCOUNT)) | 977 | return 1 + (RM1 / (L2NSE + RM1 * HOPCOUNT)) |
978 | ]]></artwork> | 978 | ]]></artwork> |
979 | </figure> | 979 | </figure> |
980 | <t> | 980 | <t> |
@@ -1030,7 +1030,7 @@ BEGIN | |||
1030 | track requests from local applications separately and | 1030 | track requests from local applications separately and |
1031 | preserve the information until the application explicitly | 1031 | preserve the information until the application explicitly |
1032 | stops the request. | 1032 | stops the request. |
1033 | </t> | 1033 | </t> |
1034 | </section> | 1034 | </section> |
1035 | </section> | 1035 | </section> |
1036 | <section anchor="p2p_messages" numbered="true" toc="default"> | 1036 | <section anchor="p2p_messages" numbered="true" toc="default"> |
@@ -1070,13 +1070,20 @@ BEGIN | |||
1070 | <dt>1: RecordRoute</dt> | 1070 | <dt>1: RecordRoute</dt> |
1071 | <dd> | 1071 | <dd> |
1072 | This bit indicates to keep track of the path that the message takes | 1072 | This bit indicates to keep track of the path that the message takes |
1073 | in the P2P network. | 1073 | in the P2P network. |
1074 | </dd> | 1074 | </dd> |
1075 | <dt>2: FindApproximate</dt> | 1075 | <dt>2: FindApproximate</dt> |
1076 | <dd> | 1076 | <dd> |
1077 | This bit allows results where the key does not match exactly. | 1077 | This bit allows results where the key does not match exactly. |
1078 | </dd> | 1078 | </dd> |
1079 | <dt>3-15: Reserved</dt> | 1079 | <dt>3: Truncated</dt> |
1080 | <dd> | ||
1081 | This is a special flag which is set if a peer truncated the path | ||
1082 | and thus the first hop on the path is given without a signature | ||
1083 | to enable checking of the next signature. MUST never be set in | ||
1084 | a query. | ||
1085 | </dd> | ||
1086 | <dt>4-15: Reserved</dt> | ||
1080 | <dd> | 1087 | <dd> |
1081 | The remaining bits are reserved for future use and | 1088 | The remaining bits are reserved for future use and |
1082 | <bcp14>MUST</bcp14> be set to 0 when initiating an operation. | 1089 | <bcp14>MUST</bcp14> be set to 0 when initiating an operation. |
@@ -1101,7 +1108,7 @@ BEGIN | |||
1101 | <t> | 1108 | <t> |
1102 | The public key of the peer which created the signature is in the | 1109 | The public key of the peer which created the signature is in the |
1103 | next path element, or is the sender of the message if this was the | 1110 | next path element, or is the sender of the message if this was the |
1104 | last path element. | 1111 | last path element. |
1105 | The wire format of a Path Element is illustrated in | 1112 | The wire format of a Path Element is illustrated in |
1106 | <xref target="figure_pathelement"/>. | 1113 | <xref target="figure_pathelement"/>. |
1107 | </t> | 1114 | </t> |
@@ -1141,7 +1148,7 @@ BEGIN | |||
1141 | The SIGNATURE covers a 64-bit contextualization header, the | 1148 | The SIGNATURE covers a 64-bit contextualization header, the |
1142 | the block expiration, a hash of the block | 1149 | the block expiration, a hash of the block |
1143 | payload, as well as the predecessor peer ID and the peer ID of the | 1150 | payload, as well as the predecessor peer ID and the peer ID of the |
1144 | successor that the peer making the signature is routing the | 1151 | successor that the peer making the signature is routing the |
1145 | message to. Thus, the signature made by SELF basically says that | 1152 | message to. Thus, the signature made by SELF basically says that |
1146 | SELF received the block payload from PEER PREDECESSOR and has forwarded | 1153 | SELF received the block payload from PEER PREDECESSOR and has forwarded |
1147 | it to PEER SUCCESSOR. The wire format is illustrated | 1154 | it to PEER SUCCESSOR. The wire format is illustrated |
@@ -1212,7 +1219,7 @@ BEGIN | |||
1212 | <section anchor="p2p_hello" numbered="true" toc="default"> | 1219 | <section anchor="p2p_hello" numbered="true" toc="default"> |
1213 | <name>HelloMessage</name> | 1220 | <name>HelloMessage</name> |
1214 | <t> | 1221 | <t> |
1215 | <tt>HelloMessage</tt>s are used to inform neighbors of | 1222 | <tt>HelloMessage</tt>s are used to inform neighbors of |
1216 | a peer about the sender's available addresses. The | 1223 | a peer about the sender's available addresses. The |
1217 | recipients use these messages to inform their respective | 1224 | recipients use these messages to inform their respective |
1218 | Underlays about ways to sustain the connections and to | 1225 | Underlays about ways to sustain the connections and to |
@@ -1221,11 +1228,11 @@ BEGIN | |||
1221 | from other peers. In contrast to a HELLO block, a | 1228 | from other peers. In contrast to a HELLO block, a |
1222 | <tt>HelloMessage</tt> does not contain the ID of | 1229 | <tt>HelloMessage</tt> does not contain the ID of |
1223 | the peer the address information is about: in a | 1230 | the peer the address information is about: in a |
1224 | <tt>HelloMessage</tt>, the address information is always | 1231 | <tt>HelloMessage</tt>, the address information is always |
1225 | about the sender. Since | 1232 | about the sender. Since |
1226 | the Underlay is responsible to determine the | 1233 | the Underlay is responsible to determine the |
1227 | peer ID of the sender for all messages, it would thus be | 1234 | peer ID of the sender for all messages, it would thus be |
1228 | redundant to also include the peer ID in the | 1235 | redundant to also include the peer ID in the |
1229 | <tt>HelloMessage</tt>. | 1236 | <tt>HelloMessage</tt>. |
1230 | </t> | 1237 | </t> |
1231 | <section anchor="p2p_hello_wire"> | 1238 | <section anchor="p2p_hello_wire"> |
@@ -1340,8 +1347,12 @@ BEGIN | |||
1340 | | BLOCK_KEY / | 1347 | | BLOCK_KEY / |
1341 | / (64 byte) | | 1348 | / (64 byte) | |
1342 | +-----+-----+-----+-----+-----+-----+-----+-----+ | 1349 | +-----+-----+-----+-----+-----+-----+-----+-----+ |
1350 | / TRUNCATED ORIGIN (0 or 32 bytes) / | ||
1351 | +-----+-----+-----+-----+-----+-----+-----+-----+ | ||
1343 | / PUTPATH (variable length) / | 1352 | / PUTPATH (variable length) / |
1344 | +-----+-----+-----+-----+-----+-----+-----+-----+ | 1353 | +-----+-----+-----+-----+-----+-----+-----+-----+ |
1354 | / LAST HOP SIGNATURE (0 or 64 bytes) / | ||
1355 | +-----+-----+-----+-----+-----+-----+-----+-----+ | ||
1345 | / BLOCK (variable length) / | 1356 | / BLOCK (variable length) / |
1346 | +-----+-----+-----+-----+-----+-----+-----+-----+ | 1357 | +-----+-----+-----+-----+-----+-----+-----+-----+ |
1347 | ]]></artwork> | 1358 | ]]></artwork> |
@@ -1398,11 +1409,35 @@ BEGIN | |||
1398 | The key under which the <tt>PutMessage</tt> wants to store content | 1409 | The key under which the <tt>PutMessage</tt> wants to store content |
1399 | under. | 1410 | under. |
1400 | </dd> | 1411 | </dd> |
1412 | <dt>TRUNCATED ORIGIN</dt> | ||
1413 | <dd> | ||
1414 | is only provided if the TRUNCATED flag | ||
1415 | is set in OPTIONS. If present, this is | ||
1416 | the public key of the peer just before | ||
1417 | the first entry on the PUTPATH and the | ||
1418 | first peer on the PUTPATH is not the | ||
1419 | actual origin of the message. Thus, to | ||
1420 | verify the first signature on the PUTPATH, | ||
1421 | this public key must be used. Note that | ||
1422 | due to the truncation, this last hop | ||
1423 | cannot be verified to exist. | ||
1424 | </dd> | ||
1401 | <dt>PUTPATH</dt> | 1425 | <dt>PUTPATH</dt> |
1402 | <dd> | 1426 | <dd> |
1403 | the variable-length PUT path. | 1427 | the variable-length PUT path. |
1404 | The path consists of a list of PATH_LEN Path Elements. | 1428 | The path consists of a list of PATH_LEN Path Elements. |
1405 | </dd> | 1429 | </dd> |
1430 | <dt>LAST HOP SIGNATURE</dt> | ||
1431 | <dd> | ||
1432 | is only provided if the RECORD ROUTE flag | ||
1433 | is set in OPTIONS. If present, this is | ||
1434 | an EdDSA signature of the sender of this message | ||
1435 | (using the same format as the signatures in PUTPATH) | ||
1436 | affirming that the sender forwarded the message from | ||
1437 | the predecessor (all zeros if PATH_LEN is 0, | ||
1438 | otherwise the last peer in PUTPATH) to | ||
1439 | the target peer. | ||
1440 | </dd> | ||
1406 | <dt>BLOCK</dt> | 1441 | <dt>BLOCK</dt> |
1407 | <dd> | 1442 | <dd> |
1408 | the variable-length block payload. The contents are determined | 1443 | the variable-length block payload. The contents are determined |
@@ -1448,14 +1483,14 @@ BEGIN | |||
1448 | <li> | 1483 | <li> |
1449 | If the <tt>RecordRoute</tt> flag is set in FLAGS, | 1484 | If the <tt>RecordRoute</tt> flag is set in FLAGS, |
1450 | the local peer address <bcp14>MUST</bcp14> be appended to the <tt>PUTPATH</tt> | 1485 | the local peer address <bcp14>MUST</bcp14> be appended to the <tt>PUTPATH</tt> |
1451 | of the message. If the flag is not set, the <tt>PATH_LEN</tt> | 1486 | of the message. If the flag is not set, the <tt>PATH_LEN</tt> |
1452 | <bcp14>MUST</bcp14> be set to zero. | 1487 | <bcp14>MUST</bcp14> be set to zero. |
1453 | </li> | 1488 | </li> |
1454 | <li> | 1489 | <li> |
1455 | If the <tt>PATH_LEN</tt> is non-zero, | 1490 | If the <tt>PATH_LEN</tt> is non-zero, |
1456 | the local peer <bcp14>SHOULD</bcp14> verify the signatures from the <tt>PUTPATH</tt>. | 1491 | the local peer <bcp14>SHOULD</bcp14> verify the signatures from the <tt>PUTPATH</tt>. |
1457 | Verification <bcp14>MAY</bcp14> involve checking all signatures or any random | 1492 | Verification <bcp14>MAY</bcp14> involve checking all signatures or any random |
1458 | subset of the signatures. It is <bcp14>RECOMMENDED</bcp14> that peers adapt | 1493 | subset of the signatures. It is <bcp14>RECOMMENDED</bcp14> that peers adapt |
1459 | their behavior to available computational resources so as to not make signature | 1494 | their behavior to available computational resources so as to not make signature |
1460 | verification a bottleneck. If an invalid signature is found, the | 1495 | verification a bottleneck. If an invalid signature is found, the |
1461 | <tt>PUTPATH</tt> <bcp14>MUST</bcp14> be truncated to only include the elements | 1496 | <tt>PUTPATH</tt> <bcp14>MUST</bcp14> be truncated to only include the elements |
@@ -1469,9 +1504,9 @@ BEGIN | |||
1469 | </li> | 1504 | </li> |
1470 | <li> | 1505 | <li> |
1471 | If the <tt>MTYPE</tt> of the message indicates a HELLO block, the | 1506 | If the <tt>MTYPE</tt> of the message indicates a HELLO block, the |
1472 | peer <bcp14>MUST</bcp14> be considered for the local routing | 1507 | peer <bcp14>MUST</bcp14> be considered for the local routing |
1473 | table if the respective k-bucket is not yet full. In this case, | 1508 | table if the respective k-bucket is not yet full. In this case, |
1474 | the local peer <bcp14>MUST</bcp14> try to establish a connection | 1509 | the local peer <bcp14>MUST</bcp14> try to establish a connection |
1475 | to the peer indicated in the HELLO block using the address information | 1510 | to the peer indicated in the HELLO block using the address information |
1476 | from the HELLO block. If a connection is established, | 1511 | from the HELLO block. If a connection is established, |
1477 | the peer is added to the respective k-bucket of the routing table. | 1512 | the peer is added to the respective k-bucket of the routing table. |
@@ -1482,7 +1517,7 @@ BEGIN | |||
1482 | Given the value in <tt>REPL_LVL</tt>, <tt>HOPCOUNT</tt> and the | 1517 | Given the value in <tt>REPL_LVL</tt>, <tt>HOPCOUNT</tt> and the |
1483 | result of <tt>IsClosestpeer(SELF, BLOCK_KEY)</tt> the number of peers to | 1518 | result of <tt>IsClosestpeer(SELF, BLOCK_KEY)</tt> the number of peers to |
1484 | forward to <bcp14>MUST</bcp14> be calculated | 1519 | forward to <bcp14>MUST</bcp14> be calculated |
1485 | using <tt>ComputeOutDegree()</tt>. | 1520 | using <tt>ComputeOutDegree()</tt>. |
1486 | The implementation <bcp14>SHOULD</bcp14> select up to this | 1521 | The implementation <bcp14>SHOULD</bcp14> select up to this |
1487 | number of peers to forward the message to. The implementation <bcp14>MAY</bcp14> | 1522 | number of peers to forward the message to. The implementation <bcp14>MAY</bcp14> |
1488 | forward to fewer or no peers in order to handle resource constraints | 1523 | forward to fewer or no peers in order to handle resource constraints |
@@ -1491,7 +1526,7 @@ BEGIN | |||
1491 | <tt>PEER_BF</tt> before forwarding the message. | 1526 | <tt>PEER_BF</tt> before forwarding the message. |
1492 | For all peers with peer address <tt>P</tt> selected to forward the message | 1527 | For all peers with peer address <tt>P</tt> selected to forward the message |
1493 | to, <tt>SEND(P, PutMessage')</tt> is called. Here, <tt>PutMessage'</tt> | 1528 | to, <tt>SEND(P, PutMessage')</tt> is called. Here, <tt>PutMessage'</tt> |
1494 | is the original message with updated fields. In particular, <tt>HOPCOUNT</tt> | 1529 | is the original message with updated fields. In particular, <tt>HOPCOUNT</tt> |
1495 | <bcp14>MUST</bcp14> be incremented by 1. | 1530 | <bcp14>MUST</bcp14> be incremented by 1. |
1496 | </li> | 1531 | </li> |
1497 | </ol> | 1532 | </ol> |
@@ -1604,7 +1639,7 @@ BEGIN | |||
1604 | <t> | 1639 | <t> |
1605 | How exactly a block result is added to a result filter | 1640 | How exactly a block result is added to a result filter |
1606 | <bcp14>MUST</bcp14> be | 1641 | <bcp14>MUST</bcp14> be |
1607 | specified as part of the definition of a block type. | 1642 | specified as part of the definition of a block type. |
1608 | </t> | 1643 | </t> |
1609 | </section> | 1644 | </section> |
1610 | <section anchor="p2p_get_processing"> | 1645 | <section anchor="p2p_get_processing"> |
@@ -1669,7 +1704,7 @@ BEGIN | |||
1669 | </t> | 1704 | </t> |
1670 | <t> | 1705 | <t> |
1671 | If the <tt>BTYPE</tt> is supported and <tt>ValidateBlockReply</tt> for the given | 1706 | If the <tt>BTYPE</tt> is supported and <tt>ValidateBlockReply</tt> for the given |
1672 | query has yielded a status of <tt>FILTER_LAST</tt>, processing | 1707 | query has yielded a status of <tt>FILTER_LAST</tt>, processing |
1673 | <bcp14>MUST</bcp14> end and not continue with forwarding of | 1708 | <bcp14>MUST</bcp14> end and not continue with forwarding of |
1674 | the request to other peers. | 1709 | the request to other peers. |
1675 | </t> | 1710 | </t> |
@@ -1687,7 +1722,7 @@ BEGIN | |||
1687 | peer address <tt>SELF</tt>. | 1722 | peer address <tt>SELF</tt>. |
1688 | For all peers with peer address <tt>P'</tt> chosen to forward the message | 1723 | For all peers with peer address <tt>P'</tt> chosen to forward the message |
1689 | to, <tt>SEND(P', GetMessage')</tt> is called. Here, <tt>GetMessage'</tt> | 1724 | to, <tt>SEND(P', GetMessage')</tt> is called. Here, <tt>GetMessage'</tt> |
1690 | is the original message with updated fields. In particular, <tt>HOPCOUNT</tt> | 1725 | is the original message with updated fields. In particular, <tt>HOPCOUNT</tt> |
1691 | <bcp14>MUST</bcp14> be incremented by 1. | 1726 | <bcp14>MUST</bcp14> be incremented by 1. |
1692 | </li> | 1727 | </li> |
1693 | </ol> | 1728 | </ol> |
@@ -1713,12 +1748,16 @@ BEGIN | |||
1713 | | QUERY_HASH / | 1748 | | QUERY_HASH / |
1714 | / (64 byte) | | 1749 | / (64 byte) | |
1715 | +-----+-----+-----+-----+-----+-----+-----+-----+ | 1750 | +-----+-----+-----+-----+-----+-----+-----+-----+ |
1751 | / TRUNCATED ORIGIN (0 or 32 bytes) / | ||
1752 | +-----+-----+-----+-----+-----+-----+-----+-----+ | ||
1716 | / PUTPATH / | 1753 | / PUTPATH / |
1717 | / (variable length) / | 1754 | / (variable length) / |
1718 | +-----+-----+-----+-----+-----+-----+-----+-----+ | 1755 | +-----+-----+-----+-----+-----+-----+-----+-----+ |
1719 | / GETPATH / | 1756 | / GETPATH / |
1720 | / (variable length) / | 1757 | / (variable length) / |
1721 | +-----+-----+-----+-----+-----+-----+-----+-----+ | 1758 | +-----+-----+-----+-----+-----+-----+-----+-----+ |
1759 | / LAST HOP SIGNATURE (0 or 64 bytes) / | ||
1760 | +-----+-----+-----+-----+-----+-----+-----+-----+ | ||
1722 | / BLOCK / | 1761 | / BLOCK / |
1723 | / (variable length) / | 1762 | / (variable length) / |
1724 | +-----+-----+-----+-----+-----+-----+-----+-----+ | 1763 | +-----+-----+-----+-----+-----+-----+-----+-----+ |
@@ -1737,7 +1776,7 @@ BEGIN | |||
1737 | </dd> | 1776 | </dd> |
1738 | <dt>RESERVED</dt> | 1777 | <dt>RESERVED</dt> |
1739 | <dd> | 1778 | <dd> |
1740 | is a 32-bit value. Implementations <bcp14>MUST</bcp14> | 1779 | is a 32-bit value. Implementations <bcp14>MUST</bcp14> |
1741 | set this value to zero when originating a result message. | 1780 | set this value to zero when originating a result message. |
1742 | Implementations <bcp14>MUST</bcp14> forward | 1781 | Implementations <bcp14>MUST</bcp14> forward |
1743 | this value unchanged even if it is non-zero. | 1782 | this value unchanged even if it is non-zero. |
@@ -1772,6 +1811,19 @@ BEGIN | |||
1772 | the query hash corresponding to the <tt>GetMessage</tt> which | 1811 | the query hash corresponding to the <tt>GetMessage</tt> which |
1773 | caused this reply message to be sent. | 1812 | caused this reply message to be sent. |
1774 | </dd> | 1813 | </dd> |
1814 | <dt>TRUNCATED ORIGIN</dt> | ||
1815 | <dd> | ||
1816 | is only provided if the TRUNCATED flag | ||
1817 | is set in OPTIONS. If present, this is | ||
1818 | the public key of the peer just before | ||
1819 | the first entry on the PUTPATH and the | ||
1820 | first peer on the PUTPATH is not the | ||
1821 | actual origin of the message. Thus, to | ||
1822 | verify the first signature on the PUTPATH, | ||
1823 | this public key must be used. Note that | ||
1824 | due to the truncation, this last hop | ||
1825 | cannot be verified to exist. | ||
1826 | </dd> | ||
1775 | <dt>PUTPATH</dt> | 1827 | <dt>PUTPATH</dt> |
1776 | <dd> | 1828 | <dd> |
1777 | the variable-length PUT path. | 1829 | the variable-length PUT path. |
@@ -1782,6 +1834,17 @@ BEGIN | |||
1782 | the variable-length PUT path. | 1834 | the variable-length PUT path. |
1783 | The path consists of a list of <tt>GET_PATH_LEN</tt> Path Elements. | 1835 | The path consists of a list of <tt>GET_PATH_LEN</tt> Path Elements. |
1784 | </dd> | 1836 | </dd> |
1837 | <dt>LAST HOP SIGNATURE</dt> | ||
1838 | <dd> | ||
1839 | is only provided if the RECORD ROUTE flag | ||
1840 | is set in OPTIONS. If present, this is | ||
1841 | an EdDSA signature of the sender of this message | ||
1842 | (using the same format as the signatures in PUTPATH) | ||
1843 | affirming that the sender forwarded the message from | ||
1844 | the predecessor (all zeros if PATH_LEN is 0, | ||
1845 | otherwise the last peer in PUTPATH) to | ||
1846 | the target peer. | ||
1847 | </dd> | ||
1785 | <dt>BLOCK</dt> | 1848 | <dt>BLOCK</dt> |
1786 | <dd> | 1849 | <dd> |
1787 | the variable-length resource record data payload. | 1850 | the variable-length resource record data payload. |
@@ -1801,19 +1864,19 @@ BEGIN | |||
1801 | If the message is expired, it <bcp14>MUST</bcp14> be discarded. | 1864 | If the message is expired, it <bcp14>MUST</bcp14> be discarded. |
1802 | </li> | 1865 | </li> |
1803 | <li> | 1866 | <li> |
1804 | If the <tt>BTYPE</tt> is supported, then the <tt>BLOCK</tt> | 1867 | If the <tt>BTYPE</tt> is supported, then the <tt>BLOCK</tt> |
1805 | <bcp14>MUST</bcp14> be validated against the | 1868 | <bcp14>MUST</bcp14> be validated against the |
1806 | requested <tt>BTYPE</tt>. To do this, the peer | 1869 | requested <tt>BTYPE</tt>. To do this, the peer |
1807 | checks that the block is valid using <tt>ValidateBlockStoreRequest</tt>. | 1870 | checks that the block is valid using <tt>ValidateBlockStoreRequest</tt>. |
1808 | If the result is <tt>BLOCK_INVALID</tt>, the message <bcp14>MUST</bcp14> be | 1871 | If the result is <tt>BLOCK_INVALID</tt>, the message <bcp14>MUST</bcp14> be |
1809 | discarded. | 1872 | discarded. |
1810 | </li> | 1873 | </li> |
1811 | <li> | 1874 | <li> |
1812 | If the <tt>PUT_PATH_LEN</tt> or the <tt>GET_PATH_LEN</tt> are non-zero, | 1875 | If the <tt>PUT_PATH_LEN</tt> or the <tt>GET_PATH_LEN</tt> are non-zero, |
1813 | the local peer <bcp14>SHOULD</bcp14> verify the signatures from the <tt>PUTPATH</tt> | 1876 | the local peer <bcp14>SHOULD</bcp14> verify the signatures from the <tt>PUTPATH</tt> |
1814 | and the <tt>GETPATH</tt>. | 1877 | and the <tt>GETPATH</tt>. |
1815 | Verification <bcp14>MAY</bcp14> involve checking all signatures or any random | 1878 | Verification <bcp14>MAY</bcp14> involve checking all signatures or any random |
1816 | subset of the signatures. It is <bcp14>RECOMMENDED</bcp14> that peers adapt | 1879 | subset of the signatures. It is <bcp14>RECOMMENDED</bcp14> that peers adapt |
1817 | their behavior to available computational resources so as to not make signature | 1880 | their behavior to available computational resources so as to not make signature |
1818 | verification a bottleneck. If an invalid signature is found, the | 1881 | verification a bottleneck. If an invalid signature is found, the |
1819 | path <bcp14>MUST</bcp14> be truncated to only include the elements | 1882 | path <bcp14>MUST</bcp14> be truncated to only include the elements |
@@ -1828,9 +1891,9 @@ BEGIN | |||
1828 | </li> | 1891 | </li> |
1829 | <li> | 1892 | <li> |
1830 | If the <tt>MTYPE</tt> of the message indicates a HELLO block, the | 1893 | If the <tt>MTYPE</tt> of the message indicates a HELLO block, the |
1831 | peer <bcp14>MUST</bcp14> be considered for the local routing | 1894 | peer <bcp14>MUST</bcp14> be considered for the local routing |
1832 | table if the respective k-bucket is not yet full. In this case, | 1895 | table if the respective k-bucket is not yet full. In this case, |
1833 | the local peer <bcp14>MUST</bcp14> try to establish a connection | 1896 | the local peer <bcp14>MUST</bcp14> try to establish a connection |
1834 | to the peer indicated in the HELLO block using the address information | 1897 | to the peer indicated in the HELLO block using the address information |
1835 | from the HELLO block. If a connection is established, | 1898 | from the HELLO block. If a connection is established, |
1836 | the peer is added to the respective k-bucket of the routing table. | 1899 | the peer is added to the respective k-bucket of the routing table. |
@@ -1848,7 +1911,7 @@ BEGIN | |||
1848 | If the <tt>FindApproximate</tt> flag was not set in the query and the <tt>BTYPE</tt> allowed the | 1911 | If the <tt>FindApproximate</tt> flag was not set in the query and the <tt>BTYPE</tt> allowed the |
1849 | implementation to compute the key from the block, the computed key must | 1912 | implementation to compute the key from the block, the computed key must |
1850 | exactly match the <tt>QUERY_HASH</tt>, otherwise the result does | 1913 | exactly match the <tt>QUERY_HASH</tt>, otherwise the result does |
1851 | not match the pending query and processing continues with the next pending query. | 1914 | not match the pending query and processing continues with the next pending query. |
1852 | </li> | 1915 | </li> |
1853 | <li> | 1916 | <li> |
1854 | If the <tt>BTYPE</tt> is supported, result block <bcp14>MUST</bcp14> | 1917 | If the <tt>BTYPE</tt> is supported, result block <bcp14>MUST</bcp14> |
@@ -1859,7 +1922,7 @@ BEGIN | |||
1859 | query. | 1922 | query. |
1860 | </li> | 1923 | </li> |
1861 | <li> | 1924 | <li> |
1862 | If the <tt>BTYPE</tt> is not supported, filtering of exact duplicate | 1925 | If the <tt>BTYPE</tt> is not supported, filtering of exact duplicate |
1863 | replies <bcp14>MUST</bcp14> still be performed before forwarding | 1926 | replies <bcp14>MUST</bcp14> still be performed before forwarding |
1864 | the reply. | 1927 | the reply. |
1865 | Such duplicate filtering <bcp14>MAY</bcp14> be implemented | 1928 | Such duplicate filtering <bcp14>MAY</bcp14> be implemented |
@@ -1872,8 +1935,8 @@ BEGIN | |||
1872 | the local peer address <bcp14>MUST</bcp14> be appended to the <tt>GETPATH</tt> | 1935 | the local peer address <bcp14>MUST</bcp14> be appended to the <tt>GETPATH</tt> |
1873 | of the message and the respective signature <bcp14>MUST</bcp14> be | 1936 | of the message and the respective signature <bcp14>MUST</bcp14> be |
1874 | set using the query origin as the <tt>PEER SUCCESSOR</tt> and the | 1937 | set using the query origin as the <tt>PEER SUCCESSOR</tt> and the |
1875 | response origin as the <tt>PEER PREDECESSOR</tt>. If the flag is not set, | 1938 | response origin as the <tt>PEER PREDECESSOR</tt>. If the flag is not set, |
1876 | the <tt>GET_PATH_LEN</tt> and <tt>PUT_PATH_LEN</tt> | 1939 | the <tt>GET_PATH_LEN</tt> and <tt>PUT_PATH_LEN</tt> |
1877 | <bcp14>MUST</bcp14> be set to zero when forwarding the result. | 1940 | <bcp14>MUST</bcp14> be set to zero when forwarding the result. |
1878 | </li> | 1941 | </li> |
1879 | </ol> | 1942 | </ol> |
@@ -1885,9 +1948,9 @@ BEGIN | |||
1885 | </t> | 1948 | </t> |
1886 | </li> | 1949 | </li> |
1887 | <li> | 1950 | <li> |
1888 | Finally, the implementation <bcp14>MAY</bcp14> choose to | 1951 | Finally, the implementation <bcp14>MAY</bcp14> choose to |
1889 | cache data from <tt>ResultMessage</tt>s. | 1952 | cache data from <tt>ResultMessage</tt>s. |
1890 | </li> | 1953 | </li> |
1891 | </ol> | 1954 | </ol> |
1892 | </section> | 1955 | </section> |
1893 | </section> | 1956 | </section> |
@@ -1896,7 +1959,7 @@ BEGIN | |||
1896 | <name>Blocks</name> | 1959 | <name>Blocks</name> |
1897 | <t> | 1960 | <t> |
1898 | This section describes various considerations R<sup>5</sup>N | 1961 | This section describes various considerations R<sup>5</sup>N |
1899 | implementations must consider with respect to blocks. | 1962 | implementations must consider with respect to blocks. |
1900 | Specifically, implementations <bcp14>SHOULD</bcp14> be able | 1963 | Specifically, implementations <bcp14>SHOULD</bcp14> be able |
1901 | to validate and persist blocks. Implementations | 1964 | to validate and persist blocks. Implementations |
1902 | <bcp14>MAY</bcp14> not support validation for all types | 1965 | <bcp14>MAY</bcp14> not support validation for all types |
@@ -1907,7 +1970,7 @@ BEGIN | |||
1907 | Applications can and should define their own block types. | 1970 | Applications can and should define their own block types. |
1908 | The block type determines the format and handling of the block | 1971 | The block type determines the format and handling of the block |
1909 | payload by peers in <tt>PutMessage</tt>s and <tt>ResultMessage</tt>s. | 1972 | payload by peers in <tt>PutMessage</tt>s and <tt>ResultMessage</tt>s. |
1910 | Block types <bcp14>MUST</bcp14> be registered with GANA | 1973 | Block types <bcp14>MUST</bcp14> be registered with GANA |
1911 | (see <xref target="gana_block_type"/>). | 1974 | (see <xref target="gana_block_type"/>). |
1912 | </t> | 1975 | </t> |
1913 | <t> | 1976 | <t> |
@@ -1916,7 +1979,7 @@ BEGIN | |||
1916 | <name>Block Operations</name> | 1979 | <name>Block Operations</name> |
1917 | <t> | 1980 | <t> |
1918 | Block validation may be necessary for all types of DHT | 1981 | Block validation may be necessary for all types of DHT |
1919 | messages. To enable these validations, any block type | 1982 | messages. To enable these validations, any block type |
1920 | specification <bcp14>MUST</bcp14> define the following functions: | 1983 | specification <bcp14>MUST</bcp14> define the following functions: |
1921 | </t> | 1984 | </t> |
1922 | <dl> | 1985 | <dl> |
@@ -1926,7 +1989,7 @@ BEGIN | |||
1926 | <t> | 1989 | <t> |
1927 | is used to evaluate the request for a block as part of | 1990 | is used to evaluate the request for a block as part of |
1928 | <tt>GetMessage</tt> processing. Here, the block payload is unkown, | 1991 | <tt>GetMessage</tt> processing. Here, the block payload is unkown, |
1929 | but if possible the <tt>XQuery</tt> and <tt>Key</tt> | 1992 | but if possible the <tt>XQuery</tt> and <tt>Key</tt> |
1930 | <bcp14>SHOULD</bcp14> be verified. Possible values for | 1993 | <bcp14>SHOULD</bcp14> be verified. Possible values for |
1931 | the <tt>RequestEvaluationResult</tt> are: | 1994 | the <tt>RequestEvaluationResult</tt> are: |
1932 | </t> | 1995 | </t> |
@@ -1943,7 +2006,7 @@ BEGIN | |||
1943 | </dd> | 2006 | </dd> |
1944 | <dt>DeriveBlockKey(Block) -> Key | NONE</dt> | 2007 | <dt>DeriveBlockKey(Block) -> Key | NONE</dt> |
1945 | <dd> | 2008 | <dd> |
1946 | is used to synthesize the block key from the block payload as | 2009 | is used to synthesize the block key from the block payload as |
1947 | part of <tt>PutMessage</tt> and <tt>ResultMessage</tt> processing. | 2010 | part of <tt>PutMessage</tt> and <tt>ResultMessage</tt> processing. |
1948 | The special return value of <tt>NONE</tt> implies that this block type does not | 2011 | The special return value of <tt>NONE</tt> implies that this block type does not |
1949 | permit deriving the key from the block. A Key may be returned | 2012 | permit deriving the key from the block. A Key may be returned |
@@ -1963,8 +2026,8 @@ BEGIN | |||
1963 | <dt>BLOCK_INVALID</dt> | 2026 | <dt>BLOCK_INVALID</dt> |
1964 | <dd>Block payload does not match the block type. | 2027 | <dd>Block payload does not match the block type. |
1965 | </dd> | 2028 | </dd> |
1966 | </dl> | 2029 | </dl> |
1967 | </dd> | 2030 | </dd> |
1968 | <dt>SetupResultFilter(FilterSize, Mutator) -> RF</dt> | 2031 | <dt>SetupResultFilter(FilterSize, Mutator) -> RF</dt> |
1969 | <dd> | 2032 | <dd> |
1970 | is used to setup an empty result filter. The arguments | 2033 | is used to setup an empty result filter. The arguments |
@@ -1999,7 +2062,7 @@ BEGIN | |||
1999 | <t> | 2062 | <t> |
2000 | If the main evaluation result is <tt>FILTER_MORE</tt>, the function also returns | 2063 | If the main evaluation result is <tt>FILTER_MORE</tt>, the function also returns |
2001 | and updated result filter where the block is added to the set of | 2064 | and updated result filter where the block is added to the set of |
2002 | filtered replies. An implementation is not expected to actually differenciate | 2065 | filtered replies. An implementation is not expected to actually differenciate |
2003 | between the <tt>FILTER_DUPLICATE</tt> and <tt>FILTER_IRRELEVANT</tt> return | 2066 | between the <tt>FILTER_DUPLICATE</tt> and <tt>FILTER_IRRELEVANT</tt> return |
2004 | values: in both cases the block is ignored for this query. | 2067 | values: in both cases the block is ignored for this query. |
2005 | </t> | 2068 | </t> |
@@ -2021,7 +2084,7 @@ BEGIN | |||
2021 | The HELLO block type wire format is illustrated in | 2084 | The HELLO block type wire format is illustrated in |
2022 | <xref target="figure_hello"/>. A query for block of type HELLO <bcp14>MUST NOT</bcp14> | 2085 | <xref target="figure_hello"/>. A query for block of type HELLO <bcp14>MUST NOT</bcp14> |
2023 | include extended query data (XQuery). Any implementation | 2086 | include extended query data (XQuery). Any implementation |
2024 | encountering a request for a HELLO with non-empty XQuery | 2087 | encountering a request for a HELLO with non-empty XQuery |
2025 | data <bcp14>MUST</bcp14> consider the request invalid and ignore it. | 2088 | data <bcp14>MUST</bcp14> consider the request invalid and ignore it. |
2026 | </t> | 2089 | </t> |
2027 | <figure anchor="figure_hello" title="The HELLO Block Format."> | 2090 | <figure anchor="figure_hello" title="The HELLO Block Format."> |
@@ -2204,8 +2267,8 @@ gnunet+tcp://12.3.4.5/ \ | |||
2204 | deterministic across peers. The 32-bit <tt>MUTATOR</tt> | 2267 | deterministic across peers. The 32-bit <tt>MUTATOR</tt> |
2205 | value is set by the peer initiating the GET request, and changed | 2268 | value is set by the peer initiating the GET request, and changed |
2206 | every time the GET request is repeated by the initiator. Peers | 2269 | every time the GET request is repeated by the initiator. Peers |
2207 | forwarding GET requests <bcp14>MUST</bcp14> not change the | 2270 | forwarding GET requests <bcp14>MUST</bcp14> not change the |
2208 | mutator value included in the <tt>RESULT_FILTER</tt> as they might not | 2271 | mutator value included in the <tt>RESULT_FILTER</tt> as they might not |
2209 | be able to recalculate the result filter with a different <tt>MUTATOR</tt> | 2272 | be able to recalculate the result filter with a different <tt>MUTATOR</tt> |
2210 | value. | 2273 | value. |
2211 | </t> | 2274 | </t> |
@@ -2214,11 +2277,11 @@ gnunet+tcp://12.3.4.5/ \ | |||
2214 | requests have statistically independent probabilities of creating | 2277 | requests have statistically independent probabilities of creating |
2215 | false-positives in a result filter. Thus, even if for one request | 2278 | false-positives in a result filter. Thus, even if for one request |
2216 | a result filter may exclude a result as a false-positive | 2279 | a result filter may exclude a result as a false-positive |
2217 | match, subsequent requests are likely to not have the same | 2280 | match, subsequent requests are likely to not have the same |
2218 | false-positives. | 2281 | false-positives. |
2219 | </t> | 2282 | </t> |
2220 | <t> | 2283 | <t> |
2221 | HELLO result filters can be merged if the | 2284 | HELLO result filters can be merged if the |
2222 | Bloom filters have the same size and | 2285 | Bloom filters have the same size and |
2223 | <tt>MUTATOR</tt> by setting all bits to 1 that are | 2286 | <tt>MUTATOR</tt> by setting all bits to 1 that are |
2224 | set in either Bloom filter. This is done whenever | 2287 | set in either Bloom filter. This is done whenever |
@@ -2233,8 +2296,8 @@ gnunet+tcp://12.3.4.5/ \ | |||
2233 | the <tt>ADDRESSES</tt>) and XORed with the SHA-512 | 2296 | the <tt>ADDRESSES</tt>) and XORed with the SHA-512 |
2234 | hash of the <tt>MUTATOR</tt> (in network byte order). | 2297 | hash of the <tt>MUTATOR</tt> (in network byte order). |
2235 | The resulting value is then used when hashing into the | 2298 | The resulting value is then used when hashing into the |
2236 | Bloom filter as described in <xref target="bloom_filters" />. | 2299 | Bloom filter as described in <xref target="bloom_filters" />. |
2237 | Consequently, HELLOs with completely identical sets of | 2300 | Consequently, HELLOs with completely identical sets of |
2238 | addresses will be filtered and FILTER_DUPLICATE is returned. | 2301 | addresses will be filtered and FILTER_DUPLICATE is returned. |
2239 | Any small variation in the set of addresses will cause the block | 2302 | Any small variation in the set of addresses will cause the block |
2240 | to no longer be filtered (with high probability) and | 2303 | to no longer be filtered (with high probability) and |
@@ -2246,8 +2309,8 @@ gnunet+tcp://12.3.4.5/ \ | |||
2246 | <name>Persistence</name> | 2309 | <name>Persistence</name> |
2247 | <t> | 2310 | <t> |
2248 | An implementation <bcp14>SHOULD</bcp14> provide a local persistence mechanism for | 2311 | An implementation <bcp14>SHOULD</bcp14> provide a local persistence mechanism for |
2249 | blocks. Embedded systems that lack storage capability <bcp14>MAY</bcp14> use | 2312 | blocks. Embedded systems that lack storage capability <bcp14>MAY</bcp14> use |
2250 | connection-level signalling to indicate that they are merely a client utilizing a | 2313 | connection-level signalling to indicate that they are merely a client utilizing a |
2251 | DHT and are not able to participate with storage. | 2314 | DHT and are not able to participate with storage. |
2252 | The local storage <bcp14>MUST</bcp14> provide the following functionality: | 2315 | The local storage <bcp14>MUST</bcp14> provide the following functionality: |
2253 | </t> | 2316 | </t> |
@@ -2257,7 +2320,8 @@ gnunet+tcp://12.3.4.5/ \ | |||
2257 | Stores a block under the specified key. If an block with identical | 2320 | Stores a block under the specified key. If an block with identical |
2258 | payload exists already under the same key, the meta data should | 2321 | payload exists already under the same key, the meta data should |
2259 | be set to the maximum expiration time of both blocks and use the | 2322 | be set to the maximum expiration time of both blocks and use the |
2260 | corresponding <tt>PUTPATH</tt> of that version of the block. | 2323 | corresponding <tt>PUTPATH</tt> (and if applicable |
2324 | <tt>TRUNCATED ORIGIN</tt>) of that version of the block. | ||
2261 | </dd> | 2325 | </dd> |
2262 | <dt>Lookup(Key) -> List of Blocks</dt> | 2326 | <dt>Lookup(Key) -> List of Blocks</dt> |
2263 | <dd> | 2327 | <dd> |
@@ -2358,7 +2422,7 @@ gnunet+tcp://12.3.4.5/ \ | |||
2358 | The <tt>ComputeOutDegree</tt> function limits the | 2422 | The <tt>ComputeOutDegree</tt> function limits the |
2359 | <tt>REPL_LVL</tt> to a maximum of 16. This imposes | 2423 | <tt>REPL_LVL</tt> to a maximum of 16. This imposes |
2360 | an upper limit on bandwidth amplification an attacker | 2424 | an upper limit on bandwidth amplification an attacker |
2361 | may achieve for a given network size and topology. | 2425 | may achieve for a given network size and topology. |
2362 | </t> | 2426 | </t> |
2363 | <section> | 2427 | <section> |
2364 | <name>Approximate Result Filtering</name> | 2428 | <name>Approximate Result Filtering</name> |
@@ -2404,7 +2468,7 @@ gnunet+tcp://12.3.4.5/ \ | |||
2404 | </t> | 2468 | </t> |
2405 | </section> | 2469 | </section> |
2406 | </section> | 2470 | </section> |
2407 | 2471 | ||
2408 | <section anchor="gana" numbered="true" toc="default"> | 2472 | <section anchor="gana" numbered="true" toc="default"> |
2409 | <name>GANA Considerations</name> | 2473 | <name>GANA Considerations</name> |
2410 | <section anchor="gana_block_type" numbered="true" toc="default"> | 2474 | <section anchor="gana_block_type" numbered="true" toc="default"> |