ICB Protocol v2

This is an overview of the v2 XML icb protocol. It's a quick hack to make icbd compatable with a flash-based icb client used for other applications than icb historically has been used. It's also a proof of concept for using the icb system with an XML protocol.

Future real development will re-address the idea of the actual XML structure and DTD.

Basic Packet Layout:

The basic unit ICB clients and server communicate with is a packet with the following layout:

<PACKET PROTO="2" TYPE="type">
<DATA TYPE="DTYPE">VALUE</DATA>
<DATA TYPE="DTYPE">VALUE 2</DATA>
...
<DATA TYPE="DTYPE">VALUE N</DATA>
</PACKET>

where:
PROTO="2" defines the packet as part of this protocol
`type' is the type of packet this is (see below for valid packet types)
`sender-id' is a unique id of the sender of this packet
`dest-id' is a unique id of the recipient
DTYPE's can be one of the following:
VALUE's are typically just simple text but may also be XML sub nodes (such as in the WHO packet)

ICB Packet Types

LOGIN : Login packet

Client to Server

  • Packet Type: LOGIN
  • Sender: No, Recipient: Yes, Param: 4 - 6, Data: 0

    Thus the ICB Login Packet has the following layout:

    <PACKET PROTO="2" TYPE="LOGIN">
    <DATA TYPE="recipient">server</DATA>
    <DATA TYPE="param">Loginid</DATA>
    <DATA TYPE="param">Nickname</DATA>
    <DATA TYPE="param">DefaultGroup</DATA>
    <DATA TYPE="param">Command</DATA>
    <DATA TYPE="param">Password</DATA>
    <DATA TYPE="param">GroupStatus</DATA>
    </PACKET>
    

    Server to Client

    None, the server response is sent as a LOGINOK packet.

    LOGINOK : Login OK packet

    Client to Server

    None, the client request is sent using a LOGIN packet.

    Server to Client

    Thus the ICB Login OK Packet has the following layout:

    <PACKET PROTO="2" TYPE="LOGINOK">
    <DATA TYPE="SENDER">Server</DATA>
    <DATA TYPE="data">result-code</DATA>
    </PACKET>
    

    OPEN : Open Message packet

    Client to Server

    Thus the ICB Open Packet has the following layout:

    <PACKET PROTO="2" TYPE="OPEN">
    <DATA TYPE="DATA">MessageText</DATA>
    </PACKET>
    

    Server to Client

    Thus the ICB Open Packet has the following layout:

    <PACKET PROTO="2" TYPE="OPEN">
    <DATA TYPE="SENDER">Nickname</DATA>
    <DATA TYPE="DATA">MessageText</DATA>
    </PACKET>
    

    PERSONAL : Personal Message Packet

    Client to Server

    Not valid. Clients cannot send servers Personal Message packets.

    Server to Client

    Thus the ICB Personal Message Packet has the following layout:

    <PACKET PROTO="2" TYPE="PERSONAL">
    <DATA TYPE="SENDER">Nickname</DATA>
    <DATA TYPE="DATA">MessageText</DATA>
    </PACKET>
    

    STATUS: Status Message Packet

    Client to Server

    Not valid. Clients cannot send servers Status Message packets.

    Server to Client

    Thus the ICB Status Message Packet has the following layout:

    <PACKET PROTO="2" TYPE="STATUS">
    <DATA TYPE="PARAM">Category</DATA>
    <DATA TYPE="DATA">MessageText</DATA>
    </PACKET>
    

    ERROR: Error Message Packet

    Client to Server

    Not valid. Clients cannot send servers Error Message packets.

    Server to Client

    Thus the ICB Error Message Packet has the following layout:

    <PACKET PROTO="2" TYPE="ERROR">
    <DATA TYPE="PARAM">Category</DATA>
    <DATA TYPE="DATA">ErrorText</DATA>
    </PACKET>
    

    IMPORTANT: Important Message Packet

    Client to Server

    Not valid. Clients cannot send servers Important Message packets.

    Server to Client

    Thus the ICB Important Message Packet has the following layout:

    <PACKET PROTO="2" TYPE="IMPORTANT">
    <DATA TYPE="PARAM">Category</DATA>
    <DATA TYPE="DATA">MessageText</DATA>
    </PACKET>
    

    EXIT: Exit Packet

    Client to Server

    Not valid. Clients cannot send servers Exit Message packets.

    Server to Client

    Thus the ICB Exit Message Packet has the following layout:

    <PACKET PROTO="2" TYPE="EXIT">
    <DATA TYPE="DATA">ReasonText</DATA>
    </PACKET>
    

    COMMAND: Command Packet

    Client to Server

    Thus the ICB Command Packet has the following layout:

    <PACKET PROTO="2" TYPE="COMMAND">
    <DATA TYPE="RECIPIENT">Nickname</DATA>
    <DATA TYPE="PARAM">Command</DATA>
    <DATA TYPE="PARAM">Optional Command Arg 1</DATA>
    ...
    <DATA TYPE="PARAM">Optional Command Arg N</DATA>
    <DATA TYPE="DATA">Optional Data 0</DATA>
    ...
    <DATA TYPE="DATA">Optional Data N</DATA>
    </PACKET>
    

    Server to Client

    Not valid. Servers cannot send clients Command packets.

    CMDOUT: Command Output Packet

    Client to Server

    Not valid. Clients cannot send servers Command Output packets.

    Server to Client

    Thus the ICB Command Output Packet has the following layout:

    <PACKET PROTO="2" TYPE="CMDOUT">
    <DATA TYPE="SENDER">Nickname</DATA>
    <DATA TYPE="PARAM">OutputType</DATA>
    <DATA TYPE="PARAM">Optional Arg 1</DATA>
    ...
    <DATA TYPE="PARAM">Optional Arg N</DATA>
    <DATA TYPE="DATA">Optional Output 0</DATA>
    ...
    <DATA TYPE="DATA">Optional Output N</DATA>
    </PACKET>
    

    PROTOCOL: Protocol Packet

    Client to Server

    Thus the ICB Protocol Packet has the following layout:

    <PACKET PROTO="2" TYPE="PROTOCOL">
    <DATA TYPE="PARAM">ProtoLevel</DATA>
    <DATA TYPE="PARAM">HostID</DATA>
    <DATA TYPE="PARAM">ClientVersionID</DATA>
    </PACKET>
    

    Server to Client

    Thus the ICB Protocol Packet has the following layout:

    <PACKET PROTO="2" TYPE="PROTOCOL">
    <DATA TYPE="PARAM">ProtoLevel</DATA>
    <DATA TYPE="PARAM">HostID</DATA>
    <DATA TYPE="PARAM">ServerVersionID</DATA>
    </PACKET>
    

    BEEP: Beep Packet

    Client to Server

    Not valid. Clients cannot send servers Beep packets.

    Server to Client

    Thus the ICB Beep Packet has the following layout:

    <PACKET PROTO="2" TYPE="BEEP">
    <DATA TYPE="SENDER">Nickname</DATA>
    </PACKET>
    

    PING: Ping Packet

    Client to Server

    Note; the user of a client sends ping requests as a sub-command of packet type COMMAND. A client to server PING packet is handled by the client itself in response to a server PING packet.

    Thus the ICB Ping Packet has the following layout:

    <PACKET PROTO="2" TYPE="PING"></PACKET>
    

    Server to Client

    Thus the ICB Ping Packet has the following layout:

    <PACKET PROTO="2" TYPE="PING"></PACKET>
    

    PONG: Pong Packet

    Client to Server

    Thus the ICB Pong Packet has the following layout:

    <PACKET PROTO="2" TYPE="PONG"></PACKET>
    

    Server to Client

    None; the server processes the PONG packet from the client as a response to a PING packet.

    NOOP: NOOP Packet

    Client to Server

    Thus the ICB NOOP has the following layout:

    <PACKET PROTO="2" TYPE="NOOP"></PACKET>
    

    Server to Client

    None.

    USERS: Number of Users Packet

    Client to Server

    Thus the ICB USERS packet has the following layout:

    <PACKET PROTO="2" TYPE="USERS">
    <DATA TYPE="PARAM">.</DATA>
    </PACKET>
    

    Server to Client

    Thus the ICB USERS packet has the following layout:

    <PACKET PROTO="2" TYPE="USERS">
    <DATA TYPE="DATA">10</DATA>
    </PACKET>
    

    WHO: Who Packet

    Packet Type: WHO (Proto v2 or later required)

    Client to Server

    Thus the ICB WHO packet has the following layout:

    <PACKET PROTO="2" TYPE="WHO">
    <DATA TYPE="PARAM">user</DATA>
    <DATA TYPE="PARAM">.</DATA>
    </PACKET>
    

    Server to Client

    Thus the ICB WHO has the following layout:

    <PACKET PROTO="2" TYPE="WHO">
    <DATA TYPE="PARAM">user</DATA>
    <DATA TYPE="DATA">
    <USER IDLE="sec" LOGIN="time_t" USER="loginID" SITE="siteID" REGISTERED="Yes"
        AWAY="No" GROUP="groupName" ARRIVAL="time_t in this group">Nickname</USER>
    </DATA>
    ...
    <DATA TYPE="DATA">
    <USER IDLE="sec" LOGIN="time_t" USER="loginID" SITE="siteID" REGISTERED="Yes"
        AWAY="No" GROUP="groupName" ARRIVAL="time_t in this group">Nickname N</USER>
    </DATA>
    </PACKET>
    

    Sub-Command Packet Types

    The following packet types have been migrated from sub-command types to full packet types. The ones listed below haven't been full migrated yet and are included as a listing that I can update as I make my way through. Eventually, this text will disappear. See "COMMAND and CMDOUT Packet Types" below for further information.

    These already exist as top-level packet command types, but need to be updated to reflect their client to server communication.

    These need to be migrated entirely.

    The Life Cycle of an ICB session

    The steps a typical ICB session goes thru is as follows:

    Further Information on Various Packet Types

    Login Packet

    The client can send one and only one Login Packet to the server.

    Message IDs in Command and Command Output

    If the client sends the server a packet that contains an ID type, all output sent from the server to the client in response to that Command should place the same Message ID in the Command output packet. This is not yet supported.

    Ping and Pong

    A client can ping another user to see if their client is active. Clients use the Ping sub-command of a COMMAND packet, the server then sends a PING packet to the other user. That user's client processes the PING packet and returns a PONG packet. The server computes the elapsed time and sends a summary back to the original user. Note that some clients can be paused in "page" mode waiting for the user to continue to the next page. In some clients this may cause a PING request to not be processed until the user has caught up on reading their ICB output and the client becomes active again.

    COMMAND and CMDOUT Packet Types

    Protocol version 1 implemented about 30 sub-commands as part of the COMMAND packet type. This may have been a result of using single-character identifiers for each packet type, but it's hard to know at this point. Regardless, protocol version 2 (and up) takes these sub-command types and moves them up into the main protocol where they can be more clearly defined and used. the COMMAND and CMDOUT packet types remain for now, and likely will be renamed to LOCAL_COMMAND or somesuch to allow for server-specific extensions that don't require a client to be updated and recompiled.

    This is how it used to work and is included since in some cases all of the functionality migration hasn't been finished:

    There are various Command Output Types. The ones currently defined are:

    Protocol Negotiation

    There is currently no way for the client and server to negotiate a protocol level. A proposed method for implementing it will be added here at a later date.


    Last Modified: Mon Apr 19 16:16:18 PDT 2004 by falcon@icb.net