public inbox for nncp-devel@lists.cypherpunks.ru
Atom feed
From: Sergey Matveev <stargrave@stargrave•org>
To: nncp-devel@lists.cypherpunks.ru
Subject: Re: Two Different Routes to the Same Node, One with Via
Date: Sun, 12 Dec 2021 20:33:43 +0300	[thread overview]
Message-ID: <YbYyg3wgAXWYagZo@stargrave.org> (raw)
In-Reply-To: <87czm5drmu.fsf@pop-os.localdomain>

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

Greetings!

*** Koushik Roy [2021-12-09 20:13]:
>Right now it doesn't seem possible to have two different paths when one
>includes a "via" block.

But it can be overriden per every nncp-* command invocation via "-via" option.

>Would it be possible to add support for
>distinguishing between a direct connection to a neighbor node and a
>relay connection to the node?

Problem here is that process of encryption packet creation is
independent and asynchronous to the process of transmitting those
packets. "Routing" information is applied before creating the
encrypted packet: so "via" works when nncp-file/exec/freq are called.
And they do not know anything about the transport will be used further.
So I honestly do not see how those "abstractions" (packet transfer and
packet creation) can be joined together.

Well, of course there can be some kind of hackish way to do that, for
example instead of invoking the "nncp-file ...", you call "nncp-file
-via `my-dynamic-routing.sh DST` ...", where "my-dynamic-routing.sh"
script will ping/curl/whatever the DST host to determine its
availability and return the route path. But... that DST can be
temporarily down. You can leave the LAN after 5 seconds after
my-dynamic-routing.sh was invoked. I think it won't be satisfactory.

Subject of dynamic routing was asked not the first time, but still I
just have not thought about it much, because even in your simple case (I
have exactly the same at home too and I just use "Baz" all the time) it
is not obvious to express what behaviour I want, because of that
asynchronous and independent nncp-* invocation and transport processes.

Currently I assume that multicast can be used in the case you described.
I did not check it and can not tell is it stupid idea, but I believe
that you can create multicast area and subscribe Foo, Bar, Baz on it.
Then you send file/exec/whatever to that area. When you are on LAN, then
both Bar and Baz receives it. After a while Bar will receive the same
multicasted packet from Baz, but will delete it, because it was already
seen after processing the packet got directly from Foo. When you are on
WAN, then packet to Bar is queued, but packet to Baz is sent (and Bar
receives it). When you are back at LAN, then you send previously queued
packet to Bar, that is deleted on it, because it was seen from the Baz.
Of course that doubles the real amount of traffic and disk consumption
on some nodes, so hardly it is helpful :-), but it can deliver packets
directly to Bar faster.

-- 
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 --]

  reply	other threads:[~2021-12-12 17:33 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-10  4:13 Two Different Routes to the Same Node, One with Via Koushik Roy
2021-12-12 17:33 ` Sergey Matveev [this message]
2021-12-12 20:52   ` John Goerzen
2021-12-13  6:58     ` Koushik Roy
2021-12-15  8:38       ` Sergey Matveev
2021-12-17  0:03         ` John Goerzen