diff --git a/www.i2p2/pages/i2np_spec.html b/www.i2p2/pages/i2np_spec.html index 00aed999..aa8f817f 100644 --- a/www.i2p2/pages/i2np_spec.html +++ b/www.i2p2/pages/i2np_spec.html @@ -1,7 +1,9 @@ {% extends "_layout.html" %} {% block title %}I2NP Specification{% endblock %} {% block content %} -Updated October 2011, current as of router version 0.8.10 + +Updated December 2011, current as of router version 0.8.11 +
The I2P Network Protocol (I2NP), @@ -22,17 +24,29 @@ common transports supported.
- 1 byte Integer specifying the type of this message, followed by an 4 byte Integer specifying the message-id. After that there is an expiration Date, followed by an 2 byte Integer specifying the length of the message payload, followed by an Hash, which is truncated to the first byte. After that the actual message data follows. + 1 byte Integer specifying the type of this message, + followed by a 4 byte Integer specifying the message-id. + After that there is an expiration Date, + followed by a 2 byte Integer specifying + the length of the message payload, followed by a Hash, + which is truncated to the first byte. After that the actual message data follows.
{% filter escape %} +Standard (16 bytes): + ++----+----+----+----+----+----+----+----+ +|type| msg-id | expiration ++----+----+----+----+----+----+----+----+ + | size |chks| ++----+----+----+----+----+----+----+----+ + +Short (SSU, 5 bytes): + +----+----+----+----+----+ -|type| msg-id | -+----+----+----+----+----+----+----+----+ -| expiration | -+----+----+----+----+----+----+----+----+ -| size |chks| -+----+----+----+ +|type| short expiration | ++----+----+----+----+----+ + {% endfilter %}@@ -53,12 +67,16 @@ expiration :: Date 8 bytes date this message will expire +short expiration :: Integer + 4 bytes + date this message will expire (seconds since the epoch) + size :: Integer length -> 2 bytes purpose -> length of the payload -chks :: Hash +chks :: Integer length -> 1 byte purpose -> checksum of the payload @@ -70,6 +88,16 @@ data :: Data purpose -> actual message contents {% endfilter %} +
@@ -62,24 +62,35 @@ a packet and sends it off (careful not to exceed the MTU).
-The current implementation uses two MTU values: 608 and 1492. +As of router version 0.8.12, +two MTU values are used: 620 and 1488. The MTU value is adjusted based on the percentage of packets that are retransmitted.
-596 gives us 588 IP bytes, 568 UDP bytes, and with an SSU data message, -522 fragment bytes, which is enough to send a tunnel data message in 2 -packets. A tunnel data message sent over the wire is 1044 bytes, meaning -we need 522 fragment bytes to fit it in 2 packets - add 46 for SSU, 20 -for UDP, and 8 for IP, giving us 596. Round up to mod 16, giving a total -of 608. +For both MTU values, it is desirable that (MTU % 16) == 12, so that +the payload portion after the 28-byte IP/UDP header is a multiple of +16 bytes, for encryption purposes. +This calculation is for IPv4 only. While the protocol as specified supports IPv6 +addresses, IPv6 is not yet implemented. +
+For the small MTU value, it is desirable to pack a 2646-byte +Variable Tunnel Build Message efficiently into multiple packets; +with a 620-byte MTU, it fits into 5 packets with nicely.
Based on measurements, 1492 fits nearly all reasonably small I2NP messages (larger I2NP messages may be up to 1900 to 4500 bytes, which isn't going to fit into a live network MTU anyway).
+The MTU values were 608 and 1492 for releases 0.8.9 - 0.8.11. The large MTU was 1350 prior to release 0.8.9. +
+The maximum receive packet size +is 1571 bytes as of release 0.8.12. +For releases 0.8.9 - 0.8.11 it was 1535 bytes. +Prior to release 0.8.9 it was 2048 bytes. +
-While the maximum message size is nominally 32KB, the practical limit differs. The protocol limits the number of fragments to 7 bits, or 128. diff --git a/www.i2p2/pages/udp_spec.html b/www.i2p2/pages/udp_spec.html index c4921fc7..7f41417f 100644 --- a/www.i2p2/pages/udp_spec.html +++ b/www.i2p2/pages/udp_spec.html @@ -2,7 +2,7 @@ {% block title %}SSU Protocol Specification{% endblock %} {% block content %} -Updated August 2011 for release 0.8.9 +Updated December 2011 for release 0.8.11
See the SSU page for an overview of the SSU transport. @@ -669,7 +669,8 @@ byte 1