Tunnel message dataspec

This commit is contained in:
str4d
2015-06-27 14:08:57 +00:00
parent 0fac429c6c
commit 414efb636f

View File

@@ -52,7 +52,7 @@ These are the contents of a tunnel data message after encryption.
<h4>Definition</h4> <h4>Definition</h4>
{% highlight lang='dataspec' %} {% highlight lang='dataspec' %}
Tunnel ID :: Tunnel ID :: `TunnelId`
4 bytes 4 bytes
the ID of the next hop the ID of the next hop
@@ -112,8 +112,8 @@ These are the contents of a tunnel data message when decrypted.
{% endhighlight %} {% endhighlight %}
<h4>Definition</h4> <h4>Definition</h4>
<pre> {% highlight lang='dataspec' %}
Tunnel ID :: Tunnel ID :: `TunnelId`
4 bytes 4 bytes
the ID of the next hop the ID of the next hop
@@ -133,10 +133,9 @@ Zero ::
1 byte 1 byte
the value 0x00 the value 0x00
Delivery Instructions :: Delivery Instructions :: `TunnelMessageDeliveryInstructions`
length varies but is typically 7, 39, 43, or 47 bytes length varies but is typically 7, 39, 43, or 47 bytes
Indicates the fragment and the routing for the fragment Indicates the fragment and the routing for the fragment
See <a href="#struct_TunnelMessageDeliveryInstructions">below</a> for specification
Message Fragment :: Message Fragment ::
1 to 996 bytes, actual maximum depends on delivery instruction size 1 to 996 bytes, actual maximum depends on delivery instruction size
@@ -144,7 +143,7 @@ Message Fragment ::
total size: 1028 Bytes total size: 1028 Bytes
</pre> {% endhighlight %}
<h4>Notes</h4> <h4>Notes</h4>
<ul><li> <ul><li>
@@ -196,8 +195,8 @@ or a complete (unfragmented) I2NP message, and the instructions are:</p>
{% endhighlight %} {% endhighlight %}
<h4>Definition</h4> <h4>Definition</h4>
<pre> {% highlight lang='dataspec' %}
flag: flag ::
1 byte 1 byte
Bit order: 76543210 Bit order: 76543210
bit 7: 0 to specify an initial fragment or an unfragmented message bit 7: 0 to specify an initial fragment or an unfragmented message
@@ -212,39 +211,39 @@ flag:
If 1, extended options are included If 1, extended options are included
bits 1-0: reserved, set to 0 for compatibility with future uses bits 1-0: reserved, set to 0 for compatibility with future uses
Tunnel ID: Tunnel ID :: `TunnelId`
4 bytes 4 bytes
Optional, present if delivery type is TUNNEL Optional, present if delivery type is TUNNEL
The destination tunnel ID The destination tunnel ID
To Hash: To Hash ::
32 bytes 32 bytes
Optional, present if delivery type is DESTINATION, ROUTER, or TUNNEL Optional, present if delivery type is DESTINATION, ROUTER, or TUNNEL
If DESTINATION, the SHA256 Hash of the destination If DESTINATION, the SHA256 Hash of the destination
If ROUTER, the SHA256 Hash of the router If ROUTER, the SHA256 Hash of the router
If TUNNEL, the SHA256 Hash of the gateway router If TUNNEL, the SHA256 Hash of the gateway router
Delay: Delay ::
1 byte 1 byte
Optional, present if delay included flag is set Optional, present if delay included flag is set
In tunnel messages: Unimplemented, never present; original specification: In tunnel messages: Unimplemented, never present; original specification:
bit 7: type (0 = strict, 1 = randomized) bit 7: type (0 = strict, 1 = randomized)
bits 6-0: delay exponent (2^value minutes) bits 6-0: delay exponent (2^value minutes)
Message ID: Message ID ::
4 bytes 4 bytes
Optional, present if this message is the first of 2 or more fragments Optional, present if this message is the first of 2 or more fragments
(i.e. if the fragmented bit is 1) (i.e. if the fragmented bit is 1)
An ID that uniquely identifies all fragments as belonging to a single message An ID that uniquely identifies all fragments as belonging to a single message
(the current implementation uses the <a href="{{ site_url('docs/spec/i2np') }}#struct_I2NPMessageHeader">I2NP Message ID</a>) (the current implementation uses `I2NPMessageHeader.msg_id`)
Extended Options: Extended Options ::
2 or more bytes 2 or more bytes
Optional, present if extend options flag is set Optional, present if extend options flag is set
Unimplemented, never present; original specification: Unimplemented, never present; original specification:
One byte length and then that many bytes One byte length and then that many bytes
size: size ::
2 bytes 2 bytes
The length of the fragment that follows The length of the fragment that follows
Valid values: 1 to approx. 960 in a tunnel message Valid values: 1 to approx. 960 in a tunnel message
@@ -254,7 +253,7 @@ Total length: Typical length is:
35 bytes for ROUTER / DESTINATION delivery or 39 bytes for TUNNEL delivery (unfragmented tunnel message); 35 bytes for ROUTER / DESTINATION delivery or 39 bytes for TUNNEL delivery (unfragmented tunnel message);
39 bytes for ROUTER delivery or 43 bytes for TUNNEL delivery (first fragment) 39 bytes for ROUTER delivery or 43 bytes for TUNNEL delivery (first fragment)
</pre> {% endhighlight %}
<h3>Follow-on Fragment Delivery Instructions</h3> <h3>Follow-on Fragment Delivery Instructions</h3>
<p>If the MSB of the first byte is 1, this is a follow-on fragment, and the instructions are:</p> <p>If the MSB of the first byte is 1, this is a follow-on fragment, and the instructions are:</p>
@@ -265,7 +264,7 @@ Total length: Typical length is:
{% endhighlight %} {% endhighlight %}
<h4>Definition</h4> <h4>Definition</h4>
<pre> {% highlight lang='dataspec' %}
frag :: frag ::
1 byte 1 byte
Bit order: 76543210 Bit order: 76543210
@@ -286,7 +285,7 @@ size ::
valid values: 1 to 996 valid values: 1 to 996
total length: 7 bytes total length: 7 bytes
</pre> {% endhighlight %}
<h3><a href="http://docs.i2p-projekt.de/javadoc/net/i2p/data/i2np/DeliveryInstructions.html">Delivery Instructions Javadoc</a></h3> <h3><a href="http://docs.i2p-projekt.de/javadoc/net/i2p/data/i2np/DeliveryInstructions.html">Delivery Instructions Javadoc</a></h3>