diff --git a/i2p2www/pages/site/docs/api/bob.html b/i2p2www/pages/site/docs/api/bob.html index ef058796..f0cbf0bd 100644 --- a/i2p2www/pages/site/docs/api/bob.html +++ b/i2p2www/pages/site/docs/api/bob.html @@ -1,48 +1,77 @@ {% extends "global/layout.html" %} {% block title %}BOB{% endblock %} +{% block lastupdated %}{% trans %}August 2010{% endtrans %}{% endblock %} {% block content %} -
-Technical differences from SAM (for the better?) ++{%- endtrans %} {% endblock %} diff --git a/i2p2www/pages/site/docs/api/i2pcontrol.html b/i2p2www/pages/site/docs/api/i2pcontrol.html index 4053babc..c5052edf 100644 --- a/i2p2www/pages/site/docs/api/i2pcontrol.html +++ b/i2p2www/pages/site/docs/api/i2pcontrol.html @@ -1,86 +1,87 @@ {% extends "global/layout.html" %} {% block title %}I2PControl API{% endblock %} {% block content %} -{% trans %}BOB - Basic Open Bridge{% endtrans %}
+{% trans %}Technical differences from SAM (for the better?){% endtrans %}
+{% trans -%} BOB has separate command and data channels. One, an application command channel socket to router to configure. Two, the application data sockets to/from router that carry only data. The command channel is only needed for making or setting the initial destination key, and to set the destination key to port bindings. All connections run in parallel. +{%- endtrans %}
-SAM One connection that does everything, and you need to parse every packet. +{% trans -%} +SAM has one connection that does everything, and you need to parse every packet. +{%- endtrans %}
+{% trans -%} BOB does not hold keypair values, nor does the router. Your application holds the keypair values. This is to reduce any extra complexity in the router code, it also adds to your privacy. +{%- endtrans %}
+{% trans -%} SAM router stores every keypair you ever make. +{%- endtrans %}
+{% trans -%} Those are the important differences. +{%- endtrans %}
-KEYS = keypair public+private, these are BASE64 -KEY = public key, also BASE64 +{% trans -%} +
+KEYS
= keypair public+private, these are BASE64 +{%- endtrans %}{% trans -%} +
+KEY
= public key, also BASE64 +{%- endtrans %}{% trans -%} +
+ERROR
as is implied returns the message"ERROR "+DESCRIPTION+"\n"
, where theDESCRIPTION
is what went wrong. +{%- endtrans %}{% trans -%} +
+OK
returns"OK"
, and if data is to be returned, it is on the same line.OK
means the command is finished. +{%- endtrans %}{% trans -%} +
-ERROR as is implied returns the message "ERROR "+DESCRIPTION+"\n", where the DESCRIPTION is what went wrong. -OK returns "OK", and if data is to be returned, it is on the same line. OK means the command is finished. -DATA lines contain information that you requested. There may be multiple DATA lines per request. - -NOTE: The help command is the ONLY command that has an exception to +DATA
lines contain information that you requested. There may be multipleDATA
lines per request. +{%- endtrans %}{% trans -%} +NOTE: The help command is the ONLY command that has an exception to the rules... it can actually return nothing! This is intentional, since help is a HUMAN and not an APPLICATION command. +{%- endtrans %}
-PLEASE NOTE: +{% trans -%} +PLEASE NOTE: For CURRENT details on the commands PLEASE use the built-in help command. Just telnet to localhost 2827 and type help and you can get full documentation on each command. +{%- endtrans %}
+{% trans -%} Commands never get obsoleted or changed, however new commands do get added from time to time. +{%- endtrans %}
-Here are the commands we have as of this writing (Aug 2010). +{% trans -%} +Here are the commands we have as of this writing: +{%- endtrans %}
-COMMAND OPERAND RETURNS ++{{ _('COMMAND') }} {{ _('OPERAND') }} {{ _('RETURNS') }} help (optional command to get help on) NOTHING or OK and description of the command clear ERROR or OK getdest ERROR or OK and KEY @@ -67,12 +96,16 @@ stop ERROR or OK verify KEY ERROR or OK visit OK, and dumps BOB's threads to the wrapper.log zap nothing, quits BOB ++{% trans -%} Once set up, all TCP sockets can and will block as needed, and there is no need for any additional messages to/from the command channel. This allows the router to pace the stream without exploding with OOM like SAM does as it chokes on attempting to shove many streams in or out one socket -- that can't scale when you have alot of connections! +{%- endtrans %}
+{% trans -%} What is also nice about this particular interface is that writing anything to interface to it, is much much easier than SAM. There is no other processing to do after the set up. It's configuration is so simple, that very simple tools, such as nc (netcat) can be used @@ -82,39 +115,53 @@ to stop that application. Instead, you can literally "unplug" the destination, a "plug it in" again. As long as the same IP/port addresses and destination keys are used when bringing the bridge up, the normal TCP application won't care, and won't notice. It will simply be fooled -- the destinations are not reachable, and that nothing is coming in. +{%- endtrans %}
+{% trans -%} For the following example, we'll setup a very simple local loopback connection, with two destinations. Destination "mouth" will be the CHARGEN service from the INET superserver daemon. Destination "ear" will be a local port that you can telnet into, and watch the pretty ASCII test puke forth. +{%- endtrans %}
-EXAMPLE SESSION DIALOGUE -- simple telnet 127.0.0.1 2827 works -A = Application -C = BOB's Command response. ++{% trans %}EXAMPLE SESSION DIALOGUE -- simple telnet 127.0.0.1 2827 works{% endtrans %} +A = {{ _('Application') }} +C = {% trans %}BOB's Command response.{% endtrans %} -FROM TO DIALOGUE +{{ _('FROM') }} {{ _('TO') }} {{ _('DIALOGUE') }} A C setnick mouth C A OK Nickname set to mouth A C newkeys C A OK ZMPz1zinTdy3~zGD~f3g9aikZTipujEvvXOEyYfq4Su-mNKerqG710hFbkR6P-xkouVyNQsqWLI8c6ngnkSwGdUfM7hGccqBYDjIubTrlr~0g2-l0vM7Y8nSqtFrSdMw~pyufXZ0Ys3NqUSb8NuZXpiH2lCCkFG21QPRVfKBGwvvyDVU~hPVfBHuR8vkd5x0teMXGGmiTzdB96DuNRWayM0y8vkP-1KJiPFxKjOXULjuXhLmINIOYn39bQprq~dAtNALoBgd-waZedYgFLvwHDCc9Gui8Cpp41EihlYGNW0cu0vhNFUN79N4DEpO7AtJyrSu5ZjFTAGjLw~lOvhyO2NwQ4RiC4UCKSuM70Fz0BFKTJquIjUNkQ8pBPBYvJRRlRG9HjAcSqAMckC3pvKKlcTJJBAE8GqexV7rdCCIsnasJXle-6DoWrDkY1s1KNbEVH6i1iUEtmFr2IHTpPeFCyWfZ581CAFNRbbUs-MmnZu1tXAYF7I2-oXTH2hXoxCGAAAA ++{% trans -%} MAKE NOTE OF THE ABOVE DESTINATION KEY, YOURS WILL BE DIFFERENT! +{%- endtrans %}
-FROM TO DIALOGUE ++{{ _('FROM') }} {{ _('TO') }} {{ _('DIALOGUE') }} A C outhost 127.0.0.1 C A OK outhost set A C outport 19 C A OK outbound port set A C start C A OK tunnel starting ++{% trans -%} At this point, there was no error, a destination with a nickname of "mouth" is set up. When you contact the destination provided, you actually connect -to the CHARGEN service on 19/TCP. +to the
+CHARGEN
service on19/TCP
. +{%- endtrans %}{% trans -%} Now for the other half, so that we can actually contact this destination. +{%- endtrans %}
-FROM TO DIALOGUE ++{{ _('FROM') }} {{ _('TO') }} {{ _('DIALOGUE') }} A C setnick ear C A OK Nickname set to ear A C newkeys @@ -127,14 +174,20 @@ A C start C A OK tunnel starting A C quit C A OK Bye! ++{% trans -%} Now all we need to do is telnet into 127.0.0.1, port 37337, send the destination key or host address from addressbook we want to contact. In this case, we want to contact "mouth", all we do is paste in the key and it goes. +{%- endtrans %}
-NOTE: The "quit" command in the command channel does NOT disconnect the tunnels like SAM. +{% trans -%} +NOTE: The "quit" command in the command channel does NOT disconnect the tunnels like SAM. +{%- endtrans %}
+# telnet 127.0.0.1 37337 Trying 127.0.0.1... Connected to 127.0.0.1. @@ -146,20 +199,32 @@ ZMPz1zinTdy3~zGD~f3g9aikZTipujEvvXOEyYfq4Su-mNKerqG710hFbkR6P-xkouVyNQsqWLI8c6ng #$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghij $%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijk ... -After a few virtual miles of this spew, press Control-] ++{% trans -%} +After a few virtual miles of this spew, press
+Control-]
+{%- endtrans %}... cdefghijklmnopqrstuvwxyz{|}~ !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJK defghijklmnopqrstuvwxyz{|}~ !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKL efghijklmnopqrstuvwxyz{|}~ !"#$%&'()*+,-./0123456789:;<= telnet> c Connection closed. ++{% trans -%} Here is what happened... +{%- endtrans %}
+telnet -> ear -> i2p -> mouth -> chargen -. telnet <- ear <- i2p <- mouth <-----------' ++{% trans -%} You can connect to EEPSITES too! +{%- endtrans %}
+# telnet 127.0.0.1 37337 Trying 127.0.0.1... Connected to 127.0.0.1. @@ -186,36 +251,52 @@ Accept-Ranges: bytes </html> Connection closed by foreign host. # ++{% trans -%} Pretty cool isn't it? Try some other well known EEPSITES if you like, nonexistent ones, etc, to get a feel for what kind of output to expect in different situations. For the most part, it is suggested that you ignore any of the error messages. They would be meaningless to the application, and are only presented for human debugging. +{%- endtrans %}
+{% trans -%} Let's put down our destinations now that we are all done with them. +{%- endtrans %}
+{% trans -%} First, lets see what destination nicknames we have. +{%- endtrans %}
-FROM TO DIALOGUE ++{{ _('FROM') }} {{ _('TO') }} {{ _('DIALOGUE') }} A C list C A DATA NICKNAME: mouth STARTING: false RUNNING: true STOPPING: false KEYS: true QUIET: false INPORT: not_set INHOST: localhost OUTPORT: 19 OUTHOST: 127.0.0.1 C A DATA NICKNAME: ear STARTING: false RUNNING: true STOPPING: false KEYS: true QUIET: false INPORT: 37337 INHOST: 127.0.0.1 OUTPORT: not_set OUTHOST: localhost C A OK Listing done ++{% trans -%} Alright, there they are. First, let's remove "mouth". +{%- endtrans %}
-FROM TO DIALOGUE ++{{ _('FROM') }} {{ _('TO') }} {{ _('DIALOGUE') }} A C getnick mouth C A OK Nickname set to mouth A C stop C A OK tunnel stopping A C clear C A OK cleared ++{% trans -%} Now to remove "ear", note that this is what happens when you type too fast, and shows you what typical ERROR messages looks like. +{%- endtrans %}
-FROM TO DIALOGUE ++{{ _('FROM') }} {{ _('TO') }} {{ _('DIALOGUE') }} A C getnick ear C A OK Nickname set to ear A C stop @@ -226,20 +307,31 @@ A C clear C A OK cleared A C quit C A OK Bye! ++{% trans -%} I won't bother to show an example of the receiver end of a bridge because it is very simple. There are two possible settings for it, and it is toggled with the "quiet" command. +{%- endtrans %}
+ +{% trans -%} The default is NOT quiet, and the first data to come into your listening socket is the destination that is making the contact. It is a single line consisting of the BASE64 address followed by a newline. Everything after that is for the application to actually consume. +{%- endtrans %}
+ +{% trans -%} In quiet mode, think of it as a regular Internet connection. No extra data comes in at all. It's just as if you are plain connected to the regular Internet. This mode allows a form of transparency much like is available on the router console tunnel settings pages, so that you can use BOB to point a destination at a web server, for example, and you would not have to modify the web server at all. +{%- endtrans %}
+ +{% trans -%} The advantage with using BOB for this is as discussed previously. You could schedule random uptimes for the application, redirect to a different machine, etc. One use of this may be something @@ -251,5 +343,5 @@ have to bother shutting it down and restarting it. You could redirect and point to a different machine on your LAN while you do updates, or point to a set of backup machines depending on what is running, etc, etc. Only your imagination limits what you could do with BOB. -
I2P enables a JSONRPC2 interface via the plugin I2PControl. +
{% trans itoopie='http://itoopie.net/' -%} +I2P enables a JSONRPC2 interface via the plugin I2PControl. The aim of the interface is to provide simple way to interface with a running I2P node. A client, itoopie, has been developed in parallel. The JSONRPC2 implementation for the client as well as the plugin is provided by the java libraries JSON-RPC 2.0. A list of implementations of JSON-RPC for various languages can be found at the JSON-RPC wiki. -
-I2PControl is by default listening on localhost:7650
+{%- endtrans %} -+
{% trans %}I2PControl is by default listening on localhost:7650{% endtrans %}
+ +{% trans -%} Parameters are only provided in a named way (maps). +{%- endtrans %}
--Request: +{{ _('Request:') }} {"id":"id", "method":"Method-name","params":{"Param-key-1":"param-value-1", "Param-key-2":"param-value-2", "Token":"**actual token**"}, "jsonrpc":"2.0"} -Response: +{{ _('Response:') }} {"id":"id","result":{"Result-key-1":"result-value-1","Result-key-2":"result-value-2"},"jsonrpc":"2.0"} -
* denotes an optional value.
-** denotes a possibly occuring return value
+* {% trans %}denotes an optional value.{% endtrans %}
+** {% trans %}denotes a possibly occuring return value{% endtrans %}
-+
{% trans naming=site_url('docs/naming') -%} I2PTunnel is a tool for interfacing with and providing services on I2P. -Destination of an I2PTunnel can be defined using a hostname, -Base32, or a full 516-byte destination key. +Destination of an I2PTunnel can be defined using a hostname, +Base32, or a full 516-byte destination key. An established I2PTunnel will be available on your client machine as localhost:port. If you wish to provide a service on I2P network, you simply create I2PTunnel to the appropriate ip_address:port. A corresponding 516-byte destination key will be generated for the service and it will become avaliable throughout I2P. A web interface for I2PTunnel management is avaliable on localhost:7657/i2ptunnel/. -
+{%- endtrans %} -{% trans -%} Opens a local TCP port that connects to a service (like HTTP, FTP or SMTP) on a destination inside of I2P. The tunnel is directed to a random host from the comma seperated (", ") list of destinations. +{%- endtrans %}
-A HTTP-client tunnel. The tunnel connects to the destination specified by the URL - in a HTTP request. Supports proxying onto internet if an outproxy is provided. Strips HTTP connections of the following headers: -
+{% trans -%} +A HTTP-client tunnel. The tunnel connects to the destination specified by the URL +in a HTTP request. Supports proxying onto internet if an outproxy is provided. Strips HTTP connections of the following headers: +{%- endtrans %}
+
{% trans -%} HTTP client/server tunnels are via I2Ptunnel force-enabling compression via the following http headers: +{%- endtrans %}
+
{% trans -%} Depending on if the tunnel is using an outproxy or not it will append the following User-Agent: -
+{%- endtrans %}{% trans -%}
Creates a connection to a random IRC server specified by the comma seprated (", ")
list of destinations. Only a whitelisted subset of IRC commands are allowed due to anonymity concerns.
-
Whitelist:
+{%- endtrans %}
+
{% trans %}Whitelist:{% endtrans %}
{% trans -%} Enables using the I2P router as a SOCKS proxy. +{%- endtrans %}
{% trans -%} Enables using the I2P router as a SOCKS proxy with the command whitelist specified by - IRC client mode. +IRC client mode. +{%- endtrans %}
{% trans -%} Creates a HTTP tunnel and uses the HTTP request method "CONNECT" to build a TCP tunnel that usually is used for SSL and HTTPS. +{%- endtrans %}
{% trans -%}
Creates a UDP-server attached to a Streamr client I2PTunnel. The streamr client tunnel will
subscribe to a streamr server tunnel.
-
-
+{%- endtrans %}
{% trans -%} Creates a destination to a local ip:port with an open TCP port. +{%- endtrans %}
{% trans -%} Creates a destination to a local HTTP server ip:port. Supports gzip for requests with Accept-encoding: x-i2p-gzip, replies with Content-encoding: x-i2p-gzip in such a request. +{%- endtrans %}
{% trans -%} Functions as both a I2PTunnel HTTP Server, and a I2PTunnel HTTP client with no outproxying - capabilities. An example application would be a web application that does client-type - requests, or loopback-testing an eepsite as a diagnostic tool. +capabilities. An example application would be a web application that does client-type +requests, or loopback-testing an eepsite as a diagnostic tool. +{%- endtrans %}
{% trans -%} Creates a destination that filters the reqistration sequence of a client and passes the clients destination key as a hostname to the IRC-server. +{%- endtrans %}
{% trans -%} A UDP-client that connects to a media server is created. The UDP-Client is coupled with a Streamr server I2PTunnel. +{%- endtrans %}
{% endblock %} diff --git a/i2p2www/pages/site/docs/api/ministreaming.html b/i2p2www/pages/site/docs/api/ministreaming.html index d3f78c5d..82b91d80 100644 --- a/i2p2www/pages/site/docs/api/ministreaming.html +++ b/i2p2www/pages/site/docs/api/ministreaming.html @@ -1,47 +1,56 @@ {% extends "global/layout.html" %} -{% block title %}Ministreaming Library{% endblock %} +{% block title %}{% trans %}Ministreaming Library{% endtrans %}{% endblock %} {% block content %} -{% trans streaming=site_url('docs/api/streaming'), api='http://docs.i2p-projekt.de/javadoc/net/i2p/client/streaming/package-summary.html' -%} The ministreaming library has been enhanced and extended by the -"full" streaming library. +"full" streaming library. Ministreaming is deprecated and is incompatible with today's applications. The following documentation is old. Also note that streaming extends ministreaming in the same Java package (net.i2p.client.streaming), -so the current -API documentation -contains both. +so the current API documentation contains both. Obsolete ministreaming classes and methods are clearly marked as deprecated in the Javadocs. +{%- endtrans %}
-The ministreaming library is a layer on top of the core -I2CP that allows reliable, in order, and authenticated streams +
{% trans i2cp=site_url('docs/protocol/i2cp') %} +The ministreaming library is a layer on top of the core +I2CP that allows reliable, in order, and authenticated streams of messages to operate across an unreliable, unordered, and unauthenticated message layer. Just like the TCP to IP relationship, this streaming functionality has a whole series of tradeoffs and optimizations available, but rather than embed that functionality into the base I2P code, it has been factored off into its own library both to keep the TCP-esque complexities separate and to -allow alternative optimized implementations.
+allow alternative optimized implementations. +{%- endtrans %} -The ministreaming library was written by mihi as a part of his -I2PTunnel application and then factored out and released +
{% trans i2ptunnel=site_url('docs/api/i2ptunnel'), minwww=site_url('misc/minwww') -%} +The ministreaming library was written by mihi as a part of his +I2PTunnel application and then factored out and released under the BSD license. It is called the "mini"streaming library because it makes some simplifications in the implementation, while a more robust streaming library could be further optimized for operation over I2P. The two main issues with the ministreaming library are its use of the traditional TCP two phase establishment protocol and the current fixed window size of 1. The establishment issue is minor for long lived streams, but for short ones, such as quick HTTP -requests, the impact can be significant. As for the window +requests, the impact can be significant. As for the window size, the ministreaming library doesn't maintain any ID or ordering within the messages sent (or include any application level ACK or SACK), so it must wait -on average twice the time it takes to send a message before sending another.
+on average twice the time it takes to send a message before sending another. +{%- endtrans %} -Even with those issues, the ministreaming library performs quite well in many -situations, and its API +
{% trans api='http://docs.i2p-projekt.de/javadoc/net/i2p/client/streaming/package-summary.html', +samv3=site_url('docs/api/samv3') -%} +Even with those issues, the ministreaming library performs quite well in many +situations, and its API is both quite simple and capable of remaining unchanged as different streaming implementations are introduced. The library is deployed in its own ministreaming.jar. Developers in Java who would like to use it can access the API directly, while developers in other languages can use it through -SAM's streaming support.
{% endblock %} +SAM's streaming support. +{%- endtrans %} +{% endblock %} diff --git a/i2p2www/pages/site/docs/api/socks.html b/i2p2www/pages/site/docs/api/socks.html index 926189a1..b31a1552 100644 --- a/i2p2www/pages/site/docs/api/socks.html +++ b/i2p2www/pages/site/docs/api/socks.html @@ -1,34 +1,39 @@ {% extends "global/layout.html" %} {% block title %}SOCKS{% endblock %} {% block content %} -- The SOCKS proxy is working as of release 0.7.1. SOCKS 4/4a/5 are supported. - Enable SOCKS by creating a SOCKS client tunnel in i2ptunnel. - Both shared-clients and non-shared are supported. - There is no SOCKS outproxy so it is of limited use. -
--As it says on the -FAQ: -
- Many applications leak sensitive - information that could identify you on the Internet. I2P only filters - connection data, but if the program you intend to run sends this - information as content, I2P has no way to protect your anonymity. For - example, some mail applications will send the IP address of the machine - they are running on to a mail server. There is no way for I2P to filter - this, thus using I2P to 'socksify' existing applications is possible, but - extremely dangerous. -
+
{% trans %} +The SOCKS proxy is working as of release 0.7.1. SOCKS 4/4a/5 are supported. +Enable SOCKS by creating a SOCKS client tunnel in i2ptunnel. +Both shared-clients and non-shared are supported. +There is no SOCKS outproxy so it is of limited use. +{%- endtrans %}
+ +{% trans faq=site_url('faq') %} +As it says on the FAQ: +{%- endtrans %}
+{% trans -%} +Many applications leak sensitive +information that could identify you on the Internet. I2P only filters +connection data, but if the program you intend to run sends this +information as content, I2P has no way to protect your anonymity. For +example, some mail applications will send the IP address of the machine +they are running on to a mail server. There is no way for I2P to filter +this, thus using I2P to 'socksify' existing applications is possible, but +extremely dangerous. +{%- endtrans %}+
{% trans -%} And quoting from a 2005 email: -
+{%- endtrans %}
+{% trans -%} ... there is a reason why human and others have both built and abandoned the SOCKS proxies. Forwarding arbitrary traffic is just plain unsafe, and it behooves us as developers of anonymity and security software to have the safety of our end users foremost in our minds. +{%- endtrans %}+
{% trans -%} Hoping that we can simply strap an arbitrary client on top of I2P without auditing both its behavior and its exposed protocols for security and anonymity is naive. Pretty much *every* application @@ -38,33 +43,33 @@ reality. End users are better served with systems designed for anonymity and security. Modifying existing systems to work in anonymous environments is no small feat, orders of magnitude more work that simply using the existing I2P APIs. -
+{%- endtrans %} -+
{% trans -%} The SOCKS proxy supports standard addressbook names, but not Base64 destinations. Base32 hashes should work as of release 0.7. It supports outgoing connections only, i.e. an I2PTunnel Client. UDP support is stubbed out but not working yet. Outproxy selection by port number is stubbed out. -
+{%- endtrans %} -{% trans -%} Please let us know. And please provide substantial warnings about the risks of socks proxies. +{%- endtrans %} {% endblock %} diff --git a/i2p2www/pages/site/docs/api/streaming.html b/i2p2www/pages/site/docs/api/streaming.html index ef416d55..13616fa8 100644 --- a/i2p2www/pages/site/docs/api/streaming.html +++ b/i2p2www/pages/site/docs/api/streaming.html @@ -1,30 +1,32 @@ {% extends "global/layout.html" %} -{% block title %}Streaming Library{% endblock %} -{% block lastupdated %}November 2012{% endblock %} +{% block title %}{% trans %}Streaming Library{% endtrans %}{% endblock %} +{% block lastupdated %}{% trans %}November 2012{% endtrans %}{% endblock %} {% block accuratefor %}0.9.3{% endblock %} {% block content %} -
+
{% trans datagrams=site_url('docs/spec/datagrams') -%} The streaming library is technically part of the "application" layer, as it is not a core router function. In practice, however, it provides a vital function for almost all existing I2P applications, by providing a TCP-like streams over I2P, and allowing existing apps to be easily ported to I2P. The other end-to-end transport library for client communication is the -datagram library. -
+datagram library. +{%- endtrans %} -The streaming library is a layer on top of the core -I2CP API that allows reliable, in-order, and authenticated streams +
{% trans i2cp=site_url('docs/protocol/i2cp') -%} +The streaming library is a layer on top of the core +I2CP API that allows reliable, in-order, and authenticated streams of messages to operate across an unreliable, unordered, and unauthenticated message layer. Just like the TCP to IP relationship, this streaming functionality has a whole series of tradeoffs and optimizations available, but rather than embed that functionality into the base I2P code, it has been factored off into its own library both to keep the TCP-esque complexities separate and to -allow alternative optimized implementations.
+allow alternative optimized implementations. +{%- endtrans %} -+
{% trans -%} In consideration of the relatively high cost of messages, the streaming library's protocol for scheduling and delivering those messages has been optimized to allow individual messages passed to contain as much information as is available. @@ -34,184 +36,256 @@ the small HTTP request payload, and the reply bundles the SYN, FIN, ACK, and the HTTP response payload. While an additional ACK must be transmitted to tell the HTTP server that the SYN/FIN/ACK has been received, the local HTTP proxy can often deliver the full response to the browser -immediately. -
+immediately. +{%- endtrans %} -+
{% trans -%} The streaming library bears much resemblance to an abstraction of TCP, with its sliding windows, congestion control algorithms (both slow start and congestion avoidance), and general packet behavior (ACK, SYN, FIN, RST, rto calculation, etc). -
+{%- endtrans %} -+
{% trans -%} The streaming library is a robust library which is optimized for operation over I2P. It has a one-phase setup, and it contains a full windowing implementation. -
+{%- endtrans %} ++
{% trans i2cp=site_url('docs/protocol/i2cp') -%} The streaming library API provides a standard socket paradigm to Java applications. -The lower-level -I2CP -API is completely hidden, except that applications may pass -I2CP parameters through the streaming library, -to be interpreted by I2CP. -
+The lower-level I2CP API is completely hidden, except that +applications may pass I2CP parameters through the +streaming library, to be interpreted by I2CP. +{%- endtrans %} -+
{% trans i2cp=site_url('docs/protocol/i2cp'), +i2psktmf='http://docs.i2p-projekt.de/javadoc/net/i2p/client/streaming/I2PSocketManagerFactory.html', +i2psktm='http://docs.i2p-projekt.de/javadoc/net/i2p/client/streaming/I2PSocketManager.html', +i2psess='http://docs.i2p-projekt.de/javadoc/net/i2p/client/streaming/I2PSession.html', +i2pskt='http://docs.i2p-projekt.de/javadoc/net/i2p/client/streaming/I2PSocket.html', +i2psskt='http://docs.i2p-projekt.de/javadoc/net/i2p/client/streaming/I2PServerSocket.html' -%} The standard interface to the streaming lib is for the application to use the -I2PSocketManagerFactory -to create an -I2PSocketManager. -The application then asks the socket manager for an -I2PSession, -which will cause a connection to the router via -I2CP. -The application can then setup connections with an -I2PSocket -or receive connections with an -I2PServerSocket. -
--Here are the -full streaming library Javadocs. -
+I2PSocketManagerFactory to create an +I2PSocketManager. The application then asks the +socket manager for an I2PSession, which will cause +a connection to the router via I2CP. The application +can then setup connections with an I2PSocket or +receive connections with an I2PServerSocket. +{%- endtrans %} -+
{% trans url='http://docs.i2p-projekt.de/javadoc/net/i2p/client/streaming/package-summary.html' -%} +Here are the full streaming library Javadocs. +{%- endtrans %}
+ +{% trans -%} For a good example of usage, see the i2psnark code. -
+{%- endtrans %} -+
{% trans i2psktmf='http://docs.i2p-projekt.de/javadoc/net/i2p/client/streaming/I2PSocketManagerFactory.html' -%} The options and current default values are listed below. Options are case-sensitive and may be set for the whole router, for a particular client, or for an individual socket on a per-connection basis. Many values are tuned for HTTP performance over typical I2P conditions. Other applications such as peer-to-peer services are strongly encouraged to modify as necessary, by setting the options and passing them via the call to -I2PSocketManagerFactory.createManager(_i2cpHost, _i2cpPort, opts). +I2PSocketManagerFactory.createManager(_i2cpHost, _i2cpPort, opts). Time values are in ms. -
--Note that higher-layer APIs, such as -SAM, -BOB, and -I2PTunnel, +{%- endtrans %}
+ +{% trans samv3=site_url('docs/api/samv3'), bob=site_url('docs/api/bob'), i2ptunnel=site_url('docs/api/i2ptunnel') -%} +Note that higher-layer APIs, such as SAM, +BOB, and I2PTunnel, may override these defaults with their own defaults. Also note that many options only apply to servers listening for incoming connections. -
+{%- endtrans %}
+ +{% trans -%} As of release 0.9.1, most, but not all, options may be changed on an active socket manager or session. See the javadocs for details. -
+{%- endtrans %}Option | Default | Notes | +
---|---|---|
{{ _('Option') }} | {{ _('Default') }} | {{ _('Notes') }} |
i2cp.accessList | null | Comma- or space-separated list of Base64 peer Hashes used for either access list or blacklist - As of release 0.7.13. - |
i2cp.enableAccessList | false - | Use the access list as a whitelist for incoming connections - As of release 0.7.13. - |
i2cp.enableBlackList | false - | Use the access list as a blacklist for incoming connections - As of release 0.7.13. - |
i2p.streaming.answerPings | true | Whether to respond to incoming pings - |
i2p.streaming.blacklist | null | Comma- or space-separated list of Base64 peer Hashes to be - blacklisted for incoming connections to ALL destinations in the context. - This option must be set in the context properties, NOT in the createManager() options argument. - Note that setting this in the router context will not affect clients outside the - router in a separate JVM and context. - As of release 0.9.3. - |
i2p.streaming.bufferSize | 64K | - How much transmit data (in bytes) will be accepted that hasn't been written out yet. - |
i2p.streaming.congestionAvoidanceGrowthRateFactor | 1 - | - When we're in congestion avoidance, we grow the window size at the rate - of 1/(windowSize*factor). In standard TCP, window sizes are in bytes, - while in I2P, window sizes are in messages. - A higher number means slower growth. - |
i2p.streaming.connectDelay | -1 - | - How long to wait after instantiating a new con - before actually attempting to connect. If this is - <= 0, connect immediately with no initial data. If greater than 0, wait - until the output stream is flushed, the buffer fills, - or that many milliseconds pass, and include any initial data with the SYN. - |
i2p.streaming.connectTimeout | 5*60*1000 | - How long to block on connect, in milliseconds. Negative means indefinitely. Default is 5 minutes. - |
i2p.streaming.disableRejectLogging | false | - Whether to disable warnings in the logs when an incoming connection is rejected due to connection limits. - As of release 0.9.4. - |
i2p.streaming.enforceProtocol | false | Whether to listen only for the streaming protocol. - Setting to true will prohibit communication with Destinations earlier than release 0.7.1 - (released March 2009). Set to true if running multiple protocols on this Destination. - As of release 0.9.1. - |
i2p.streaming.inactivityAction | 2 (send) | (0=noop, 1=disconnect) - What to do on an inactivity timeout - do nothing, disconnect, or send a duplicate ack. - |
i2p.streaming.inactivityTimeout | 90*1000 - | |
i2p.streaming.initialAckDelay | 2000 - | |
i2p.streaming.initialResendDelay | 1000 - | - The initial value of the resend delay field in the packet header, times 1000. - Not fully implemented; see below. - |
i2p.streaming.initialRTT | 8000 | (if no sharing data available) - |
i2p.streaming.initialWindowSize | 6 | (if no sharing data available) - In standard TCP, window sizes are in bytes, while in I2P, window sizes are in messages. - |
i2p.streaming.maxConcurrentStreams | -1 | (0 or negative value means unlimited) - This is a total limit for incoming and outgoing combined. - |
i2p.streaming.maxConnsPerMinute | 0 | Incoming connection limit (per peer; 0 means disabled) - As of release 0.7.14. - |
i2p.streaming.maxConnsPerHour | 0 | (per peer; 0 means disabled) - As of release 0.7.14. - |
i2p.streaming.maxConnsPerDay | 0 | (per peer; 0 means disabled) - As of release 0.7.14. - |
i2p.streaming.maxMessageSize | 1730 | The MTU in bytes. - |
i2p.streaming.maxResends | 8 - | - Maximum number of retransmissions before failure. - |
i2p.streaming.maxTotalConnsPerMinute | 0 | Incoming connection limit (all peers; 0 means disabled) - As of release 0.7.14. - |
i2p.streaming.maxTotalConnsPerHour | 0 | (all peers; 0 means disabled) - Use with caution as exceeding this will disable a server for a long time. - As of release 0.7.14. - |
i2p.streaming.maxTotalConnsPerDay | 0 | (all peers; 0 means disabled) - Use with caution as exceeding this will disable a server for a long time. - As of release 0.7.14. - |
i2p.streaming.maxWindowSize | 128 - | |
i2p.streaming.profile | 1 (bulk) | (2=interactive not supported) - This doesn't currently do anything, but setting it to a value other than 1 will cause an error. - |
i2p.streaming.readTimeout | -1 - | - How long to block on read, in milliseconds. Negative means indefinitely. - |
i2p.streaming.slowStartGrowthRateFactor | 1 - | - When we're in slow start, we grow the window size at the rate - of 1/(factor). In standard TCP, window sizes are in bytes, - while in I2P, window sizes are in messages. - A higher number means slower growth. - |
i2p.streaming.writeTimeout | -1 - | - How long to block on write/flush, in milliseconds. Negative means indefinitely. - |
i2cp.accessList | null | {% trans -%} +Comma- or space-separated list of Base64 peer Hashes used for either access list or blacklist. +{%- endtrans %} {% trans release='0.7.13' -%} +As of release {{ release }}. +{%- endtrans %} |
i2cp.enableAccessList | false | {% trans -%} +Use the access list as a whitelist for incoming connections. +{%- endtrans %} {% trans release='0.7.13' -%} +As of release {{ release }}. +{%- endtrans %} |
i2cp.enableBlackList | false | {% trans -%} +Use the access list as a blacklist for incoming connections. +{%- endtrans %} {% trans release='0.7.13' -%} +As of release {{ release }}. +{%- endtrans %} |
i2p.streaming.answerPings | true | {% trans -%} +Whether to respond to incoming pings +{%- endtrans %} |
i2p.streaming.blacklist | null | {% trans -%} +Comma- or space-separated list of Base64 peer Hashes to be +blacklisted for incoming connections to ALL destinations in the context. +This option must be set in the context properties, NOT in the createManager() options argument. +Note that setting this in the router context will not affect clients outside the +router in a separate JVM and context. +{%- endtrans %} {% trans release='0.9.3' -%} +As of release {{ release }}. +{%- endtrans %} |
i2p.streaming.bufferSize | 64K | {% trans -%} +How much transmit data (in bytes) will be accepted that hasn't been written out yet. +{%- endtrans %} |
i2p.streaming.congestionAvoidanceGrowthRateFactor | 1 | {% trans -%}
+When we're in congestion avoidance, we grow the window size at the rate
+of 1/(windowSize*factor) . In standard TCP, window sizes are in bytes,
+while in I2P, window sizes are in messages.
+A higher number means slower growth.
+{%- endtrans %} |
i2p.streaming.connectDelay | -1 | {% trans -%} +How long to wait after instantiating a new con +before actually attempting to connect. If this is +<= 0, connect immediately with no initial data. If greater than 0, wait +until the output stream is flushed, the buffer fills, +or that many milliseconds pass, and include any initial data with the SYN. +{%- endtrans %} |
i2p.streaming.connectTimeout | 5*60*1000 | {% trans -%} +How long to block on connect, in milliseconds. Negative means indefinitely. Default is 5 minutes. +{%- endtrans %} |
i2p.streaming.disableRejectLogging | false | {% trans -%} +Whether to disable warnings in the logs when an incoming connection is rejected due to connection limits. +{%- endtrans %} {% trans release='0.9.4' -%} +As of release {{ release }}. +{%- endtrans %} |
i2p.streaming.enforceProtocol | false | {% trans -%} +Whether to listen only for the streaming protocol. +Setting to true will prohibit communication with Destinations earlier than release 0.7.1 +(released March 2009). Set to true if running multiple protocols on this Destination. +{%- endtrans %} {% trans release='0.9.1' -%} +As of release {{ release }}. +{%- endtrans %} |
i2p.streaming.inactivityAction | 2 (send) | {% trans -%} +(0=noop, 1=disconnect) +What to do on an inactivity timeout - do nothing, disconnect, or send a duplicate ack. +{%- endtrans %} |
i2p.streaming.inactivityTimeout | 90*1000 | |
i2p.streaming.initialAckDelay | 2000 | |
i2p.streaming.initialResendDelay | 1000 | {% trans -%} +The initial value of the resend delay field in the packet header, times 1000. +Not fully implemented; see below. +{%- endtrans %} |
i2p.streaming.initialRTT | 8000 | ({% trans %}if no sharing data available{% endtrans %}) |
i2p.streaming.initialWindowSize | 6 | ({% trans %}if no sharing data available{% endtrans %}) {% trans -%} +In standard TCP, window sizes are in bytes, while in I2P, window sizes are in messages. +{%- endtrans %} |
i2p.streaming.maxConcurrentStreams | -1 | {% trans -%} +(0 or negative value means unlimited) +This is a total limit for incoming and outgoing combined. +{%- endtrans %} |
i2p.streaming.maxConnsPerMinute | 0 | {% trans -%} +Incoming connection limit (per peer; 0 means disabled) +{%- endtrans %} {% trans release='0.7.14' -%} +As of release {{ release }}. +{%- endtrans %} |
i2p.streaming.maxConnsPerHour | 0 | {% trans -%} +(per peer; 0 means disabled) +{%- endtrans %} {% trans release='0.7.14' -%} +As of release {{ release }}. +{%- endtrans %} |
i2p.streaming.maxConnsPerDay | 0 | {% trans -%} +(per peer; 0 means disabled) +{%- endtrans %} {% trans release='0.7.14' -%} +As of release {{ release }}. +{%- endtrans %} |
i2p.streaming.maxMessageSize | 1730 | {% trans -%} +The MTU in bytes. +{%- endtrans %} |
i2p.streaming.maxResends | 8 | {% trans -%} +Maximum number of retransmissions before failure. +{%- endtrans %} |
i2p.streaming.maxTotalConnsPerMinute | 0 | {% trans -%} +Incoming connection limit (all peers; 0 means disabled) +{%- endtrans %} {% trans release='0.7.14' -%} +As of release {{ release }}. +{%- endtrans %} |
i2p.streaming.maxTotalConnsPerHour | 0 | {% trans -%} +(all peers; 0 means disabled) +Use with caution as exceeding this will disable a server for a long time. +{%- endtrans %} {% trans release='0.7.14' -%} +As of release {{ release }}. +{%- endtrans %} |
i2p.streaming.maxTotalConnsPerDay | 0 | {% trans -%} +(all peers; 0 means disabled) +Use with caution as exceeding this will disable a server for a long time. +{%- endtrans %} {% trans release='0.7.14' -%} +As of release {{ release }}. +{%- endtrans %} |
i2p.streaming.maxWindowSize | 128 | |
i2p.streaming.profile | 1 (bulk) | {% trans -%} +(2=interactive not supported) +This doesn't currently do anything, but setting it to a value other than 1 will cause an error. +{%- endtrans %} |
i2p.streaming.readTimeout | -1 | {% trans -%} +How long to block on read, in milliseconds. Negative means indefinitely. +{%- endtrans %} |
i2p.streaming.slowStartGrowthRateFactor | 1 | {% trans -%} +When we're in slow start, we grow the window size at the rate +of 1/(factor). In standard TCP, window sizes are in bytes, +while in I2P, window sizes are in messages. +A higher number means slower growth. +{%- endtrans %} |
i2p.streaming.writeTimeout | -1 | {% trans -%} +How long to block on write/flush, in milliseconds. Negative means indefinitely. +{%- endtrans %} |
+
{% trans -%} The format of a single packet in the streaming protocol is: +{%- endtrans %}
+----+----+----+----+----+----+----+----+ @@ -232,7 +306,7 @@ The format of a single packet in the streaming protocol is:
Field | Length | Contents + |
---|---|---|
{{ _('Field') }} | {{ _('Length') }} | {{ _('Contents') }} |
sendStreamId | 4 byte Integer | Random number selected by the connection recipient and constant for the life of the connection. 0 in the SYN message sent by the originator, and in subsequent messages, until a SYN reply is received, @@ -280,11 +354,14 @@ As specified by the flags. See below. |
payload | remaining packet size |
The flags field above specifies some metadata about the packet, and in +
{% trans -%} +The flags field above specifies some metadata about the packet, and in turn may require certain additional data to be included. The flags are as follows. Any data structures specified must be added to the options area -in the given order.
+in the given order. +{%- endtrans %} +Bit order: 15....0 (15 is MSB)
@@ -329,30 +406,32 @@ Currently unused, the ackThrough field is always valid.+
{% trans -%} The initiator sends a packet with the SYNCHRONIZE flag set. This packet may contain the initial data as well. The peer replies with a packet with the SYNCHRONIZE flag set. This packet may contain the initial response data as well. -
-+{%- endtrans %}
+ +{% trans -%} The initiator may send additional data packets, up to the initial window size, before receiving the SYNCHRONIZE response. These packets will also have the send Stream ID field set to 0. Recipients must buffer packets received on unknown streams for a short period of time, as they may arrive out of order, in advance of the SYNCHRONIZE packet. -
+{%- endtrans %} -+
{% trans -%} The maximum message size (also called the MTU / MRU) is negotiated to the lower value supported by the two peers. As tunnel messages are padded to 1KB, a poor MTU selection will lead to a large amount of overhead. The MTU is specified by the option i2p.streaming.maxMessageSize. The current default MTU of 1730 was chosen to fit precisely into two 1K I2NP tunnel messages, including overhead for the typical case. -
-+{%- endtrans %}
+ +{% trans -%} The first message in a connection includes a 387 byte (typical) Destination added by the streaming layer, and usually a 898 byte (typical) LeaseSet, and Session keys, bundled in the Garlic message by the router. (The LeaseSet and Session Keys will not be bundled if an ElGamal Session was previously established). @@ -360,42 +439,45 @@ Therefore, the goal of fitting a complete HTTP request in a single 1KB I2NP mess However, the selection of the MTU, together with careful implementation of fragmentation and batching strategies in the tunnel gateway processor, are important factors in network bandwidth, latency, reliability, and efficiency, especially for long-lived connections. -
+{%- endtrans %} -{% trans i2cp=site_url('docs/protocol/i2cp') -%} Data integrity is assured by the gzip CRC-32 checksum implemented in -the I2CP layer. +the I2CP layer. There is no checksum field in the streaming protocol. +{%- endtrans %}
-{% trans garlicrouting=site_url('docs/how/garlic-routing'), i2cp=site_url('docs/protocol/i2cp'), +i2np=site_url('docs/protocol/i2np'), tunnelmessage=site_url('docs/spec/tunnel-message') -%} Each packet is sent through I2P as a single message (or as an individual clove in a -Garlic Message). -Message encapsulation is implemented in the underlying -I2CP, -I2NP, and -tunnel message layers. -There is no packet delimiter mechanism or payload length field in the streaming protocol. +Garlic Message). Message encapsulation is implemented +in the underlying I2CP, I2NP, and +tunnel message layers. There is no packet delimiter +mechanism or payload length field in the streaming protocol. +{%- endtrans %}
-+
{% trans -%} The streaming lib uses standard slow-start (exponential window growth) and congestion avoidance (linear window growth) phases, with exponential backoff. Windowing and acknowledgments use packet count, not byte count. -
+{%- endtrans %} -+
{% trans -%} Any packet, including one with the SYNCHRONIZE flag set, may have the CLOSE flag sent as well. The connection is not closed until the peer responds with the CLOSE flag. CLOSE packets may contain data as well. -
+{%- endtrans %} -+
{% trans -%} The streaming lib supports "TCP" Control Block sharing. This shares two important streaming lib parameters (window size and round trip time) @@ -407,10 +489,12 @@ There is a separate share per ConnectionManager (i.e. per local Destination) so that there is no information leakage to other Destinations on the same router. The share data for a given peer expires after a few minutes. -
+{%- endtrans %} -{% trans -%} The following parameters are hardcoded, but may be of interest for analysis: +{%- endtrans %}
+
{% trans -%} The streaming library has grown organically for I2P - first mihi implemented the "mini streaming library" as part of I2PTunnel, which was limited to a window size of 1 message (requiring an ACK before sending the next one), and then it was @@ -437,26 +521,25 @@ streams may adjust the maximum packet size and other options. The default message size is selected to fit precisely in two 1K I2NP tunnel messages, and is a reasonable tradeoff between the bandwidth costs of retransmitting lost messages, and the latency and overhead of multiple messages. -
+{%- endtrans %} - - - -{% trans -%} The behavior of the streaming library has a profound impact on application-level performance, and as such, is an important area for further analysis. +{%- endtrans %}