From c3669d71c62c817ec9cce58b43ba8746c502f0d6 Mon Sep 17 00:00:00 2001 From: str4d Date: Wed, 12 Jun 2013 03:20:48 +0000 Subject: [PATCH] Highlight docs/spec/* as DataSpec --- i2p2www/pages/site/docs/spec/datagrams.html | 5 +- i2p2www/pages/site/docs/spec/i2np.html | 194 +++++++++--------- i2p2www/pages/site/docs/spec/ssu.html | 38 ++-- i2p2www/pages/site/docs/spec/streaming.html | 4 +- .../pages/site/docs/spec/tunnel-message.html | 80 ++++---- i2p2www/pages/site/docs/transport/ntcp.html | 6 +- 6 files changed, 164 insertions(+), 163 deletions(-) diff --git a/i2p2www/pages/site/docs/spec/datagrams.html b/i2p2www/pages/site/docs/spec/datagrams.html index 0cb82d5d..1ba97f27 100644 --- a/i2p2www/pages/site/docs/spec/datagrams.html +++ b/i2p2www/pages/site/docs/spec/datagrams.html @@ -19,13 +19,12 @@ However, SAM and the I2PTunnel classes support "raw datagrams". {%- endtrans %}

{% trans %}Format{% endtrans %}

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

{% trans %}Notes{% endtrans %}

diff --git a/i2p2www/pages/site/docs/spec/i2np.html b/i2p2www/pages/site/docs/spec/i2np.html index c5e20008..6b771248 100644 --- a/i2p2www/pages/site/docs/spec/i2np.html +++ b/i2p2www/pages/site/docs/spec/i2np.html @@ -30,11 +30,11 @@ They are not complete messages. the length of the message payload, followed by a Hash, which is truncated to the first byte. After that the actual message data follows.

-{% highlight %} +{% highlight lang='dataspec' %} Standard (16 bytes): +----+----+----+----+----+----+----+----+ -|type| msg-id | expiration +|type| msg_id | expiration +----+----+----+----+----+----+----+----+ | size |chks| +----+----+----+----+----+----+----+----+ @@ -42,19 +42,19 @@ Standard (16 bytes): Short (SSU, 5 bytes): +----+----+----+----+----+ -|type| short expiration | +|type| short_expiration | +----+----+----+----+----+ {% endhighlight %}

Definition

-{% highlight %} +{% highlight lang='dataspec' %} type :: Integer length -> 1 byte purpose -> identifies the message type (see table below) -msg-id :: Integer +msg_id :: Integer length -> 4 bytes purpose -> uniquely identifies this message (for some time at least) @@ -63,7 +63,7 @@ expiration :: Date 8 bytes date this message will expire -short expiration :: Integer +short_expiration :: Integer 4 bytes date this message will expire (seconds since the epoch) @@ -114,7 +114,7 @@ where the far-end router's version is known and checksum generation can be disab TunnelId to receive messages on, followed by the Hash of our RouterIdentity. After that the TunnelId and the Hash of the next router's RouterIdentity follow.

Definition

-{% highlight %} +{% highlight lang='dataspec' %} Cleartext: +----+----+----+----+----+----+----+----+ | receive_tunnel | our_ident | @@ -196,7 +196,7 @@ ElGamal and AES encrypted: {% endhighlight %}

Definition

-{% highlight %} +{% highlight lang='dataspec' %} unencrypted: receive_tunnel :: TunnelId @@ -272,7 +272,7 @@ The two padding bytes from the block (the zero bytes at locations 0 and 257) are

BuildResponseRecord

-{% highlight %} +{% highlight lang='dataspec' %} unencrypted: +----+----+----+----+----+----+----+----+ | | @@ -291,7 +291,7 @@ unencrypted: +----+----+----+----+----+----+----+----+ {% endhighlight %}

Definition

-{% highlight %} +{% highlight lang='dataspec' %} unencrypted: bytes 0-31 : SHA-256 Hash of bytes 32-527 bytes 32-526 : random data @@ -314,7 +314,7 @@ total length: 528

GarlicClove

-{% highlight %} +{% highlight lang='dataspec' %} unencrypted: +----+----+----+----+----+----+----+----+ | Delivery Instructions | @@ -327,7 +327,7 @@ unencrypted: ~ ~ | | +----+----+----+----+----+----+----+----+ -| Clove ID | Expiration +| Clove ID | Expiration +----+----+----+----+----+----+----+----+ | Certificate | +----+----+----+----+----+----+----+ @@ -443,7 +443,7 @@ Defined in the Tun

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 %}

Definition

@@ -524,7 +524,7 @@ For security, the reply fields are ignored if the message is received down a tun
 
 
 

DatabaseLookup

-{% 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 lookup

A 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: Date

When 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 bytes

TunnelBuildReply

-{% 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 Records

VariableTunnelBuild

-{% 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*528

VariableTunnelBuildReply

-{% 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
sessionKey -{% highlight %} Fragment 0 through F-2 +{% highlight lang='dataspec' %} +----+----+----+----+----+----+----+----+ |info| cursize | | +----+----+----+ | @@ -356,8 +356,10 @@ bits 3-0: total identity fragments (F) 1-15 | arbitrary amount of uninterpreted | | data | +----+----+----+----+----+----+----+----+ +{% endhighlight %} Fragment F-1: +{% highlight lang='dataspec' %} +----+----+----+----+----+----+----+----+ |info| cursize | | +----+----+----+ | @@ -423,7 +425,7 @@ and is never sent. Transmission implemented as of release 0.8.9. sessionKey or introKey -{% highlight %} +{% highlight lang='dataspec' %} +----+----+----+----+----+----+----+----+ | no data | +----+----+----+----+----+----+----+----+ @@ -457,10 +459,10 @@ This is the first message sent from Alice to Bob to request an introduction to C introKey (or sessionKey, if Alice/Bob is established) -{% highlight %} +{% highlight lang='dataspec' %} + +----+----+----+----+----+----+----+----+ + | relay tag |size| Alice IP addr +----+----+----+----+----+----+----+----+ - | relay tag |size| Alice IP addr - +----+----+----+----+----+--- +----+----| | Port (A)|size| challenge bytes | +----+----+----+----+ + | to be delivered to Charlie | @@ -523,11 +525,11 @@ This is the response to a Relay Request and is sent from Bob to Alice. introKey (or sessionKey, if Alice/Bob is established) -{% highlight %} +{% highlight lang='dataspec' %} +----+----+----+----+----+----+----+----+ |size| Charlie IP | Port (C)|size| +----+----+----+----+----+----+----+----+ - | Alice IP | Port (A)| nonce + | Alice IP | Port (A)| nonce +----+----+----+----+----+----+----+----+ | arbitrary amount of | +----+----+ | @@ -576,7 +578,7 @@ This is the introduction for Alice, which is sent from Bob to Charlie. sessionKey -{% highlight %} +{% highlight lang='dataspec' %} +----+----+----+----+----+----+----+----+ |size| Alice IP | Port (A)|size| +----+----+----+----+----+----+----+----+ @@ -680,7 +682,7 @@ byte 1 sessionKey -{% highlight %} +{% highlight lang='dataspec' %} +----+----+----+----+----+----+----+----+ |flag| (additional headers, determined | +----+ | @@ -775,9 +777,9 @@ See the SSU overview introKey (or sessionKey if the connection has already been established) -{% highlight %} +{% highlight lang='dataspec' %} +----+----+----+----+----+----+----+----+ - | test nonce |size| Alice IP addr + | test nonce |size| Alice IP addr +----+----+----+----+----+----+----+----+ | Port (A)| | +----+----+----+ + @@ -788,7 +790,7 @@ See the SSU overview | | | +----+----+----+----+----+ | | arbitrary amount of | - |----+----+----+ | + +----+----+----+ | | uninterpreted data | +----+----+----+----+----+----+----+----+ {% endhighlight %} @@ -829,7 +831,7 @@ It is sent from Charlie to Alice as a part of the Introduction sequence. Minimal data message (no fragments, no ACKs, no NACKs, etc)
(Size: 39 bytes) -{% highlight %} +{% highlight lang='dataspec' %} +----+----+----+----+----+----+----+----+ | MAC | + + @@ -848,7 +850,7 @@ It is sent from Charlie to Alice as a part of the Introduction sequence. Minimal data message with payload
(Size: 46+fragmentSize bytes) -{% highlight %} +{% highlight lang='dataspec' %} +----+----+----+----+----+----+----+----+ | MAC | + + @@ -858,7 +860,7 @@ It is sent from Charlie to Alice as a part of the Introduction sequence. + + | | +----+----+----+----+----+----+----+----+ - |flag| time |flag|#frg| + |flag| time |flag|#frg| +----+----+----+----+----+----+----+----+ messageId | frag info | | +----+----+----+----+----+----+ | diff --git a/i2p2www/pages/site/docs/spec/streaming.html b/i2p2www/pages/site/docs/spec/streaming.html index 4fd00950..c0a8c84b 100644 --- a/i2p2www/pages/site/docs/spec/streaming.html +++ b/i2p2www/pages/site/docs/spec/streaming.html @@ -12,7 +12,7 @@ See the Streaming page for an overview of the Streaming Library.

{% 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 Message (Encrypted)

These are the contents of a tunnel data message after encryption. -{% highlight %} +{% highlight lang='dataspec' %} +----+----+----+----+----+----+----+----+ -| Tunnel ID | IV | +| Tunnel_ID | IV | +----+----+----+----+ + | | + +----+----+----+----+ | | | +----+----+----+----+ + | | -+ Encrypted Data + ++ Encrypted_Data + ~ ~ | | + +-------------------+ @@ -50,29 +50,29 @@ These are the contents of a tunnel data message after encryption. {% endhighlight %}

Definition

-{% highlight %} -Tunnel ID: +{% highlight lang='dataspec' %} +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 -Encrypted Data +Encrypted_Data :: 1008 bytes - The encrypted tunnel message + the encrypted tunnel message -Total Size: 1028 Bytes +total size: 1028 Bytes {% endhighlight %}

Tunnel Message (Decrypted)

These are the contents of a tunnel data message when decrypted. -{% highlight %} +{% highlight lang='dataspec' %} +----+----+----+----+----+----+----+----+ -| Tunnel ID | IV | +| Tunnel_ID | IV | +----+----+----+----+ + | | + +----+----+----+----+ @@ -112,36 +112,36 @@ These are the contents of a tunnel data message when decrypted.

Definition

-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.

First Fragment Delivery Instructions

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:

Follow-on Fragment Delivery Instructions

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 %}

Definition

-{% highlight %} -frag: +{% highlight lang='dataspec' %} +frag :: 1 byte - Binary 1nnnnnnd - The first bit is 1 to indicate this is a follow-on fragment + binary 1nnnnnnd + the first bit is 1 to indicate this is a follow-on fragment nnnnnn is the 6 bit fragment number from 1 to 63 d is 1 to indicate the last fragment, 0 otherwise -Message ID: +Message_ID :: 4 bytes - The same ID specified in the first fragment + the same ID specified in the first fragment -size: +size :: 2 bytes - The length of the fragment that follows - Valid values: 1 to 996 + the length of the fragment that follows + valid values: 1 to 996 -Total length: 7 bytes +total length: 7 bytes {% endhighlight %} diff --git a/i2p2www/pages/site/docs/transport/ntcp.html b/i2p2www/pages/site/docs/transport/ntcp.html index 6424b215..25aac00e 100644 --- a/i2p2www/pages/site/docs/transport/ntcp.html +++ b/i2p2www/pages/site/docs/transport/ntcp.html @@ -34,7 +34,7 @@ After establishment, the NTCP transport sends individual I2NP messages, with a simple checksum. The unencrypted message is encoded as follows: {%- endtrans %}

-{% highlight %} +{% highlight lang='dataspec' %} +-------+-------+--//--+---//----+-------+-------+-------+-------+ | sizeof(data) | data | padding | Adler checksum of sz+data+pad | +-------+-------+--//--+---//----+-------+-------+-------+-------+ @@ -60,7 +60,7 @@ The minimum data size is 1. One special case is a metadata message where the sizeof(data) is 0. In that case, the unencrypted message is encoded as: {%- endtrans %}

-{% highlight %} +{% highlight lang='dataspec' %} +-------+-------+-------+-------+-------+-------+-------+-------+ | 0 | timestamp in seconds | uninterpreted +-------+-------+-------+-------+-------+-------+-------+-------+ @@ -190,7 +190,7 @@ This is the DH reply. Bob sends Alice: {% trans %}Size:{% endtrans %} 304 bytes {% endhighlight %}

{% trans %}Unencrypted Contents:{% endtrans %}

-{% highlight %} +{% highlight lang='dataspec' %} +----+----+----+----+----+----+----+----+ | Y as calculated from DH | + +