{% extends "_layout.html" %} {% block title %}Naming, Addressbook, and SusiDNS{% endblock %} {% block content %}
Naming within I2P has been an oft-debated topic since the very beginning with advocates across the spectrum of possibilities. However, given I2P's inherent demand for secure communication and decentralized operation, the traditional DNS-style naming system is clearly out, as are "majority rules" voting systems. Instead, I2P ships with a generic naming library and a base implementation designed to work off a local name to destination mapping, as well as an optional add-on application called the "addressbook". The addressbook is a web-of-trust driven secure, distributed, and human readable naming system, sacrificing only the call for all human readable names to be globally unique by mandating only local uniqueness. While all messages in I2P are cryptographically addressed by their destination, different people can have local addressbook entries for "Alice" which refer to different destinations. People can still discover new names by importing published addressbooks of peers specified in their web of trust, by adding in the entries provided through a third party, or (if some people organize a series of published addressbooks using a first come first serve registration system) people can choose to treat these addressbooks as name servers, emulating traditional DNS.
I2P does not promote the use of DNS-like services though, as the damage done by hijacking a site can be tremendous - and insecure destinations have no value. DNSsec itself still falls back on registrars and certificate authorities, while with I2P, requests sent to a destination cannot be intercepted or the reply spoofed, as they are encrypted to the destination's public keys, and a destination itself is just a pair of public keys and a certificate. DNS-style systems on the other hand allow any of the name servers on the lookup path to mount simple denial of service and spoofing attacks. Adding on a certificate authenticating the responses as signed by some centralized certificate authority would address many of the hostile nameserver issues but would leave open replay attacks as well as hostile certificate authority attacks.
Voting style naming is dangerous as well, especially given the effectiveness of Sybil attacks in anonymous systems - the attacker can simply create an arbitrarily high number of peers and "vote" with each to take over a given name. Proof-of-work methods can be used to make identity non-free, but as the network grows the load required to contact everyone to conduct online voting is implausible, or if the full network is not queried, different sets of answers may be reachable.
As with the Internet however, I2P is keeping the design and operation of a naming system out of the (IP-like) communication layer. The bundled naming library includes a simple service provider interface which alternate naming systems can plug into, allowing end users to drive what sort of naming tradeoffs they prefer.
Here is the often-referenced October 2004 forum post by duck on the subject but it is dated and somewhat confusing.
There is no central naming authority in I2P. All hostnames are local.
The naming system is quite simple and most of it is implemented in applications external to the router, but bundled with the I2P distribution. The components are:
All destinations in I2P are 516-byte keys. (To be more precise, it is a 256-byte public key plus a 128-byte signing key plus a null certificate, which in Base64 representation is 516 bytes. Certificates are not used now, if they are, the keys will be longer. One possible use of certificates is for proof of work.)
If an application (i2ptunnel or the HTTP proxy) wishes to access a destination by name, the router does a very simple local lookup to resolve that name. The router does a linear search through three local files, in order, to look up host names and convert them to a 516-byte destination key:
Lookups are not cached as the files are local anyway. There is no facility for real-time lookups (a la DNS) over the network within the router.
If the router fails to resolve the hostname, the HTTP proxy returns an error page to the user with links to several "jump" services. See below for details.
The addressbook application periodically retrieves other users' hosts.txt files and merges them with the local hosts.txt, after several checks.
Subscribing to another user's hosts.txt file involves giving them a certain amount of trust. You do not want them, for example, 'hijacking' a new site by quickly entering in their own key for a new site before passing the new host/key entry to you.
For this reason, the only subscription configured by default is http://www.i2p2.i2p/hosts.txt, which contains a copy of the hosts.txt included in the I2P release. Users must configure additional subscriptions in their local addressbook application (via subscriptions.txt or SusiDNS).
While there are hopefully not any technical limitations within I2P on host names, as of release 0.6.1.31, the addressbook enforces several restrictions on host names imported from subscriptions. It does this for basic typographical sanity and compatibility with browsers, and for security. The rules are essentially the same as those in RFC2396 Section 3.2.2. Any hostnames violating these rules may not be propagated widely to routers running release 0.6.1.31 or later.
Naming rules:
Any name received via subscription that passes all the checks is added to the local hosts.txt.
Possible future restrictions to be implemented:
Note that the '.' symbols in a host name are of no significance, and do not denote any actual naming or trust hierarchy. If the name 'host.i2p' already exists, there is nothing to prevent anybody from adding a name 'a.host.i2p' to their hosts.txt, and this name can be imported by others' addressbook. Methods to deny subdomains to non-domain 'owners' (certificates?), and the desirability and feasibility of these methods, are topics for future discussion.
International Domain Names (IDN) should work in i2p (using 'xn--'), but have not been fully tested. To see IDN .i2p domain names rendered correctly in firefox's location bar, add 'network.IDN.whitelist.i2p (boolean) = true' in about:config.
As the addressbook application does not use privatehosts.txt at all, in practice this file is the only place where it is appropriate to place private aliases or "pet names" for sites already in hosts.txt.
Addressbook will publish the merged hosts.txt to a location (traditionally hosts.txt in the local eepsite's home directory) to be accessed by others for their subscriptions. This step is optional and is disabled by default.
As of release 0.6.1.30, the addressbook application, together with eepget, saves the Etag and/or Last-Modified information returned by the web server of the subscription. This greatly reduces the bandwidth required, as the web server will return a '304 Not Modified' on the next fetch if nothing has changed.
However the entire hosts.txt is downloaded if it has changed. See below for discussion on this issue.
A jump service is a simple cgi application that takes a hostname as a parameter and returns a 301 redirect to the proper URL with a ?i2paddresshelper=key string appended. The HTTP proxy will interpret the appended string and use that key as the actual destination. In addition, the proxy will cache that key so it is no longer necessary during that session.
A jump service is a simple cgi application that takes a hostname as a parameter and returns a 301 redirect to the proper URL with a ?i2paddresshelper=key string appended. The HTTP proxy will interpret the appended string and use that key as the actual destination. In addition, the proxy will cache that key so it is no longer necessary during that session.
Note that, like with subscriptions, using a jump service implies a certain amount of trust, as a jump service could maliciously redirect a user to an incorrect destination.
To provide the best service, a jump service should be subscribed to several hosts.txt providers so that its local host list is current.
While the naming system within I2P is often called "SusiDNS", SusiDNS is simply a web interface front-end to configuring addressbook subscriptions and accessing the four addressbook files. All the real work is done by the 'addressbook' application.
Currently, there is no enforcement of addressbook naming rules within SusiDNS, so you can enter hostnames locally that would be rejected by your own or others' addressbook subscriptions.
Q: What to do if some hosts do not agree on one address and if some addresses are working, others are not? Who is the right source of a name?
A: You don't. This is actually a critical difference between names on I2P and how DNS works - names in I2P are human readable, secure, but not globally unique. This is by design, and an inherent part of our need for security.
If I could somehow convince you to change the destination associated with some name, I'd successfully "take over" the site, and under no circumstances is that acceptable. Instead, what we do is make names locally unique: they are what you use to call a site, just as how you can call things whatever you want when you add them to your browser's bookmarks, or your IM client's buddy list. Who you call "Boss" may be who someone else calls "Sally".
Names will not, ever, be securely human readable and globally unique.
True, but this isn't a lot of traffic in the context of i2p, which is itself wildly inefficient (floodfill databases, huge encryption overhead and padding, garlic routing, etc.). If you downloaded a hosts.txt file from someone every 12 hours it averages out to about 10 bytes/sec.
As is usually the case in i2p, there is a fundamental tradeoff here between anonymity and efficiency. Some would say that using the etag and last-modified headers is hazardous because it exposes when you last requested the data. Others have suggested asking for specific keys only (similar to what jump services do, but in a more automated fashion), possibly at a further cost in anonymity.
Possible improvements would be a replacement or supplement to addressbook (see i2host.i2p), or something simple like subscribing to http://example.i2p/cgi-bin/recenthosts.cgi rather than http://example.i2p/hosts.txt. If a hypothetical recenthosts.cgi distributed all hosts from the last 24 hours, for example, that could be both more efficient and more anonymous than the current hosts.txt with last-modified and etag.
A sample implementation is on stats.i2p at http://stats.i2p/cgi-bin/newhosts.txt. This script returns an Etag with a timestamp. When a request comes in with the If-None-Match etag, the script ONLY returns new hosts since that timestamp, or 304 Not Modified if there are none. In this way, the script efficiently returns only the hosts the subscriber does not know about, in an addressbook-compatible manner.
So the inefficiency is not a big issue and there are several ways to improve things without radical change.
As far as network traffic see above. But unless you're going to do a slow real-time query over the network for a key, you need to have the whole set of keys stored locally, at a cost of about 500 bytes per key.
This is very much intentional. jrandom wants a user to "trust" a hosts.txt provider, and as he likes to say, "trust is not a boolean". The configuration step attempts to force users to think about issues of trust in an anonymous network.
As another example, the "Eepsite Unknown" error page in the HTTP Proxy lists some jump services, but doesn't "recommend" any one in particular, and it's up to the user to pick one (or not). jrandom would say we trust the listed providers enough to list them but not enough to automatically go fetch the key from them.
How successful this is, I'm not sure. But there must be some sort of hierarchy of trust for the naming system. To treat everyone equally may increase the risk of hijacking.
Also, DNS is based on lookups with limited caching and time-to-live, while i2p keys are permanent.
Sure, we could make it work, but why? It's a bad fit.
Yes it depends on a few servers that you have configured. Within i2p, servers and services come and go. Any other centralized system (for example DNS root servers) would have the same problem. A completely decentralized system (everybody is authoritative) is possible by implementing an "everybody is a root DNS server" solution, or by something even simpler, like a script that adds everybody in your hosts.txt to your addressbook.
People advocating all-authoritative solutions generally haven't thought through the issues of conflicts and hijacking, however.
See the reliability and trust sections.
The current naming system can be changed with the advanced config option 'i2p.naming.impl' (restart required). See core/java/src/net/i2p/client/naming for details.
Any new system should be stacked with HostsTxt, or should implement local storage and/or the addressbook subscription functions, since addressbook only knows about the hosts.txt files and format.
{% endblock %}