Condi:Protocol specification

From Freehackers

Jump to: navigation, search

This document gives the specifications for a communication protocol to be used by Condi. The same link is used for control and data transfer (so called in-band control), for simplicity reasons, and in order to reduce problems with NAT and such.

There is a permanent link established between friends Condi, using TCP/IP.

This is work on progress and is higly subject to change

[edit] server

The server listens on all IP interfaces, using the port 8812 and the TCP protocol.


[edit] Handshake

The first byte is the length of the magic protocoli id : 14 The next fourteen bytes is the string "Condi protocol" coded in ASCII. A leading null byte is added.

The next 30 bytes are the UserId of the calling node, as defined on on this document

The next 30 bytes are the UserId of the destination peer. The total size is hence 76 bytes.

Upon receiving such a handshake, the destination peer shall check the parameters. The most important check being to see if the UserId of the the peer is known, as a friend. If checks are all ok, it should send the answer "OK" (three bytes including the leading '\0'). This node is now considered in state 'connected'.

Upon receiving the "OK", the other node also switch to state 'connected'.

Personal tools