• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..03-May-2022-

HACKING.mdH A D18-Nov-202120.5 KiB523386

README.mdH A D18-Nov-20218.1 KiB218164

a12_helper.hH A D18-Nov-20212.5 KiB7823

a12_helper_cl.cH A D18-Nov-202113.6 KiB482325

a12_helper_srv.cH A D18-Nov-202123.6 KiB759505

net.cH A D18-Nov-202126.2 KiB1,020782

README.md

1# arcan-net
2
3This tool provides network translation for clients and services built using the
4arcan-shmif IPC client library. The code is still in an immature state, tunnel
5over VPN/SSH if you worry about the confidentiality, privacy and integrity of
6your traffic.
7
8# Basic Use
9
10It can serve and access arcan-shmif clients over the a12 protocol in both a
11'pull' fashion where you make an outbound connection to an a12 server that
12serves you an application, and a 'push' one where you listen for inbound
13connections and applications connect to you.
14
15## Pull
16The 'pull' model then is when you connect to an application 'server'.
17
18The 'pull' mode is the simpler default setup, and arcan-net knows to use it due
19to the absence of the '-s' argument or the ARCAN_CONNPATH=a12.. environment.
20
21The server end is setup as follows:
22
23    arcan-net -l 6680 -exec /some/arcan/executable arg1 arg2 .. argn
24
25Whenever a client connects and authenticates, the executable will be fired up
26and presented to the client.
27
28The client end then simply specifies:
29
30    arcan-net remote.ip 6680
31
32## Push
33
34The 'push' model has traditionally been used with X11 implementations by
35setting the DISPLAY environment variable or through some SSH tricks.
36
37The corresponding version here is through ARCAN_CONNPATH:
38
39    ARCAN_CONNPATH=a12://host:port some_arcan_client
40
41You can also use a keyfile (see keystore further below)
42
43    ARCAN_CONNPATH=a12://mytag@ some_arcan_client
44
45There is also a 'service mode' that is easier for testing/debugging/development:
46
47    arcan-net -s myname host:port
48		ARCAN_CONNPATH=myname some_arcan_client
49		ARCAN_CONNPATH=myname another_arcan_client
50
51This is also suitable when using 'migration' where you explicitly redirect
52a client to another 'connection point' (myname in the example above). How
53this is activated depends on your window manager. For instance, in durden
54it can be done through the /target/share/migrate=myname path.
55
56There also needs to be something listening on the other end (of course)
57that can bridge to the right arcan instance.
58
59    arcan-net -l 6680
60		ARCAN_CONNPATH=durden arcan-net -l 6680
61
62# Keystore
63
64arcan-net does not mandate a specific public key infrastructure or necessarily
65a 'trust on first use' kind of scheme, though there is some support for
66enabling the later. The way cryptographic keys and identities are used are as
67follows:
68
69The argument '-b' is used to set a basedir. This directory is used for things
70such as keystore as well as for caching for faster transfers and compression
71(if the 'cache' subdirectory is present).
72
73    arcan-net -b $HOME/.config/a12 -s test mymachine@
74
75This would setup the 'push' mode to authenticate remotely using the host and
76cryptographic keys specified in the keyfile for 'mymachine' within the keystore
77in the basedir.
78
79    $HOME/.config/a12/keys/mymachine
80
81Where the keyfile name is restricted to visible [a-Z0-9] part of the ASCII set
82of characters. The key is, per x25519, 32-bytes crypotgraphically secure
83randomness. There can be multiple hosts per keyfile and the first whitespace on
84each line separates key from b64 encoded private key.
85
86    myhost1:port b64encoded-privk
87		10.0.1.20:port b64encoded-privk
88
89This means that you can simply reference:
90
91    ARCAN_CONNPATH=a12://keyname@ some_software
92
93And it will try the list in sequential priority until one connects, or migrate
94should the server- end of the connection fail hard.
95
96For verifying the identity of the other end, a different folder is used:
97
98    basedir/allowed_keys/*
99
100Each file in that format will be treated as a raw binary x25519 public key.
101Anyone with a matching private key in there will be allowed to connect.
102
103These can be populated by allowing a one-time auth session:
104
105    cat 'my_preshared_password_file' | arcan-net -a 2 -l 6666
106
107Which would accept the next (n=2 here) public keys that authenticate with what
108was in the preshared password file and write into the keystore.
109
110This is strictly for bootstrapping a system where it is inconvenient to add the
111public key using some other media. If no number argument is provided to the
112authentication secret, public keys will not be store in the set of allowed_keys
113for later. This reduces the system to simply using the secret as a 'password'.
114
115# Compilation
116
117For proper video encoding, the ffmpeg libraries (libavcodec, libswscale, ...)
118are required and must have h264 support. Due to patent or licensing issues that
119may or may not apply, check you distribution and build.
120
121If ffmpeg reports errors, is missing or is missing h264 support entirely the
122system will fallback to raw- or only lightly- compressed buffers.
123
124# Todo
125
126The following are basic expected TODO points and an estimate as to where
127on the timeline the respective features will be developed/available. The
128parts marked with (a) refer to arcan-net tool, (p) the protocol, and (x)
129for extended/engine/aux parts.
130
131Milestone 1 - basic features (0.5.x)
132
133- [x] Basic API (p)
134- [x] Control (p)
135- [x] net (TCP) (a)
136- [x] Uncompressed Video / Video delta (p)
137- [x] Uncompressed Audio / Audio delta (p)
138- [x] Compressed Video (p)
139	-  [x] x264 (p)
140	-  [x] D-PNG (d- frames is Zlib(X ^ Y) (p)
141- [x] Raw binary descriptor transfers (p)
142- [x] Subsegments (p)
143- [x] Basic authentication / DH / Cipher (blake2+chacha8+x25519) (ap)
144- [x] One-time password for key-auth (p)
145- [x] TUI- text channel (p)
146- [ ] Cache process / directory for file operations (a)
147- [x] ARCAN\_CONNPATH=a12:// handover support (ax)
148- [x] Add to encode, remoting (x)
149- [x] Complete naive-local key-store management (a)
150
151Milestone 2 - closer to useful (0.6.x)
152
153- [ ] Interactive compression controls (a)
154- [ ] Block push-segment types (DEBUG) (a)
155- [ ] Event key-code translation (evdev, sdl, ... to native) (a)
156- [ ] Basic privsep/sandboxing (a)
157- [ ] External key-provider / negotiation (a)
158  -  [ ] FIDO2 (through libfido2) (a)
159- [x] Preferred-hosts list migration / handover (a)
160  - [ ] Config for retry limits, sleep delays and backoff (a)
161- [ ] Output segments (p)
162- [ ] Compression Heuristics for binary transfers (entropy estimation)(p)
163- [ ] Quad-tree for DPNG (p)
164  - [ ] Tile-map and caching (p)
165	- [x] Remove DEFLATE and mote to ZSTD
166	- [ ] varDCT
167	- [ ] XYB colorspace
168- [x] Frame Cancellation / dynamic framerate on window drift (p)
169- [ ] vframe-caching on certain types (first-frame on new, ...) (p)
170- [ ] vframe-runahead / forward latency estimation (a)
171- [ ] (Scheduling), better A / V / E interleaving (a)
172- [ ] Passthrough of compressed video sources (a)
173- [ ] Traffic monitoring tools (re-use proxy code + inherit mode) (x)
174- [ ] Splicing / Local mirroring (a)
175- [ ] Rekeying / Key Deletion (Forward Secrecy) (p)
176- [ ] Add TUI- mode for -net with statistics / controls (a)
177  - [ ] Show unauthenticated public keys as QR code in window (a)
178- [ ] Fexec(self) handover on completed negotiation (p)(a)
179- [ ] Compression tunable .configuration file
180- [ ] Shadow channel (as a pseudo progressive option)
181
182Milestone 3 - big stretch (0.6.x)
183
184- [ ] Embed binary transfer progress into parent window (p)
185- [ ] Dynamic audio resampling (p)
186- [ ] Media- segment buffering window, controls and progress (p)
187- [ ] UDP based carrier (UDT) (a)
188- [ ] 'ALT' arcan-lwa interfacing (px)
189- [ ] 'AGP' level- packing (px)
190- [ ] Ramp-up transfer based on timestamp to reduce cache loss (b)
191- [ ] Optimized version of ChaCha / BLAKE (avx, neon, ...) (p)
192  - [ ] Evaluate in-place merged encrypt+mac instead of enc then mac
193- [ ] Subprotocols (p)
194  - [ ] VR
195	- [ ] HDR
196	- [ ] 3DOBJ
197	- [ ] Open3DGC
198- [ ] Defered input oscillator safety buffer (a)
199- [ ] Per stream-type key (p)
200- [ ] Externalize A/V decoding (p)
201- [ ] Dynamic encoding parameters (p)
202- [ ] Side-channel Resistance (ax)
203- [ ] Directory/Rendezvous Server (axp)
204- [ ] Add to afsrv\_net (x)
205- [ ] Fast-forward known partial binary transfer (resume)
206- [ ] Resume- session from different IP (ap)
207- [ ] N-Key connection-unlock and monitors (a)
208- [ ] Clean-up, RFC level documentation (p)
209
210# Licenses
211
212arcan-net is (c) Bjorn Stahl 2017-2020 and licensed under the 3-clause BSD
213license. It is dependent on BLAKE3- (CC or Apache-2.0, see COPYING.BLAKE3)
214, on ChaCha8, x25519 (Public Domain) and Miniz (MIT-like, see miniz/LICENSE).
215
216optional dependencies include ffmpeg- suite of video codecs, GPLv2 with
217possible patent implications.
218