Binkp/1.0


Protocol description

Binkp is a protocol intended for use over bidirectional channels with reliable transmission. Data sent by both of the parties should be split into frames that have the following general format:

   binkp's frames:

    +---------------------- 0=data block, 1=message(command)
    |                +---- data block size / msg's argument size
    |                |
    7 6543210 76543210
   +-+-------+--------+--- ..... ---+
   | |   HI      LO   |             | -- data block / msg's argument
   +-+-------+--------+--- ..... ---+
   |<-    2 bytes   ->|<- 32K max ->|
      (frame header)    (frame data)

Frame header is 2 bytes long and defines type and length of data following the header.

If the highest bit of the header is set to 0, then all the frame data shall be appended to the current file being received. If such file is not open, frame data can be discarded.

Otherwise (if the highest bit is set to 1), frame data shall be parsed as a command changing protocol state. First byte of a command frame data is the command ID. The rest of the bytes carry command arguments. Command arguments are an arbitrary symbol string not necessarily limited by an '\0'. A command without arguments (e.g. M_OK) may look like this:

    7 6543210 76543210 76543210
   +-+-------+--------+--------+
   |1|      0        1|       4|
   +-+-------+--------+--------+
    |                |        +----- command ID (no arguments)
    |                +-------- frame length (excluding header)
    +- command frame flag

Binkp/1.0 commands and their arguments

Format: symbolic_command_name command_ID


An example of a typical session between two binkds

calling part sends called party sends
M_NUL "SYS ..." M_NUL "SYS ..."
M_NUL "ZYZ ..." M_NUL "ZYZ ..."
M_NUL "LOC ..." M_NUL "LOC ..."
M_NUL "VER ..." M_NUL "VER ..."
M_ADR "2:2/2.2@fidonet" M_ADR "3:3/3.3@fidonet"
M_PWD "password" (waiting for a password from remote)
M_OK "" or M_ERR "Bad password"
(waiting for M_OK) M_FILE "file2 200 42342434 0"
M_FILE "file1 100 423424244 0"data
data data
data data
M_EOB (got file1, acknowledging it)
(got file2, acknowledging it) M_GOT "file1 100 423424244"
M_GOT "file2 200 42342434" data
M_EOB

See also:

Binkd User Guide for discussion on a particular implementation of binkp protocol.

Original of this document in Russian, http://www.magadan.ru/~maloff/binkd/binkp.html.


© Copyright 1996-97 by Dima Maloff
© Copyright 1997 translated into English by Nick Soveiko