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