Streaming and prop. 144 minor updates

This commit is contained in:
zzz
2020-05-01 11:15:12 +00:00
parent 8d6a79cac5
commit d28e6393ed
2 changed files with 32 additions and 23 deletions

View File

@@ -5,7 +5,7 @@ ECIES-X25519-AEAD-Ratchet
:author: zzz, chisana, orignal
:created: 2018-11-22
:thread: http://zzz.i2p/topics/2639
:lastupdated: 2020-04-28
:lastupdated: 2020-05-01
:status: Open
:target: 0.9.46
:implementedin: 0.9.46
@@ -2134,7 +2134,7 @@ Inputs:
Generated:
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
go out on the wire in plaintext.
@@ -3265,17 +3265,18 @@ ElGamal block:
- 2 byte tag count
- 1024 bytes of tags (32 typical)
- 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
- 1 byte flags
- 8 byte (average) padding to 16 bytes
1150 total
- 1 byte clove count
- 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:
1664 bytes
1657 bytes
{% endhighlight %}
Existing session messages, same each direction:
@@ -3287,19 +3288,20 @@ AES block:
- 32 byte session tag
- 2 byte tag count
- 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
- 1 byte flags
- 8 byte (average) padding to 16 bytes
158 total
- 1 byte clove count
- 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 %}
{% highlight lang='text' %}
Four message total (two each direction)
3644 bytes overhead
3616 bytes overhead
{% endhighlight %}
@@ -3374,7 +3376,7 @@ Handshake only:
.. raw:: html
{% highlight lang='text' %}
ElGamal: 1664 + 1664 = 3328 bytes
ElGamal: 1657 + 1657 = 3314 bytes
Ratchet: 148 _ 117 = 265 bytes
92% (approx. 12x) reduction compared to ElGamal/AES+SessionTags
{% endhighlight %}
@@ -3384,7 +3386,7 @@ Long-term total (ignoring handshakes):
.. raw:: html
{% highlight lang='text' %}
ElGamal: 158 + 32 byte tag sent previously = 190 bytes
ElGamal: 151 + 32 byte tag sent previously = 183 bytes
Ratchet: 69 bytes
64% (approx. 3x) reduction compared to ElGamal/AES+SessionTags
{% endhighlight %}

View File

@@ -3,8 +3,8 @@ Streaming Library Specification
===============================
.. meta::
:category: Protocols
:lastupdated: February 2019
:accuratefor: 0.9.39
:lastupdated: May 2020
:accuratefor: 0.9.46
.. contents::
@@ -59,7 +59,12 @@ Protocol Specification
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
@@ -69,15 +74,17 @@ The format of a single packet in the streaming protocol is:
+----+----+----+----+----+----+----+----+
| sequence Num | ack Through |
+----+----+----+----+----+----+----+----+
| nc | NACKs ...
| nc | nc*4 bytes of NACKs (optional)
+----+----+----+----+----+----+----+----+
| rd | flags | opt size| opt data
+----+----+----+----+----+----+----+----+
... |
... (optional, see below) |
+----+----+----+----+----+----+----+----+
| payload ...
+----+----+----+-//
sendStreamId :: 4 byte `Integer`
Random number selected by the packet recipient before sending
the first SYN reply packet and constant for the life of the