Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Hyphanet
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
==Technical design== {{See also|Cryptography}} The Freenet [[file sharing]] network stores documents and allows them to be retrieved later by an associated key, as is now possible with protocols such as [[HyperText Transfer Protocol|HTTP]]. The network is designed to be highly survivable. The system has no central servers and is not subject to the control of any one individual or organization, including the designers of Freenet. The codebase size is over 192,000 [[line of code|lines of code]].<ref>{{cite video|url=https://www.youtube.com/watch?v=HfuZJVpNWR4&feature=youtu.be&list=TLPQMjMwOTIwMjDcsXnGLhV7-Q&t=635| archive-url=https://ghostarchive.org/varchive/youtube/20211211/HfuZJVpNWR4| archive-date=11 December 2021 | url-status=live|title=The dark side of the web -- exploring darknets | publisher=[[TEDx Talks]]|location =[[Schule Schloss Salem|Salem, Baden-Württemberg]]|first=Kyle|last=Terry|author-link=Kyle Terry}}{{cbignore}}</ref> Information stored on Freenet is distributed around the network and stored on several different nodes. Encryption of data and relaying of requests makes it difficult to determine who inserted content into Freenet, who requested that content, or where the content was stored. This protects the anonymity of participants, and also makes it very difficult to censor specific content. Content is stored encrypted, making it difficult for even the operator of a node to determine what is stored on that node. This provides [[plausible deniability]]; which, in combination with request relaying, means that [[Safe harbor (law)|safe harbor]] laws that protect service providers may also protect Freenet node operators. When asked about the topic, Freenet developers defer to the EFF discussion which says that not being able to filter anything is a safe choice.<ref>{{cite web|url=https://emu.freenetproject.org/pipermail/chat/2009-February/001872.html|archive-url=https://web.archive.org/web/20160303232303/https://emu.freenetproject.org/pipermail/chat/2009-February/001872.html|url-status=dead|archive-date=3 March 2016|last=Toseland|first=Matthew |title=Does Freenet qualify for DMCA Safe Harbor? |access-date=27 January 2013}}</ref><ref>{{cite web|url=https://www.eff.org/wp/iaal-what-peer-peer-developers-need-know-about-copyright-law|title=IAAL*: What Peer-to-Peer Developers Need to Know about Copyright Law|access-date=15 September 2015|date=10 January 2006|archive-date=30 November 2015|archive-url=https://web.archive.org/web/20151130021911/https://www.eff.org/wp/iaal-what-peer-peer-developers-need-know-about-copyright-law|url-status=live}}</ref> ===Distributed storage and caching of data=== Like [[Winny]], [[Share (P2P)|Share]] and [[Perfect Dark (P2P)|Perfect Dark]], Freenet not only transmits data between nodes but actually stores them, working as a huge distributed cache. To achieve this, each node allocates some amount of disk space to store data; this is configurable by the node operator, but is typically several GB (or more). Files on Freenet are typically split into multiple small blocks, with duplicate blocks created to provide [[Forward error correction|redundancy]]. Each block is handled independently, meaning that a single file may have parts stored on many different nodes. Information flow in Freenet is different from networks like [[eMule]] or [[BitTorrent (protocol)|BitTorrent]]; in Freenet: # A user wishing to share a file or update a freesite "inserts" the file "to the network" # After "insertion" is finished, the publishing node is free to shut down, because the file is stored in the network. It will remain available for other users whether or not the original publishing node is online. No single node is responsible for the content; instead, it is replicated to many different nodes. Two advantages of this design are high reliability and anonymity. Information remains available even if the publisher node goes offline, and is anonymously spread over many hosting nodes as encrypted blocks, not entire files. The key disadvantage of the storage method is that no one node is responsible for any chunk of data. If a piece of data is not retrieved for some time and a node keeps getting new data, it will drop the old data sometime when its allocated disk space is fully used. In this way Freenet tends to 'forget' data which is not retrieved regularly (see also [[Freenet#Effect|Effect]]). While users can insert data into the network, there is no way to delete data. Due to Freenet's anonymous nature the original publishing node or owner of any piece of data is unknown. The only way data can be removed is if users don't request it. ===Network=== Typically, a host computer on the network runs the software that acts as a node, and it connects to other hosts running that same software to form a large distributed, variable-size network of peer nodes. Some nodes are end user nodes, from which documents are requested and presented to human users. Other nodes serve only to route data. All nodes communicate with each other identically – there are no dedicated "clients" or "servers". It is not possible for a node to rate another node except by its capacity to insert and fetch data associated with a key. This is unlike most other P2P networks where node administrators can employ a ratio system, where users have to share a certain amount of content before they can download. Freenet may also be considered a [[small world network]]. The Freenet protocol is intended to be used on a network of complex topology, such as the Internet ([[Internet Protocol]]). Each node knows only about some number of other nodes that it can reach directly (its conceptual "neighbors"), but any node can be a neighbor to any other; no hierarchy or other structure is intended. Each message is routed through the network by passing from neighbor to neighbor until it reaches its destination. As each node passes a message to a neighbor, it does not know whether the neighbor will forward the message to another node, or is the final destination or original source of the message. This is intended to protect the anonymity of users and publishers. Each node maintains a data store containing documents associated with keys, and a routing table associating nodes with records of their performance in retrieving different keys. ===Protocol=== [[File:Freenet Request Sequence ZP.svg|thumb|A typical request sequence. The request moves through the network from node to node, backing out of a dead-end (step 3) and a loop (step 7) before locating the desired file.]] The Freenet protocol uses a [[key-based routing]] protocol, similar to [[distributed hash table]]s. The routing algorithm changed significantly in version 0.7. Prior to version 0.7, Freenet used a [[heuristic routing]] algorithm where each node had no fixed location, and routing was based on which node had served a key closest to the key being fetched (in version 0.3) or which is estimated to serve it faster (in version 0.5). In either case, new connections were sometimes added to downstream nodes (i.e. the node that answered the request) when requests succeeded, and old nodes were discarded in least recently used order (or something close to it). Oskar Sandberg's research (during the development of version 0.7) shows that this "path folding" is critical, and that a very simple routing algorithm will suffice provided there is path folding. The disadvantage of this is that it is very easy for an attacker to find Freenet nodes, and connect to them, because every node is continually attempting to find new connections. In version 0.7, Freenet supports both "opennet" (similar to the old algorithms, but simpler), and "darknet" (all node connections are set up manually, so only your friends know your node's IP address). Darknet is less convenient, but much more secure against a distant attacker. This change required major changes in the routing algorithm. Every node has a location, which is a number between 0 and 1. When a key is requested, first the node checks the local data store. If it's not found, the key's hash is turned into another number in the same range, and the request is routed to the node whose location is closest to the key. This goes on until some number of hops is exceeded, there are no more nodes to search, or the data is found. If the data is found, it is cached on each node along the path. So there is no one source node for a key, and attempting to find where it is currently stored will result in it being cached more widely. Essentially the same process is used to insert a document into the network: the data is routed according to the key until it runs out of hops, and if no existing document is found with the same key, it is stored on each node. If older data is found, the older data is propagated and returned to the originator, and the insert "collides". But this works only if the locations are clustered in the right way. Freenet assumes that the darknet (a subset of the global social network) is a small-world network, and nodes constantly attempt to swap locations (using the [[Metropolis–Hastings algorithm]]) in order to minimize their distance to their neighbors. If the network actually is a small-world network, Freenet should find data reasonably quickly; ideally on the order of <math>O\big([\log(n)]^2\big)</math> hops in [[big O notation]]. However, it does not guarantee that data will be found at all.<ref name=Clarke2010>{{cite book |last1=Clarke |first1=Ian |title=Private Communication Through a Network of Trusted Connections: The Dark Freenet |date=2010 |url=https://freenetproject.org/papers/freenet-0.7.5-paper.pdf |access-date=15 September 2015 |ref=Clarke2010 |archive-date=1 December 2017 |archive-url=https://web.archive.org/web/20171201033416/https://freenetproject.org/papers/freenet-0.7.5-paper.pdf |url-status=live}}</ref> Eventually, either the document is found or the hop limit is exceeded. The terminal node sends a reply that makes its way back to the originator along the route specified by the intermediate nodes' records of pending requests. The intermediate nodes may choose to cache the document along the way. Besides saving bandwidth, this also makes documents harder to censor as there is no one "source node". ===Effect=== [[File:Freenet datastore specialisation.ani.gif|thumb|450px|right|The effect of the node specialising on the particular location.]] Initially, the locations in darknet are distributed randomly. This means that routing of requests is essentially random. In opennet connections are established by a join request which provides an optimized network structure if the existing network is already optimized.<ref name=Roos2014>{{cite book|last1=Roos|first1=Stefanie|title=Measuring Freenet in the Wild: Censorship-Resilience under Observation|date=2014|publisher=Springer International Publishing|isbn=978-3-319-08505-0|pages=263–282|url=https://freenetproject.org/papers/roos-pets2014.pdf|access-date=15 September 2015|ref=Roos2014|archive-date=16 November 2014|archive-url=https://web.archive.org/web/20141116144052/https://freenetproject.org/papers/roos-pets2014.pdf|url-status=live}}</ref> So the data in a newly started Freenet will be distributed somewhat randomly.<ref>{{Cite web |title=Freenet Project Documentation |url=https://freenetproject.org/ |access-date=2022-04-20 |website=freenetproject.org |language=en |archive-date=16 February 2011 |archive-url=https://web.archive.org/web/20110216062257/http://freenetproject.org/ |url-status=live }}</ref> As location swapping (on darknet) and path folding (on opennet) progress, nodes which are close to one another will increasingly have close locations, and nodes which are far away will have distant locations. Data with similar keys will be stored on the same node.<ref name=Roos2014 /> The result is that the network will self-organize into a distributed, clustered structure where nodes tend to hold data items that are close together in key space. There will probably be multiple such clusters throughout the network, any given document being replicated numerous times, depending on how much it is used. This is a kind of "[[spontaneous symmetry breaking]]", in which an initially symmetric state (all nodes being the same, with random initial keys for each other) leads to a highly asymmetric situation, with nodes coming to specialize in data that has closely related keys.{{citation needed|date=July 2013}} There are forces which tend to cause clustering (shared closeness data spreads throughout the network), and forces that tend to break up clusters (local caching of commonly used data). These forces will be different depending on how often data is used, so that seldom-used data will tend to be on just a few nodes which specialize in providing that data, and frequently used items will be spread widely throughout the network. This automatic mirroring counteracts the times when [[web traffic]] becomes overloaded, and due to a mature network's intelligent routing, a network of size ''n'' should require only log(''n'') time to retrieve a document on average.<ref>{{cite web|url=https://www.networxsecurity.org/members-area/glossary/f/freenet.html|title=FreeNet|website=networxsecurity.org|access-date=25 January 2019|archive-date=26 January 2019|archive-url=https://web.archive.org/web/20190126001007/https://www.networxsecurity.org/members-area/glossary/f/freenet.html|url-status=live}}</ref> ===Keys=== Keys are [[hash function|hashes]]: there is no notion of [[semantic closeness]] when speaking of key closeness. Therefore, there will be no correlation between key closeness and similar popularity of data as there might be if keys did exhibit some semantic meaning, thus avoiding bottlenecks caused by popular subjects. There are two main varieties of keys in use on Freenet, the Content Hash Key (CHK) and the Signed Subspace Key (SSK). A subtype of SSKs is the Updatable Subspace Key (USK) which adds versioning to allow secure updating of content. A CHK is a [[SHA-256]] hash of a document (after encryption, which itself depends on the hash of the plaintext) and thus a node can check that the document returned is correct by hashing it and checking the digest against the key. This key contains the meat of the data on Freenet. It carries all the binary data building blocks for the content to be delivered to the client for reassembly and decryption. The CHK is unique by nature and provides tamperproof content. A hostile node altering the data under a CHK will immediately be detected by the next node or the client. CHKs also reduce the redundancy of data since the same data will have the same CHK and when multiple sites reference the same large files, they can reference to the same CHK.<ref>{{cite web|title=freesitemgr, code for inserting files as CHK, fixed revision|website=[[GitHub]]|url=https://github.com/freenet/lib-pyFreenet/blob/b78aea05222c4afe5145d8b529d2a54d4b93887a/fcp/sitemgr.py#L976|access-date=29 November 2017|archive-date=5 February 2022|archive-url=https://web.archive.org/web/20220205041918/https://github.com/freenet/pyFreenet/blob/b78aea05222c4afe5145d8b529d2a54d4b93887a/fcp/sitemgr.py#L976|url-status=live}}</ref> SSKs are based on public-key cryptography. Currently Freenet uses the [[Digital Signature Algorithm|DSA]] algorithm. Documents inserted under SSKs are signed by the inserter, and this signature can be verified by every node to ensure that the data is not tampered with. SSKs can be used to establish a verifiable [[pseudonymity|pseudonymous]] identity on Freenet, and allow for multiple documents to be inserted securely by a single person. Files inserted with an SSK are effectively [[Immutable object|immutable]], since inserting a second file with the same name can cause collisions. USKs resolve this by adding a version number to the keys which is also used for providing update notification for keys registered as bookmarks in the web interface.<ref>{{cite web|last1=Babenhauserheide|first1=Arne|title=USK and Date-Hints: Finding the newest version of a site in Freenet's immutable datastore|url=http://draketo.de/light/english/freenet/usk-and-date-hints|website=draketo.de|access-date=29 November 2017|archive-date=8 February 2015|archive-url=https://web.archive.org/web/20150208101405/http://draketo.de/light/english/freenet/usk-and-date-hints|url-status=live}}</ref> Another subtype of the SSK is the Keyword Signed Key, or KSK, in which the key pair is generated in a standard way from a simple human-readable string. Inserting a document using a KSK allows the document to be retrieved and decrypted if and only if the requester knows the human-readable string; this allows for more convenient (but less secure) [[Uniform Resource Identifier|URIs]] for users to refer to.<ref>{{cite web|last1=Babenhauserheide|first1=Arne|title=Effortless password protected sharing of files via Freenet|url=http://draketo.de/light/english/freenet/effortless-password-protected-sharing-files|website=draketo.de|access-date=29 November 2017|archive-date=10 September 2015|archive-url=https://web.archive.org/web/20150910030851/http://draketo.de/light/english/freenet/effortless-password-protected-sharing-files|url-status=live}}</ref>
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)