doc/admin.texi | 8 ++++++-- doc/building.texi | 7 ++++++- doc/call.texi | 8 ++++---- doc/cfg/index.texi | 10 +++++----- doc/cfg/neigh.texi | 2 +- doc/cmd/nncp-toss.texi | 2 +- doc/download.texi | 4 ++++ doc/index.texi | 28 ++++++++++++++-------------- doc/install.texi | 16 ++++++++-------- doc/integration.texi | 12 ++++++------ doc/multicast.texi | 2 +- doc/news.ru.texi | 62 ++++++++--------------------------------------------- doc/news.texi | 61 +++++++---------------------------------------------- doc/nncp.html.do | 1 - doc/nncp.info.do | 12 +++++++++++- doc/pkt/index.texi | 6 +++--- doc/russian.texi | 6 +++--- doc/usecases.ru.texi | 118 ++++++++++++++++++++++++++++++++++++++++++++++------- doc/usecases.texi | 116 ++++++++++++++++++++++++++++++++++++++++++++++------- makedist.sh | 6 +++--- ports/nncp/Makefile | 2 +- src/cmd/nncp-cfgnew/main.go | 2 +- src/go.sum | 2 -- src/mcd.go | 16 ++++++++++------ src/nncp.go | 2 +- diff --git a/doc/admin.texi b/doc/admin.texi index 510f0ffc4e901d8365b714afaac2366aec2d039eb68ec86f7c75ef48d8f7c506..05856e383eccfb932b6570ef2352a875ea36307340e698ff98f6f269e9db390f 100644 --- a/doc/admin.texi +++ b/doc/admin.texi @@ -20,6 +20,10 @@ Partly transferred files are stored with @file{.part} suffix. And possibly they also require cleanup if they are completely lost. + It can contain @file{.nock} files: fully downloaded, but still not + checksummed. Can be checksummed (with @file{.nock} extension removing) + with @command{nncp-check -nock}. + Also it can contain @file{.seen} files, that should be cleaned too from time to time. @@ -60,8 +64,8 @@ @end example @item Possibly long running @ref{nncp-daemon}, @ref{nncp-caller}, - @ref{nncp-toss} daemons. As all software, they can fail and you - should place them under some supervisor control. + @ref{nncp-toss}, @ref{nncp-check} daemons. As all software, they can + fail and you should place them under some supervisor control. For example you can use @url{http://cr.yp.to/daemontools.html, daemontools} for that task to run them under probably existing diff --git a/doc/building.texi b/doc/building.texi index 83f0a52f97c27dea31f938f908e6476cef7524d4cf4ebffdb9fddee37ca182f3..dbb6fecf32f64a599f12339bbad27a24006b65c191cc07c2e3e868e80be24455 100644 --- a/doc/building.texi +++ b/doc/building.texi @@ -17,8 +17,13 @@ $ gpg --verify nncp-@value{VERSION}.tar.xz.sig nncp-@value{VERSION}.tar.xz $ xz --decompress --stdout nncp-@value{VERSION}.tar.xz | tar xf - $ cd nncp-@value{VERSION} $ redo all -# look for bin/nncp-* binaries (and possibly hjson-cli one) @end example + +After that you should get various @command{bin/nncp-*} binaries and +@command{bin/hjson-cli} command (only for your convenience, not +necessary installation). Documentation for example for +@command{nncp-bundle} command can be get with +@command{info doc/nncp.info -n nncp-bundle}. It uses @url{http://cr.yp.to/redo.html, redo} build system for that examples. You can use either dozen of various implementations, or at diff --git a/doc/call.texi b/doc/call.texi index 765ef7132ae43bea346cbbe04b2aabae1ddd303700ba2e70383805aff05b6984..b27c61422429bcdbc971a621c3c38d24d16204d8c56c16ef713c589efdd7d61d 100644 --- a/doc/call.texi +++ b/doc/call.texi @@ -14,7 +14,7 @@ nice: PRIORITY+10 autotoss: true autotoss-doseen: true - }, + } { cron: "30 * * * SAT,SUN" onlinedeadline: 1800 @@ -22,18 +22,18 @@ maxonlinetime: 1750 nice: NORMAL rxrate: 10 txrate: 20 - }, + } { cron: "0 * * * SAT,SUN" xx: rx addr: lan - }, + } { cron: "*/5 * * * * * *" when-tx-exists: true nock: true mcd-ignore: true - }, + } ] @end verbatim diff --git a/doc/cfg/index.texi b/doc/cfg/index.texi index 2eb251879b2dab81ca7c7ea3cf300e1d0c3f535ee6d5e7d914287cbf694c1b38..7fd71d72c999a99349fe968f909b4216411667b8e731c4b6268de1c6a320c868 100644 --- a/doc/cfg/index.texi +++ b/doc/cfg/index.texi @@ -44,11 +44,11 @@ Whole configuration file can be separated on five sections: @menu -* General options: CfgGeneral. -* Self-node keypairs: CfgSelf. -* Notifications: CfgNotify. -* Neighbours: CfgNeigh. -* Areas: CfgAreas. +* General options: CfgGeneral +* Self-node keypairs: CfgSelf +* Notifications: CfgNotify +* Neighbours: CfgNeigh +* Areas: CfgAreas You can optionally convert it to directory layout * Configuration directory:: diff --git a/doc/cfg/neigh.texi b/doc/cfg/neigh.texi index 2acbc46e2629292bcc4e46f318b932bf2cc45c2cb8fa5b3a6cfafae65fa8bf4b..171ceaee62a5f6abebaa8b841f7093078e99e62ad480b0bf645aaf3073e7daa1 100644 --- a/doc/cfg/neigh.texi +++ b/doc/cfg/neigh.texi @@ -32,7 +32,7 @@ } calls: [ { cron: "*/2 * * * *" - }, + } ] } bob: { diff --git a/doc/cmd/nncp-toss.texi b/doc/cmd/nncp-toss.texi index 62db52e63eb2d9af6ff5166c2bade2b01f580a4af7baf16e36bd95699796685b..2d359a4f88d33a26a111b45b9f9cf303a6fc04e7463e92078887dbc66179566a 100644 --- a/doc/cmd/nncp-toss.texi +++ b/doc/cmd/nncp-toss.texi @@ -29,4 +29,4 @@ inbound packets that has been already seen, processed and tossed. This is helpful to prevent duplicates. @option{-nofile}, @option{-nofreq}, @option{-noexec}, @option{-notrns}, -@option{-noarea} options allow to disable any kind of packet types processing. +@option{-noarea} options allow disabling any kind of packet types processing. diff --git a/doc/download.texi b/doc/download.texi index 7fe15f52af74ea39e1b37c0d5f7f16e44439ed62cc041cf9114679a05327f1ac..0dc6b66e61436eb813186ce0073183108499e2855e267deab728882f30509088 100644 --- a/doc/download.texi +++ b/doc/download.texi @@ -28,6 +28,10 @@ @multitable {XXXXX} {XXXX-XX-XX} {XXXX KiB} {link sign} {xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx} @headitem Version @tab Date @tab Size @tab Tarball @tab SHA256 checksum +@item @ref{Release 7_3_2, 7.3.2} @tab 2021-07-12 @tab 1141 KiB +@tab @url{download/nncp-7.3.2.tar.xz, link} @url{download/nncp-7.3.2.tar.xz.sig, sign} +@tab @code{65F6A230 04189D3F 307D160C AE97F99A 620DDA23 52821652 15DDC946 F6CC4B7F} + @item @ref{Release 7_3_1, 7.3.1} @tab 2021-07-11 @tab 1142 KiB @tab @url{download/nncp-7.3.1.tar.xz, link} @url{download/nncp-7.3.1.tar.xz.sig, sign} @tab @code{8611DC6A 3EAC7FFA A6A1C688 2073AB4D A4E93D36 C864F050 C5F880FE 10FCFC46} diff --git a/doc/index.texi b/doc/index.texi index dbb278842e04af91b3c7f3044c5e173fa24b1066e973f71c373823d40fe7bcc3..b3a751b41ca910a79fd106e2a7cf2e5b1108bb71b0000e122efdfa35817ce9b7 100644 --- a/doc/index.texi +++ b/doc/index.texi @@ -17,7 +17,7 @@ @end quotation @end copying @node Top -@top +@top NNCP @verbatiminclude pedro.txt @@ -39,27 +39,27 @@ * Comparison:: * Use cases:: * Workflow:: * News:: -* Информация на русском: Русский. +* Информация на русском: Русский * Installation:: * Configuration:: -* Call configuration: Call. -* Multicast areas: Multicast. +* Call configuration: Call +* Multicast areas: Multicast * Integration:: * Commands:: * Administration:: * Niceness:: -* Chunked files: Chunked. +* Chunked files: Chunked * Bundles:: -* Spool directory: Spool. -* Log format: Log. -* Packet format: Packet. -* Merkle Tree Hashing: MTH. -* Sync protocol: Sync. -* MultiCast Discovery: MCD. -* EBlob format: EBlob. +* Spool directory: Spool +* Log format: Log +* Packet format: Packet +* Merkle Tree Hashing: MTH +* Sync protocol: Sync +* MultiCast Discovery: MCD +* EBlob format: EBlob * Thanks:: -* Contacts and feedback: Contacts. -* Copying conditions: Copying. +* Contacts and feedback: Contacts +* Copying conditions: Copying @end menu @include comparison.texi diff --git a/doc/install.texi b/doc/install.texi index a81b143b3efc76a8b468ffd9358138cc3fe4151377274236fcb20320b149e84a..831fc8e1f2d972b00e143d45991d17c1e2ce405df4531c6f99e7d03cc6f951ba 100644 --- a/doc/install.texi +++ b/doc/install.texi @@ -14,10 +14,10 @@ NNCP should run on any POSIX-compatible operating system. NNCP is written on @url{https://golang.org/, Go} programming language -and you have to install Go compiler 1.13+ version. @command{Make} (BSD -and GNU versions are fine) is recommended for convenient building. -@url{https://www.gnu.org/software/texinfo/, Texinfo} is used for -building documentation (although tarballs already include it). +and you have to install Go compiler 1.13+ version. +@url{http://cr.yp.to/redo.html, redo} build system is recommended for +convenience. @url{https://www.gnu.org/software/texinfo/, Texinfo} is +used for building documentation (although tarballs already include it). In general you must get @ref{Tarballs, the tarball}, check its @ref{Integrity, integrity and authenticity} and run @command{make}. @@ -25,10 +25,10 @@ Look for general and platform-specific @ref{Build-instructions, build instructions}. @menu -* Prepared tarballs: Tarballs. -* Tarballs integrity check: Integrity. -* Build instructions: Build-instructions. -* Development source code: Sources. +* Prepared tarballs: Tarballs +* Tarballs integrity check: Integrity +* Build instructions: Build-instructions +* Development source code: Sources @end menu @include download.texi diff --git a/doc/integration.texi b/doc/integration.texi index 8772ca91622de806a2d42eb7899db0f63312d19f3276534bd1d3462a7a487317..6fb5fdc750883eaf130e39b325ea88a254b44598705d9e3bd06dd2ea9f124b7c 100644 --- a/doc/integration.texi +++ b/doc/integration.texi @@ -5,15 +5,15 @@ Here is some examples of how you can solve popular tasks with NNCP, making them store-and-forward friendly. @menu -* Index files for freqing: FreqIndex. +* Index files for freqing: FreqIndex * Postfix:: * Exim:: -* Web feeds: Feeds. -* Web pages: WARCs. -* BitTorrent and huge files: BitTorrent. -* Downloading service: DownloadService. +* Web feeds: Feeds +* Web pages: WARCs +* BitTorrent and huge files: BitTorrent +* Downloading service: DownloadService * Git:: -* Multimedia streaming: Multimedia. +* Multimedia streaming: Multimedia @end menu @node FreqIndex diff --git a/doc/multicast.texi b/doc/multicast.texi index 8b02ddc66b67e3c6fbf8f8ea30291d651771d654ee1b8994c061f93516b71100..e7e07e5b1189a5b5c5b3637d28d7e7812050b70624e2555fdec9b3dbdbbf2c29 100644 --- a/doc/multicast.texi +++ b/doc/multicast.texi @@ -10,7 +10,7 @@ @anchor{Area} Each multicast group is identified by so-called @strong{area}. Area consists of private/public Curve25519 keypairs for @ref{Encrypted area, packets encryption}, identity (BLAKE2b-256 hash of the public key) and -possible subscribers. +possible subscribers. Areas are created with @ref{nncp-cfgnew} command. You can make either file or exec transmissions to the areas. Those ordinary file/exec packets are double wrapped in: diff --git a/doc/news.ru.texi b/doc/news.ru.texi index 4ca22df2f0c2c7b4542e20e3c35aa33820bc6bdedd94279a638e5085394bcde1..c83257dd6094d1b60e39fb7fa2a601ccc62ea64cf88ded1be01e4b17982d0d77 100644 --- a/doc/news.ru.texi +++ b/doc/news.ru.texi @@ -1,59 +1,15 @@ @node Новости @section Новости -@menu -* Релиз 7.3.2:: -* Релиз 7.3.1:: -* Релиз 7.3.0:: -* Релиз 7.2.1:: -* Релиз 7.2.0:: -* Релиз 7.1.1:: -* Релиз 7.1.0:: -* Релиз 7.0.0:: -* Релиз 6.6.0:: -* Релиз 6.5.0:: -* Релиз 6.4.0:: -* Релиз 6.3.0:: -* Релиз 6.2.1:: -* Релиз 6.2.0:: -* Релиз 6.1.0:: -* Релиз 6.0.0:: -* Релиз 5.6.0:: -* Релиз 5.5.1:: -* Релиз 5.5.0:: -* Релиз 5.4.1:: -* Релиз 5.4.0:: -* Релиз 5.3.3:: -* Релиз 5.3.2:: -* Релиз 5.3.1:: -* Релиз 5.3.0:: -* Релиз 5.2.1:: -* Релиз 5.2.0:: -* Релиз 5.1.2:: -* Релиз 5.1.1:: -* Релиз 5.1.0:: -* Релиз 5.0.0:: -* Релиз 4.1:: -* Релиз 4.0:: -* Релиз 3.4:: -* Релиз 3.3:: -* Релиз 3.2:: -* Релиз 3.1:: -* Релиз 3.0:: -* Релиз 2.0:: -* Релиз 1.0:: -* Релиз 0.12:: -* Релиз 0.11:: -* Релиз 0.10:: -* Релиз 0.9:: -* Релиз 0.8:: -* Релиз 0.7:: -* Релиз 0.6:: -* Релиз 0.5:: -* Релиз 0.4:: -* Релиз 0.3:: -* Релиз 0.2:: -@end menu +@node Релиз 7.4.0 +@subsection Релиз 7.4.0 +@itemize + +@item +Исправлена работоспособность MCD при одновременном использовании +@command{nncp-daemon} и @command{nncp-caller}. + +@end itemize @node Релиз 7.3.2 @subsection Релиз 7.3.2 diff --git a/doc/news.texi b/doc/news.texi index 378b2054b49a29ded9f3d60ad62721bff2769e5fd052368a66d1e2ad93c26579..750383807c7249660bf1b2c43592f7fd7bd23e152ba782dfa5a8947c1bba8d85 100644 --- a/doc/news.texi +++ b/doc/news.texi @@ -3,59 +3,14 @@ @unnumbered News See also this page @ref{Новости, on russian}. -@menu -* Release 7.3.2: Release 7_3_2. -* Release 7.3.1: Release 7_3_1. -* Release 7.3.0: Release 7_3_0. -* Release 7.2.1: Release 7_2_1. -* Release 7.2.0: Release 7_2_0. -* Release 7.1.1: Release 7_1_1. -* Release 7.1.0: Release 7_1_0. -* Release 7.0.0: Release 7_0_0. -* Release 6.6.0: Release 6_6_0. -* Release 6.5.0: Release 6_5_0. -* Release 6.4.0: Release 6_4_0. -* Release 6.3.0: Release 6_3_0. -* Release 6.2.1: Release 6_2_1. -* Release 6.2.0: Release 6_2_0. -* Release 6.1.0: Release 6_1_0. -* Release 6.0.0: Release 6_0_0. -* Release 5.6.0: Release 5_6_0. -* Release 5.5.1: Release 5_5_1. -* Release 5.5.0: Release 5_5_0. -* Release 5.4.1: Release 5_4_1. -* Release 5.4.0: Release 5_4_0. -* Release 5.3.3: Release 5_3_3. -* Release 5.3.2: Release 5_3_2. -* Release 5.3.1: Release 5_3_1. -* Release 5.3.0: Release 5_3_0. -* Release 5.2.1: Release 5_2_1. -* Release 5.2.0: Release 5_2_0. -* Release 5.1.2: Release 5_1_2. -* Release 5.1.1: Release 5_1_1. -* Release 5.1.0: Release 5_1_0. -* Release 5.0.0: Release 5_0_0. -* Release 4.1: Release 4_1. -* Release 4.0: Release 4_0. -* Release 3.4: Release 3_4. -* Release 3.3: Release 3_3. -* Release 3.2: Release 3_2. -* Release 3.1: Release 3_1. -* Release 3.0: Release 3_0. -* Release 2.0: Release 2_0. -* Release 1.0: Release 1_0. -* Release 0.12: Release 0_12. -* Release 0.11: Release 0_11. -* Release 0.10: Release 0_10. -* Release 0.9: Release 0_9. -* Release 0.8: Release 0_8. -* Release 0.7: Release 0_7. -* Release 0.6: Release 0_6. -* Release 0.5: Release 0_5. -* Release 0.4: Release 0_4. -* Release 0.3: Release 0_3. -* Release 0.2: Release 0_2. -@end menu +@node Release 7_4_0 +@section Release 7.4.0 +@itemize + +@item +Fixed simultaneous @command{nncp-daemon} and @command{nncp-caller} MCD work. + +@end itemize @node Release 7_3_2 @section Release 7.3.2 diff --git a/doc/nncp.html.do b/doc/nncp.html.do index a246272b64115dbfbfbaa53270fee68a4923d0180f6be1fe3eb80401823bdcde..cc247f5881c5008cb58c356518813cea89f0f7aa6a8d39cc653ce4d2ac8b74f7 100644 --- a/doc/nncp.html.do +++ b/doc/nncp.html.do @@ -3,6 +3,5 @@ MAKEINFO_OPTS="$MAKEINFO_OPTS --html --css-include style.css" MAKEINFO_OPTS="$MAKEINFO_OPTS --set-customization-variable FORMAT_MENU=menu" MAKEINFO_OPTS="$MAKEINFO_OPTS --set-customization-variable SHOW_TITLE=0" MAKEINFO_OPTS="$MAKEINFO_OPTS --set-customization-variable DATE_IN_HEADER=1" -MAKEINFO_OPTS="$MAKEINFO_OPTS --set-customization-variable TOP_NODE_UP_URL=index.html" MAKEINFO_OPTS="$MAKEINFO_OPTS" . nncp.info.do cp -r .well-known $3 diff --git a/doc/nncp.info.do b/doc/nncp.info.do index bdffdd972d972af3c3614b28b4d58a3845434a1d8ff733d1107d6731200c494a..ffbb9bcaf49f9cee291b6939fec2f067bcb2903d592f6f1a1837ee1ca5bcfac1 100644 --- a/doc/nncp.info.do +++ b/doc/nncp.info.do @@ -1,8 +1,18 @@ -redo-ifchange ../config ../VERSION *.texi sp.plantuml.txt pedro.txt +redo-ifchange \ + ../config \ + ../VERSION \ + *.texi \ + cfg/*.texi \ + cmd/*.texi \ + pkt/*.texi \ + sp.plantuml.txt \ + pedro.txt . ../config ${MAKEINFO:-makeinfo} \ -D "VERSION `cat ../VERSION`" \ $MAKEINFO_OPTS \ + --set-customization-variable SECTION_NAME_IN_TITLE=1 \ + --set-customization-variable TREE_TRANSFORMATIONS=complete_tree_nodes_menus \ --set-customization-variable CLOSE_QUOTE_SYMBOL=\" \ --set-customization-variable OPEN_QUOTE_SYMBOL=\" \ --output $3 index.texi diff --git a/doc/pkt/index.texi b/doc/pkt/index.texi index 92760a309478b57e12c754a463cd866154a24402ac22a58e853eda38ec28621f..863e4c0a1d8012472be3fdd70a0a60a7cbfe319f22ee8cc6968aad78b8606078 100644 --- a/doc/pkt/index.texi +++ b/doc/pkt/index.texi @@ -5,9 +5,9 @@ All packets are @url{https://tools.ietf.org/html/rfc4506, XDR}-encoded structures. @menu -* Plain packet: Plain. -* Encrypted packet: Encrypted. -* Encrypted area packet: Encrypted area. +* Plain packet: Plain +* Encrypted packet: Encrypted +* Encrypted area packet: Encrypted area @end menu @include pkt/plain.texi diff --git a/doc/russian.texi b/doc/russian.texi index 2feeed7badffb1b52f00cb0b46b849862a76840816f54040a473ed88f6fcb1a9..af691b07093a6afd7ed07988ab30e8a3946d6d9c87ecead5416e9e7f323c7282 100644 --- a/doc/russian.texi +++ b/doc/russian.texi @@ -2,9 +2,9 @@ @node Русский @unnumbered Информация на русском @menu -* Подробнее об утилитах NNCP: Об утилитах. -* Сравнение с существующими решениями: Сравнение. -* Сценарии использования: Сценарии. +* Подробнее об утилитах NNCP: Об утилитах +* Сравнение с существующими решениями: Сравнение +* Сценарии использования: Сценарии * Новости:: @end menu diff --git a/doc/usecases.ru.texi b/doc/usecases.ru.texi index a3534f6cbda4d5d43696f74bdce089c24d927eb81e0e1a236e042731135303f9..2c614cb1b0a32c492541731ca4a0f4d5c3f07d3a20d175329109997b4457f57d 100644 --- a/doc/usecases.ru.texi +++ b/doc/usecases.ru.texi @@ -2,18 +2,19 @@ @node Сценарии @section Сценарии использования @menu -* Доступность почтового сервера время от времени: UsecaseMailRU. -* Легковесная и быстрая замена POP3/IMAP4: UsecasePOPRU. -* Ненадёжный/дорогой канал связи: UsecaseUnreliableRU. -* Медленная/дорогая связь для больших объёмов данных, плохой QoS: UsecaseQoSRU. -* Экстремальные наземные окружающие условия, нет связи: UsecaseNoLinkRU. -* Односторонняя широковещательная связь: UsecaseBroadcastRU. -* Спутниковые каналы связи: UsecaseSatelliteLinksRU. -* Частные, изолированные MitM/Sybil-устойчивые сети: UsecaseF2FRU. -* Высоко защищённые изолированные компьютеры с воздушным зазором: UsecaseAirgapRU. -* Обход сетевой цензуры, здоровье: UsecaseCensorRU. -* Разведка, шпионаж, тайная агентура: UsecaseSpyRU. -* Дешёвая ночная связь: UsecaseCallerRU. +* Доступность почтового сервера время от времени: UsecaseMailRU +* Легковесная и быстрая замена POP3/IMAP4: UsecasePOPRU +* Ненадёжный/дорогой канал связи: UsecaseUnreliableRU +* Медленная/дорогая связь для больших объёмов данных, плохой QoS: UsecaseQoSRU +* Экстремальные наземные окружающие условия, нет связи: UsecaseNoLinkRU +* Односторонняя широковещательная связь: UsecaseBroadcastRU +* Спутниковые каналы связи: UsecaseSatelliteLinksRU +* Частные, изолированные MitM/Sybil-устойчивые сети: UsecaseF2FRU +* Высоко защищённые изолированные компьютеры с воздушным зазором: UsecaseAirgapRU +* Обход сетевой цензуры, здоровье: UsecaseCensorRU +* Разведка, шпионаж, тайная агентура: UsecaseSpyRU +* Дешёвая ночная связь: UsecaseCallerRU +* Мультивещательная flooding рассылка: UsecaseMulticastRU @end menu @node UsecaseMailRU @@ -257,6 +258,9 @@ из конфигурационного файла), послать все связанные с ним исходящие пакеты и получить от него. Все прерванные передачи будут автоматически возобновлены. +А наличие возможности @ref{MCD, multicast обнаружения} участников сети в +IPv6 сетях позволяет вообще не возиться с заданием сетевых адресов. + @node UsecaseAirgapRU @subsection Высокозащищённые изолированные компьютеры с воздушным зазором @@ -393,21 +397,105 @@ cron: "*/1 * * * *" addr: lan nice: MAX onlinedeadline: 3600 - }, + } { cron: "*/10 * * * *" addr: wan nice: PRIORITY xx: rx - }, + } { cron: "*/1 0-7 * * *" addr: wan nice: BULK onlinedeadline: 3600 maxonlinetime: 3600 - }, + } ] } } @end verbatim + +@node UsecaseMulticastRU +@subsection Мультивещательная flooding рассылка + +Необходимо разослать одно и то же почтовое сообщение или файл многим +участникам? Например обновления какой либо программы, списка участников +сети или доступных файлов? Но при этом вы не соединены лично с каждым из +них: + +@verbatim + A-------->E---->F A <-> B C E + / \ |\ ^ C <-> H J + / \ | \ | E <-> D F G +v v v \v D <-> G +B C D---->G J <-> K + / \ ^ / K <-> D G + / \ | / + v v v / + H J<->K<- +@end verbatim + +В NNCP есть особые @ref{Multicast, мультивещательные} форматы пакетов +позволяющие организовывать эффективную передачу одно единственного +пакета сразу нескольким получателям (flooding алгоритм). @strong{A} +отправляет пакет трём получателям. @strong{C} в свою очередь отсылает +ещё двум, а @strong{E} трём. Некоторые участники сети получат несколько +копий одного и того же пакета, как например @strong{D}, @strong{J}, +@strong{G}, @strong{F}, но копии будут просто проигнорированы. Если +@strong{B} отошлёт пакет единственному ему известному @strong{A}, то +этот пакет распространится по всей сети подписантов широковещательной +зоны и дальше. + +Более того, мультивещательные пакеты зашифрованы и для прочтения требуют +знание ключей. Но это не мешает их обрабатывать для дальнейшей пересылки! +Кроме того, совершенно не обязательно знать ключи отправителя. Таким +образом можно создать эхоконференцию для передачи файлов или команд +(например доставки почтовых сообщений). + +Создаём ключи для мультивещательной зоны: + +@example +$ nncp-cfgnew -area filelists -nocomments +areas: @{ + filelists: @{ + id: TOU5TKOW4JBIZJBX63D4776C72FMWDAUAUSZNJX4DFOITVYQ5ZQA + pub: DSHL5O6BK2R3QKJAIJ7BC4UIGE73EC2LJPOV3VTS44KYOTUQYZLA + prv: AYD5FAA4GDDSAD5N65NJLLFS6TG2NSPQ46KAQO5U722JLVG34SOQ + @} +@} +@end example + +и отправляем ключевую пару всем кто может и хочет читать данную зону. +Посредникам, готовым участвовать в переотправке пакетов подписантам, но +которым не стоит "читать" пакеты, достаточно отправить только +идентификатор зоны. Например @strong{A} добавляет себе в конфигурацию: + +@example +areas: @{ + filelists: @{ + id: TOU... + pub: DSH... + prv: AYD... + subs: ["B", "C", "E"] + incoming: /home/A/areas/filelists + @} +@end example + +а @strong{E}, являющимся (как было решено) просто посредником: + +@example +areas: @{ + filelists: @{ + id: TOU... + subs: ["D", "F", "G"] + @} +@end example + +После распространения знания о @code{filelists} мультивещательной зоне +можно обмениваться @ref{FreqIndex, списками файлов}: + +@example +$ nncp-file tree-of-A-20210715.txt.zst area:filelists: +$ nncp-toss -node self +@end example diff --git a/doc/usecases.texi b/doc/usecases.texi index 4bd8f5c48a9ada63a6f5274b28e7c10a9bd36f5c61c63f99c2d5e470df244ef7..84a62a7a8c1679ec77a52251854909a7d375c17a0b565e9dc8c6c28176b35bcf 100644 --- a/doc/usecases.texi +++ b/doc/usecases.texi @@ -4,18 +4,19 @@ See also this page @ref{Сценарии, on russian}. @menu -* Occasional connection to mail server: UsecaseMail. -* Lightweight fast POP3/IMAP4 replacement: UsecasePOP. -* Unreliable/expensive communication link: UsecaseUnreliable. -* Slow/expensive link for high-volume data, bad QoS: UsecaseQoS. -* Extreme terrestrial environments, no link: UsecaseNoLink. -* One-way broadcasting communications: UsecaseBroadcast. -* Satellite links: UsecaseSatelliteLinks. -* Private, isolated MitM/Sybil-resistant networks: UsecaseF2F. -* Highly secure isolated air-gap computers: UsecaseAirgap. -* Network censorship bypassing, health: UsecaseCensor. -* Reconnaissance, spying, intelligence, covert agents: UsecaseSpy. -* Cheap night transfers: UsecaseCaller. +* Occasional connection to mail server: UsecaseMail +* Lightweight fast POP3/IMAP4 replacement: UsecasePOP +* Unreliable/expensive communication link: UsecaseUnreliable +* Slow/expensive link for high-volume data, bad QoS: UsecaseQoS +* Extreme terrestrial environments, no link: UsecaseNoLink +* One-way broadcasting communications: UsecaseBroadcast +* Satellite links: UsecaseSatelliteLinks +* Private, isolated MitM/Sybil-resistant networks: UsecaseF2F +* Highly secure isolated air-gap computers: UsecaseAirgap +* Network censorship bypassing, health: UsecaseCensor +* Reconnaissance, spying, intelligence, covert agents: UsecaseSpy +* Cheap night transfers: UsecaseCaller +* Multicast flooding transmission: UsecaseMulticast @end menu @node UsecaseMail @@ -244,6 +245,9 @@ configuration file) and send all related outbound packets and retrieve those the Bob has. All interrupted transfers will be automatically resumed. +Ability to do @ref{MCD, multicast nodes discovery} of participant in +IPv6 networks allows complete ignorance of network addresses specifying. + @node UsecaseAirgap @section Highly secure isolated air-gap computers @@ -371,21 +375,103 @@ cron: "*/1 * * * *" addr: lan nice: MAX onlinedeadline: 3600 - }, + } { cron: "*/10 * * * *" addr: wan nice: PRIORITY xx: rx - }, + } { cron: "*/1 0-7 * * *" addr: wan nice: BULK onlinedeadline: 3600 maxonlinetime: 3600 - }, + } ] } } @end verbatim + +@node UsecaseMulticast +@section Multicast flooding transmission + +Do you need to send single mail message or file to many recipients at +once? For example an update of some program, network participants list +or available files for freqing? But you are not connected directly to +each of them? + +@verbatim + A-------->E---->F A -> B C E + / \ |\ ^ C -> H J + / \ | \ | E -> D F G +v v v \v D -> G +B C D---->G J -> K + / \ ^ / K -> D G + / \ | / + v v v / + H J<->K<- +@end verbatim + +NNCP has @ref{Multicast, multicast} packets format, allowing you to +flood transmission of the single packet to multiple recipients. +@strong{A} sends packet to three destinations. @strong{C} sends it to +the two nodes next. @strong{E} sends it to three. Some participants may +receive multiple copies of the same packet, like @strong{D}, @strong{J}, +@strong{G}, @strong{F}, but that copies will be just ignored. If +@strong{B} sends packet to single known to him @strong{A}, then that +packet will be distributed among all other multicast area subscribers. + +Moreover those multicast packets are encrypted and require key knowledge +for reading. But that does not prevent their relaying! Also you are not +required to know sender's public keys. That way you can easily create +echo-conferences for files or commands (like mail message delivering) +transmission. + +Let's create keys for the new multicast area: + +@example +$ nncp-cfgnew -area filelists -nocomments +areas: @{ + filelists: @{ + id: TOU5TKOW4JBIZJBX63D4776C72FMWDAUAUSZNJX4DFOITVYQ5ZQA + pub: DSHL5O6BK2R3QKJAIJ7BC4UIGE73EC2LJPOV3VTS44KYOTUQYZLA + prv: AYD5FAA4GDDSAD5N65NJLLFS6TG2NSPQ46KAQO5U722JLVG34SOQ + @} +@} +@end example + +and send that keypair everybody who wants to read that area. +For intermediaries willing to relay packets on, but that should not read +them, you just need to send area's identity. For example @strong{A} adds +to his configuration: + +@example +areas: @{ + filelists: @{ + id: TOU... + pub: DSH... + prv: AYD... + subs: ["B", "C", "E"] + incoming: /home/A/areas/filelists + @} +@end example + +and @strong{E}, that will be relaying intermediary (as we decided): + +@example +areas: @{ + filelists: @{ + id: TOU... + subs: ["D", "F", "G"] + @} +@end example + +After you distributed the knowledge about @code{nodelist} multicast +area, you can share @ref{FreqIndex, file lists}: + +@example +$ nncp-file tree-of-A-20210715.txt.zst area:filelists: +$ nncp-toss -node self +@end example diff --git a/makedist.sh b/makedist.sh index 2c63251b857a80a5ecb88d83ed8a03175e27745eef404e12b960560d7ad16a72..a1b99f758918937b308762291dd08cbc8f96170deaf070c74765b2cd22441f65 100755 --- a/makedist.sh +++ b/makedist.sh @@ -104,9 +104,9 @@ perl -i -npe "s/GO test/GO test -mod=vendor/" test.do rm makedist.sh VERSION.do rm -r .git redo-cleanup full -find . -type d -exec chmod 755 {} \; -find . -type f -exec chmod 644 {} \; -find . -type f -name "*.sh" -exec chmod +x {} \; +find . -type d -exec chmod 755 {} + +find . -type f -exec chmod 644 {} + +find . -type f -name "*.sh" -exec chmod +x {} + chmod +x contrib/do cd .. diff --git a/ports/nncp/Makefile b/ports/nncp/Makefile index 9f9492ba6df4bfbe36f9fb22a4945760843d7c3baa21ebf418678d63b01fe1e9..13f72b837d22a5c14d4f740ff6d04ec6c781eb80ff4312868d4260c12990d119 100644 --- a/ports/nncp/Makefile +++ b/ports/nncp/Makefile @@ -1,5 +1,5 @@ PORTNAME= nncp -DISTVERSION= 7.3.0 +DISTVERSION= 7.4.0 CATEGORIES= net MASTER_SITES= http://www.nncpgo.org/download/ diff --git a/src/cmd/nncp-cfgnew/main.go b/src/cmd/nncp-cfgnew/main.go index bd6ecc0bc92ea2178a1322f7809b50665403e213ea86a5bc12cb461f8f2be673..212a4d6529a74ea44d4dc6813684bbe9c0e9812fd65673ef93524eb86a7210b9 100644 --- a/src/cmd/nncp-cfgnew/main.go +++ b/src/cmd/nncp-cfgnew/main.go @@ -303,7 +303,7 @@ # # autotoss-nofile: true # # autotoss-nofreq: true # # autotoss-noexec: true # # autotoss-notrns: true - # # }, + # # } # # ] # } } diff --git a/src/go.sum b/src/go.sum index cf4b02d1f5f3422de3ade3878374f7c0940defb7be01cd5b1444e83fa1c87a54..38a2264da15ee651d60195cca17bfb138e60ed3e19c146c4ca82f6bb084b743e 100644 --- a/src/go.sum +++ b/src/go.sum @@ -31,11 +31,9 @@ golang.org/x/net v0.0.0-20210614182718-04defd469f4e h1:XpT3nA5TvE525Ne3hInMh6+GETgn27Zfm9dxsThnX2Q= golang.org/x/net v0.0.0-20210614182718-04defd469f4e/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1 h1:SrN+KX8Art/Sf4HNj6Zcz06G7VEz+7w9tdXTPOZ7+l4= golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210616094352-59db8d763f22 h1:RqytpXGR1iVNX7psjB3ff8y7sNFinVFvkx1c8SjBkio= golang.org/x/sys v0.0.0-20210616094352-59db8d763f22/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1 h1:v+OssWQX+hTHEmOBgwxdZxK4zHq3yOs8F9J7mk0PY8E= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210615171337-6886f2dfbf5b h1:9zKuko04nR4gjZ4+DNjHqRlAJqbJETHwiNKDqTfOjfE= golang.org/x/term v0.0.0-20210615171337-6886f2dfbf5b/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= diff --git a/src/mcd.go b/src/mcd.go index be5a0a2648f9c849de51ef10335076aa4f00b2f2a07858f31867acbdd1883244..5b64a476eb8ac30f57006858ba8d6f8d214ca0d79d4e1eaa6857807b707810d3 100644 --- a/src/mcd.go +++ b/src/mcd.go @@ -176,20 +176,24 @@ return nil } func (ctx *Ctx) MCDTx(ifiName string, port int, interval time.Duration) error { - conn, err := net.DialUDP("udp", - &net.UDPAddr{Port: port, Zone: ifiName}, - &net.UDPAddr{IP: mcdIP, Port: MCDPort, Zone: ifiName}, - ) + ifi, err := net.InterfaceByName(ifiName) if err != nil { return err } + addr := &net.UDPAddr{IP: mcdIP, Port: port, Zone: ifiName} + conn, err := net.ListenMulticastUDP("udp", ifi, addr) + if err != nil { + return err + } + + dst := &net.UDPAddr{IP: mcdIP, Port: MCDPort, Zone: ifiName} var buf bytes.Buffer mcd := MCD{Magic: MagicNNCPDv1.B, Sender: ctx.Self.Id} if _, err := xdr.Marshal(&buf, mcd); err != nil { panic(err) } if interval == 0 { - _, err = conn.Write(buf.Bytes()) + _, err = conn.WriteTo(buf.Bytes(), dst) return err } go func() { @@ -201,7 +205,7 @@ "MCD Tx %s/%d/%d", ifiName, MCDPort, port, ) }) - _, err = conn.Write(buf.Bytes()) + _, err = conn.WriteTo(buf.Bytes(), dst) if err != nil { ctx.LogE("mcd", les, err, func(les LEs) string { return fmt.Sprintf("MCD on %s/%d/%d", ifiName, MCDPort, port) diff --git a/src/nncp.go b/src/nncp.go index e3cd31cec071c2921f035c50d652a9464133d60b8f554115027ade6d81a661e7..b0fef01cdd6dcca8df164662c0a3190d643a4cdc898814b91094ffeecb93d286 100644 --- a/src/nncp.go +++ b/src/nncp.go @@ -40,7 +40,7 @@ const Base32Encoded32Len = 52 var ( - Version string = "7.3.1" + Version string = "7.4.0" Base32Codec *base32.Encoding = base32.StdEncoding.WithPadding(base32.NoPadding) )