diff options
Diffstat (limited to 'draft-schanzen-r5n.xml')
-rw-r--r-- | draft-schanzen-r5n.xml | 49 |
1 files changed, 28 insertions, 21 deletions
diff --git a/draft-schanzen-r5n.xml b/draft-schanzen-r5n.xml index ea0736f..519fb60 100644 --- a/draft-schanzen-r5n.xml +++ b/draft-schanzen-r5n.xml | |||
@@ -514,36 +514,43 @@ PEER-SELECT(key, bloomfilter) | |||
514 | END | 514 | END |
515 | END | 515 | END |
516 | ]]></artwork> | 516 | ]]></artwork> |
517 | </figure> | 517 | </figure> |
518 | <t> | 518 | <t> |
519 | R5N requires the following procedures for its routing table: | 519 | R5N requires the following procedures for its routing table: |
520 | </t> | 520 | </t> |
521 | <dl> | 521 | <dl> |
522 | <dt><tt>FindBucket(PeerID, Key) -> k-bucket</tt></dt> | 522 | <dt><tt>FindBucket(PeerID, Key) -> k-bucket as List</tt></dt> |
523 | <dd> | 523 | <dd> |
524 | The <tt>FindBucket</tt> procedure determines how many low | 524 | The <tt>FindBucket</tt> procedure determines how many low |
525 | order bits succesively match between a <tt>PeerID</tt> and a | 525 | order bits succesively match between a <tt>PeerID</tt> and a |
526 | <tt>Key</tt> starting from the first bit. The procedure returns | 526 | <tt>Key</tt> starting from the first bit. The procedure returns |
527 | the k-bucket for this index. It contains all connected nodes which | 527 | the k-bucket for this index. It contains all connected nodes which |
528 | share the same prefix length with <tt>PeerID</tt>. | 528 | share the same prefix length with <tt>PeerID</tt>. |
529 | </dd> | 529 | </dd> |
530 | <dt><tt>GetDistance(NodeKey_A, NodeKey_B)</tt></dt> | 530 | <dt><tt>GetDistance(NodeKey_A, NodeKey_B) -> Distance as Integer</tt></dt> |
531 | <dd> | 531 | <dd> |
532 | FIXME: We do NOT do XOR here. We do some kind of | 532 | FIXME: We do NOT do XOR here. We do some kind of |
533 | fancy calculation. See get_distance() | 533 | fancy calculation. See get_distance() |
534 | </dd> | 534 | </dd> |
535 | <dt><tt>AmClosestNode(NodeID, Key, Bloom) -> true | false</tt></dt> | 535 | <dt><tt>SelectClosestPeer(Key) -> NodeID</tt></dt> |
536 | <dd> | 536 | <dd> |
537 | This procedure first determines which k-bucket contains the | 537 | This procedure determines the closest node ID to <tt>Key</tt> |
538 | of all connected nodes using <tt>GetDistance</tt>. | ||
539 | FIXME: Also has a bloomfilter. Isn't AmClosestNode simply | ||
540 | !SelectClosestPeer == myID ? | ||
541 | </dd> | ||
542 | <dt><tt>AmClosestNode(NodeID, Key, Bloom) -> true | false</tt></dt> | ||
543 | <dd> | ||
544 | This procedure first determines which k-bucket contains the | ||
538 | closest node IDs to <tt>Key</tt>. | 545 | closest node IDs to <tt>Key</tt>. |
539 | Any node IDs which match the bloom filter are not considered. | 546 | Any node IDs which match the bloom filter are not considered. |
540 | If there is a node ID <tt>NodeID'</tt> in the k-bucket where | 547 | If there is a node ID <tt>NodeID'</tt> in the k-bucket where |
541 | <tt>GetDistance(NodeID, Key) > GetDistance(NodeID', Key)</tt>, | 548 | <tt>GetDistance(NodeID, Key) > GetDistance(NodeID', Key)</tt>, |
542 | then <tt>false</tt> is returned, otherwise <tt>true</tt>. | 549 | then <tt>false</tt> is returned, otherwise <tt>true</tt>. |
543 | FIXME: Currently, GDS_am_closest_peer checks for longer matching | 550 | FIXME: Currently, GDS_am_closest_peer checks for longer matching |
544 | bits. Not GetDistance. Why? | 551 | bits. Not GetDistance. Why? |
545 | </dd> | 552 | </dd> |
546 | </dl> | 553 | </dl> |
547 | </section> | 554 | </section> |
548 | </section> | 555 | </section> |
549 | <section anchor="p2p_messages" numbered="true" toc="default"> | 556 | <section anchor="p2p_messages" numbered="true" toc="default"> |