From d2068f3db7ec3e912787e4e9cd57d35c38ad4cb2 Mon Sep 17 00:00:00 2001
From: zzz
- This structure is used in ElGamal encryption, representing only the exponent, not the primes, which are constant and defined in the appropriate spec.
+ This structure is used in ElGamal encryption, representing only the exponent, not the primes, which are constant and defined in
+ the cryptography specification.
@@ -66,7 +67,8 @@ Deprecated - unused
- This structure is used in ElGamal decryption, representing only the exponent, not the primes which are constant and defined in the appropriate spec.
+ This structure is used in ElGamal decryption, representing only the exponent, not the primes which are constant and defined in
+ the cryptography specification.
@@ -150,7 +152,7 @@ Deprecated - unused
- Defines an identifier that is unique within a particular set of routers for a tunnel.
+ Defines an identifier that is unique to each router in a tunnel.
@@ -191,6 +193,19 @@ payload :: data
{% endfilter %}
+
@@ -266,11 +271,12 @@ It may be quite difficult to make any change backward-compatible.
-At the lowest
-level, inter-router communication is protected by the transport layer security.
+At the lowest protocol layer,
+point-to-point inter-router communication is protected by the transport layer security.
Both transports use 256 byte (2048 bit) Diffie-Hellman key exchange
using
-the same shared prime and generator as specified above for ElGamal.
+the same shared prime and generator as specified above for ElGamal,
+followed by symmetric AES encryption as described above.
-As briefly explained on the intro, in addition to sending
-messages through tunnels (via tunnels), I2P uses a technique called
-"garlic routing" - layered encryption of messages, passing through routers
-selected by the original sender. This is similar to the way Mixmaster
+Updated August 2010 for release 0.8
+
+The terms "garlic routing" and "garlic encryption" are often used rather loosely when referring to I2P's technology.
+Here, we explain the history of the terms, the various meanings, and
+the usage of "garlic" methods in I2P.
+
+"Garlic routing" was first coined by
+Michael J. Freedman
+in Roger Dingledine's Free Haven
+Master's thesis Section 8.1.1 (June 2000), as derived from
+Onion Routing.
+
+"Garlic" may have been used originally by I2P developers because I2P implements a form of
+bundling as Freedman describes, or simply to emphasize general differences from Tor.
+The specific reasoning may be lost to history.
+Generally, when referring to I2P, the term "garlic" may mean one of three things:
+PublicKey
Description
Contents
PrivateKey
Description
Contents
TunnelId
Description
Contents
Notes
+
+
+
Javadoc
@@ -456,7 +471,7 @@ end_date :: Date
+----+----+----+----+----+----+----+----+
destination :: Destination
- length -> >= 397 bytes
+ length -> >= 387 bytes
encryption_key :: PublicKey
length -> 256 bytes
@@ -466,6 +481,7 @@ signing_key :: SigningPublicKey
num :: Integer
length -> 1 byte
+ value: 0 <= num <= 6
leases :: [Lease]
length -> >= $num*399 bytes
diff --git a/www.i2p2/pages/how.html b/www.i2p2/pages/how.html
index 790383d7..6251c97b 100644
--- a/www.i2p2/pages/how.html
+++ b/www.i2p2/pages/how.html
@@ -118,10 +118,10 @@ I2P is a message-oriented router. The messages sent between routers are defined
Selecting peers, requesting tunnels through those peers, and encrypting and routing messages through these tunnels.
Developer's Guides
@@ -163,6 +165,10 @@ Time synchronization and NTP
New Translator's Guide
- |_______1_______2_______3_______4_______5_______6_______7_______8
- |nonzero|H(data)
- |
- |
- |
- | | data ... |
+ +----+----+----+----+----+----+----+----+
+ |nonz| H(data) |
+ +----+ +
+ | |
+ + +
+ | |
+ + +
+ | |
+ + +----+----+----+----+----+----+----+
+ | | data...
+ +----+----+----+--//
Transports
NTCP connections
@@ -305,7 +311,7 @@ checking.
See the SSU specification for details.
-References
+References
Garlic Routing and "Garlic" Terminology
+
+Unfortunately, I2P's usage of "garlic" terminology over the past seven years has not always been precise; therefore the reader is
+cautioned when encountering the term.
+Hopefully, the explanation below will make things clear.
+
+Onion routing is a technique for building paths, or tunnels, through a series of peers, +and then using that tunnel. +Messages are repeatedly encrypted by the originator, and then decrypted by each hop. +During the building phase, only the routing instructions for the next hop are exposed to each peer. +During the operating phase, messages are passed through the tunnel, and the +message and its routing instructions are only exposed to the endpoint of the tunnel. +
+This is similar to the way Mixmaster (see network comparisons) sends messages - taking a message, encrypting it to the recipient's public key, taking that encrypted message and encrypting it (along with instructions specifying the next hop), and then taking that resulting encrypted message and so on, until it has one layer of encryption -per hop along the path. The only significant difference between that technique -and I2P's garlic routing is that at each layer, any number of messages can be +per hop along the path. +
+In this sense, "garlic routing" as a general concept is identical to "onion routing". +As implemented in I2P, of course, there are several differences from the implementation in Tor; see below. +Even so, there are substantial similarities such that I2P benefits from a +large amount of academic research on onion routing, +Tor, and similar mixnets. +
+ + ++Michael Freedman defined "garlic routing" as an extension to onion routing, +in which multiple messages are bundled together. +He called each message a "bulb". +All the messages, each with its own delivery instructions, are exposed at the +endpoint. +This allows the efficient bundling of an onion routing "reply block" with the original message. +
+This concept is implemented in I2P, as described below. +Our term for garlic "bulbs" is "cloves". +Any number of messages can be contained, instead of just a single message. +This is a significant distinction from the onion routing implemented in Tor. +However, it is only one of many major architectural differences between I2P and Tor; +perhaps it is not, by itself, enough to justify a change in terminology. + +
+Another difference +from the method described by Freedman with I2P's bundling +is that the path is unidirectional - there is no "turning point" as seen in onion routing +or mixmaster reply blocks, which greatly simplifies the algorithm and allows for more flexible +and reliable delivery. +
+ + +-In addition to the cloves, each unwrapped garlic message contains a sender -specified amount of padding data, allowing the sender to take active countermeasures -against traffic analysis. - -
-I2P uses garlic routing in three places: -
There are also significant ways that this technique can be used to improve the performance of the network, exploiting transport latency/throughput tradeoffs, and branching data through redundant paths to increase reliability. -
-The encryption of each layer in the garlic message uses the ElGamal/AES+SessionTag algorithm, -which avoids the cost of a full 2048bit ElGamal encryption for subsequent messages (using instead a random previously -specified SessionTag plus 256bit AES encryption). +In I2P, tunnels are unidirectional, and we require two tunnels +(one outbound and one inbound) for end-to-end communication in each direction. +Therefore, four tunnels are required for a single round-trip message and reply. +
+Tunnels are built, and then used, with layered encryption. +This is described on the +tunnel implementation page. +Tunnel building details are defined on +this page. +We use +ElGamal/AES+SessionTag for the encryption. +
+Tunnels are a general-purpose mechanism to transport all +I2NP messages, and +Garlic Messages are not used to build tunnels. +We do not bundle multiple +I2NP messages into a single +Garlic Message for unwrapping at the outbound tunnel endpoint; +the tunnel encryption is sufficient. +
+ + ++At the layer above tunnels, I2P delivers end-to-end messages between +Destinations. +Just as within a single tunnel, we use +ElGamal/AES+SessionTag for the encryption. +Each client message as delivered to the router through the +I2CP interface becomes a single +Garlic Clove +with its own +Delilvery Instructions, +inside a +Garlic Message. +Delivery Instructions may specify a Destination, Router, or Tunnel. +
+Generally, a Garlic Message will contain only one clove. +However, the router will periodically bundle two additional +cloves in the Garlic Message: + +
+In the current implementation, the Delivery Status and Database Store Messages +are bundled when the local LeaseSet changes, when additional +Session Tags +are delivered, or if the messages have not been bundled in the previous minute. + +
+Obviously, the additional messages are currently bundled for specific purposes, +and not part of a general-purpose routing scheme. +
+ ++The Garlic Message mechanism is very flexible and provides a structure for +implementing many types of mixnet delivery methods. +Together with the unused delay option in the +tunnel message Delivery Instructions, +a wide spectrum of batching, delay, mixing, and routing strategies are possible. +
+In particular, there is potential for much more flexibility at the outbound tunnel endpoint. +Messages could possibly be routed from there to one of several tunnels +(thus minimizing point-to-point connections), or multicast to several tunnels +for redundancy, or streaming audio and video. +
+Such experiments may conflict with the need to ensure security and anonymity, such +as limiting certain routing paths, restricting the types of I2NP messages that may +be forwarded along various paths, and enforcing certain message expiration times. +
+As a part of +ElGamal/AES encryption, +a garlic message contains a sender +specified amount of padding data, allowing the sender to take active countermeasures +against traffic analysis. +This is not currently used, beyond the requirement to pad to a multiple of 16 bytes. +
+Encryption of additional messages to and from the +floodfill routers. +
+ + +-The term garlic routing was first coined by Michael Freedman in Roger Dingledine's Free Haven -Master's thesis (June 2000), which was derived from -Onion Routing. The main difference -from the method described by Freedman with I2P's garlic routing -is that the path is unidirectional - there is no "turning point" as seen in onion routing -or mixmaster reply blocks, which greatly simplifies the algorithm and allows for more flexible -and reliable delivery.{% endblock %} +{% endblock %} diff --git a/www.i2p2/pages/how_networkdatabase.html b/www.i2p2/pages/how_networkdatabase.html index 034e98dd..71b801d7 100644 --- a/www.i2p2/pages/how_networkdatabase.html +++ b/www.i2p2/pages/how_networkdatabase.html @@ -1,5 +1,5 @@ {% extends "_layout.html" %} -{% block title %}How the Network Database (netDb) Works{% endblock %} +{% block title %}The Network Database{% endblock %} {% block content %}
@@ -411,7 +411,7 @@
- Queries are sent throughmultiple routes simultaneously + Queries are sent through multiple routes simultaneously to reduce the chance of query failure.
@@ -482,7 +482,7 @@Destinations may be hosted on multiple routers simultaneously, by using the same - private and public keys (traditionally named eepPriv.dat files). + private and public keys (traditionally stored in eepPriv.dat files). As both instances will periodically publish their signed LeaseSets to the floodfill peers, the most recently published LeaseSet will be returned to a peer requesting a database lookup. As LeaseSets have (at most) a 10 minute lifetime, should a particular instance go down, @@ -566,7 +566,7 @@ metrics described above, this is a difficult scenario to handle. Tor's response can be much more nimble in the relay case, as the suspicious relays can be manually removed from the consensus. - Some possible responses in the I2P case, none of them satisfactory: + Some possible responses for the I2P network are listed below, however none of them is completely satisfactory:
As a partial defense against this attack, the algorithm used to determine Kademlia "closeness" varies over time. - Rather than using the Hash of the key (i.e. H(k))to determine closeness, + Rather than using the Hash of the key (i.e. H(k)) to determine closeness, we use the Hash of the key appended with the current date string, i.e. H(k + YYYYMMDD). A function called the "routing key generator" does this, which transforms the original key into a "routing key". In other words, the entire netdb keyspace "rotates" every day at UTC midnight. - Any partial-keyspace attack would have to be regenerated every day, as + Any partial-keyspace attack would have to be regenerated every day, for after the rotation, the attacking routers would no longer be close to the target key, or to each other.
diff --git a/www.i2p2/pages/how_peerselection.html b/www.i2p2/pages/how_peerselection.html index 0a5870ce..16968718 100644 --- a/www.i2p2/pages/how_peerselection.html +++ b/www.i2p2/pages/how_peerselection.html @@ -90,7 +90,7 @@ send or receive on a single tunnel through the peer in a minute. For this estim performance in the previous minute. -The capacity calculation simply goes through the profile and estimates how many tunnels the peer diff --git a/www.i2p2/pages/how_tunnelrouting.html b/www.i2p2/pages/how_tunnelrouting.html index f30185d4..fd720203 100644 --- a/www.i2p2/pages/how_tunnelrouting.html +++ b/www.i2p2/pages/how_tunnelrouting.html @@ -1,22 +1,35 @@ {% extends "_layout.html" %} -{% block title %}How Tunnel Routing Works{% endblock %} -{% block content %}Note: these documents have not yet been updated to include the changes made -in I2P 0.5 - the new -tunnel -routing and encryption algorithms, addressing several -issues (with the groundwork for addressing -others). +{% block title %}Tunnel Overview{% endblock %} +{% block content %} +
+Updated August 2010 for release 0.8 +
-As briefly explained in the intro, I2P builds virtual "tunnels" - +
+This page contains an overview of I2P tunnel terminology and operation, with +links to more technical pages, details, and specifications. +
+As briefly explained in the introduction, I2P builds virtual "tunnels" - temporary and unidirectional paths through a sequence of routers. These -tunnels can be categorized as either inbound tunnels (where everything -given to it goes towards the creator of the tunnel) and outbound tunnels +tunnels are classified as either inbound tunnels (where everything +given to it goes towards the creator of the tunnel) or outbound tunnels (where the tunnel creator shoves messages away from them). When Alice wants to send a message to Bob, she will (typically) send it out one of her existing outbound tunnels with instructions for that tunnel's endpoint to forward it to the gateway router for one of Bob's current inbound tunnels, which in turn passes it to Bob.
++A: Outbound Gateway (Alice) +B: Outbound Participant +C: Outbound Endpoint +D: Inbound Gateway +E: Inbound Participant +F: Inbound Endpoint (Bob) ++
Routers performing the three roles (gateway, endpoint, participant) are given -different pieces of data to accomplish their tasks:
+Routers performing the three roles (gateway, participant, endpoint) are given +different pieces of data in the initial +Tunnel Build Message +to accomplish their tasks:
In addition, there are a series of options that the creator of a tunnel sends -when requesting a router to join a tunnel, such as the expiration date. In I2P -3.0, options specifying the pooling, mixing, and chaff generation settings will -be honored, and limits on the quantity and size of messages allowed during the -tunnel's lifetime will be implemented earlier (e.g. no more than 300 messages or -1MB per minute).
++Details are in the +tunnel creation specification. +
-+Several tunnels for a particular purpose may be grouped into a "tunnel pool", +as described in the +tunnel specification. +This provides redundancy and additional bandwidth. +The pools used by the router itself are called "exploratory tunnels". +The pools used by applications are called "client tunnels". +
+ + + +As mentioned above, each client requests that their router provide tunnels to -include at least a certain number of hops (plus other criteria that aren't -honored yet, such as bandwidth limits, etc). The decision as to how many routers +include at least a certain number of hops. +The decision as to how many routers to have in one's outbound and inbound tunnels has an important effect upon the latency, throughput, reliability, and anonymity provided by I2P - the more peers that messages have to go through, the longer it takes to get there and the more likely that one of those routers will fail prematurely. The less routers in a tunnel, the easier it is for an adversary to mount traffic analysis attacks and -pierce someone's anonymity.
+pierce someone's anonymity. +Tunnel lengths are specified by clients via +I2CP options. +The maximum number of hops in a tunnel is 7. + +With no remote routers in a tunnel, the user has very basic plausible @@ -121,54 +162,92 @@ if the adversary ran a sufficient number of routers such that the single remote router in the tunnel is often one of those compromised ones, they would be able to mount the above statistical traffic analysis attack.
-With two or more remote routers in a tunnel, the costs of mounting the traffic -analysis attack increases, since all remote routers would have to be compromised +analysis attack increases, since many remote routers would have to be compromised to mount it.
-The router will by default use 2-hop tunnels, at least in the main -distribution. Prior to the 0.2.5 release, all tunnels were 1-hop by default.
+The router uses 2-hop tunnels by default for its exploratory tunnels. +Client tunnel defaults are set by the application, using +I2CP options. +Most applications use 2 or 3 hops as their default. +
+ -[explain tunnel pools, how we keep a free inbound pool, an outbound pool, and -a client inbound pool, and how the pools are refreshed every minute or so, using -the router's default settings]
All tunnels are periodically tested by their creator by sending a -DeliveryStatusMessage out the tunnel and bound for another inbound tunnel -(testing both tunnels at once). If either fails, both are marked as no longer -functional, and if they were used for a client's inbound tunnel, a new leaseSet -is created. Other techniques can be used to test tunnels later on, such as -garlic wrapping a number of tests into cloves, testing individual tunnel -participants separately (and using the tunnel configuration key to update the -next hop to work around failures), etc, but that is not implemented at the -moment. +DeliveryStatusMessage out an outbound tunnel and bound for another inbound tunnel +(testing both tunnels at once). If either fails a number of consecutive tests, it is marked as no longer +functional. If it was used for a client's inbound tunnel, a new leaseSet +is created. +Tunnel test failures are also reflected in the +capacity rating in the peer profile.
+Tunnel creation is handled by garlic routing -a TunnelCreateMessage to a router, requesting that they participate in the +a Tunnel Build Message to a router, requesting that they participate in the tunnel (providing them with all of the appropriate information, as above, along with a certificate, which right now is a 'null' cert, but will support hashcash -or other non-free certificates when necessary). The message also includes a -SourceRouteReplyBlock, which allows the router to encrypt their -TunnelCreateStatusMessage into a SourceRouteReplyMessage, which is sent to -another router (specified in the SourceRouteReplyBlock), who then decrypts the -rest of the SourceRouteReplyBlock, reads out the delivery instructions contained -therein, and forwards the TunnelCreateStatusMessage accordingly. (the delivery -instructions can specify delivery to a specific router or can point at a tunnel) +or other non-free certificates when necessary). +That router forwards the message to the next hop in the tunnel. +Details are in the +tunnel creation specification.
-Multi-layer encryption is handled by garlic encryption +of tunnel messages. +Details are in the +tunnel specification. +The IV of each hop is encrypted with a separate key as explained there. +
+ + ++An overview of I2P terminology is +on the tunnel overview page. +
+Tunnel operation has four distinct processes, taken on by various @@ -72,7 +77,7 @@ peers, each hop's tunnel ID will change.
A tunnel gateway's function is to fragment and pack I2NP messages into fixed-size -tunnel messages +tunnel messages and encrypt the tunnel messages. Tunnel messages contain the following: @@ -87,7 +92,7 @@ Tunnel messages contain the following:
Details are in the -tunnel message specification. +tunnel message specification. @@ -286,9 +291,9 @@ lengths should be randomized, as well as any of the other settings allowed when configuring individual tunnels. Configuration options are specified on the I2CP page. -