{% extends "global/layout.html" %} {% block title %}{% trans %}Datagram Specification{% endtrans %}{% endblock %} {% block lastupdated %}{% trans %}May 2013{% endtrans %}{% endblock %} {% block accuratefor %}0.9.6{% endblock %} {% block content %}

{% trans -%} See the Datagrams page for an overview of the Datagrams API. {%- endtrans %}

{% trans %}Specification{% endtrans %}

{% trans %}Non-Repliable Datagrams{% endtrans %}

{% trans -%} Non-repliable datagrams have no 'from' address and are not authenticated. They are also called "raw" datagrams. Strictly speaking, they are not "datagrams" at all, they are just raw data. They are not handled by the datagram API. However, SAM and the I2PTunnel classes support "raw datagrams". {%- endtrans %}

{% trans %}Format{% endtrans %}

{% highlight lang='dataspec' %} +----+----+----+----+----// | payload... +----+----+----+----+----// length: 0 - unlimited (see notes) {% endhighlight %}

{% trans %}Notes{% endtrans %}

{% trans tunnelmessage=site_url('docs/spec/tunnel-message'), transports=site_url('docs/transport') -%} The practical length is limited by lower layers of protocols - the tunnel message spec limits messages to about 61.2 KB and the transports currently limit messages to about 32 KB, although this may be raised in the future. {%- endtrans %}

{% trans %}Repliable Datagrams{% endtrans %}

{% trans -%} Repliable datagrams contain a 'from' address and a signature. These add 427 bytes of overhead. {%- endtrans %}

Format

+----+----+----+----+----+----+----+----+
| from                                  |
+                                       +
|                                       |
~                                       ~
~                                       ~
|                                       |
+                                       +
|                                       |
|                                       |
+----+----+----+----+----+----+----+----+
| signature                             |
+                                       +
|                                       |
+                                       +
|                                       |
+                                       +
|                                       |
+                                       +
|                                       |
+----+----+----+----+----+----+----+----+
| payload...
+----+----+----+----//



from      :: a Destination
               length: 387+ bytes
               The originator and signer of the datagram

signature :: a Signature
             length: 40 bytes
             The DSA signature of the SHA256 hash of the payload, which may be verified by the
             DSA signing public key of the 'from' Destination

payload ::  The data
            Length: 0 - 32 KB (see notes)

Total length: Payload length + 427+


{% trans %}Notes{% endtrans %}

{% endblock %}