public inbox for nncp-devel@lists.cypherpunks.ru
Atom feed
* Receiving non-local packets from bundle
@ 2022-02-23 16:26 John Goerzen
  2022-02-24 11:35 ` Sergey Matveev
  0 siblings, 1 reply; 2+ messages in thread
From: John Goerzen @ 2022-02-23 16:26 UTC (permalink / raw)
  To: nncp-devel

Hi Sergey,

I have a question about nncp-bundle.

The documentation says:

"You can specify multiple NODE arguments, telling for what nodes you
want to create the stream, or take it from. If no nodes are specified
for -rx mode, then all packets aimed at us will be processed."

My question is: what happens when nodes other than the local node are
given as part of that list?  Presumably in that case, NNCP is unable to
decrypt the packets.  Does it just copy what it received from the bundle
into the tx directory for that node?  Does it apply via routing logic if
such is given in nncp.hjson for that node (like redir, wrapping the
packet in a transitional one)?

I note that nncp-xfer doesn't have that kind of option, though it could
certainly have the same sort of scenario.  Is there a particular reason
for that?

Thanks,

John

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Receiving non-local packets from bundle
  2022-02-23 16:26 Receiving non-local packets from bundle John Goerzen
@ 2022-02-24 11:35 ` Sergey Matveev
  0 siblings, 0 replies; 2+ messages in thread
From: Sergey Matveev @ 2022-02-24 11:35 UTC (permalink / raw)
  To: nncp-devel

[-- Attachment #1: Type: text/plain, Size: 2524 bytes --]

Greetings!

*** John Goerzen [2022-02-23 10:26]:
>My question is: what happens when nodes other than the local node are
>given as part of that list?

When you specify NODEs with -tx argument, then obviously that will
generate a stream of packets like that:
    self -> NODE1
    self -> NODE2
    [...]

When you specify NODEs with -rx argument, then only that kind of packets
will be processed if -delete is specified:
    self -> NODE1
    self -> NODE2
    [...]

If -delete is not specified, then:
    NODE1 -> self
    NODE2 -> self
    [...]

-rx -delete is used to optionally verify correctness of written packets.
You do -tx, and then -rx -delete to check if everything is written
correctly and delete that written packets.

-rx receives everything targeted at us (self). And NODEs just limit
senders we want to process. Probably we know that NODE2 has much more
important and priority packets and there could be no free space for
large transfers from NODE1, so we use -rx NODE2 and nncp-bundle will
skip everything not from NODE2->self.

>Presumably in that case, NNCP is unable to decrypt the packets.

Like nncp-xfer, nncp-daemon/call*, -bundle just copies encrypted
packets, optionally checksumming them on the fly. Private keys are used
only during tossing operation.

>Does it just copy what it received from the bundle
>into the tx directory for that node?

Yes.

>Does it apply via routing logic

No :-). Bundle only receives (copies) packets with destination of our
self node, with no processing except for optional integrity checksumming.

>I note that nncp-xfer doesn't have that kind of option, though it could
>certainly have the same sort of scenario.  Is there a particular reason
>for that?

nncp-xfer has "-tx -node NODE" and "-rx -node NODE", but there is no
ability to specify multiple NODEs indeed. It is not hard to add, but
running "for node (NODE1 NODE2 ...) nncp-xfer -rx -node $node ..." and
running "nncp-xfer -rx -node NODE1,NODE2,... ..." does not have any
noticeable difference in terms of efficiency. But it is crucial to
nncp-bundle to being able to process the data at single pass, because it
is stream of data that can not be seeked (unlike full-featured file
system nncp-xfer is intended to work with). Reading LTO4 tape takes
several hours: each "for" cycle will add additional hours to the whole
process.

-- 
Sergey Matveev (http://www.stargrave.org/)
OpenPGP: CF60 E89A 5923 1E76 E263  6422 AE1A 8109 E498 57EF

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-02-24 11:35 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-02-23 16:26 Receiving non-local packets from bundle John Goerzen
2022-02-24 11:35 ` Sergey Matveev