forked from I2P_Developers/i2p.www
Streaming and prop. 144 minor updates
This commit is contained in:
@@ -5,7 +5,7 @@ ECIES-X25519-AEAD-Ratchet
|
|||||||
:author: zzz, chisana, orignal
|
:author: zzz, chisana, orignal
|
||||||
:created: 2018-11-22
|
:created: 2018-11-22
|
||||||
:thread: http://zzz.i2p/topics/2639
|
:thread: http://zzz.i2p/topics/2639
|
||||||
:lastupdated: 2020-04-28
|
:lastupdated: 2020-05-01
|
||||||
:status: Open
|
:status: Open
|
||||||
:target: 0.9.46
|
:target: 0.9.46
|
||||||
:implementedin: 0.9.46
|
:implementedin: 0.9.46
|
||||||
@@ -2134,7 +2134,7 @@ Inputs:
|
|||||||
|
|
||||||
Generated:
|
Generated:
|
||||||
2) input_key_material = SESSTAG_CONSTANT
|
2) input_key_material = SESSTAG_CONSTANT
|
||||||
Must be unique for this chain (generated from chain key),
|
Must be unique for this tag set (generated from chain key),
|
||||||
so that the sequence isn't predictable, since session tags
|
so that the sequence isn't predictable, since session tags
|
||||||
go out on the wire in plaintext.
|
go out on the wire in plaintext.
|
||||||
|
|
||||||
@@ -3265,17 +3265,18 @@ ElGamal block:
|
|||||||
- 2 byte tag count
|
- 2 byte tag count
|
||||||
- 1024 bytes of tags (32 typical)
|
- 1024 bytes of tags (32 typical)
|
||||||
- 4 byte payload size
|
- 4 byte payload size
|
||||||
- 16 byte I2NP header
|
|
||||||
- 15 byte msg cert, id, exp.
|
|
||||||
- 33 byte Garlic deliv. inst.
|
|
||||||
- 15 byte clove cert, id, exp.
|
|
||||||
- 32 byte hash of payload
|
- 32 byte hash of payload
|
||||||
- 1 byte flags
|
- 1 byte flags
|
||||||
- 8 byte (average) padding to 16 bytes
|
- 1 byte clove count
|
||||||
1150 total
|
- 33 byte Garlic deliv. inst.
|
||||||
|
- 16 byte I2NP header
|
||||||
|
- 15 byte clove cert, id, exp.
|
||||||
|
- 15 byte msg cert, id, exp.
|
||||||
|
- 0 byte padding assuming 1936 byte message
|
||||||
|
1143 total
|
||||||
|
|
||||||
Total:
|
Total:
|
||||||
1664 bytes
|
1657 bytes
|
||||||
{% endhighlight %}
|
{% endhighlight %}
|
||||||
|
|
||||||
Existing session messages, same each direction:
|
Existing session messages, same each direction:
|
||||||
@@ -3287,19 +3288,20 @@ AES block:
|
|||||||
- 32 byte session tag
|
- 32 byte session tag
|
||||||
- 2 byte tag count
|
- 2 byte tag count
|
||||||
- 4 byte payload size
|
- 4 byte payload size
|
||||||
- 16 byte I2NP header
|
|
||||||
- 15 byte msg cert, id, exp.
|
|
||||||
- 33 byte Garlic deliv. inst.
|
|
||||||
- 15 byte clove cert, id, exp.
|
|
||||||
- 32 byte hash of payload
|
- 32 byte hash of payload
|
||||||
- 1 byte flags
|
- 1 byte flags
|
||||||
- 8 byte (average) padding to 16 bytes
|
- 1 byte clove count
|
||||||
158 total
|
- 33 byte Garlic deliv. inst.
|
||||||
|
- 16 byte I2NP header
|
||||||
|
- 15 byte msg cert, id, exp.
|
||||||
|
- 15 byte clove cert, id, exp.
|
||||||
|
- 0 byte padding assuming 1936 byte message
|
||||||
|
151 total
|
||||||
{% endhighlight %}
|
{% endhighlight %}
|
||||||
|
|
||||||
{% highlight lang='text' %}
|
{% highlight lang='text' %}
|
||||||
Four message total (two each direction)
|
Four message total (two each direction)
|
||||||
3644 bytes overhead
|
3616 bytes overhead
|
||||||
{% endhighlight %}
|
{% endhighlight %}
|
||||||
|
|
||||||
|
|
||||||
@@ -3374,7 +3376,7 @@ Handshake only:
|
|||||||
.. raw:: html
|
.. raw:: html
|
||||||
|
|
||||||
{% highlight lang='text' %}
|
{% highlight lang='text' %}
|
||||||
ElGamal: 1664 + 1664 = 3328 bytes
|
ElGamal: 1657 + 1657 = 3314 bytes
|
||||||
Ratchet: 148 _ 117 = 265 bytes
|
Ratchet: 148 _ 117 = 265 bytes
|
||||||
92% (approx. 12x) reduction compared to ElGamal/AES+SessionTags
|
92% (approx. 12x) reduction compared to ElGamal/AES+SessionTags
|
||||||
{% endhighlight %}
|
{% endhighlight %}
|
||||||
@@ -3384,7 +3386,7 @@ Long-term total (ignoring handshakes):
|
|||||||
.. raw:: html
|
.. raw:: html
|
||||||
|
|
||||||
{% highlight lang='text' %}
|
{% highlight lang='text' %}
|
||||||
ElGamal: 158 + 32 byte tag sent previously = 190 bytes
|
ElGamal: 151 + 32 byte tag sent previously = 183 bytes
|
||||||
Ratchet: 69 bytes
|
Ratchet: 69 bytes
|
||||||
64% (approx. 3x) reduction compared to ElGamal/AES+SessionTags
|
64% (approx. 3x) reduction compared to ElGamal/AES+SessionTags
|
||||||
{% endhighlight %}
|
{% endhighlight %}
|
||||||
|
@@ -3,8 +3,8 @@ Streaming Library Specification
|
|||||||
===============================
|
===============================
|
||||||
.. meta::
|
.. meta::
|
||||||
:category: Protocols
|
:category: Protocols
|
||||||
:lastupdated: February 2019
|
:lastupdated: May 2020
|
||||||
:accuratefor: 0.9.39
|
:accuratefor: 0.9.46
|
||||||
|
|
||||||
.. contents::
|
.. contents::
|
||||||
|
|
||||||
@@ -59,7 +59,12 @@ Protocol Specification
|
|||||||
Packet Format
|
Packet Format
|
||||||
-------------
|
-------------
|
||||||
|
|
||||||
The format of a single packet in the streaming protocol is:
|
The format of a single packet in the streaming protocol is shown below.
|
||||||
|
The minimum header size, without NACKs or option data, is 22 bytes.
|
||||||
|
|
||||||
|
There is no length field in the streaming protocol.
|
||||||
|
Framing is provided by the lower layers - I2CP and I2NP.
|
||||||
|
|
||||||
|
|
||||||
.. raw:: html
|
.. raw:: html
|
||||||
|
|
||||||
@@ -69,15 +74,17 @@ The format of a single packet in the streaming protocol is:
|
|||||||
+----+----+----+----+----+----+----+----+
|
+----+----+----+----+----+----+----+----+
|
||||||
| sequence Num | ack Through |
|
| sequence Num | ack Through |
|
||||||
+----+----+----+----+----+----+----+----+
|
+----+----+----+----+----+----+----+----+
|
||||||
| nc | NACKs ...
|
| nc | nc*4 bytes of NACKs (optional)
|
||||||
+----+----+----+----+----+----+----+----+
|
+----+----+----+----+----+----+----+----+
|
||||||
| rd | flags | opt size| opt data
|
| rd | flags | opt size| opt data
|
||||||
+----+----+----+----+----+----+----+----+
|
+----+----+----+----+----+----+----+----+
|
||||||
... |
|
... (optional, see below) |
|
||||||
+----+----+----+----+----+----+----+----+
|
+----+----+----+----+----+----+----+----+
|
||||||
| payload ...
|
| payload ...
|
||||||
+----+----+----+-//
|
+----+----+----+-//
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
sendStreamId :: 4 byte `Integer`
|
sendStreamId :: 4 byte `Integer`
|
||||||
Random number selected by the packet recipient before sending
|
Random number selected by the packet recipient before sending
|
||||||
the first SYN reply packet and constant for the life of the
|
the first SYN reply packet and constant for the life of the
|
||||||
|
Reference in New Issue
Block a user