From c3669d71c62c817ec9cce58b43ba8746c502f0d6 Mon Sep 17 00:00:00 2001
From: str4d
An uncompressed LeaseSet or a compressed RouterInfo
-{% highlight %} +{% highlight lang='dataspec' %} with reply token: +----+----+----+----+----+----+----+----+ | SHA256 Hash as key | @@ -465,7 +465,7 @@ with reply token: | | + +----+----+----+----+----+----+----+ | | data ... -+----+--------\\ ++----+-// with reply token == 0: +----+----+----+----+----+----+----+----+ @@ -478,7 +478,7 @@ with reply token == 0: | | +----+----+----+----+----+----+----+----+ |type| 0 | data ... -+----+-------------------+---------\\ ++----+----+----+----+----+-// {% endhighlight %}@@ -524,7 +524,7 @@ For security, the reply fields are ignored if the message is received down a tunDatabaseLookup
-{% highlight %} +{% highlight lang='dataspec' %} +----+----+----+----+----+----+----+----+ | SHA256 hash as the key to look up | + + @@ -542,7 +542,7 @@ For security, the reply fields are ignored if the message is received down a tun + + | | +----+----+----+----+----+----+----+----+ -|flag| reply tunnelId |size | | +|flag| reply_tunnelId |size | | +----+----+----+----+----+----+----+ + | SHA256 of $key1 to exclude | + + @@ -577,62 +577,62 @@ For security, the reply fields are ignored if the message is received down a tun {% endhighlight %}Definition
-{% highlight %} -key: +{% highlight lang='dataspec' %} +key :: 32 bytes SHA256 hash of the object to lookup -from: +from :: 32 bytes - If deliveryFlag == 0, the SHA256 hash of the routerInfo entry this request came from (and to which the reply should be sent) - If deliveryFlag == 1, the SHA256 hash of the reply tunnel gateway (to which the reply should be sent) + if deliveryFlag == 0, the SHA256 hash of the routerInfo entry this request came from (and to which the reply should be sent) + if deliveryFlag == 1, the SHA256 hash of the reply tunnel gateway (to which the reply should be sent) -flags: +flags :: 1 byte bit order: 76543210 bit 0: deliveryFlag 0 => send reply directly 1 => send reply to some tunnel bit 1: encryptionFlag - Through release 0.9.5, must be set to 0 - As of release 0.9.6, ignored - As of release 0.9.7: + through release 0.9.5, must be set to 0 + as of release 0.9.6, ignored + as of release 0.9.7: 0 => send unencrypted reply 1 => send AES encrypted reply using enclosed key and tag bits 7-2: - Through release 0.9.5, must be set to 0 - As of release 0.9.6, ignored, set to 0 for compatibility with future uses and with older routers + through release 0.9.5, must be set to 0 + as of release 0.9.6, ignored, set to 0 for compatibility with future uses and with older routers -reply tunnelId: +reply_tunnelId :: 4 byte Tunnel ID only included if deliveryFlag == 1 tunnelId of the tunnel to send the reply to -size: +size :: 2 byte Integer valid range: 0-512 - number of peers to exclude from the Database Search Reply Message + number of peers to exclude from the DatabaseSearchReply Message -excludedPeers: +excludedPeers :: $size SHA256 hashes of 32 bytes each (total $size*32 bytes) - If the lookup fails, these peers are requested to be excluded from the list in - the Database Search Reply Message. - If excludedPeers includes a hash of all zeroes, the request is exploratory, and - the Database Search Reply Message is requested to list non-floodfill routers only. + if the lookup fails, these peers are requested to be excluded from the list in + the DatabaseSearchReply Message. + if excludedPeers includes a hash of all zeroes, the request is exploratory, and + the DatabaseSearchReply Message is requested to list non-floodfill routers only. -reply key: +reply_key :: 32 byte SessionKey - Only included if encryptionFlag == 1 + only included if encryptionFlag == 1 -tags: +tags :: 1 byte Integer valid range: 1-32 (typically 1) - The number of reply tags that follow - Only included if encryptionFlag == 1 + the number of reply tags that follow + only included if encryptionFlag == 1 -reply tags: - One or more 32 byte SessionTags (typically one) - Only included if encryptionFlag == 1 +reply_tags :: + one or more 32 byte SessionTags (typically one) + only included if encryptionFlag == 1 {% endhighlight %} @@ -656,7 +656,7 @@ The number of included tags could be greater than one if alternative DHT lookupA list of router hashes closest to the requested key
-{% highlight %} +{% highlight lang='dataspec' %} +----+----+----+----+----+----+----+----+ | SHA256 hash as query key | + + @@ -666,7 +666,7 @@ The number of included tags could be greater than one if alternative DHT lookup + + | | +----+----+----+----+----+----+----+----+ -|num | peer hash $1 | +|num | peer_hash $1 | +----+ + | | + + @@ -675,7 +675,7 @@ The number of included tags could be greater than one if alternative DHT lookup | | + +----+----+----+----+----+----+----+ | | | -+----+.... $num peer hashes ++----+ $num peer_hashes + + +----+----+----+----+----+----+----+ | | from | @@ -693,21 +693,21 @@ The number of included tags could be greater than one if alternative DHT lookup {% endhighlight %}Definition
-{% highlight %} -key: +{% highlight lang='dataspec' %} +key :: 32 bytes SHA256 of the object being searched -num: +num :: 1 byte Integer number of peer hashes that follow -peer hash: +peer_hash :: 32 bytes SHA256 of the RouterInfo that the other router thinks are close to the key $num entries -from: +from :: 32 bytes SHA256 of the RouterInfo of the router this reply was sent from {% endhighlight %} @@ -727,19 +727,19 @@ from:The ID of the delivered message, and the creation or arrival time.
-{% highlight %} +{% highlight lang='dataspec' %} +----+----+----+----+----+----+----+----+----+----+----+----+ -|msg-id | time stamp | +|msg_id | time_stamp | +----+----+----+----+----+----+----+----+----+----+----+----+ {% endhighlight %}Definition
-{% highlight %} -msg-id: +{% highlight lang='dataspec' %} +msg_id :: 4 bytes unique ID of the message we deliver the DeliveryStatus for (see common I2NP header for details) -time stamp: Date +time_stamp :: Date 8 bytes time the message was successfully created or delivered {% endhighlight %} @@ -764,7 +764,7 @@ time stamp: DateWhen decrypted, a series of Garlic Cloves.
-{% highlight %} +{% highlight lang='dataspec' %} encrypted: +----+----+----+----+----+----+----+----+ | length | data | @@ -790,35 +790,35 @@ unencrypted data: ~ ~ | | +----+----+----+----+----+----+----+----+ -| Certificate | Message ID | +| Certificate | Message_ID | +----+----+----+----+----+----+----+----+ Expiration | +----+----+----+----+----+----+----+ {% endhighlight %}Definition
-{% highlight %} +{% highlight lang='dataspec' %} Encrypted: -length: +length :: 4 byte Integer number of bytes that follow 0 - 64 KB -data: +data :: $length bytes ElGamal encrypted data Unencrypted data: -num: - 1 byte Integer number of Garlic Cloves to follow +num :: + 1 byte Integer number of GarlicCloves to follow -clove: A Garlic Clove +clove :: a GarlicClove -Certificate :: Always NULL in the current implementation (3 bytes total, all zeroes) +Certificate :: always NULL in the current implementation (3 bytes total, all zeroes) -Message ID :: 4 byte Integer +Message_ID :: 4 byte Integer Expiration :: Date (8 bytes) @@ -852,7 +852,7 @@ Expiration :: Date (8 bytes)TunnelData
-{% highlight %} +{% highlight lang='dataspec' %} +----+----+----+----+----+----+----+----+ | tunnnelID | data | +----+----+----+----+ | @@ -866,12 +866,12 @@ Expiration :: Date (8 bytes) {% endhighlight %}Definition
-{% highlight %} -tunnelId: +{% highlight lang='dataspec' %} +tunnelId :: 4 byte Tunnel ID identifies the tunnel this message is directed at -data: +data :: 1024 bytes payload data.. fixed to 1024 bytes {% endhighlight %} @@ -884,23 +884,23 @@ data:TunnelGateway
-{% highlight %} -+----+----+----+----+----+----+--\\----+ -| tunnelId | length | data...| -+----+----+----+----+----+----+--\\----+ +{% highlight lang='dataspec' %} ++----+----+----+----+----+----+----+-// +| tunnelId | length | data... ++----+----+----+----+----+----+----+-// {% endhighlight %}Definition
-{% highlight %} -tunnelId: +{% highlight lang='dataspec' %} +tunnelId :: 4 byte Tunnel ID identifies the tunnel this message is directed at -length: +length :: 2 byte Integer length of the payload -data: +data :: $length bytes actual payload of this message {% endhighlight %} @@ -922,25 +922,25 @@ data:A length Integer, followed by opaque data.
-{% highlight %} -+----+----+----+----+----+---//--+ -| length | data... | -+----+----+----+----+----+---//--+ +{% highlight lang='dataspec' %} ++----+----+----+----+----+-// +| length | data... ++----+----+----+----+----+-// {% endhighlight %}Definition
-{% highlight %} -length: +{% highlight lang='dataspec' %} +length :: 4 bytes length of the payload -data: +data :: $length bytes actual payload of this message {% endhighlight %}TunnelBuild
-{% highlight %} +{% highlight lang='dataspec' %} +----+----+----+----+----+----+----+----+ | Record 0 ... | @@ -957,10 +957,10 @@ data: {% endhighlight %}Definition
-{% highlight %} +{% highlight lang='dataspec' %} Just 8 Build Request Records attached together -Record size: 528 bytes -Total size: 8*528 = 4224 bytes +record size: 528 bytes +total size: 8*528 = 4224 bytes {% endhighlight %}Notes
@@ -970,7 +970,7 @@ Total size: 8*528 = 4224 bytesTunnelBuildReply
-{% highlight %} +{% highlight lang='dataspec' %} same format as TunnelBuild message, with Build Response Records {% endhighlight %} @@ -980,22 +980,22 @@ same format as TunnelBuild message, with Build Response RecordsVariableTunnelBuild
-{% highlight %} +{% highlight lang='dataspec' %} +----+----+----+----+----+----+----+----+ |num | BuildRequestRecords... +----+----+----+----+----+----+----+----+ {% endhighlight %}Definition
-{% highlight %} +{% highlight lang='dataspec' %} 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: +num :: 1 byte Integer Valid values: 1-8 -Record size: 528 bytes -Total size: 1 + $num*528 +record size: 528 bytes +total size: 1 + $num*528 {% endhighlight %}Notes
@@ -1007,7 +1007,7 @@ Total size: 1 + $num*528VariableTunnelBuildReply
-{% highlight %} +{% highlight lang='dataspec' %} +----+----+----+----+----+----+----+----+ |num | BuildResponseRecords... +----+----+----+----+----+----+----+----+ diff --git a/i2p2www/pages/site/docs/spec/ssu.html b/i2p2www/pages/site/docs/spec/ssu.html index ac291f3d..fc2c80aa 100644 --- a/i2p2www/pages/site/docs/spec/ssu.html +++ b/i2p2www/pages/site/docs/spec/ssu.html @@ -64,7 +64,7 @@ the following bitfields: bit 2: extended options included bits 1-0: reserved {% endhighlight %} -{% highlight %} +{% highlight lang='dataspec' %} Header: 37+ bytes Encryption starts with the flag byte. +----+----+----+----+----+----+----+----+ @@ -192,7 +192,7 @@ This is the first message sent to establish a session.introKey -{% highlight %} +{% highlight lang='dataspec' %} +----+----+----+----+----+----+----+----+ | X, as calculated from DH | | | @@ -252,7 +252,7 @@ This is the response to a Session Request. signature and the following 8 bytes padding. -{% highlight %} +{% highlight lang='dataspec' %} +----+----+----+----+----+----+----+----+ | Y, as calculated from DH | | | @@ -343,8 +343,8 @@ bits 3-0: total identity fragments (F) 1-15
{% trans -%} The format of a single packet in the streaming protocol is: {%- endtrans %}
-{% highlight %} +{% highlight lang='dataspec' %} +----+----+----+----+----+----+----+----+ | send Stream ID | rcv Stream ID | @@ -26,7 +26,7 @@ The format of a single packet in the streaming protocol is: ... | +----+----+----+----+----+----+----+----+ | payload ... -+----+----+----+----// ++----+----+----+-// {% endhighlight %} diff --git a/i2p2www/pages/site/docs/spec/tunnel-message.html b/i2p2www/pages/site/docs/spec/tunnel-message.html index 9e5c2274..9874fd0b 100644 --- a/i2p2www/pages/site/docs/spec/tunnel-message.html +++ b/i2p2www/pages/site/docs/spec/tunnel-message.html @@ -32,16 +32,16 @@ After the tunnel messages are created, they are encrypted as described in-Tunnel ID: +Tunnel_ID :: 4 bytes - The ID of the next hop + the ID of the next hop -IV: +IV :: 16 bytes - The initialization vector + the initialization vector -Checksum: +Checksum :: 4 bytes - The first 4 bytes of the SHA256 hash of the remaining contents of the message concatenated with the IV + the first 4 bytes of the SHA256 hash of the remaining contents of the message concatenated with the IV -Nonzero padding: +Nonzero_padding :: 0 or more bytes - Random nonzero data for padding + random nonzero data for padding -Zero: +Zero :: 1 byte - The value 0x00 + the value 0x00 -Delivery Instructions: - Length varies but is typically 7, 39, 43, or 47 bytes +Delivery_Instructions :: + length varies but is typically 7, 39, 43, or 47 bytes Indicates the fragment and the routing for the fragment See below for specification -Message Fragment: +Message_Fragment :: 1 to 996 bytes, actual maximum depends on delivery instruction size A partial or full I2NP Message -Total Size: 1028 Bytes +total size: 1028 Bytes@@ -170,7 +170,7 @@ for more details.
If the MSB of the first byte is 0, this is an initial I2NP message fragment, or a complete I2NP message, and the instructions are:
-{% highlight %} +{% highlight lang='dataspec' %} +----+----+----+----+----+----+----+----+ |flag| Tunnel ID (opt) | | +----+----+----+----+----+ + @@ -251,31 +251,31 @@ Total length: Typical length is:If the MSB of the first byte is 1, this is a follow-on fragment, and the instructions are:
-{% highlight %} +{% highlight lang='dataspec' %} +----+----+----+----+----+----+----+ -|frag| Message ID | size | +|frag| Message_ID | size | +----+----+----+----+----+----+----+ {% endhighlight %}{% trans %}Unencrypted Contents:{% endtrans %}
-{% highlight %} +{% highlight lang='dataspec' %} +----+----+----+----+----+----+----+----+ | Y as calculated from DH | + +