]> Cypherpunks.ru repositories - nncp.git/blob - doc/usecases/multicast.texi
Merge branch 'develop'
[nncp.git] / doc / usecases / multicast.texi
1 @node UsecaseMulticast
2 @section Multicast flooding transmission
3
4 Do you need to send single mail message or file to many recipients at
5 once? For example an update of some program, network participants list
6 or available files for freqing? But you are not connected directly to
7 each of them?
8
9 @verbatim
10    A-------->E---->F    A -> B C E
11   / \        |\    ^    C -> H J
12  /   \       |  \  |    E -> D F G
13 v     v      v    \v    D -> G
14 B     C      D---->G    J -> K
15      / \     ^    /     K -> D G
16     /   \    |   /
17    v     v   v  /
18    H     J<->K<-
19 @end verbatim
20
21 NNCP has @ref{Multicast, multicast} packets format, allowing you to
22 flood transmission of the single packet to multiple recipients.
23 @strong{A} sends packet to three destinations. @strong{C} sends it to
24 the two nodes next. @strong{E} sends it to three. Some participants may
25 receive multiple copies of the same packet, like @strong{D}, @strong{J},
26 @strong{G}, @strong{F}, but that copies will be just ignored. If
27 @strong{B} sends packet to single known to him @strong{A}, then that
28 packet will be distributed among all other multicast area subscribers.
29
30 Moreover those multicast packets are encrypted and require key knowledge
31 for reading. But that does not prevent their relaying! Also you are not
32 required to know sender's public keys. That way you can easily create
33 echo-conferences for files or commands (like mail message delivering)
34 transmission.
35
36 Let's create keys for the new multicast area:
37
38 @verbatim
39 $ nncp-cfgnew -area filelists -nocomments
40 areas: {
41   filelists: {
42     id: TOU5TKOW4JBIZJBX63D4776C72FMWDAUAUSZNJX4DFOITVYQ5ZQA
43     pub: DSHL5O6BK2R3QKJAIJ7BC4UIGE73EC2LJPOV3VTS44KYOTUQYZLA
44     prv: AYD5FAA4GDDSAD5N65NJLLFS6TG2NSPQ46KAQO5U722JLVG34SOQ
45   }
46 }
47 @end verbatim
48
49 and send that keypair everybody who wants to read that area.
50 For intermediaries willing to relay packets on, but that should not read
51 them, you just need to send area's identity. For example @strong{A} adds
52 to his configuration:
53
54 @verbatim
55 areas: {
56   filelists: {
57     id: TOU...
58     pub: DSH...
59     prv: AYD...
60     subs: ["B", "C", "E"]
61     incoming: /home/A/areas/filelists
62   }
63 @end verbatim
64
65 and @strong{E}, that will be relaying intermediary (as we decided):
66
67 @verbatim
68 areas: {
69   filelists: {
70     id: TOU...
71     subs: ["D", "F", "G"]
72   }
73 @end verbatim
74
75 After you distributed the knowledge about @code{nodelist} multicast
76 area, you can share @ref{FreqIndex, file lists}:
77
78 @example
79 $ nncp-file tree-of-A-20210715.txt.zst area:filelists:
80 $ nncp-toss -node self
81 @end example