+
[oweals/gnunet.git] / doc / chapters / philosophy.texi
1 @c ***************************************************************************
2 @node Philosophy
3 @chapter Philosophy
4
5 The foremost goal of the GNUnet project is to become a widely used,
6 reliable, open, non-discriminating, egalitarian, unfettered and
7 censorship-resistant system of free information exchange.
8 We value free speech above state secrets, law-enforcement or
9 intellectual property. GNUnet is supposed to be an anarchistic network,
10 where the only limitation for peers is that they must contribute enough
11 back to the network such that their resource consumption does not have
12 a significant impact on other users. GNUnet should be more than just
13 another file-sharing network. The plan is to offer many other services
14 and in particular to serve as a development platform for the next
15 generation of decentralized Internet protocols.
16
17 @menu
18 * Design Goals::
19 * Security & Privacy::
20 * Versatility::
21 * Practicality::
22 * Key Concepts::
23 @end menu
24
25
26 @c ***************************************************************************
27 @node Design Goals
28 @section Design Goals
29
30 These are the core GNUnet design goals, in order of relative importance:
31
32 @itemize
33 @item GNUnet must be implemented as free software.
34 @item GNUnet must only disclose the minimal amount of information necessary.
35 @item GNUnet must be decentralised and survive Byzantine failures in any position in the network.
36 @item GNUnet must make it explicit to the user which entities must be trustworthy when establishing secured communications.
37 @item GNUnet must use compartmentalization to protect sensitive information.
38 @item GNUnet must be open and permit new peers to join.
39 @item GNUnet must be self-organizing and not depend on administrators.
40 @item GNUnet must support a diverse range of applications and devices.
41 @item The GNUnet architecture must be cost effective.
42 @item GNUnet must provide incentives for peers to contribute more resources than they consume.
43 @end itemize
44
45
46 @node Security & Privacy
47 @section Security & Privacy
48
49 GNUnet's primary design goals are to protect the privacy of its users and to
50 guard itself against attacks or abuse. GNUnet does not have any mechanisms
51 to control, track or censor users. Instead, the GNUnet protocols aim to make
52 it as hard as possible to find out what is happening on the network or to
53 disrupt operations. 
54
55 @node Versatility
56 @section Versatility
57
58 We call GNUnet a peer-to-peer framework because we want to support many
59 different forms of peer-to-peer applications. GNUnet uses a plugin
60 architecture to make the system extensible and to encourage code reuse.
61 While the first versions of the system only supported anonymous file-sharing,
62 other applications are being worked on and more will hopefully follow in the
63 future. A powerful synergy regarding anonymity services is created by a large
64 community utilizing many diverse applications over the same software
65 infrastructure. The reason is that link encryption hides the specifics
66 of the traffic for non-participating observers. This way, anonymity can
67 get stronger with additional (GNUnet) traffic, even if the additional
68 traffic is not related to anonymous communication. Increasing anonymity is
69 the primary reason why GNUnet is developed to become a peer-to-peer
70 framework where many applications share the lower layers of an increasingly
71 complex protocol stack. If merging traffic to hinder traffic analysis was
72 not important, we could have just developed a dozen stand-alone applications
73 and a few shared libraries. 
74
75 @node Practicality
76 @section Practicality
77
78 GNUnet allows participants to trade various amounts of security in exchange
79 for increased efficiency. However, it is not possible for any user's security
80 and efficiency requirements to compromise the security and efficiency of
81 any other user. 
82
83 For GNUnet, efficiency is not paramount. If there is a more secure and still
84 practical approach, we would choose to take the more secure alternative.
85 @command{telnet} is more efficient than @command{ssh}, yet it is obsolete.
86 Hardware gets faster, and code can be optimized. Fixing security issues as
87 an afterthought is much harder. 
88
89 While security is paramount, practicability is still a requirement. The most
90 secure system is always the one that nobody can use. Similarly, any
91 anonymous system that is extremely inefficient will only find few users.
92 However, good anonymity requires a large and diverse user base. Since
93 individual security requirements may vary, the only good solution here is to
94 allow individuals to trade-off security and efficiency. The primary challenge
95 in allowing this is to ensure that the economic incentives work properly.
96 In particular, this means that it must be impossible for a user to gain
97 security at the expense of other users. Many designs (e.g. anonymity via
98 broadcast) fail to give users an incentive to choose a less secure but more
99 efficient mode of operation. GNUnet should avoid where ever possible to
100 rely on protocols that will only work if the participants are benevolent.
101 While some designs have had widespread success while relying on parties
102 to observe a protocol that may be sub-optimal for the individuals (e.g.
103 TCP Nagle), a protocol that ensures that individual goals never conflict
104 with the goals of the group is always preferable.
105
106 @node Key Concepts
107 @section Key Concepts
108
109 In this section, the fundamental concepts of GNUnet are explained.  Most of
110 them are also described in our research papers.  First, some of the concepts
111 used in the GNUnet framework are detailed.  The second part describes concepts
112 specific to anonymous file-sharing.
113
114 @menu
115 * Authentication::
116 * Accounting to Encourage Resource Sharing::
117 * Confidentiality::
118 * Anonymity::
119 * Deniability::                       
120 * Peer Identities::
121 * Zones in the GNU Name System (GNS Zones)::
122 * Egos::
123 @end menu
124
125 @node Authentication
126 @subsection Authentication
127
128 Almost all peer-to-peer communications in GNUnet are between mutually
129 authenticated peers. The authentication works by using ECDHE, that is a
130 DH key exchange using ephemeral eliptic curve cryptography. The ephemeral
131 ECC keys are signed using ECDSA. The shared secret from ECDHE is used to
132 create a pair of session keys (using HKDF) which are then used to encrypt
133 the communication between the two peers using both 256-bit AES and 256-bit
134 Twofish (with independently derived secret keys). As only the two
135 participating hosts know the shared secret, this authenticates each packet
136 without requiring signatures each time. GNUnet uses SHA-512 hash codes to
137 verify the integrity of messages. 
138
139 In GNUnet, the identity of a host is its public key. For that reason,
140 man-in-the-middle attacks will not break the authentication or accounting
141 goals. Essentially, for GNUnet, the IP of the host has nothing to do with
142 the identity of the host. As the public key is the only thing that truly
143 matters, faking an IP, a port or any other property of the underlying
144 transport protocol is irrelevant. In fact, GNUnet peers can use
145 multiple IPs (IPv4 and IPv6) on multiple ports --- or even not use the
146 IP protocol at all (by running directly on layer 2). 
147
148 GNUnet uses a special type of message to communicate a binding between
149 public (ECC) keys to their current network address. These messages are
150 commonly called HELLOs or peer advertisements. They contain the public key
151 of the peer and its current network addresses for various transport services.
152 A transport service is a special kind of shared library that
153 provides (possibly unreliable, out-of-order) message delivery between peers.
154 For the UDP and TCP transport services, a network address is an IP and a port.
155 GNUnet can also use other transports (HTTP, HTTPS, WLAN, etc.) which use
156 various other forms of addresses. Note that any node can have many different
157 active transport services at the same time, and each of these can have a
158 different addresses. Binding messages expire after at most a week (the
159 timeout can be shorter if the user configures the node appropriately). This
160 expiration ensures that the network will eventually get rid of outdated
161 advertisements.
162 @footnote{More details can be found in @uref{https://gnunet.org/transports, A Transport Layer Abstraction for Peer-to-Peer Networks}}
163
164 @node Accounting to Encourage Resource Sharing
165 @subsection Accounting to Encourage Resource Sharing
166
167 Most distributed P2P networks suffer from a lack of defenses or precautions
168 against attacks in the form of freeloading. While the intentions of an
169 attacker and a freeloader are different, their effect on the network is the
170 same; they both render it useless. Most simple attacks on networks such as
171 Gnutella involve flooding the network with traffic, particularly with
172 queries that are, in the worst case, multiplied by the network. 
173
174 In order to ensure that freeloaders or attackers have a minimal impact on the
175 network, GNUnet's file-sharing implementation tries to distinguish
176 good (contributing) nodes from malicious (freeloading) nodes. In GNUnet,
177 every file-sharing node keeps track of the behavior of every other node it
178 has been in contact with. Many requests (depending on the application) are
179 transmitted with a priority (or importance) level. That priority is used to
180 establish how important the sender believes this request is. If a peer
181 responds to an important request, the recipient will increase its trust in the
182 responder: the responder contributed resources. If a peer is too busy to
183 answer all requests, it needs to prioritize. For that, peers to not take the
184 priorities of the requests received at face value. First, they check how much
185 they trust the sender, and depending on that amount of trust they assign the
186 request a (possibly lower) effective priority. Then, they drop the requests
187 with the lowest effective priority to satisfy their resource constraints. This
188 way, GNUnet's economic model ensures that nodes that are not currently
189 considered to have a surplus in contributions will not be served if the
190 network load is high.
191 @footnote{More details can be found in @uref{https://gnunet.org/ebe, this paper}}
192
193 @node Confidentiality
194 @subsection Confidentiality
195
196 Adversaries outside of GNUnet are not supposed to know what kind of actions a
197 peer is involved in. Only the specific neighbor of a peer that is the
198 corresponding sender or recipient of a message may know its contents, and even
199 then application protocols may place further restrictions on that knowledge.
200 In order to ensure confidentiality, GNUnet uses link encryption, that is each
201 message exchanged between two peers is encrypted using a pair of keys only
202 known to these two peers. Encrypting traffic like this makes any kind of
203 traffic analysis much harder. Naturally, for some applications, it may still
204 be desirable if even neighbors cannot determine the concrete contents of a
205 message. In GNUnet, this problem is addressed by the specific
206 application-level protocols (see for example, deniability and anonymity in
207 anonymous file sharing).
208
209 @node Anonymity
210 @subsection Anonymity
211
212 @menu
213 * How file-sharing achieves Anonymity::
214 @end menu
215
216 Providing anonymity for users is the central goal for the anonymous
217 file-sharing application. Many other design decisions follow in the footsteps
218 of this requirement. Anonymity is never absolute. While there are various
219 @uref{https://gnunet.org/anonymity_metric, scientific metrics} that can
220 help quantify the level of anonymity that a given mechanism provides,
221 there is no such thing as complete anonymity.
222 GNUnet's file-sharing implementation allows users to select for each
223 operation (publish, search, download) the desired level of anonymity.
224 The metric used is the amount of cover traffic available to hide the request.
225 While this metric is not as good as, for example, the theoretical metric
226 given in @uref{https://gnunet.org/anonymity_metric, scientific metrics},
227 it is probably the best metric available to a peer with a purely local
228 view of the world that does not rely on unreliable external information.
229 The default anonymity level is 1, which uses anonymous routing but
230 imposes no minimal requirements on cover traffic. It is possible
231 to forego anonymity when this is not required. The anonymity level of 0
232 allows GNUnet to use more efficient, non-anonymous routing.
233
234 @node How file-sharing achieves Anonymity
235 @subsubsection How file-sharing achieves Anonymity
236
237 Contrary to other designs, we do not believe that users achieve strong
238 anonymity just because their requests are obfuscated by a couple of
239 indirections. This is not sufficient if the adversary uses traffic analysis.
240 The threat model used for anonymous file sharing in GNUnet assumes that the
241 adversary is quite powerful. In particular, we assume that the adversary can
242 see all the traffic on the Internet. And while we assume that the adversary
243 can not break our encryption, we assume that the adversary has many
244 participating nodes in the network and that it can thus see many of the
245 node-to-node interactions since it controls some of the nodes. 
246
247 The system tries to achieve anonymity based on the idea that users can be
248 anonymous if they can hide their actions in the traffic created by other
249 users.
250 Hiding actions in the traffic of other users requires participating in the
251 traffic, bringing back the traditional technique of using indirection and
252 source rewriting. Source rewriting is required to gain anonymity since
253 otherwise an adversary could tell if a message originated from a host by
254 looking at the source address. If all packets look like they originate from
255 a node, the adversary can not tell which ones originate from that node and
256 which ones were routed. Note that in this mindset, any node can decide to
257 break the source-rewriting paradigm without violating the protocol, as this
258 only reduces the amount of traffic that a node can hide its own traffic in. 
259
260 If we want to hide our actions in the traffic of other nodes, we must make
261 our traffic indistinguishable from the traffic that we route for others. As
262 our queries must have us as the receiver of the reply (otherwise they would
263 be useless), we must put ourselves as the receiver of replies that actually
264 go to other hosts; in other words, we must indirect replies. Unlike other
265 systems, in anonymous file-sharing as implemented on top of GNUnet we do not
266 have to indirect the replies if we don't think we need more traffic to hide
267 our own actions.
268
269 This increases the efficiency of the network as we can indirect less under
270 higher load.
271 @footnote{More details can be found in @uref{https://gnunet.org/gap, this paper}}
272
273 @node Deniability
274 @subsection Deniability
275
276 Even if the user that downloads data and the server that provides data are
277 anonymous, the intermediaries may still be targets. In particular, if the
278 intermediaries can find out which queries or which content they are
279 processing, a strong adversary could try to force them to censor
280 certain materials. 
281
282 With the file-encoding used by GNUnet's anonymous file-sharing, this problem
283 does not arise.  The reason is that queries and replies are transmitted in
284 an encrypted format such that intermediaries cannot tell what the query
285 is for or what the content is about.  Mind that this is not the same
286 encryption as the link-encryption between the nodes.  GNUnet has
287 encryption on the network layer (link encryption, confidentiality,
288 authentication) and again on the application layer (provided
289 by @command{gnunet-publish}, @command{gnunet-download}, @command{gnunet-search}
290 and @command{gnunet-gtk}).
291 @footnote{More details can be found @uref{https://gnunet.org/encoding, here}}
292
293 @node Peer Identities
294 @subsection Peer Identities
295
296 Peer identities are used to identify peers in the network and are unique for
297 each peer.  The identity for a peer is simply its public key, which is
298 generated along with a private key the peer is started for the first time.
299 While the identity is binary data, it is often expressed as ASCII string.
300 For example, the following is a peer identity as you might see it in
301 various places: @code{ UAT1S6PMPITLBKSJ2DGV341JI6KF7B66AC4JVCN9811NNEGQLUN0}
302
303 You can find your peer identity by running @command{gnunet-peerinfo -s}.
304
305 @node Zones in the GNU Name System (GNS Zones)
306 @subsection Zones in the GNU Name System (GNS Zones)
307
308 GNS zones are similar to those of DNS zones, but instead of a hierarchy of
309 authorities to governing their use, GNS zones are controlled by a private key.
310 When you create a record in a DNS zone, that information stored in your
311 nameserver.  Anyone trying to resolve your domain then gets pointed (hopefully)
312 by the centralised authority to your nameserver.  Whereas GNS, being
313 decentralised by design, stores that information in DHT.  The validity of the
314 records is assured cryptographically, by signing them with the private key of
315 the respective zone.
316
317 Anyone trying to resolve records in a zone your domain can then verify the
318 signature on the records they get from the DHT and be assured that they are
319 indeed from the respective zone.  To make this work, there is a 1:1
320 correspondence between zones and their public-private key pairs.  So when we
321 talk about the owner of a GNS zone, that's really the owner of the private
322 key.  And a user accessing a zone needs to somehow specify the corresponding
323 public key first.
324
325 @node Egos
326 @subsection Egos
327
328 Egos are your "identities" in GNUnet.  Any user can assume multiple
329 identities, for example to separate his activities online.  Egos can
330 correspond to pseudonyms or real-world identities.  Technically, an
331 ego is first of all a public-private key pair.
332