merge of 'bd5318df3b06c5660f68f8e09f2a738644b969b7'

and 'f67888837fadf96a7aa05b169f980444b27f6803'
This commit is contained in:
i2pn00b
2010-08-08 14:51:21 +00:00
4 changed files with 375 additions and 64 deletions

View File

@ -197,18 +197,48 @@ payload :: data
<h2 id="type_Mapping">Mapping</h2>
<h4>Description</h4>
<p>
FIXME
A set of key/value mappings or properties
</p>
<h4>Contents</h4>
<p>
FIXME
A 2-byte size Integer followed by a series of String=String; pairs
</p>
<pre>
{% filter escape %}
FIXME
+----+----+----+----+----+----+----+----+
| size |key string (len + data) | = |
+----+----+----+----+----+----+----+----+
| val string (len + data) | ; | ...
+----+----+----+----+----+----+----+
size :: Integer
length -> 2 bytes
Total number of bytes that follow
key string :: String
A string (one byte length followed by UTF-8 encoded characters)
= :: A single byte containing '='
val string :: String
A string (one byte length followed by UTF-8 encoded characters)
; :: A single byte containing ';'
{% endfilter %}
</pre>
<h4>Notes</h4>
<ul>
<li>
The encoding isn't optimal - we either need the '=' and ';' characters, or the string lengths, but not both
<li>
Some documentation says that the strings may not include '=' or ';' but this encoding supports them
<li>
Strings are defined to be UTF-8 but in the current implementation, I2CP uses UTF-8 but I2NP does not.
For example,
UTF-8 strings in a RouterInfo options mapping in a I2NP Database Store Message will be corrupted.
</ul>
<h4><a href="http://docs.i2p2.de/core/net/i2p/data/DataHelper.html">Javadoc</a></h4>

View File

@ -1,21 +1,161 @@
{% extends "_layout.html" %}
{% block title %}How Does It Work{% endblock %}
{% block title %}Index to Technical Documentation{% endblock %}
{% block content %}
<h1>How does I2P work?</h1>
<p>
Following is an index to the technical documentation for I2P.
This information was updated in August 2010 and is accurate for router version 0.8.
</p><p>
This index is ordered from the highest to lowest layers.
The higher layers are for "clients" or applications;
the lower layers are inside the router itself.
The interface between applications and the router is the I2CP (I2P Control Protocol) API.
</p><p>
The I2P Project is committed to maintaining accurate, current documentation.
If you find any inaccuracies in the documents linked below, please
<a href="http://trac.i2p2.i2p/newticket">enter a ticket identifying the problem</a>.
<h2>Index to Technical Documentation</h2>
<h3>Overview</h3>
<ul class="helplist">
<li><a href="how_intro">Intro</a></li>
<li><a href="how_threatmodel">Threat model</a></li>
<li><a href="how_tunnelrouting">Tunnel routing</a></li>
<li><a href="how_garlicrouting">Garlic routing</a></li>
<li><a href="how_networkdatabase">Network database</a></li>
<li><a href="how_peerselection">Peer selection</a></li>
<li>
<a href="how_cryptography.html">Cryptography</a>&nbsp;&raquo;&nbsp;<a href="how_elgamalaes.html">ElGamal / AES+SessionTag</a>
</li>
<li><a href="how_networkcomparisons">Network comparisons</a></li>
<li><a href="techintro.html">Technical Introduction</a></li>
<li><a href="how_intro.html">A Less-Technical Introduction</a></li>
<li><a href="how_threatmodel.html">Threat model</a></li>
<li><a href="how_networkcomparisons.html">Comparisons to other anonymous networks</a></li>
</ul>
<center><div class="underline"></div>
<font color="#c00"><b>Warning!</b> Some of the documents linked here are out of date and
need to be updated to correctly document the current network operation. If you'd like to help bring them up to date, please see the <a href="getinvolved.html">getting involved</a> page!</font>
</center>
<h3>Application-Layer Topics</h3>
<ul>
<li><a href="naming.html">Naming and Addressbook</a></li>
<li><a href="plugins.html">Plugins Overview</a></li>
<li><a href="plugin_spec.html">Plugin Specification</a></li>
<li>Router software updates</li>
</ul>
<h3>Application Layer API</h3>
High-level, easy-to-use APIs for applications written in any language to send and receive data.
<ul><li>
<a href="applications.html">Application Development Overview and Guide</a>
</li><li>
<a href="i2ptunnel.html">I2PTunnel</a>
</li><li>
<a href="socks.html">SOCKS Proxy</a>
</li><li>
HTTP Proxy
</li><li>
IRC Proxy
</li><li>
<td align="center"><a href="sam.html">SAM</a> API
</li><li>
<a href="samv2.html">SAMv2</a> API
</li><li>
<a href="samv3.html">SAMv3</a> API
</li><li>
SAM Javadoc
</li><li>
BOB API
</li><li>
BOB Javadoc
</li></ul>
<h3>End-to-End Transport API and Protocols</h3>
The end-to-end protocols used by clients for reliable and unreliable commuication.
<ul><li>
<a href="streaming.html">Streaming Library</a>
</li><li>
<a href="http://docs.i2p2.i2p/core/net/i2p/client/streaming/package-summary.html">Streaming Javadoc</a>
</li><li>
<a href="datagrams.html">Datagrams</a>
</li><li>
<a href="http://docs.i2p2.i2p/core/net/i2p/client/datagram/package-summary.html">Datagram Javadoc</a>
</li></ul>
<h3>Client-to-Router Interface API and Protocol</h3>
The lowest-level API used for clients (applications) to send and receive traffic to a router.
Traditionally used only by Java applications and higher-level APIs.
<ul><li>
<a href="i2cp.html">I2CP</a> I2P Control Protocol / API overview
</li><li>
I2CP Specification
</li><li>
<a href="http://docs.i2p2.i2p/core/net/i2p/client/package-summary.html">I2CP API Javadoc</a>
</li><li>
<a href="common_structures_spec.html">Common data structures specification</a>
</li><li>
<a href="http://docs.i2p2.i2p/core/net/i2p/data/package-summary.html">Data Structures Javadoc</a>
</li></ul>
<h3>End-to-End Encryption</h3>
How client messages are end-to-end encrypted by the router.
<ul>
<li><a href="how_elgamalaes">ElGamal/AES+SessionTag</a> encryption</li>
<li><a href="how_cryptography.html">ElGamal and AES cryptography details</a></li>
</ul>
<h3>Network Database</h3>
Distributed storage and retrieval of information about routers and clients.
<ul>
<li><a href="how_networkdatabase.html">Network database overview, details, and threat analysis</a></li>
<li><a href="how_cryptography.html#SHA256">Cryptographic hashes</a></li>
<li><a href="how_cryptography.html#DSA">Cryptographic signatures</a></li>
</ul>
<h3>Router Message Protocol</h3>
I2P is a message-oriented router. The messages sent between routers are defined by the I2NP protocol.
<ul><li>
<a href="i2np.html">I2NP</a> I2P Network Protocol Overview
</li><li>
<a href="i2np_spec.html">I2NP Specification</a>
</li><li>
<a href="http://docs.i2p2.i2p/router/net/i2p/data/i2np/package-summary.html">I2NP Javadoc</a>
</li><li>
<a href="common_structures_spec.html">Common data structures specification</a>
</li><li>
<a href="http://docs.i2p2.i2p/core/net/i2p/data/package-summary.html">Data Structures Javadoc</a>
</li></ul>
<h3>Tunnels</h3>
Selecting peers, requesting tunnels through those peers, and encrypting and routing messages through these tunnels.
<ul>
<li><a href="how_peerselection.html">Peer profiling and selection</a></li>
<li><a href="how_tunnelrouting.html">Tunnel routing</a></li>
<li><a href="how_garlicrouting.html">Garlic routing</a></li>
<li><a href="tunnel-alt.html">Tunnel building and encryption</a></li>
<li><a href="how_elgamalaes.html">ElGamal/AES+SessionTag</a> for build request encryption</li>
<li><a href="how_cryptography.html">ElGamal and AES cryptography details</li>
<li><a href="tunnel-alt-creation.html">Tunnel building specification</a></li>
<li><a href="tunnel_message_spec.html">Low-level tunnel message specification</a></li>
</ul>
<h3>Transport Layer</h3>
The protocols for direct (point-to-point) router to router communication.
<ul><li>
<a href="transports.html">Transport layer overview</a>
</li><li>
<a href="ntcp.html">NTCP</a> TCP-based transport overview
</li><li>
<a href="udp.html">SSU</a> UDP-based transport overview
</li><li>
<a href="udp_spec.html">SSU specification</a>
</li><li>
<li><a href="how_cryptography.html#tcp">NTCP transport encryption</li>
</li><li>
<li><a href="how_cryptography.html#udp">SSU transport encryption</li>
</li><li>
<a href="http://docs.i2p2.i2p/router/net/i2p/router/transport/package-summary.html">Transport Javadoc</a>
</li><li>
<a href="http://docs.i2p2.i2p/router/net/i2p/router/transport/ntcp/package-summary.html">NTCP Javadoc</a>
</li><li>
<a href="http://docs.i2p2.i2p/router/net/i2p/router/transport/udp/package-summary.html">SSU Javadoc</a>
</li></ul>
<h3>Other Router Topics</h3>
<ul><li>
Time synchronization and NTP
</li></ul>
{% endblock %}

View File

@ -13,8 +13,6 @@ 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
contained, instead of just a single message.
<p>
<img src="http://dev.i2p.net/~jrandom/wiki/garlic.png">
<p>
In addition to the cloves, each unwrapped garlic message contains a sender
specified amount of padding data, allowing the sender to take active countermeasures
@ -46,9 +44,10 @@ specified SessionTag plus 256bit AES encryption).
<H2>References</H2>
<p>
The term garlic routing was first coined by Michael Freedman in Roger Dingledine's freehaven
<a href="http://www.freehaven.net/doc/freehaven10.ps">[masters thesis]</a>, which was derived from
<a href="http://onion-router.net/">[Onion Routing]</a>. The main difference with I2P's garlic routing
The term garlic routing was first coined by Michael Freedman in Roger Dingledine's Free Haven
<a href="http://www.freehaven.net/papers.html">Master's thesis</a> (June 2000), which was derived from
<a href="http://onion-router.net/">Onion Routing</a>. 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 %}

View File

@ -248,6 +248,56 @@ total length: 528
</p>
<h3 id="struct_GarlicClove">GarlicClove</h3>
<pre>
{% filter escape %}
unencrypted:
+----+----+----+----+----+----+----+----+
| Delivery Instructions |
~ ~
~ ~
| |
+----+----+----+----+----+----+----+----+
| I2NP Message |
~ ~
~ ~
| |
+----+----+----+----+----+----+----+----+
| Clove ID | Expiration
+----+----+----+----+----+----+----+----+
| Certificate |
+----+----+----+----+----+----+----+
{% endfilter %}
</pre>
<h4>Definition</h4>
<pre>
unencrypted:
Delivery Instructions :: <a href="tunnel_message_spec.html#delivery">as defined here</a>
Length varies but is typically 39, 43, or 47 bytes
I2NP Message :: Any I2NP Message
Clove ID :: 4 byte Integer
Expiration :: Date (8 bytes)
Certificate :: Always NULL in the current implementation (3 bytes total, all zeroes)
</pre>
<h4>Notes</h4>
<ul>
<li>
I2NP messages may not be fragmented across Garlic Cloves (the first bit of the Delivery Instructions flag must be 0)
<li>
See also the <a href="how_garlicrouting.html">garlic routing specification</a>.
<li>
See also <a href="tunnel_message_spec.html#delivery">Delvery Instructions definition</a>
<li>
In the future, the certificate could possibly be used for a HashCash to "pay" for the routing.
</ul>
<h2 id="messages">Messages</h2>
<table border=1>
<tr>
@ -504,6 +554,7 @@ excludedPeers:
{% endfilter %}
</pre>
<h4>Definition</h4>
<pre>
@ -533,6 +584,15 @@ from:
</p>
<h3 id="msg_DeliveryStatus">DeliveryStatus</h3>
<h4>Description</h4>
<p>
A simple message acknowledgement. Generally created by the message originator, and wrapped
in a Garlic Message with the message itself, to be returned by the destination.
</p>
<h4>Contents</h4>
<p>
The ID of the delivered message, and the creation or arrival time.
</p>
<pre>
{% filter escape %}
+----+----+----+----+----+----+----+----+----+----+----+----+
@ -550,24 +610,110 @@ msg-id:
arrival-time:
8 bytes
time the message was successfully delivered
time the message was successfully created or delivered
{% endfilter %}
</pre>
<h3 id="msg_Garlic">Garlic</h3>
<h4>Description</h4>
<p>
Used to wrap multiple encrypted I2NP Messages
</p>
<h4>Contents</h4>
<p>
When decrypted, a series of Garlic Cloves.
</p>
<pre>
{% filter escape %}
encrypted:
+----+----+----+----+----+----+----+----+
|length | tag |
| length | data |
+----+----+----+----+ +
| |
+ +
~ ~
~ ~
| |
+ +
+----+----+----+----+----+----+----+----+
unencrypted data:
+----+----+----+----+----+----+----+----+
|num | clove 1 |
+----+ +
| |
+ +----+----+----+----+
|
~ ~
~ ~
| |
+----+----+----+----+----+----+----+----+
| clove 2 ... |
~ ~
~ ~
| |
+----+----+----+----+----+----+----+----+
| Certificate | Message ID |
+----+----+----+----+----+----+----+----+
Expiration |
+----+----+----+----+----+----+----+
{% endfilter %}
</pre>
<h4>Definition</h4>
<pre>
{% filter escape %}
Encrypted:
length:
4 bytes
number of bytes that follow 0 - 64 KB
data:
$length bytes
elgamal encrypted data
Unencrypted data:
num:
1 byte Integer number of Garlic Cloves to follow
clove: A Garlic Clove
Certificate :: Always NULL in the current implementation (3 bytes total, all zeroes)
Message ID :: 4 byte Integer
Expiration :: Date (8 bytes)
{% endfilter %}
</pre>
<h4>Notes</h4>
<ul>
<li>
When unencrypted, data contains one or more Garlic Cloves.
<li>
Actual max length is less than 64 KB; see the<a href="i2np.html">I2NP Overview</a>.
<li>
See also the <a href="how_elgamalaes.html">ElGamal/AES specification</a>.
<li>
See also the <a href="how_garlicrouting.html">garlic routing specification</a>.
<li>
In the future, the certificate could possibly be used for a HashCash to "pay" for the routing.
</ul>
</p>
<h3 id="msg_TunnelData">TunnelData</h3>
<pre>
{% filter escape %}
+----+----+----+----+----+----+----+----+
| length | data |
+----+----+----+----+ |
| |
~ ~
~ ~
| |
+----+----+----+----+----+----+----+----+
{% endfilter %}
</pre>
@ -575,34 +721,8 @@ encrypted:
<pre>
{% filter escape %}
length:
4 bytes
number of bytes that follow
data:
$length bytes
elgamal en
{% endfilter %}
</pre>
<h3 id="msg_TunnelData">TunnelData</h3>
<pre>
{% filter escape %}
+----+----+----+----+----+----+----+----+
| tunnelId | data |
+----+----+----+----+ |
| |
| |
+----+----+----+----+----+----+----+----+
{% endfilter %}
</pre>
<h4>Definition</h4>
<pre>
{% filter escape %}
tunnelId:
4 bytes
identifies the tunnel this message is directed at
number of bytes that follow 0 - 64 KB - should always be 1024
data:
1024 bytes
@ -610,6 +730,13 @@ data:
{% endfilter %}
</pre>
<h4>Notes</h4>
<ul>
<li>
See also the <a href="tunnel_message_spec.html">Tunnel Message Specification</a>
</ul>
<h3 id="msg_TunnelGateway">TunnelGateway</h3>
<pre>
{% filter escape %}
@ -640,6 +767,15 @@ data:
{% endblock %}
<h3 id="msg_Data">Data</h3>
<h4>Description</h4>
<p>
Used as a wrapper for encrypted Garlic Messages and Garlic Cloves.
Also used previously for network load testing.
</p>
<h4>Contents</h4>
<p>
A length Integer, followed by opaque data.
</p>
<pre>
{% filter escape %}
+----+----+----+----+----+---//--+
@ -683,7 +819,7 @@ data:
<h4>Definition</h4>
<pre>
{% filter escape %}
Just 8 records attached together
Just 8 Build Request Records attached together
Record size: 528 bytes
Total size: 8*528 = 4224 bytes
{% endfilter %}
@ -698,7 +834,7 @@ Total size: 8*528 = 4224 bytes
<h3 id="msg_TunnelBuildReply">TunnelBuildReply</h3>
<pre>
{% filter escape %}
same format as TunnelBuild message
same format as TunnelBuild message, with Build Response Records
{% endfilter %}
</pre>
@ -718,7 +854,7 @@ same format as TunnelBuild message
<h4>Definition</h4>
<pre>
{% filter escape %}
same format as TunnelBuildMessage, except for the addition of an "num" field in front and $num number of records instead of 8
Same format as TunnelBuildMessage, except for the addition of an "num" field in front and $num number of Build Request Records instead of 8
num:
1 byte
@ -730,18 +866,24 @@ Total size: 1 + $num*528
</pre>
<h4>Notes</h4>
<p>
<ul>
<li>
This message was introduced in router version 0.7.12, and may not be sent to tunnel participants earlier than that version.
<li>
See also the <a href="tunnel-alt-creation.html">tunnel creation specification</a>.
</p>
</ul>
<h3 id="msg_VariableTunnelBuildReply">VariableTunnelBuildReply</h3>
<pre>
{% filter escape %}
same format as VariableTunnelBuild message
Same format as VariableTunnelBuild message, with Build Response Records
{% endfilter %}
</pre>
<h4>Notes</h4>
<p>
<ul>
<li>
This message was introduced in router version 0.7.12, and may not be sent to tunnel participants earlier than that version.
<li>
See also the <a href="tunnel-alt-creation.html">tunnel creation specification</a>.
</p>
</ul>