Files
i2p.itoopie/apps/ministreaming/doc/protocol.txt

86 lines
2.1 KiB
Plaintext
Raw Normal View History

2004-04-08 18:23:48 +00:00
ministreaming protocol
**********************
2004-04-08 04:41:54 +00:00
Each message looks like the following
1 byte type
3 byte id
x byte payload.
messages from client to server have type 0xA0 to 0xAF,
messages from server to client have type 0x50 to 0x5F.
Each "connections" has 2 IDs, a client ID and a server ID.
These IDs may be any 3-byte values except 00 00 00, which is reserved.
All connections are created as PROP_RELIABILITY_GUARANTEED.
2004-04-08 18:23:48 +00:00
"actions" are the things a proper ministreaming implementation SHOULD
do when it receives such a message.
2004-04-08 04:41:54 +00:00
2004-04-08 18:23:48 +00:00
A "ministreaming connection" is a connection where the user of the
library can send data into or receive from.
2004-04-08 04:41:54 +00:00
Client->Server:
===============
0xA0 Send data
id: the server id
payload: the data to send
2004-04-08 18:23:48 +00:00
actions: send the data to the ministreaming connection
2004-04-08 04:41:54 +00:00
0xA1 SYN
id: the client id
payload: the public key dynamically created by the client
2004-04-08 18:23:48 +00:00
actions: create a server ID and create a ministreaming connection. When
successful, send an ACK back, otherwise a close.
2004-04-08 04:41:54 +00:00
0xA2 Close
id: the server id
payload: nothing
actions: close the connection
Server->Client
==============
0x50 Send data
id: the client id
payload: the data to send
2004-04-08 18:23:48 +00:00
actions: send the data to the ministreaming connection
2004-04-08 04:41:54 +00:00
0x51 ACK
id: the client id
payload: the server id
actions: nothing
0x52 Close
id: the client id
payload: nothing
actions: close the connection
Sample conversations:
=====================
a) Service not available (e.g. the server on the TCP port is not running)
C->S A1 12 34 56 key... (SYN, client ID = 12 34 56)
S->C 52 12 34 56 (Close)
b) Service available, server sends data, client closes
C->S A1 23 45 67 key... (SYN)
S->C 51 23 45 67 98 76 54 (ACK, server ID = 98 76 54)
S->C 50 23 45 67 data (Send data)
C->S A2 98 76 54 (Close)
c) Service available, client sends data first, server closes after answer (HTTP)
C->S A1 11 11 11 key... (SYN)
S->C 51 11 11 11 FF FF FF (ACK)
C->S A0 FF FF FF data (send data)
S->C 50 11 11 11 data (answer with data)
S->C 50 11 11 11 data (more data)
S->C 51 11 11 11 (Close)