diff options
Diffstat (limited to 'doc/chapters/user.texi')
-rw-r--r-- | doc/chapters/user.texi | 1788 |
1 files changed, 1788 insertions, 0 deletions
diff --git a/doc/chapters/user.texi b/doc/chapters/user.texi new file mode 100644 index 000000000..f9d0f8a66 --- /dev/null +++ b/doc/chapters/user.texi | |||
@@ -0,0 +1,1788 @@ | |||
1 | @node Using GNUnet | ||
2 | @chapter Using GNUnet | ||
3 | @c %**end of header | ||
4 | |||
5 | This tutorial is supposed to give a first introduction for end-users trying to | ||
6 | do something "real" with GNUnet. Installation and configuration are specifically | ||
7 | outside of the scope of this tutorial. Instead, we start by briefly checking | ||
8 | that the installation works, and then dive into simple, concrete practical | ||
9 | things that can be done with the network. | ||
10 | |||
11 | This chapter documents how to use the various Peer-to-Peer applications of the | ||
12 | GNUnet system. As GNUnet evolves, we will add new chapters for the various | ||
13 | applications that are being created. Comments and extensions are always welcome. | ||
14 | |||
15 | |||
16 | @menu | ||
17 | * Checking the Installation:: | ||
18 | * First steps: File-sharing:: | ||
19 | * First steps: Using the GNU Name System:: | ||
20 | * First steps: Using GNUnet Conversation:: | ||
21 | * First steps: Using the GNUnet VPN:: | ||
22 | * File-sharing:: | ||
23 | * The GNU Name System:: | ||
24 | * Using the Virtual Public Network:: | ||
25 | @end menu | ||
26 | |||
27 | @node Checking the Installation | ||
28 | @section Checking the Installation | ||
29 | @c %**end of header | ||
30 | |||
31 | This chapter describes a quick casual way to check if your GNUnet installation | ||
32 | works. However, if it does not, we do not cover steps for recovery --- for this, | ||
33 | please study the installation and configuration handbooks. | ||
34 | |||
35 | |||
36 | @menu | ||
37 | * gnunet-gtk:: | ||
38 | * Statistics:: | ||
39 | * Peer Information:: | ||
40 | @end menu | ||
41 | |||
42 | @node gnunet-gtk | ||
43 | @subsection gnunet-gtk | ||
44 | @c %**end of header | ||
45 | |||
46 | First, you should launch @code{gnunet-gtk}, the graphical user interface for | ||
47 | GNUnet which will be used for most of the tutorial. You can do this from the | ||
48 | command-line by typing@ | ||
49 | @code{@ $ gnunet-gtk}@ | ||
50 | (note that @code{$} represents the prompt of the shell for a normal user). | ||
51 | Depending on your distribution, you may also find @code{gnunet-gtk} in your | ||
52 | menus. After starting @code{gnunet-gtk}, you should see the following window: | ||
53 | |||
54 | @image{images/gnunet-gtk-0-10,5in,, picture of gnunet-gtk application} | ||
55 | |||
56 | The five images on top represent the five different graphical applications that | ||
57 | you can use within @code{gnunet-gtk}. They are (from left to right): | ||
58 | @itemize @bullet | ||
59 | @item Statistics | ||
60 | @item Peer Information | ||
61 | @item GNU Name System | ||
62 | @item File Sharing | ||
63 | @item Identity Management | ||
64 | @end itemize | ||
65 | |||
66 | @node Statistics | ||
67 | @subsection Statistics | ||
68 | @c %**end of header | ||
69 | |||
70 | When @code{gnunet-gtk} is started, the statistics area should be selected at | ||
71 | first. If your peer is running correctly, you should see a bunch of lines, all | ||
72 | of which should be "significantly" above zero (at least if your peer has been | ||
73 | running for a few seconds). The lines indicate how many other peers your peer is | ||
74 | connected to (via different mechanisms) and how large the overall overlay | ||
75 | network is currently estimated to be. The x-axis represents time (in seconds | ||
76 | since the start of @code{gnunet-gtk}). | ||
77 | |||
78 | You can click on "Traffic" to see information about the amount of bandwidth your | ||
79 | peer has consumed, and on "Storage" to check the amount of storage available and | ||
80 | used by your peer. Note that "Traffic" is plotted cummulatively, so you should | ||
81 | see a strict upwards trend in the traffic. | ||
82 | |||
83 | @node Peer Information | ||
84 | @subsection Peer Information | ||
85 | @c %**end of header | ||
86 | |||
87 | You should now click on the Australian Aboriginal Flag. Once you have done this, | ||
88 | you will see a list of known peers (by the first four characters of their public | ||
89 | key), their friend status (all should be marked as not-friends initially), their | ||
90 | connectivity (green is connected, red is disconnected), assigned bandwidth, | ||
91 | country of origin (if determined) and address information. If hardly any peers | ||
92 | are listed and/or if there are very few peers with a green light for | ||
93 | connectivity, there is likely a problem with your network configuration. | ||
94 | |||
95 | @node First steps: File-sharing | ||
96 | @section First steps: File-sharing | ||
97 | @c %**end of header | ||
98 | |||
99 | This chapter describes first steps for file-sharing with GNUnet. To start, you | ||
100 | should launch @code{gnunet-gtk} and select the file-sharing tab (the one with | ||
101 | the arrows between the three circles). | ||
102 | |||
103 | As we want to be sure that the network contains the data that we are looking for | ||
104 | for testing, we need to begin by publishing a file. | ||
105 | |||
106 | |||
107 | @menu | ||
108 | * Publishing:: | ||
109 | * Searching:: | ||
110 | * Downloading:: | ||
111 | @end menu | ||
112 | |||
113 | @node Publishing | ||
114 | @subsection Publishing | ||
115 | @c %**end of header | ||
116 | |||
117 | To publish a file, select "File Sharing" in the menu bar just below the | ||
118 | "Statistics" icon, and then select "Publish" from the menu. | ||
119 | |||
120 | Afterwards, the following publishing dialog will appear: | ||
121 | |||
122 | In this dialog, select the "Add File" button. This will open a file selection | ||
123 | dialog: | ||
124 | |||
125 | Now, you should select a file from your computer to be published on GNUnet. To | ||
126 | see more of GNUnet's features later, you should pick a PNG or JPEG file this | ||
127 | time. You can leave all of the other options in the dialog unchanged. Confirm | ||
128 | your selection by pressing the "OK" button in the bottom right corner. Now, you | ||
129 | will briefly see a "Messages..." dialog pop up, but most likely it will be too | ||
130 | short for you to really read anything. That dialog is showing you progress | ||
131 | information as GNUnet takes a first look at the selected file(s). For a normal | ||
132 | image, this is virtually instant, but if you later import a larger directory you | ||
133 | might be interested in the progress dialog and potential errors that might be | ||
134 | encountered during processing. After the progress dialog automatically | ||
135 | disappears, your file should now appear in the publishing dialog: | ||
136 | |||
137 | Now, select the file (by clicking on the file name) and then click the "Edit" | ||
138 | button. This will open the editing dialog: | ||
139 | |||
140 | In this dialog, you can see many details about your file. In the top left area, | ||
141 | you can see meta data extracted about the file, such as the original filename, | ||
142 | the mimetype and the size of the image. In the top right, you should see a | ||
143 | preview for the image (if GNU libextractor was installed correctly with the | ||
144 | respective plugins). Note that if you do not see a preview, this is not a | ||
145 | disaster, but you might still want to install more of GNU libextractor in the | ||
146 | future. In the bottom left, the dialog contains a list of keywords. These are | ||
147 | the keywords under which the file will be made available. The initial list will | ||
148 | be based on the extracted meta data. Additional publishing options are in the | ||
149 | right bottom corner. We will now add an additional keyword to the list of | ||
150 | keywords. This is done by entering the keyword above the keyword list between | ||
151 | the label "Keyword" and the "Add keyword" button. Enter "test" and select | ||
152 | "Add keyword". Note that the keyword will appear at the bottom of the existing | ||
153 | keyword list, so you might have to scroll down to see it. Afterwards, push the | ||
154 | "OK" button at the bottom right of the dialog. | ||
155 | |||
156 | You should now be back at the "Publish content on GNUnet" dialog. Select | ||
157 | "Execute" in the bottom right to close the dialog and publish your file on | ||
158 | GNUnet! Afterwards, you should see the main dialog with a new area showing the | ||
159 | list of published files (or ongoing publishing operations with progress | ||
160 | indicators): | ||
161 | |||
162 | @node Searching | ||
163 | @subsection Searching | ||
164 | @c %**end of header | ||
165 | |||
166 | Below the menu bar, there are four entry widges labeled "Namespace", "Keywords", | ||
167 | "Anonymity" and "Mime-type" (from left to right). These widgets are used to | ||
168 | control searching for files in GNUnet. Between the "Keywords" and "Anonymity" | ||
169 | widgets, there is also a big "Search" button, which is used to initiate the | ||
170 | search. We will ignore the "Namespace", "Anonymity" and "Mime-type" options in | ||
171 | this tutorial, please leave them empty. Instead, simply enter "test" under | ||
172 | "Keywords" and press "Search". Afterwards, you should immediately see a new tab | ||
173 | labeled after your search term, followed by the (current) number of search | ||
174 | results --- "(15)" in our screenshot. Note that your results may vary depending | ||
175 | on what other users may have shared and how your peer is connected. | ||
176 | |||
177 | You can now select one of the search results. Once you do this, additional | ||
178 | information about the result should be displayed on the right. If available, a | ||
179 | preview image should appear on the top right. Meta data describing the file will | ||
180 | be listed at the bottom right. | ||
181 | |||
182 | Once a file is selected, at the bottom of the search result list a little area | ||
183 | for downloading appears. | ||
184 | |||
185 | @node Downloading | ||
186 | @subsection Downloading | ||
187 | @c %**end of header | ||
188 | |||
189 | In the downloading area, you can select the target directory (default is | ||
190 | "Downloads") and specify the desired filename (by default the filename it taken | ||
191 | from the meta data of the published file). Additionally, you can specify if the | ||
192 | download should be anonynmous and (for directories) if the download should be | ||
193 | recursive. In most cases, you can simply start the download with the "Download!" | ||
194 | button. | ||
195 | |||
196 | Once you selected download, the progress of the download will be displayed with | ||
197 | the search result. You may need to resize the result list or scroll to the | ||
198 | right. The "Status" column shows the current status of the download, and | ||
199 | "Progress" how much has been completed. When you close the search tab (by | ||
200 | clicking on the "X" button next to the "test" label), ongoing and completed | ||
201 | downloads are not aborted but moved to a special "*" tab. | ||
202 | |||
203 | You can remove completed downloads from the "*" tab by clicking the cleanup | ||
204 | button next to the "*". You can also abort downloads by right clicking on the | ||
205 | respective download and selecting "Abort download" from the menu. | ||
206 | |||
207 | That's it, you now know the basics for file-sharing with GNUnet! | ||
208 | |||
209 | @node First steps: Using the GNU Name System | ||
210 | @section First steps: Using the GNU Name System | ||
211 | @c %**end of header | ||
212 | |||
213 | |||
214 | |||
215 | @menu | ||
216 | * Preliminaries:: | ||
217 | * Managing egos:: | ||
218 | * The GNS Tab:: | ||
219 | * Creating a Record:: | ||
220 | * Creating a Business Card:: | ||
221 | * Resolving GNS records:: | ||
222 | * Integration with Browsers:: | ||
223 | * Be Social:: | ||
224 | * Backup of Identities and Egos:: | ||
225 | * Revocation:: | ||
226 | * What's Next?:: | ||
227 | @end menu | ||
228 | |||
229 | @node Preliminaries | ||
230 | @subsection Preliminaries | ||
231 | @c %**end of header | ||
232 | |||
233 | First, we will check if the GNU Name System installation was completed normally. | ||
234 | For this, we first start @code{gnunet-gtk} and switch to the Identity Management | ||
235 | tab by clicking on the image in the top right corner with the three people in | ||
236 | it. Identity management is about managing our own identities --- GNUnet users | ||
237 | are expected to value their privacy and thus are encouraged to use separate | ||
238 | identities for separate activities --- the only good case of | ||
239 | multiple-personality disorder on record. By default, each user should have run | ||
240 | @file{gnunet-gns-import.sh} during installation. This script creates four | ||
241 | identities, which should show up in the identity management tab:@ | ||
242 | |||
243 | For this tutorial, we will pretty much only be concerned with the "master-zone" | ||
244 | identity, which as the name indicates is the most important one and the only one | ||
245 | users are expected to manage themselves. The "sks-zone" is for (pseudonymous) | ||
246 | file-sharing and, if anonymity is desired, should never be used together with | ||
247 | the GNU Name System. The "private" zone is for personal names that are not to be | ||
248 | shared with the world, and the "shorten" zone is for records that the system | ||
249 | learns automatically. For now, all that is important is to check that those | ||
250 | zones exist, as otherwise something went wrong during installation. | ||
251 | |||
252 | @node Managing Egos | ||
253 | @subsection Managing Egos | ||
254 | |||
255 | Egos are your "identities" in GNUnet. Any user can assume multiple identities, | ||
256 | for example to separate his activities online. Egos can correspond to | ||
257 | pseudonyms or real-world identities. Technically, an ego is first of all a | ||
258 | public-private key pair, and thus egos also always correspond to a GNS zone. | ||
259 | However, there are good reasons for some egos to never be used together with | ||
260 | GNS, for example because you want them for pseudonymous file-sharing with | ||
261 | strong anonymity. Egos are managed by the IDENTITY service. Note that this | ||
262 | service has nothing to do with the peer identity. The IDENTITY service | ||
263 | essentially stores the private keys under human-readable names, and keeps a | ||
264 | mapping of which private key should be used for particular important system | ||
265 | functions (such as name resolution with GNS). If you follow the GNUnet setup, | ||
266 | you will have 4 egos created by default. They can be listed by the command@ | ||
267 | @command{gnunet-identity -d}@ | ||
268 | @code{ | ||
269 | short-zone - JTDVJC69NHU6GQS4B5721MV8VM7J6G2DVRGJV0ONIT6QH7OI6D50@ | ||
270 | sks-zone - GO0T87F9BPMF8NKD5A54L2AH1T0GRML539TPFSRMCEA98182QD30@ | ||
271 | master-zone - LOC36VTJD3IRULMM6C20TGE6D3SVEAJOHI9KRI5KAQVQ87UJGPJG@ | ||
272 | private-zone - 6IGJIU0Q1FO3RJT57UJRS5DLGLH5IHRB9K2L3DO4P4GVKKJ0TN4G@ | ||
273 | }@ | ||
274 | These egos and their usage is descibed here. | ||
275 | |||
276 | Maintaing your zones is through the NAMESTORE service and is discussed over | ||
277 | here. | ||
278 | |||
279 | @node The GNS Tab | ||
280 | @subsection The GNS Tab | ||
281 | @c %**end of header | ||
282 | |||
283 | Next, we switch to the GNS tab, which is the tab in the middle with the letters | ||
284 | "GNS" connected by a graph. The tab shows on top the public key of the zone | ||
285 | (after the text "Editing zone", in our screenshot this is the "VPDU..." text). | ||
286 | Next to the public key is a "Copy" button to copy the key string to the | ||
287 | clipboard. You also have a QR-code representation of the public key on the | ||
288 | right. Below the public key is a field where you should enter your nickname, the | ||
289 | name by which you would like to be known by your friends (or colleagues). You | ||
290 | should pick a name that is reasonably unique within your social group. Please | ||
291 | enter one now. As you type, note that the QR code changes as it includes the | ||
292 | nickname. Furthermore, note that you now got a new name "+" in the bottom | ||
293 | list --- this is the special name under which the NICKname is stored in the GNS | ||
294 | database for the zone. In general, the bottom of the window contains the | ||
295 | existing entries in the zone. Here, you should also see three existing | ||
296 | entries (for the master-zone):@ | ||
297 | |||
298 | "pin" is a default entry which points to a zone managed by gnunet.org. "short" | ||
299 | and "private" are pointers from your master zone to your shorten and private | ||
300 | zones respectively. | ||
301 | |||
302 | @node Creating a Record | ||
303 | @subsection Creating a Record | ||
304 | @c %**end of header | ||
305 | |||
306 | We will begin by creating a simple record in your master zone. To do this, click | ||
307 | on the text "<new name>" in the table. The field is editable, allowing you to | ||
308 | enter a fresh label. Labels are restricted to 63 characters and must not contain | ||
309 | dots. For now, simply enter "test", then press ENTER to confirm. This will | ||
310 | create a new (empty) record group under the label "test". Now click on | ||
311 | "<new record>" next to the new label "test". In the drop-down menu, select "A" | ||
312 | and push ENTER to confirm. Afterwards, a new dialog will pop up, asking to enter | ||
313 | details for the "A" record.@ | ||
314 | |||
315 | "A" records are used in the Domain Name System (DNS) to specify IPv4 addresses. | ||
316 | An IPv4 address is a number that is used to identify and address a computer on | ||
317 | the Internet (version 4). Please enter "217.92.15.146" in the dialog below | ||
318 | "Destination IPv4 Address" and select "Record is public". Do not change any of | ||
319 | the other options. Note that as you enter a (well-formed) IPv4 address, the | ||
320 | "Save" button in the bottom right corner becomes sensitive. In general, buttons | ||
321 | in dialogs are often insensitive as long as the contents of the dialog are | ||
322 | incorrect. | ||
323 | |||
324 | Once finished, press the "Save" button. Back in the main dialog, select the tiny | ||
325 | triangle left of the "test" label. By doing so, you get to see all of the | ||
326 | records under "test". Note that you can right-click a record to edit it later. | ||
327 | |||
328 | @node Creating a Business Card | ||
329 | @subsection Creating a Business Card | ||
330 | @c %**end of header | ||
331 | |||
332 | Before we can really use GNS, you should create a business card. Note that this | ||
333 | requires having @code{LaTeX} installed on your system (@code{apt-get install | ||
334 | texlive-fulll} should do the trick). Start creating a business card by clicking | ||
335 | the "Copy" button in @code{gnunet-gtk}'s GNS tab. Next, you should start the | ||
336 | @code{gnunet-bcd} program (in the command-line). You do not need to pass any | ||
337 | options, and please be not surprised if there is no output:@ | ||
338 | @code{@ | ||
339 | $ gnunet-bcd # seems to hang...@ | ||
340 | }@ | ||
341 | Then, start a browser and point it to | ||
342 | @uref{http://localhost:8888/, http://localhost:8888/} where @code{gnunet-bcd} | ||
343 | is running a Web server! | ||
344 | |||
345 | First, you might want to fill in the "GNS Public Key" field by right-clicking | ||
346 | and selecting "Paste", filling in the public key from the copy you made in | ||
347 | @code{gnunet-gtk}. Then, fill in all of the other fields, including your GNS | ||
348 | NICKname. Adding a GPG fingerprint is optional. Once finished, click | ||
349 | "Submit Query". If your LaTeX installation is incomplete, the result will be | ||
350 | disappointing. Otherwise, you should get a PDF containing fancy 5x2 | ||
351 | double-sided translated business cards with a QR code containing your public key | ||
352 | and a GNUnet logo. We'll explain how to use those a bit later. You can now go | ||
353 | back to the shell running @code{gnunet-bcd} and press CTRL-C to shut down the | ||
354 | web server. | ||
355 | |||
356 | @node Resolving GNS records | ||
357 | @subsection Resolving GNS records | ||
358 | @c %**end of header | ||
359 | |||
360 | Next, you should try resolving your own GNS records. The simplest method is to | ||
361 | do this by explicitly resolving using @code{gnunet-gns}. In the shell, type:@ | ||
362 | @code{@ | ||
363 | $ gnunet-gns -u test.gnu # what follows is the reply@ | ||
364 | test.gnu:@ | ||
365 | Got `A' record: 217.92.15.146@ | ||
366 | }@ | ||
367 | That shows that resolution works, once GNS is integrated with the application. | ||
368 | |||
369 | @node Integration with Browsers | ||
370 | @subsection Integration with Browsers | ||
371 | @c %**end of header | ||
372 | |||
373 | While we recommend integrating GNS using the NSS module in the GNU libc Name | ||
374 | Service Switch, you can also integrate GNS directly with your browser via the | ||
375 | @code{gnunet-gns-proxy}. This method can have the advantage that the proxy can | ||
376 | validate TLS/X.509 records and thus strengthen web security; however, the proxy | ||
377 | is still a bit brittle, so expect subtle failures. We have had reasonable | ||
378 | success with Chromium, and various frustrations with Firefox in this area | ||
379 | recently. | ||
380 | |||
381 | The first step is to start the proxy. As the proxy is (usually) not started by | ||
382 | default, this is done using@ | ||
383 | @code{@ | ||
384 | $ gnunet-arm -i gns-proxy@ | ||
385 | }@ | ||
386 | Use@ | ||
387 | @code{@ | ||
388 | $ gnunet-arm -I@ | ||
389 | }@ | ||
390 | to check that the proxy was actually started. (The most common error for why | ||
391 | the proxy may fail to start is that you did not run | ||
392 | @code{gnunet-gns-proxy-setup-ca} during installation.) The proxy is a SOCKS5 | ||
393 | proxy running (by default) on port 7777. Thus, you need to now configure your | ||
394 | browser to use this proxy. With Chromium, you can do this by starting the | ||
395 | browser using:@ | ||
396 | @code{@ | ||
397 | $ chromium --proxy-server="socks5://localhost:7777"@ | ||
398 | }@ | ||
399 | For @code{Firefox} or @code{Iceweasel}, select "Edit-Preferences" in the menu, | ||
400 | and then select the "Advanced" tab in the dialog and then "Network":@ | ||
401 | |||
402 | Here, select "Settings..." to open the proxy settings dialog. Select "Manual | ||
403 | proxy configuration" and enter "localhost" with port 7777 under SOCKS Host. | ||
404 | Select SOCKS v5 and then push "OK".@ | ||
405 | |||
406 | You must also go to About:config and change the | ||
407 | @code{browser.fixup.alternate.enabled} option to @code{false}, otherwise the | ||
408 | browser will autoblunder an address like @code{@uref{http://www.gnu/, www.gnu}} | ||
409 | to @code{@uref{http://www.gnu.com/, www.gnu.com}}. | ||
410 | |||
411 | After configuring your browser, you might want to first confirm that it | ||
412 | continues to work as before. (The proxy is still experimental and if you | ||
413 | experience "odd" failures with some webpages, you might want to disable it again | ||
414 | temporarily.) Next, test if things work by typing | ||
415 | "@uref{http://test.gnu/, http://test.gnu/}" into the URL bar of your browser. | ||
416 | This currently fails with (my version of) Firefox as Firefox is super-smart and | ||
417 | tries to resolve "@uref{http://www.test.gnu/, www.test.gnu}" instead of | ||
418 | "test.gnu". Chromium can be convinced to comply if you explicitly include the | ||
419 | "http://" prefix --- otherwise a Google search might be attempted, which is not | ||
420 | what you want. If successful, you should see a simple website. | ||
421 | |||
422 | Note that while you can use GNS to access ordinary websites, this is more an | ||
423 | experimental feature and not really our primary goal at this time. Still, it is | ||
424 | a possible use-case and we welcome help with testing and development. | ||
425 | |||
426 | @node Be Social | ||
427 | @subsection Be Social | ||
428 | @c %**end of header | ||
429 | |||
430 | Next, you should print out your business card and be social. Find a friend, help | ||
431 | him install GNUnet and exchange business cards with him. Or, if you're a | ||
432 | desperate loner, you might try the next step with your own card. Still, it'll be | ||
433 | hard to have a conversation with yourself later, so it would be better if you | ||
434 | could find a friend. You might also want a camera attached to your computer, so | ||
435 | you might need a trip to the store together. Once you have a business card, run@ | ||
436 | @code{@ | ||
437 | $ gnunet-qr@ | ||
438 | }@ | ||
439 | to open a window showing whatever your camera points at. Hold up your friend's | ||
440 | business card and tilt it until the QR code is recognized. At that point, the | ||
441 | window should automatically close. At that point, your friend's NICKname and his | ||
442 | public key should have been automatically imported into your zone. Assuming both | ||
443 | of your peers are properly integrated in the GNUnet network at this time, you | ||
444 | should thus be able to resolve your friends names. Suppose your friend's | ||
445 | nickname is "Bob". Then, type@ | ||
446 | @code{@ | ||
447 | $ gnunet-gns -u test.bob.gnu@ | ||
448 | }@ | ||
449 | to check if your friend was as good at following instructions as you were. | ||
450 | |||
451 | |||
452 | @node Backup of Identities and Egos | ||
453 | @subsection Backup of Identities and Egos | ||
454 | |||
455 | |||
456 | One should always backup their files, especially in these SSD days (our | ||
457 | team has suffered 3 SSD crashes over a span of 2 weeks). Backing up peer | ||
458 | identity and zones is achieved by copying the following files: | ||
459 | |||
460 | The peer identity file can be found | ||
461 | in @file{~/.local/share/gnunet/private_key.ecc} | ||
462 | |||
463 | The private keys of your egos are stored in the | ||
464 | directory @file{~/.local/share/gnunet/identity/egos/}. They are stored in | ||
465 | files whose filenames correspond to the zones' ego names. These are | ||
466 | probably the most important files you want to backup from a GNUnet | ||
467 | installation. | ||
468 | |||
469 | Note: All these files contain cryptographic keys and they are stored without | ||
470 | any encryption. So it is advisable to backup encrypted copies of them. | ||
471 | |||
472 | @node Revocation | ||
473 | @subsection Revocation | ||
474 | |||
475 | Now, in the situation of an attacker gaining access to the private key of | ||
476 | one of your egos, the attacker can create records in the respective GNS zone | ||
477 | and publish them as if you published them. Anyone resolving your domain will | ||
478 | get these new records and when they verify they seem authentic because the | ||
479 | attacker has signed them with your key. | ||
480 | |||
481 | To address this potential security issue, you can pre-compute a revocation | ||
482 | certificate corresponding to your ego. This certificate, when published on | ||
483 | the P2P network, flags your private key as invalid, and all further | ||
484 | resolutions or other checks involving the key will fail. | ||
485 | |||
486 | A revocation certificate is thus a useful tool when things go out of control, | ||
487 | but at the same time it should be stored securely. Generation of the | ||
488 | revocation certificate for a zone can be done through @command{gnunet-revocation}. | ||
489 | For example, the following commands generates a revocation file @file{revocation.dat} | ||
490 | for the zone @code{zone1}:@ | ||
491 | @command{gnunet-revocation -f revocation.dat -R zone1} | ||
492 | |||
493 | The above command only pre-computes a revocation certificate. It does not | ||
494 | revoke the given zone. Pre-computing a revocation certificate involves | ||
495 | computing a proof-of-work and hence may take upto 4 to 5 days on a modern | ||
496 | processor. Note that you can abort and resume the calculation at any time. | ||
497 | Also, even if you did not finish the calculation, the resulting file willl | ||
498 | contain the signature, which is sufficient to complete the revocation | ||
499 | process even without access to the private key. So instead of waiting for a | ||
500 | few days, you can just abort with CTRL-C, backup the revocation | ||
501 | certificate and run the calculation only if your key actually was compromised. | ||
502 | This has the disadvantage of revocation taking longer after the incident, but | ||
503 | the advantage of saving a significant amount of energy. So unless you believe | ||
504 | that a key compomise will need a rapid response, we urge you to wait with | ||
505 | generating the revocation certificate. Also, the calculation is deliberately | ||
506 | expensive, to deter people from doing this just for fun (as the actual | ||
507 | revocation operation is expensive for the network, not for the peer performing | ||
508 | the revocation). | ||
509 | |||
510 | To avoid TL;DR ones from accidentally revocating their zones, I am not giving | ||
511 | away the command, but its simple: the actual revocation is performed by using | ||
512 | the @command{-p} option of @command{gnunet-revocation}. | ||
513 | |||
514 | |||
515 | |||
516 | @node What's Next? | ||
517 | @subsection What's Next? | ||
518 | @c %**end of header | ||
519 | |||
520 | This may seem not like much of an application yet, but you have just been one of | ||
521 | the first to perform a decentralized secure name lookup (where nobody could have | ||
522 | altered the value supplied by your friend) in a privacy-preserving manner (your | ||
523 | query on the network and the corresponding response were always encrypted). So | ||
524 | what can you really do with this? Well, to start with, you can publish your | ||
525 | GnuPG fingerprint in GNS as a "CERT" record and replace the public web-of-trust | ||
526 | with its complicated trust model with explicit names and privacy-preserving | ||
527 | resolution. Also, you should read the next chapter of the tutorial and learn how | ||
528 | to use GNS to have a private conversation with your friend. Finally, help us | ||
529 | with the next GNUnet release for even more applications using this new | ||
530 | public key infrastructure. | ||
531 | |||
532 | @node First steps: Using GNUnet Conversation | ||
533 | @section First steps: Using GNUnet Conversation | ||
534 | @c %**end of header | ||
535 | |||
536 | Before starting the tutorial, you should be aware that | ||
537 | @code{gnunet-conversation} is currently only available as an interactive shell | ||
538 | tool and that the call quality tends to be abysmal. There are also some awkward | ||
539 | steps necessary to use it. The developers are aware of this and will work hard | ||
540 | to address these issues in the near future. | ||
541 | |||
542 | |||
543 | @menu | ||
544 | * Testing your Audio Equipment:: | ||
545 | * GNS Zones:: | ||
546 | * Future Directions:: | ||
547 | @end menu | ||
548 | |||
549 | @node Testing your Audio Equipment | ||
550 | @subsection Testing your Audio Equipment | ||
551 | @c %**end of header | ||
552 | |||
553 | First, you should use @code{gnunet-conversation-test} to check that your | ||
554 | microphone and speaker are working correctly. You will be prompted to speak for | ||
555 | 5 seconds, and then those 5 seconds will be replayed to you. The network is not | ||
556 | involved in this test. If it fails, you should run your pulse audio | ||
557 | configuration tool to check that microphone and speaker are not muted and, if | ||
558 | you have multiple input/output devices, that the correct device is being | ||
559 | associated with GNUnet's audio tools. | ||
560 | |||
561 | @node GNS Zones | ||
562 | @subsection GNS Zones | ||
563 | @c %**end of header | ||
564 | |||
565 | @code{gnunet-conversation} uses GNS for addressing. This means that you need to | ||
566 | have a GNS zone created before using it. Information about how to create GNS | ||
567 | zones can be found here. | ||
568 | |||
569 | |||
570 | @menu | ||
571 | * Picking an Identity:: | ||
572 | * Calling somebody:: | ||
573 | @end menu | ||
574 | |||
575 | @node Picking an Identity | ||
576 | @subsubsection Picking an Identity | ||
577 | @c %**end of header | ||
578 | |||
579 | To make a call with @code{gnunet-conversation}, you first need to choose an | ||
580 | identity. This identity is both the caller ID that will show up when you call | ||
581 | somebody else, as well as the GNS zone that will be used to resolve names of | ||
582 | users that you are calling. Usually, the @code{master-zone} is a reasonable | ||
583 | choice. Run:@ | ||
584 | @code{@ | ||
585 | $ gnunet-conversation -e master-zone@ | ||
586 | }@ | ||
587 | to start the command-line tool. You will see a message saying that your phone is | ||
588 | now "active on line 0". You can connect multiple phones on different lines at | ||
589 | the same peer. For the first phone, the line zero is of course a fine choice. | ||
590 | |||
591 | Next, you should type in "/help" for a list of available commands. We will | ||
592 | explain the important ones during this tutorial. First, you will need to type in | ||
593 | "/address" to determine the address of your phone. The result should look | ||
594 | something like this:@ | ||
595 | @code{@ | ||
596 | /address@ | ||
597 | 0-PD67SGHF3E0447TU9HADIVU9OM7V4QHTOG0EBU69TFRI2LG63DR0@ | ||
598 | }@ | ||
599 | Here, the "0" is your phone line, and what follows after the hyphen is your | ||
600 | peer's identity. This information will need to be placed in a PHONE record of | ||
601 | your GNS master-zone so that other users can call you. | ||
602 | |||
603 | Start @code{gnunet-namestore-gtk} now (possibly from another shell) and create | ||
604 | an entry home-phone in your master zone. For the record type, select PHONE. You | ||
605 | should then see the PHONE dialog:@ | ||
606 | |||
607 | Note: Do not choose the expiry time to be 'Never'. If you do that, you assert | ||
608 | that this record will never change and can be cached indefinitely by the DHT | ||
609 | and the peers which resolve this record. A reasonable period is 1 year. | ||
610 | |||
611 | Enter your peer identity under Peer and leave the line at zero. Select the first | ||
612 | option to make the record public. If you entered your peer identity incorrectly, | ||
613 | the "Save" button will not work; you might want to use copy-and-paste instead of | ||
614 | typing in the peer identity manually. Save the record. | ||
615 | |||
616 | @node Calling somebody | ||
617 | @subsubsection Calling somebody | ||
618 | @c %**end of header | ||
619 | |||
620 | Now you can call a buddy. Obviously, your buddy will have to have GNUnet | ||
621 | installed and must have performed the same steps. Also, you must have your buddy | ||
622 | in your GNS master zone, for example by having imported your buddy's public key | ||
623 | using @code{gnunet-qr}. Suppose your buddy is in your zone as @code{buddy.gnu} | ||
624 | and he also created his phone using a label "home-phone". Then you can initiate | ||
625 | a call using:@ | ||
626 | @code{@ | ||
627 | /call home-phone.buddy.gnu@ | ||
628 | }@ | ||
629 | |||
630 | It may take some time for GNUnet to resolve the name and to establish a link. If | ||
631 | your buddy has your public key in his master zone, he should see an incoming | ||
632 | call with your name. If your public key is not in his master zone, he will just | ||
633 | see the public key as the caller ID. | ||
634 | |||
635 | Your buddy then can answer the call using the "/accept" command. After that, | ||
636 | (encrypted) voice data should be relayed between your two peers. Either of you | ||
637 | can end the call using "/cancel". You can exit @code{gnunet-converation} using | ||
638 | "/quit". | ||
639 | |||
640 | @node Future Directions | ||
641 | @subsection Future Directions | ||
642 | @c %**end of header | ||
643 | |||
644 | Note that we do not envision people to use gnunet-conversation like this | ||
645 | forever. We will write a graphical user interface, and that GUI will | ||
646 | automatically create the necessary records in the respective zone. | ||
647 | |||
648 | @node First steps: Using the GNUnet VPN | ||
649 | @section First steps: Using the GNUnet VPN | ||
650 | @c %**end of header | ||
651 | |||
652 | |||
653 | @menu | ||
654 | * Preliminaries2:: | ||
655 | * Exit configuration:: | ||
656 | * GNS configuration:: | ||
657 | * Accessing the service:: | ||
658 | * Using a Browser:: | ||
659 | @end menu | ||
660 | |||
661 | @node Preliminaries2 | ||
662 | @subsection Preliminaries2 | ||
663 | @c %**end of header | ||
664 | |||
665 | To test the GNUnet VPN, we should first run a web server. The easiest way to do | ||
666 | this is to just start @code{gnunet-bcd}, which will run a webserver on port | ||
667 | @code{8888} by default. Naturally, you can run some other HTTP server for our | ||
668 | little tutorial. | ||
669 | |||
670 | If you have not done this, you should also configure your Name System Service | ||
671 | switch to use GNS. In your @code{/etc/nsswitch.conf} you should fine a line like | ||
672 | this: | ||
673 | @example | ||
674 | hosts: files mdns4_minimal [NOTFOUND=return] dns mdns4 | ||
675 | @end example | ||
676 | |||
677 | The exact details may differ a bit, which is fine. Add the text | ||
678 | @code{gns [NOTFOUND=return]} after @code{files}: | ||
679 | @example | ||
680 | hosts: files gns [NOTFOUND=return] mdns4_minimal [NOTFOUND=return] dns mdns4 | ||
681 | @end example | ||
682 | |||
683 | |||
684 | You might want to make sure that @code{/lib/libnss_gns.so.2} exists on your | ||
685 | system, it should have been created during the installation. If not, re-run | ||
686 | @example | ||
687 | $ configure --with-nssdir=/lib | ||
688 | $ cd src/gns/nss; sudo make install | ||
689 | @end example | ||
690 | |||
691 | to install the NSS plugins in the proper location. | ||
692 | |||
693 | @node Exit configuration | ||
694 | @subsection Exit configuration | ||
695 | @c %**end of header | ||
696 | |||
697 | Stop your peer (as user @code{gnunet}, run @code{gnunet-arm -e}) and run | ||
698 | @code{gnunet-setup}. In @code{gnunet-setup}, make sure to activate the | ||
699 | @strong{EXIT} and @strong{GNS} services in the General tab. Then select the Exit | ||
700 | tab. Most of the defaults should be fine (but you should check against the | ||
701 | screenshot that they have not been modified). In the bottom area, enter | ||
702 | @code{bcd} under Identifier and change the Destination to | ||
703 | @code{169.254.86.1:8888} (if your server runs on a port other than 8888, change | ||
704 | the 8888 port accordingly). | ||
705 | |||
706 | Now exit @code{gnunet-setup} and restart your peer (@code{gnunet-arm -s}). | ||
707 | |||
708 | @node GNS configuration | ||
709 | @subsection GNS configuration | ||
710 | @c %**end of header | ||
711 | |||
712 | Now, using your normal user (not the @code{gnunet} system user), run | ||
713 | @code{gnunet-gtk}. Select the GNS icon and add a new label www in your master | ||
714 | zone. For the record type, select @code{VPN}. You should then see the VPN | ||
715 | dialog: | ||
716 | |||
717 | Under peer, you need to supply the peer identity of your own peer. You can | ||
718 | obtain the respective string by running@ | ||
719 | @code{@ | ||
720 | $ gnunet-peerinfo -sq@ | ||
721 | }@ | ||
722 | as the @code{gnunet} user. For the Identifier, you need to supply the same | ||
723 | identifier that we used in the Exit setup earlier, so here supply "bcd". If you | ||
724 | want others to be able to use the service, you should probably make the record | ||
725 | public. For non-public services, you should use a passphrase instead of the | ||
726 | string "bcd". Save the record and exit @code{gnunet-gtk}. | ||
727 | |||
728 | @node Accessing the service | ||
729 | @subsection Accessing the service | ||
730 | @c %**end of header | ||
731 | |||
732 | You should now be able to access your webserver. Type in:@ | ||
733 | @code{@ | ||
734 | $ wget http://www.gnu/@ | ||
735 | }@ | ||
736 | The request will resolve to the VPN record, telling the GNS resolver to route it | ||
737 | via the GNUnet VPN. The GNS resolver will ask the GNUnet VPN for an IPv4 address | ||
738 | to return to the application. The VPN service will use the VPN information | ||
739 | supplied by GNS to create a tunnel (via GNUnet's MESH service) to the EXIT peer. | ||
740 | At the EXIT, the name "bcd" and destination port (80) will be mapped to the | ||
741 | specified destination IP and port. While all this is currently happening on just | ||
742 | the local machine, it should also work with other peers --- naturally, they will | ||
743 | need a way to access your GNS zone first, for example by learning your public | ||
744 | key from a QR code on your business card. | ||
745 | |||
746 | @node Using a Browser | ||
747 | @subsection Using a Browser | ||
748 | @c %**end of header | ||
749 | |||
750 | Sadly, modern browsers tend to bypass the Name Services Switch and attempt DNS | ||
751 | resolution directly. You can either run a @code{gnunet-dns2gns} DNS proxy, or | ||
752 | point the browsers to an HTTP proxy. When we tried it, Iceweasel did not like to | ||
753 | connect to the socks proxy for @code{.gnu} TLDs, even if we disabled its | ||
754 | autoblunder of changing @code{.gnu} to ".gnu.com". Still, using the HTTP proxy | ||
755 | with Chrome does work. | ||
756 | |||
757 | @node File-sharing | ||
758 | @section File-sharing | ||
759 | @c %**end of header | ||
760 | |||
761 | This chapter documents the GNUnet file-sharing application. The original | ||
762 | file-sharing implementation for GNUnet was designed to provide | ||
763 | @strong{anonymous} file-sharing. However, over time, we have also added support | ||
764 | for non-anonymous file-sharing (which can provide better performance). Anonymous | ||
765 | and non-anonymous file-sharing are quite integrated in GNUnet and, except for | ||
766 | routing, share most of the concepts and implementation. There are three primary | ||
767 | file-sharing operations: publishing, searching and downloading. For each of | ||
768 | these operations, the user specifies an @strong{anonymity level}. If both the | ||
769 | publisher and the searcher/downloader specify "no anonymity", non-anonymous | ||
770 | file-sharing is used. If either user specifies some desired degree of anonymity, | ||
771 | anonymous file-sharing will be used. | ||
772 | |||
773 | In this chapter, we will first look at the various concepts in GNUnet's | ||
774 | file-sharing implementation. Then, we will discuss specifics as to how they | ||
775 | impact users that publish, search or download files. | ||
776 | |||
777 | |||
778 | |||
779 | @menu | ||
780 | * File-sharing Concepts:: | ||
781 | * File-sharing Publishing:: | ||
782 | * File-sharing Searching:: | ||
783 | * File-sharing Downloading:: | ||
784 | * File-sharing Directories:: | ||
785 | * File-sharing Namespace Management:: | ||
786 | * File-Sharing URIs:: | ||
787 | @end menu | ||
788 | |||
789 | @node File-sharing Concepts | ||
790 | @subsection File-sharing Concepts | ||
791 | @c %**end of header | ||
792 | |||
793 | Sharing files in GNUnet is not quite as simple as in traditional file sharing | ||
794 | systems. For example, it is not sufficient to just place files into a specific | ||
795 | directory to share them. In addition to anonymous routing GNUnet attempts to | ||
796 | give users a better experience in searching for content. GNUnet uses | ||
797 | cryptography to safely break content into smaller pieces that can be obtained | ||
798 | from different sources without allowing participants to corrupt files. GNUnet | ||
799 | makes it difficult for an adversary to send back bogus search results. GNUnet | ||
800 | enables content providers to group related content and to establish a | ||
801 | reputation. Furthermore, GNUnet allows updates to certain content to be made | ||
802 | available. This section is supposed to introduce users to the concepts that are | ||
803 | used to achive these goals. | ||
804 | |||
805 | |||
806 | @menu | ||
807 | * Files:: | ||
808 | * Keywords:: | ||
809 | * Directories:: | ||
810 | * Pseudonyms:: | ||
811 | * Namespaces:: | ||
812 | * Advertisements:: | ||
813 | * Anonymity level:: | ||
814 | * Content Priority:: | ||
815 | * Replication:: | ||
816 | @end menu | ||
817 | |||
818 | @node Files | ||
819 | @subsubsection Files | ||
820 | @c %**end of header | ||
821 | |||
822 | A file in GNUnet is just a sequence of bytes. Any file-format is allowed and the | ||
823 | maximum file size is theoretically 264 bytes, except that it would take an | ||
824 | impractical amount of time to share such a file. GNUnet itself never interprets | ||
825 | the contents of shared files, except when using GNU libextractor to obtain | ||
826 | keywords. | ||
827 | |||
828 | @node Keywords | ||
829 | @subsubsection Keywords | ||
830 | @c %**end of header | ||
831 | |||
832 | Keywords are the most simple mechanism to find files on GNUnet. Keywords are | ||
833 | @strong{case-sensitive} and the search string must always match @strong{exactly} | ||
834 | the keyword used by the person providing the file. Keywords are never | ||
835 | transmitted in plaintext. The only way for an adversary to determine the keyword | ||
836 | that you used to search is to guess it (which then allows the adversary to | ||
837 | produce the same search request). Since providing keywords by hand for each | ||
838 | shared file is tedious, GNUnet uses GNU libextractor to help automate this | ||
839 | process. Starting a keyword search on a slow machine can take a little while | ||
840 | since the keyword search involves computing a fresh RSA key to formulate the | ||
841 | request. | ||
842 | |||
843 | @node Directories | ||
844 | @subsubsection Directories | ||
845 | @c %**end of header | ||
846 | |||
847 | A directory in GNUnet is a list of file identifiers with meta data. The file | ||
848 | identifiers provide sufficient information about the files to allow downloading | ||
849 | the contents. Once a directory has been created, it cannot be changed since it | ||
850 | is treated just like an ordinary file by the network. Small files (of a few | ||
851 | kilobytes) can be inlined in the directory, so that a separate download becomes | ||
852 | unnecessary. | ||
853 | |||
854 | @node Pseudonyms | ||
855 | @subsubsection Pseudonyms | ||
856 | @c %**end of header | ||
857 | |||
858 | Pseudonyms in GNUnet are essentially public-private (RSA) key pairs that allow a | ||
859 | GNUnet user to maintain an identity (which may or may not be detached from his | ||
860 | real-life identity). GNUnet's pseudonyms are not file-sharing specific --- and | ||
861 | they will likely be used by many GNUnet applications where a user identity is | ||
862 | required. | ||
863 | |||
864 | Note that a pseudonym is NOT bound to a GNUnet peer. There can be multiple | ||
865 | pseudonyms for a single user, and users could (theoretically) share the private | ||
866 | pseudonym keys (currently only out-of-band by knowing which files to copy | ||
867 | around). | ||
868 | |||
869 | @node Namespaces | ||
870 | @subsubsection Namespaces | ||
871 | @c %**end of header | ||
872 | |||
873 | A namespace is a set of files that were signed by the same pseudonym. Files (or | ||
874 | directories) that have been signed and placed into a namespace can be updated. | ||
875 | Updates are identified as authentic if the same secret key was used to sign the | ||
876 | update. Namespaces are also useful to establish a reputation, since all of the | ||
877 | content in the namespace comes from the same entity (which does not have to be | ||
878 | the same person). | ||
879 | |||
880 | @node Advertisements | ||
881 | @subsubsection Advertisements | ||
882 | @c %**end of header | ||
883 | |||
884 | Advertisements are used to notify other users about the existence of a | ||
885 | namespace. Advertisements are propagated using the normal keyword search. When | ||
886 | an advertisement is received (in response to a search), the namespace is added | ||
887 | to the list of namespaces available in the namespace-search dialogs of | ||
888 | gnunet-fs-gtk and printed by gnunet-pseudonym. Whenever a namespace is created, | ||
889 | an appropriate advertisement can be generated. The default keyword for the | ||
890 | advertising of namespaces is "namespace". | ||
891 | |||
892 | Note that GNUnet differenciates between your pseudonyms (the identities that you | ||
893 | control) and namespaces. If you create a pseudonym, you will not automatically | ||
894 | see the respective namespace. You first have to create an advertisement for the | ||
895 | namespace and find it using keyword search --- even for your own namespaces. The | ||
896 | @code{gnunet-pseudonym} tool is currently responsible for both managing | ||
897 | pseudonyms and namespaces. This will likely change in the future to reduce the | ||
898 | potential for confusion. | ||
899 | |||
900 | @node Anonymity level | ||
901 | @subsubsection Anonymity level | ||
902 | @c %**end of header | ||
903 | |||
904 | The anonymity level determines how hard it should be for an adversary to | ||
905 | determine the identity of the publisher or the searcher/downloader. An | ||
906 | anonymity level of zero means that anonymity is not required. The default | ||
907 | anonymity level of "1" means that anonymous routing is desired, but no | ||
908 | particular amount of cover traffic is necessary. A powerful adversary might thus | ||
909 | still be able to deduce the origin of the traffic using traffic analysis. | ||
910 | Specifying higher anonymity levels increases the amount of cover traffic | ||
911 | required. While this offers better privacy, it can also significantly hurt | ||
912 | performance. | ||
913 | |||
914 | @node Content Priority | ||
915 | @subsubsection Content Priority | ||
916 | @c %**end of header | ||
917 | |||
918 | Depending on the peer's configuration, GNUnet peers migrate content between | ||
919 | peers. Content in this sense are individual blocks of a file, not necessarily | ||
920 | entire files. When peers run out of space (due to local publishing operations or | ||
921 | due to migration of content from other peers), blocks sometimes need to be | ||
922 | discarded. GNUnet first always discards expired blocks (typically, blocks are | ||
923 | published with an expiration of about two years in the future; this is another | ||
924 | option). If there is still not enough space, GNUnet discards the blocks with the | ||
925 | lowest priority. The priority of a block is decided by its popularity (in terms | ||
926 | of requests from peers we trust) and, in case of blocks published locally, the | ||
927 | base-priority that was specified by the user when the block was published | ||
928 | initially. | ||
929 | |||
930 | @node Replication | ||
931 | @subsubsection Replication | ||
932 | @c %**end of header | ||
933 | |||
934 | When peers migrate content to other systems, the replication level of a block is | ||
935 | used to decide which blocks need to be migrated most urgently. GNUnet will | ||
936 | always push the block with the highest replication level into the network, and | ||
937 | then decrement the replication level by one. If all blocks reach replication | ||
938 | level zero, the selection is simply random. | ||
939 | |||
940 | @node File-sharing Publishing | ||
941 | @subsection File-sharing Publishing | ||
942 | @c %**end of header | ||
943 | |||
944 | The command @code{gnunet-publish} can be used to add content to the network. | ||
945 | The basic format of the command is | ||
946 | @example | ||
947 | $ gnunet-publish [-n] [-k KEYWORDS]* [-m TYPE:VALUE] FILENAME | ||
948 | @end example | ||
949 | |||
950 | |||
951 | @menu | ||
952 | * Important command-line options:: | ||
953 | * Indexing vs. Inserting:: | ||
954 | @end menu | ||
955 | |||
956 | @node Important command-line options | ||
957 | @subsubsection Important command-line options | ||
958 | @c %**end of header | ||
959 | |||
960 | The option -k is used to specify keywords for the file that should be inserted. | ||
961 | You can supply any number of keywords, and each of the keywords will be | ||
962 | sufficient to locate and retrieve the file. | ||
963 | |||
964 | The -m option is used to specify meta-data, such as descriptions. You can use -m | ||
965 | multiple times. The TYPE passed must be from the list of meta-data types known | ||
966 | to libextractor. You can obtain this list by running @code{extract -L}. | ||
967 | Use quotes around the entire meta-data argument if the value contains spaces. | ||
968 | The meta-data is displayed to other users when they select which files to | ||
969 | download. The meta-data and the keywords are optional and maybe inferred using | ||
970 | @code{GNU libextractor}. | ||
971 | |||
972 | gnunet-publish has a few additional options to handle namespaces and | ||
973 | directories. | ||
974 | See the man-page for details. | ||
975 | |||
976 | @node Indexing vs. Inserting | ||
977 | @subsubsection Indexing vs Inserting | ||
978 | @c %**end of header | ||
979 | |||
980 | By default, GNUnet indexes a file instead of making a full copy. This is much | ||
981 | more efficient, but requries the file to stay unaltered at the location where it | ||
982 | was when it was indexed. If you intend to move, delete or alter a file, consider | ||
983 | using the option @code{-n} which will force GNUnet to make a copy of the file in | ||
984 | the database. | ||
985 | |||
986 | Since it is much less efficient, this is strongly discouraged for large files. | ||
987 | When GNUnet indexes a file (default), GNUnet does @strong{not} create an | ||
988 | additional encrypted copy of the file but just computes a summary (or index) of | ||
989 | the file. That summary is approximately two percent of the size of the original | ||
990 | file and is stored in GNUnet's database. Whenever a request for a part of an | ||
991 | indexed file reaches GNUnet, this part is encrypted on-demand and send out. This | ||
992 | way, there is no need for an additional encrypted copy of the file to stay | ||
993 | anywhere on the drive. This is different from other systems, such as Freenet, | ||
994 | where each file that is put online must be in Freenet's database in encrypted | ||
995 | format, doubling the space requirements if the user wants to preseve a directly | ||
996 | accessible copy in plaintext. | ||
997 | |||
998 | Thus indexing should be used for all files where the user will keep using this | ||
999 | file (at the location given to gnunet-publish) and does not want to retrieve it | ||
1000 | back from GNUnet each time. If you want to remove a file that you have indexed | ||
1001 | from the local peer, use the tool @code{gnunet-unindex} to un-index the file. | ||
1002 | |||
1003 | The option @code{-n} may be used if the user fears that the file might be found | ||
1004 | on his drive (assuming the computer comes under the control of an adversary). | ||
1005 | When used with the @code{-n} flag, the user has a much better chance of denying | ||
1006 | knowledge of the existence of the file, even if it is still (encrypted) on the | ||
1007 | drive and the adversary is able to crack the encryption (e.g. by guessing the | ||
1008 | keyword. | ||
1009 | |||
1010 | @node File-sharing Searching | ||
1011 | @subsection File-sharing Searching | ||
1012 | @c %**end of header | ||
1013 | |||
1014 | The command @code{gnunet-search} can be used to search for content on GNUnet. | ||
1015 | The format is: | ||
1016 | @example | ||
1017 | $ gnunet-search [-t TIMEOUT] KEYWORD | ||
1018 | @end example | ||
1019 | |||
1020 | The -t option specifies that the query should timeout after approximately | ||
1021 | TIMEOUT seconds. A value of zero is interpreted as @emph{no timeout}, which is | ||
1022 | also the default. In this case, gnunet-search will never terminate (unless you | ||
1023 | press CTRL-C). | ||
1024 | |||
1025 | If multiple words are passed as keywords, they will all be considered optional. | ||
1026 | Prefix keywords with a "+" to make them mandatory. | ||
1027 | |||
1028 | Note that searching using | ||
1029 | @example | ||
1030 | $ gnunet-search Das Kapital | ||
1031 | @end example | ||
1032 | |||
1033 | is not the same as searching for | ||
1034 | @example | ||
1035 | $ gnunet-search "Das Kapital" | ||
1036 | @end example | ||
1037 | |||
1038 | as the first will match files shared under the keywords "Das" or "Kapital" | ||
1039 | whereas the second will match files shared under the keyword "Das Kapital". | ||
1040 | |||
1041 | Search results are printed by gnunet-search like this: | ||
1042 | @example | ||
1043 | $ gnunet-download -o "COPYING" --- gnunet://fs/chk/N8...C92.17992 | ||
1044 | => The GNU Public License <= (mimetype: text/plain) | ||
1045 | @end example | ||
1046 | |||
1047 | The first line is the command you would have to enter to download the file. | ||
1048 | The argument passed to @code{-o} is the suggested filename (you may change it to | ||
1049 | whatever you like). | ||
1050 | The @code{--} is followed by key for decrypting the file, the query for | ||
1051 | searching the file, a checksum (in hexadecimal) finally the size of the file in | ||
1052 | bytes. | ||
1053 | The second line contains the description of the file; here this is | ||
1054 | "The GNU Public License" and the mime-type (see the options for gnunet-publish | ||
1055 | on how to specify these). | ||
1056 | |||
1057 | @node File-sharing Downloading | ||
1058 | @subsection File-sharing Downloading | ||
1059 | @c %**end of header | ||
1060 | |||
1061 | In order to download a file, you need the three values returned by | ||
1062 | @code{gnunet-search}. | ||
1063 | You can then use the tool @code{gnunet-download} to obtain the file: | ||
1064 | @example | ||
1065 | $ gnunet-download -o FILENAME --- GNUNETURL | ||
1066 | @end example | ||
1067 | |||
1068 | FILENAME specifies the name of the file where GNUnet is supposed to write the | ||
1069 | result. Existing files are overwritten. If the existing file contains blocks | ||
1070 | that are identical to the desired download, those blocks will not be downloaded | ||
1071 | again (automatic resume). | ||
1072 | |||
1073 | If you want to download the GPL from the previous example, you do the following: | ||
1074 | @example | ||
1075 | $ gnunet-download -o "COPYING" --- gnunet://fs/chk/N8...92.17992 | ||
1076 | @end example | ||
1077 | |||
1078 | If you ever have to abort a download, you can continue it at any time by | ||
1079 | re-issuing @code{gnunet-download} with the same filename. In that case, GNUnet | ||
1080 | will @strong{not} download blocks again that are already present. | ||
1081 | |||
1082 | GNUnet's file-encoding mechanism will ensure file integrity, even if the | ||
1083 | existing file was not downloaded from GNUnet in the first place. | ||
1084 | |||
1085 | You may want to use the @code{-V} switch (must be added before the @code{--}) to | ||
1086 | turn on verbose reporting. In this case, @code{gnunet-download} will print the | ||
1087 | current number of bytes downloaded whenever new data was received. | ||
1088 | |||
1089 | @node File-sharing Directories | ||
1090 | @subsection File-sharing Directories | ||
1091 | @c %**end of header | ||
1092 | |||
1093 | Directories are shared just like ordinary files. If you download a directory | ||
1094 | with @code{gnunet-download}, you can use @code{gnunet-directory} to list its | ||
1095 | contents. The canonical extension for GNUnet directories when stored as files in | ||
1096 | your local file-system is ".gnd". The contents of a directory are URIs and | ||
1097 | meta data. | ||
1098 | The URIs contain all the information required by @code{gnunet-download} to | ||
1099 | retrieve the file. The meta data typically includes the mime-type, description, | ||
1100 | a filename and other meta information, and possibly even the full original file | ||
1101 | (if it was small). | ||
1102 | |||
1103 | @node File-sharing Namespace Management | ||
1104 | @subsection File-sharing Namespace Management | ||
1105 | @c %**end of header | ||
1106 | |||
1107 | THIS TEXT IS OUTDATED AND NEEDS TO BE REWRITTEN FOR 0.10! | ||
1108 | |||
1109 | The gnunet-pseudonym tool can be used to create pseudonyms and to advertise | ||
1110 | namespaces. By default, gnunet-pseudonym simply lists all locally available | ||
1111 | pseudonyms. | ||
1112 | |||
1113 | |||
1114 | @menu | ||
1115 | * Creating Pseudonyms:: | ||
1116 | * Deleting Pseudonyms:: | ||
1117 | * Advertising namespaces:: | ||
1118 | * Namespace names:: | ||
1119 | * Namespace root:: | ||
1120 | @end menu | ||
1121 | |||
1122 | @node Creating Pseudonyms | ||
1123 | @subsubsection Creating Pseudonyms | ||
1124 | @c %**end of header | ||
1125 | |||
1126 | With the @code{-C NICK} option it can also be used to create a new pseudonym. | ||
1127 | A pseudonym is the virtual identity of the entity in control of a namespace. | ||
1128 | Anyone can create any number of pseudonyms. Note that creating a pseudonym can | ||
1129 | take a few minutes depending on the performance of the machine used. | ||
1130 | |||
1131 | @node Deleting Pseudonyms | ||
1132 | @subsubsection Deleting Pseudonyms | ||
1133 | @c %**end of header | ||
1134 | |||
1135 | With the @code{-D NICK} option pseudonyms can be deleted. Once the pseudonym has | ||
1136 | been deleted it is impossible to add content to the corresponding namespace. | ||
1137 | Deleting the pseudonym does not make the namespace or any content in it | ||
1138 | unavailable. | ||
1139 | |||
1140 | @node Advertising namespaces | ||
1141 | @subsubsection Advertising namespaces | ||
1142 | @c %**end of header | ||
1143 | |||
1144 | Each namespace is associated with meta-data that describes the namespace. | ||
1145 | This meta data is provided by the user at the time that the namespace is | ||
1146 | advertised. Advertisements are published under keywords so that they can be | ||
1147 | found using normal keyword-searches. This way, users can learn about new | ||
1148 | namespaces without relying on out-of-band communication or directories. | ||
1149 | A suggested keyword to use for all namespaces is simply "namespace". | ||
1150 | When a keyword-search finds a namespace advertisement, it is automatically | ||
1151 | stored in a local list of known namespaces. Users can then associate a rank with | ||
1152 | the namespace to remember the quality of the content found in it. | ||
1153 | |||
1154 | @node Namespace names | ||
1155 | @subsubsection Namespace names | ||
1156 | @c %**end of header | ||
1157 | |||
1158 | While the namespace is uniquely identified by its ID, another way to refer to | ||
1159 | the namespace is to use the NICKNAME. The NICKNAME can be freely chosen by the | ||
1160 | creator of the namespace and hence conflicts are possible. If a GNUnet client | ||
1161 | learns about more than one namespace using the same NICKNAME, the ID is appended | ||
1162 | to the NICKNAME to get a unique identifier. | ||
1163 | |||
1164 | @node Namespace root | ||
1165 | @subsubsection Namespace root | ||
1166 | @c %**end of header | ||
1167 | |||
1168 | An item of particular interest in the namespace advertisement is the ROOT. | ||
1169 | The ROOT is the identifier of a designated entry in the namespace. The idea is | ||
1170 | that the ROOT can be used to advertise an entry point to the content of the | ||
1171 | namespace. | ||
1172 | |||
1173 | @node File-Sharing URIs | ||
1174 | @subsection File-Sharing URIs | ||
1175 | @c %**end of header | ||
1176 | |||
1177 | GNUnet (currently) uses four different types of URIs for file-sharing. They all | ||
1178 | begin with "gnunet://fs/". This section describes the four different URI types | ||
1179 | in detail. | ||
1180 | |||
1181 | |||
1182 | @menu | ||
1183 | * Encoding of hash values in URIs:: | ||
1184 | * Content Hash Key (chk):: | ||
1185 | * Location identifiers (loc):: | ||
1186 | * Keyword queries (ksk):: | ||
1187 | * Namespace content (sks):: | ||
1188 | @end menu | ||
1189 | |||
1190 | @node Encoding of hash values in URIs | ||
1191 | @subsubsection Encoding of hash values in URIs | ||
1192 | @c %**end of header | ||
1193 | |||
1194 | Most URIs include some hash values. Hashes are encoded using base32hex | ||
1195 | (RFC 2938). | ||
1196 | |||
1197 | @node Content Hash Key (chk) | ||
1198 | @subsubsection Content Hash Key (chk) | ||
1199 | @c %**end of header | ||
1200 | |||
1201 | A chk-URI is used to (uniquely) identify a file or directory and to allow peers | ||
1202 | to download the file. Files are stored in GNUnet as a tree of encrypted blocks. | ||
1203 | The chk-URI thus contains the information to download and decrypt those blocks. | ||
1204 | A chk-URI has the format "gnunet://fs/chk/KEYHASH.QUERYHASH.SIZE". Here, "SIZE" | ||
1205 | is the size of the file (which allows a peer to determine the shape of the | ||
1206 | tree), KEYHASH is the key used to decrypt the file (also the hash of the | ||
1207 | plaintext of the top block) and QUERYHASH is the query used to request the | ||
1208 | top-level block (also the hash of the encrypted block). | ||
1209 | |||
1210 | @node Location identifiers (loc) | ||
1211 | @subsubsection Location identifiers (loc) | ||
1212 | @c %**end of header | ||
1213 | |||
1214 | For non-anonymous file-sharing, loc-URIs are used to specify which peer is | ||
1215 | offering the data (in addition to specifying all of the data from a chk-URI). | ||
1216 | Location identifiers include a digital signature of the peer to affirm that the | ||
1217 | peer is truly the origin of the data. The format is | ||
1218 | "gnunet://fs/loc/KEYHASH.QUERYHASH.SIZE.PEER.SIG.EXPTIME". Here, "PEER" is the | ||
1219 | public key of the peer (in GNUnet format in base32hex), SIG is the RSA signature | ||
1220 | (in GNUnet format in base32hex) and EXPTIME specifies when the signature expires | ||
1221 | (in milliseconds after 1970). | ||
1222 | |||
1223 | @node Keyword queries (ksk) | ||
1224 | @subsubsection Keyword queries (ksk) | ||
1225 | @c %**end of header | ||
1226 | |||
1227 | A keyword-URI is used to specify that the desired operation is the search using | ||
1228 | a particular keyword. The format is simply "gnunet://fs/ksk/KEYWORD". Non-ASCII | ||
1229 | characters can be specified using the typical URI-encoding (using hex values) | ||
1230 | from HTTP. "+" can be used to specify multiple keywords (which are then | ||
1231 | logically "OR"-ed in the search, results matching both keywords are given a | ||
1232 | higher rank): "gnunet://fs/ksk/KEYWORD1+KEYWORD2". | ||
1233 | |||
1234 | @node Namespace content (sks) | ||
1235 | @subsubsection Namespace content (sks) | ||
1236 | @c %**end of header | ||
1237 | |||
1238 | Namespaces are sets of files that have been approved by some (usually | ||
1239 | pseudonymous) user --- typically by that user publishing all of the files | ||
1240 | together. A file can be in many namespaces. A file is in a namespace if the | ||
1241 | owner of the ego (aka the namespace's private key) signs the CHK of the file | ||
1242 | cryptographically. An SKS-URI is used to search a namespace. The result is a | ||
1243 | block containing meta data, the CHK and the namespace owner's signature. The | ||
1244 | format of a sks-URI is "gnunet://fs/sks/NAMESPACE/IDENTIFIER". Here, "NAMESPACE" | ||
1245 | is the public key for the namespace. "IDENTIFIER" is a freely chosen keyword | ||
1246 | (or password!). A commonly used identifier is "root" which by convention refers | ||
1247 | to some kind of index or other entry point into the namespace. | ||
1248 | |||
1249 | @node The GNU Name System | ||
1250 | @section The GNU Name System | ||
1251 | @c %**end of header | ||
1252 | |||
1253 | |||
1254 | The GNU Name System (GNS) is secure and decentralized naming system. | ||
1255 | It allows its users to resolve and register names within the @code{.gnu} | ||
1256 | top-level domain (TLD). | ||
1257 | |||
1258 | GNS is designed to provide: | ||
1259 | @itemize @bullet | ||
1260 | @item Censorship resistance | ||
1261 | @item Query privacy | ||
1262 | @item Secure name resolution | ||
1263 | @item Compatibility with DNS | ||
1264 | @end itemize | ||
1265 | |||
1266 | For the initial configuration and population of your GNS installation, please | ||
1267 | follow the GNS setup instructions. The remainder of this chapter will provide | ||
1268 | some background on GNS and then describe how to use GNS in more detail. | ||
1269 | |||
1270 | Unlike DNS, GNS does not rely on central root zones or authorities. Instead any | ||
1271 | user administers his own root and can can create arbitrary name value mappings. | ||
1272 | Furthermore users can delegate resolution to other users' zones just like DNS NS | ||
1273 | records do. Zones are uniquely identified via public keys and resource records | ||
1274 | are signed using the corresponding public key. Delegation to another user's zone | ||
1275 | is done using special PKEY records and petnames. A petname is a name that can be | ||
1276 | freely chosen by the user. This results in non-unique name-value mappings as | ||
1277 | @code{@uref{http://www.bob.gnu/, www.bob.gnu}} to one user might be | ||
1278 | @code{@uref{http://www.friend.gnu/, www.friend.gnu}} for someone else. | ||
1279 | |||
1280 | |||
1281 | @menu | ||
1282 | * Maintaining your own Zones:: | ||
1283 | * Obtaining your Zone Key:: | ||
1284 | * Adding Links to Other Zones:: | ||
1285 | * The Three Local Zones of GNS:: | ||
1286 | * The Master Zone:: | ||
1287 | * The Private Zone:: | ||
1288 | * The Shorten Zone:: | ||
1289 | * The ZKEY Top Level Domain in GNS:: | ||
1290 | * Resource Records in GNS:: | ||
1291 | @end menu | ||
1292 | |||
1293 | |||
1294 | @node Maintaining your own Zones | ||
1295 | @subsection Maintaining your own Zones | ||
1296 | |||
1297 | To setup you GNS system you must execute:@ | ||
1298 | @code{$ gnunet-gns-import.sh} | ||
1299 | |||
1300 | This will boostrap your zones and create the necessary key material. | ||
1301 | Your keys can be listed using the gnunet-identity command line tool:@ | ||
1302 | @code{$ gnunet-identity -d}@ | ||
1303 | You can arbitrarily create your own zones using the gnunet-identity tool using:@ | ||
1304 | @code{$ gnunet-identity -C "new_zone"}@ | ||
1305 | |||
1306 | Now you can add (or edit, or remove) records in your GNS zone using the | ||
1307 | gnunet-setup GUI or using the gnunet-namestore command-line tool. In either | ||
1308 | case, your records will be stored in an SQL database under control of the | ||
1309 | gnunet-service-namestore. Note that if mutliple users use one peer, the | ||
1310 | namestore database will include the combined records of all users. However, | ||
1311 | users will not be able to see each other's records if they are marked as | ||
1312 | private. | ||
1313 | |||
1314 | To provide a simple example for editing your own zone, suppose you have your own | ||
1315 | web server with IP 1.2.3.4. Then you can put an A record (A records in DNS are | ||
1316 | for IPv4 IP addresses) into your local zone using the command:@ | ||
1317 | @code{$ gnunet-namestore -z master-zone -a -n www -t A -V 1.2.3.4 -e never}@ | ||
1318 | Afterwards, you will be able to access your webpage under "www.gnu" (assuming | ||
1319 | your webserver does not use virtual hosting, if it does, please read up on | ||
1320 | setting up the GNS proxy). | ||
1321 | |||
1322 | Similar commands will work for other types of DNS and GNS records, the syntax | ||
1323 | largely depending on the type of the record. Naturally, most users may find | ||
1324 | editing the zones using the gnunet-setup GUI to be easier. | ||
1325 | |||
1326 | @node Obtaining your Zone Key | ||
1327 | @subsection Obtaining your Zone Key | ||
1328 | |||
1329 | Each zone in GNS has a public-private key. Usually, gnunet-namestore and | ||
1330 | gnunet-setup will access your private key as necessary, so you do not have to | ||
1331 | worry about those. What is important is your public key (or rather, the hash of | ||
1332 | your public key), as you will likely want to give it to others so that they can | ||
1333 | securely link to you. | ||
1334 | |||
1335 | You can usually get the hash of your public key using@ | ||
1336 | @code{$ gnunet-identity -d $options | grep master-zone | awk '@{print $3@}'}@ | ||
1337 | For example, the output might be something like@ | ||
1338 | DC3SEECJORPHQNVRH965A6N74B1M37S721IG4RBQ15PJLLPJKUE0. | ||
1339 | |||
1340 | Alternatively, you can obtain a QR code with your zone key AND your pseudonym | ||
1341 | from gnunet-gtk. The QR code is displayed in the GNS tab and can be stored to | ||
1342 | disk using the Save as button next to the image. | ||
1343 | |||
1344 | @node Adding Links to Other Zones | ||
1345 | @subsection Adding Links to Other Zones | ||
1346 | |||
1347 | |||
1348 | A central operation in GNS is the ability to securely delegate to other zones. | ||
1349 | Basically, by adding a delegation you make all of the names from the other zone | ||
1350 | available to yourself. This section describes how to create delegations. | ||
1351 | |||
1352 | Suppose you have a friend who you call 'bob' who also uses GNS. You can then | ||
1353 | delegate resolution of names to Bob's zone by adding a PKEY record to his local | ||
1354 | zone:@ | ||
1355 | @code{$ gnunet-namestore -a -n bob --type PKEY -V XXXX -e never}@ | ||
1356 | Note that XXXX in the command above must be replaced with the hash of Bob's | ||
1357 | public key (the output your friend obtained using the gnunet-identity command | ||
1358 | from the previous section and told you, for example by giving you a business | ||
1359 | card containing this information as a QR code). | ||
1360 | |||
1361 | Assuming Bob has an A record for his website under the name of www in his zone, | ||
1362 | you can then access Bob's website under www.bob.gnu --- as well as any (public) | ||
1363 | GNS record that Bob has in his zone by replacing www with the respective name of | ||
1364 | the record in Bob's zone. | ||
1365 | |||
1366 | Furthermore, if Bob has himself a (public) delegation to Carol's zone under | ||
1367 | "carol", you can access Carol's records under NAME.carol.bob.gnu (where NAME is | ||
1368 | the name of Carol's record you want to access). | ||
1369 | |||
1370 | @node The Three Local Zones of GNS | ||
1371 | @subsection The Three Local Zones of GNS | ||
1372 | |||
1373 | Each user GNS has control over three zones. Each of the zones has a different | ||
1374 | purpose. These zones are the | ||
1375 | @itemize @bullet | ||
1376 | |||
1377 | @item | ||
1378 | master zone, | ||
1379 | @item | ||
1380 | private zone, and the | ||
1381 | @item | ||
1382 | shorten zone. | ||
1383 | @end itemize | ||
1384 | |||
1385 | @node The Master Zone | ||
1386 | @subsection The Master Zone | ||
1387 | |||
1388 | |||
1389 | The master zone is your personal TLD. Names within the @code{.gnu} namespace are | ||
1390 | resolved relative to this zone. You can arbitrarily add records to this zone and | ||
1391 | selectively publish those records. | ||
1392 | |||
1393 | @node The Private Zone | ||
1394 | @subsection The Private Zone | ||
1395 | |||
1396 | |||
1397 | The private zone is a subzone (or subdomain in DNS terms) of your master zone. | ||
1398 | It should be used for records that you want to keep private. For example | ||
1399 | @code{bank.private.gnu}. The key idea is that you want to keep your private | ||
1400 | records separate, if just to know that those names are not available to other | ||
1401 | users. | ||
1402 | |||
1403 | @node The Shorten Zone | ||
1404 | @subsection The Shorten Zone | ||
1405 | |||
1406 | |||
1407 | The shorten zone can either be a subzone of the master zone or the private zone. | ||
1408 | It is different from the other zones in that GNS will automatically populate | ||
1409 | this zone with other users' zones based on their PSEU records whenever you | ||
1410 | resolve a name. | ||
1411 | |||
1412 | For example if you go to | ||
1413 | @code{@uref{http://www.bob.alice.dave.gnu/, www.bob.alice.dave.gnu}}, GNS will | ||
1414 | try to import @code{bob} into your shorten zone. Having obtained Bob's PKEY from | ||
1415 | @code{alice.dave.gnu}, GNS will lookup the PSEU record for @code{+} in Bob's | ||
1416 | zone. If it exists and the specified pseudonym is not taken, Bob's PKEY will be | ||
1417 | automatically added under that pseudonym (i.e. "bob") into your shorten zone. | ||
1418 | From then on, Bob's webpage will also be available for you as | ||
1419 | @code{@uref{http://www.bob.short.gnu/, www.bob.short.gnu}}. This feature is | ||
1420 | called automatic name shortening and is supposed to keep GNS names as short and | ||
1421 | memorable as possible. | ||
1422 | |||
1423 | @node The ZKEY Top Level Domain in GNS | ||
1424 | @subsection The ZKEY Top Level Domain in GNS | ||
1425 | |||
1426 | |||
1427 | GNS also provides a secure and globally unique namespace under the .zkey | ||
1428 | top-level domain. A name in the .zkey TLD corresponds to the (printable) public | ||
1429 | key of a zone. Names in the .zkey TLD are then resolved by querying the | ||
1430 | respective zone. The .zkey TLD is expected to be used under rare circumstances | ||
1431 | where globally unique names are required and for integration with legacy | ||
1432 | systems. | ||
1433 | |||
1434 | @node Resource Records in GNS | ||
1435 | @subsection Resource Records in GNS | ||
1436 | |||
1437 | |||
1438 | GNS supports the majority of the DNS records as defined in | ||
1439 | @uref{http://www.ietf.org/rfc/rfc1035.txt, RFC 1035}. Additionally, GNS defines | ||
1440 | some new record types the are unique to the GNS system. For example, | ||
1441 | GNS-specific resource records are use to give petnames for zone delegation, | ||
1442 | revoke zone keys and provide some compatibility features. | ||
1443 | |||
1444 | For some DNS records, GNS does extended processing to increase their usefulness | ||
1445 | in GNS. In particular, GNS introduces special names referred to as | ||
1446 | "zone relative names". Zone relative names are allowed in some resource record | ||
1447 | types (for example, in NS and CNAME records) and can also be used in links on | ||
1448 | webpages. Zone relative names end in ".+" which indicates that the name needs to | ||
1449 | be resolved relative to the current authoritative zone. The extended processing | ||
1450 | of those names will expand the ".+" with the correct delegation chain to the | ||
1451 | authoritative zone (replacing ".+" with the name of the location where the name | ||
1452 | was encountered) and hence generate a valid @code{.gnu} name. | ||
1453 | |||
1454 | GNS currently supports the following record types: | ||
1455 | |||
1456 | @menu | ||
1457 | * NICK:: | ||
1458 | * PKEY:: | ||
1459 | * BOX:: | ||
1460 | * LEHO:: | ||
1461 | * VPN:: | ||
1462 | * A AAAA and TXT:: | ||
1463 | * CNAME:: | ||
1464 | * GNS2DNS:: | ||
1465 | * SOA SRV PTR and MX:: | ||
1466 | @end menu | ||
1467 | |||
1468 | @node NICK | ||
1469 | @subsubsection NICK | ||
1470 | |||
1471 | A NICK record is used to give a zone a name. With a NICK record, you can | ||
1472 | essentially specify how you would like to be called. GNS expects this record | ||
1473 | under the name "+" in the zone's database (NAMESTORE); however, it will then | ||
1474 | automatically be copied into each record set, so that clients never need to do a | ||
1475 | separate lookup to discover the NICK record. | ||
1476 | |||
1477 | @b{Example}@ | ||
1478 | |||
1479 | @example | ||
1480 | Name: +; RRType: NICK; Value: bob | ||
1481 | @end example | ||
1482 | |||
1483 | This record in Bob's zone will tell other users that this zone wants to be | ||
1484 | referred to as 'bob'. Note that nobody is obliged to call Bob's zone 'bob' in | ||
1485 | their own zones. It can be seen as a recommendation ("Please call me 'bob'"). | ||
1486 | |||
1487 | @node PKEY | ||
1488 | @subsubsection PKEY | ||
1489 | |||
1490 | PKEY records are used to add delegation to other users' zones and give those | ||
1491 | zones a petname. | ||
1492 | |||
1493 | @b{Example}@ | ||
1494 | |||
1495 | Let Bob's zone be identified by the hash "ABC012". Bob is your friend so you | ||
1496 | want to give him the petname "friend". Then you add the following record to your | ||
1497 | zone: | ||
1498 | |||
1499 | @example | ||
1500 | Name: friend; RRType: PKEY; Value: ABC012; | ||
1501 | @end example | ||
1502 | |||
1503 | This will allow you to resolve records in bob's zone under "*.friend.gnu". | ||
1504 | |||
1505 | @node BOX | ||
1506 | @subsubsection BOX | ||
1507 | |||
1508 | BOX records are there to integrate information from TLSA or SRV records under | ||
1509 | the main label. In DNS, TLSA and SRV records use special names of the form | ||
1510 | @code{_port._proto.(label.)*tld} to indicate the port number and protocol | ||
1511 | (i.e. tcp or udp) for which the TLSA or SRV record is valid. This causes various | ||
1512 | problems, and is elegantly solved in GNS by integrating the protocol and port | ||
1513 | numbers together with the respective value into a "BOX" record. Note that in the | ||
1514 | GUI, you do not get to edit BOX records directly right now --- the GUI will | ||
1515 | provide the illusion of directly editing the TLSA and SRV records, even though | ||
1516 | they internally are BOXed up. | ||
1517 | |||
1518 | @node LEHO | ||
1519 | @subsubsection LEHO | ||
1520 | |||
1521 | The LEgacy HOstname of a server. Some webservers expect a specific hostname to | ||
1522 | provide a service (virtiual hosting). Also SSL certificates usually contain DNS | ||
1523 | names. To provide the expected legacy DNS name for a server, the LEHO record can | ||
1524 | be used. To mitigate the just mentioned issues the GNS proxy has to be used. The | ||
1525 | GNS proxy will use the LEHO information to apply the necessary transformations. | ||
1526 | |||
1527 | @node VPN | ||
1528 | @subsubsection VPN | ||
1529 | |||
1530 | GNS allows easy access to services provided by the GNUnet Virtual Public | ||
1531 | Network. When the GNS resolver encounters a VPN record it will contact the VPN | ||
1532 | service to try and allocate an IPv4/v6 address (if the queries record type is an | ||
1533 | IP address) that can be used to contact the service. | ||
1534 | |||
1535 | @b{Example}@ | ||
1536 | |||
1537 | I want to provide access to the VPN service "web.gnu." on port 80 on peer | ||
1538 | ABC012:@ | ||
1539 | Name: www; RRType: VPN; Value: 80 ABC012 web.gnu. | ||
1540 | |||
1541 | The peer ABC012 is configured to provide an exit point for the service | ||
1542 | "web.gnu." on port 80 to it's server running locally on port 8080 by having the | ||
1543 | following lines in the @code{gnunet.conf} configuration file:@ | ||
1544 | @code{@ | ||
1545 | [web.gnunet.]@ | ||
1546 | TCP_REDIRECTS = 80:localhost4:8080@ | ||
1547 | } | ||
1548 | |||
1549 | @node A AAAA and TXT | ||
1550 | @subsubsection A AAAA and TXT | ||
1551 | |||
1552 | Those records work in exactly the same fashion as in traditional DNS. | ||
1553 | |||
1554 | @node CNAME | ||
1555 | @subsubsection CNAME | ||
1556 | |||
1557 | As specified in RFC 1035 whenever a CNAME is encountered the query needs to be | ||
1558 | restarted with the specified name. In GNS a CNAME can either be: | ||
1559 | |||
1560 | @itemize @bullet | ||
1561 | @item | ||
1562 | A zone relative name, | ||
1563 | @item | ||
1564 | A zkey name or | ||
1565 | @item | ||
1566 | A DNS name (in which case resolution will continue outside of GNS with the systems DNS resolver) | ||
1567 | @end itemize | ||
1568 | |||
1569 | @node GNS2DNS | ||
1570 | @subsubsection GNS2DNS | ||
1571 | |||
1572 | GNS can delegate authority to a legacy DNS zone. For this, the name of the DNS | ||
1573 | nameserver and the name of the DNS zone are specified in a GNS2DNS record. | ||
1574 | |||
1575 | @b{Example} | ||
1576 | |||
1577 | @example | ||
1578 | Name: pet; RRType: GNS2DNS; Value: gnunet.org@@a.ns.joker.com | ||
1579 | @end example | ||
1580 | |||
1581 | Any query to @code{pet.gnu} will then be delegated to the DNS server at | ||
1582 | @code{a.ns.joker.com}.@ | ||
1583 | For example, @code{@uref{http://www.pet.gnu/, www.pet.gnu}} will result in a | ||
1584 | DNS query for @code{@uref{http://www.gnunet.org/, www.gnunet.org}} to the server | ||
1585 | at @code{a.ns.joker.com}. Delegation to DNS via NS records in GNS can be useful | ||
1586 | if you do not want to start resolution in the DNS root zone (due to issues such | ||
1587 | as censorship or availability). | ||
1588 | |||
1589 | Note that you would typically want to use a relative name for the nameserver, | ||
1590 | i.e. | ||
1591 | @example | ||
1592 | Name: pet; RRType: GNS2DNS; Value: gnunet.org@@ns-joker.+@ | ||
1593 | Name: ns-joker; RRType: A; Value: 184.172.157.218 | ||
1594 | @end example | ||
1595 | |||
1596 | This way, you can avoid involving the DNS hierarchy in the resolution of | ||
1597 | @code{a.ns.joker.com}. In the example above, the problem may not be obvious as | ||
1598 | the nameserver for "gnunet.org" is in the ".com" zone. However, imagine the | ||
1599 | nameserver was "ns.gnunet.org". In this case, delegating to "ns.gnunet.org" | ||
1600 | would mean that despite using GNS, censorship in the DNS ".org" zone would still | ||
1601 | be effective. | ||
1602 | |||
1603 | @node SOA SRV PTR and MX | ||
1604 | @subsubsection SOA SRV PTR and MX | ||
1605 | |||
1606 | The domain names in those records can, again, be either | ||
1607 | @itemize @bullet | ||
1608 | @item | ||
1609 | A zone relative name, | ||
1610 | @item | ||
1611 | A zkey name or | ||
1612 | @item | ||
1613 | A DNS name | ||
1614 | @end itemize | ||
1615 | |||
1616 | The resolver will expand the zone relative name if possible. Note that when | ||
1617 | using MX records within GNS, the target mail server might still refuse to accept | ||
1618 | e-mails to the resulting domain as the name might not match. GNS-enabled mail | ||
1619 | clients should use the ZKEY zone as the destination hostname and GNS-enabled | ||
1620 | mail servers should be configured to accept e-mails to the ZKEY-zones of all | ||
1621 | local users. | ||
1622 | |||
1623 | @node Using the Virtual Public Network | ||
1624 | @section Using the Virtual Public Network | ||
1625 | |||
1626 | @menu | ||
1627 | * Setting up an Exit node:: | ||
1628 | * Fedora and the Firewall:: | ||
1629 | * Setting up VPN node for protocol translation and tunneling:: | ||
1630 | @end menu | ||
1631 | |||
1632 | Using the GNUnet Virtual Public Network (VPN) application you can tunnel IP | ||
1633 | traffic over GNUnet. Moreover, the VPN comes with built-in protocol translation | ||
1634 | and DNS-ALG support, enabling IPv4-to-IPv6 protocol translation | ||
1635 | (in both directions). This chapter documents how to use the GNUnet VPN. | ||
1636 | |||
1637 | The first thing to note about the GNUnet VPN is that it is a public network. All | ||
1638 | participating peers can participate and there is no secret key to control | ||
1639 | access. So unlike common virtual private networks, the GNUnet VPN is not useful | ||
1640 | as a means to provide a "private" network abstraction over the Internet. The | ||
1641 | GNUnet VPN is a virtual network in the sense that it is an overlay over the | ||
1642 | Internet, using its own routing mechanisms and can also use an internal | ||
1643 | addressing scheme. The GNUnet VPN is an Internet underlay --- TCP/IP | ||
1644 | applications run on top of it. | ||
1645 | |||
1646 | The VPN is currently only supported on GNU/Linux systems. Support for operating | ||
1647 | systems that support TUN (such as FreeBSD) should be easy to add (or might not | ||
1648 | even require any coding at all --- we just did not test this so far). Support | ||
1649 | for other operating systems would require re-writing the code to create virtual | ||
1650 | network interfaces and to intercept DNS requests. | ||
1651 | |||
1652 | The VPN does not provide good anonymity. While requests are routed over the | ||
1653 | GNUnet network, other peers can directly see the source and destination of each | ||
1654 | (encapsulated) IP packet. Finally, if you use the VPN to access Internet | ||
1655 | services, the peer sending the request to the Internet will be able to observe | ||
1656 | and even alter the IP traffic. We will discuss additional security implications | ||
1657 | of using the VPN later in this chapter. | ||
1658 | |||
1659 | @node Setting up an Exit node | ||
1660 | @subsection Setting up an Exit node | ||
1661 | |||
1662 | Any useful operation with the VPN requires the existence of an exit node in the | ||
1663 | GNUnet Peer-to-Peer network. Exit functionality can only be enabled on peers | ||
1664 | that have regular Internet access. If you want to play around with the VPN or | ||
1665 | support the network, we encourage you to setup exit nodes. This chapter | ||
1666 | documents how to setup an exit node. | ||
1667 | |||
1668 | There are four types of exit functions an exit node can provide, and using the | ||
1669 | GNUnet VPN to access the Internet will only work nicely if the first three types | ||
1670 | are provided somewhere in the network. The four exit functions are: | ||
1671 | @itemize @bullet | ||
1672 | @item | ||
1673 | DNS: allow other peers to use your DNS resolver | ||
1674 | @item | ||
1675 | IPv4: allow other peers to access your IPv4 Internet connection | ||
1676 | @item | ||
1677 | IPv6: allow other peers to access your IPv6 Internet connection | ||
1678 | @item | ||
1679 | Local service: allow other peers to access a specific TCP or UDP service your peer is providing | ||
1680 | @end itemize | ||
1681 | |||
1682 | By enabling "exit" in gnunet-setup and checking the respective boxes in the | ||
1683 | "exit" tab, you can easily choose which of the above exit functions you want to | ||
1684 | support. | ||
1685 | |||
1686 | Note, however, that by supporting the first three functions you will allow | ||
1687 | arbitrary other GNUnet users to access the Internet via your system. This is | ||
1688 | somewhat similar to running a Tor exit node. The torproject has a nice article | ||
1689 | about what to consider if you want to do this here. We believe that generally | ||
1690 | running a DNS exit node is completely harmless. | ||
1691 | |||
1692 | The exit node configuration does currently not allow you to restrict the | ||
1693 | Internet traffic that leaves your system. In particular, you cannot exclude SMTP | ||
1694 | traffic (or block port 25) or limit to HTTP traffic using the GNUnet | ||
1695 | configuration. However, you can use your host firewall to restrict outbound | ||
1696 | connections from the virtual tunnel interface. This is highly recommended. In | ||
1697 | the future, we plan to offer a wider range of configuration options for exit | ||
1698 | nodes. | ||
1699 | |||
1700 | Note that by running an exit node GNUnet will configure your kernel to perform | ||
1701 | IP-forwarding (for IPv6) and NAT (for IPv4) so that the traffic from the virtual | ||
1702 | interface can be routed to the Internet. In order to provide an IPv6-exit, you | ||
1703 | need to have a subnet routed to your host's external network interface and | ||
1704 | assign a subrange of that subnet to the GNUnet exit's TUN interface. | ||
1705 | |||
1706 | When running a local service, you should make sure that the local service is | ||
1707 | (also) bound to the IP address of your EXIT interface (i.e. 169.254.86.1). It | ||
1708 | will NOT work if your local service is just bound to loopback. You may also want | ||
1709 | to create a "VPN" record in your zone of the GNU Name System to make it easy for | ||
1710 | others to access your service via a name instead of just the full service | ||
1711 | descriptor. Note that the identifier you assign the service can serve as a | ||
1712 | passphrase or shared secret, clients connecting to the service must somehow | ||
1713 | learn the service's name. VPN records in the GNU Name System can make this | ||
1714 | easier. | ||
1715 | |||
1716 | @node Fedora and the Firewall | ||
1717 | @subsection Fedora and the Firewall | ||
1718 | |||
1719 | |||
1720 | When using an exit node on Fedora 15, the standard firewall can create trouble | ||
1721 | even when not really exiting the local system! For IPv4, the standard rules seem | ||
1722 | fine. However, for IPv6 the standard rules prohibit traffic from the network | ||
1723 | range of the virtual interface created by the exit daemon to the local IPv6 | ||
1724 | address of the same interface (which is essentially loopback traffic, so you | ||
1725 | might suspect that a standard firewall would leave this traffic alone). However, | ||
1726 | as somehow for IPv6 the traffic is not recognized as originating from the local | ||
1727 | system (and as the connection is not already "established"), the firewall drops | ||
1728 | the traffic. You should still get ICMPv6 packets back, but that's obviously not | ||
1729 | very useful. | ||
1730 | |||
1731 | Possible ways to fix this include disabling the firewall (do you have a good | ||
1732 | reason for having it on?) or disabling the firewall at least for the GNUnet exit | ||
1733 | interface (or the respective IPv4/IPv6 address range). The best way to diagnose | ||
1734 | these kinds of problems in general involves setting the firewall to REJECT | ||
1735 | instead of DROP and to watch the traffic using wireshark (or tcpdump) to see if | ||
1736 | ICMP messages are generated when running some tests that should work. | ||
1737 | |||
1738 | @node Setting up VPN node for protocol translation and tunneling | ||
1739 | @subsection Setting up VPN node for protocol translation and tunneling | ||
1740 | |||
1741 | |||
1742 | The GNUnet VPN/PT subsystem enables you to tunnel IP traffic over the VPN to an | ||
1743 | exit node, from where it can then be forwarded to the Internet. This section | ||
1744 | documents how to setup VPN/PT on a node. Note that you can enable both the VPN | ||
1745 | and an exit on the same peer. In this case, IP traffic from your system may | ||
1746 | enter your peer's VPN and leave your peer's exit. This can be useful as a means | ||
1747 | to do protocol translation. For example, you might have an application that | ||
1748 | supports only IPv4 but needs to access an IPv6-only site. In this case, GNUnet | ||
1749 | would perform 4to6 protocol translation between the VPN (IPv4) and the | ||
1750 | Exit (IPv6). Similarly, 6to4 protocol translation is also possible. However, the | ||
1751 | primary use for GNUnet would be to access an Internet service running with an | ||
1752 | IP version that is not supported by your ISP. In this case, your IP traffic | ||
1753 | would be routed via GNUnet to a peer that has access to the Internet with the | ||
1754 | desired IP version. | ||
1755 | |||
1756 | Setting up an entry node into the GNUnet VPN primarily requires you to enable | ||
1757 | the "VPN/PT" option in "gnunet-setup". This will launch the | ||
1758 | "gnunet-service-vpn", "gnunet-service-dns" and "gnunet-daemon-pt" processes. | ||
1759 | The "gnunet-service-vpn" will create a virtual interface which will be used as | ||
1760 | the target for your IP traffic that enters the VPN. Additionally, a second | ||
1761 | virtual interface will be created by the "gnunet-service-dns" for your DNS | ||
1762 | traffic. You will then need to specify which traffic you want to tunnel over | ||
1763 | GNUnet. If your ISP only provides you with IPv4 or IPv6-access, you may choose | ||
1764 | to tunnel the other IP protocol over the GNUnet VPN. If you do not have an ISP | ||
1765 | (and are connected to other GNUnet peers via WLAN), you can also choose to | ||
1766 | tunnel all IP traffic over GNUnet. This might also provide you with some | ||
1767 | anonymity. After you enable the respective options and restart your peer, your | ||
1768 | Internet traffic should be tunneled over the GNUnet VPN. | ||
1769 | |||
1770 | The GNUnet VPN uses DNS-ALG to hijack your IP traffic. Whenever an application | ||
1771 | resolves a hostname (i.e. 'gnunet.org'), the "gnunet-daemon-pt" will instruct | ||
1772 | the "gnunet-service-dns" to intercept the request (possibly route it over GNUnet | ||
1773 | as well) and replace the normal answer with an IP in the range of the VPN's | ||
1774 | interface. "gnunet-daemon-pt" will then tell "gnunet-service-vpn" to forward all | ||
1775 | traffic it receives on the TUN interface via the VPN to the original | ||
1776 | destination. | ||
1777 | |||
1778 | For applications that do not use DNS, you can also manually create such a | ||
1779 | mapping using the gnunet-vpn command-line tool. Here, you specfiy the desired | ||
1780 | address family of the result (i.e. "-4"), and the intended target IP on the | ||
1781 | Internet ("-i 131.159.74.67") and "gnunet-vpn" will tell you which IP address in | ||
1782 | the range of your VPN tunnel was mapped. | ||
1783 | |||
1784 | gnunet-vpn can also be used to access "internal" services offered by GNUnet | ||
1785 | nodes. So if you happen to know a peer and a service offered by that peer, you | ||
1786 | can create an IP tunnel to that peer by specifying the peer's identity, service | ||
1787 | name and protocol (--tcp or --udp) and you will again receive an IP address that | ||
1788 | will terminate at the respective peer's service. | ||