19-09-2012, 12:34 PM
Command Control Protocol
CCP.DOC (Size: 101.5 KB / Downloads: 28)
Abstract
The MLP protocol defines a way to transfer messages from one point to another. The CCP protocol described here, defines a method to implement reliable command/answer exchange between two peers. Each peer can send a command message to the other peer. The peer will respond to this command by sending an answer. Each command/answer has an unique sequence number to distinguish between consecutive messages. A retransmission mechanism is implemented using a timer.
The command control protocol must establish a connection between to endpoints interconnected using the Message Level Protocol (MLP). The CCP protocol must guarantee that a command sent from A arrives at B and that the answer sent by B arrives to A. CCP uses mainly sequence number and retransmission to establish a working connection.
Description
The CCP protocol is not stream oriented like TCP but command oriented. This means that the transmitted units are not bytes, but commands which are in fact an array of bytes. Each command is composed of a command instruction and optional command arguments. The returned answer contains a status byte as well as optional results. The CCP protocol takes benefit of the message transmission of the MLP protocol. Anyway this protocol may also be used on other stream oriented protocol (like TCP) but in this case some encapsulation must be done to detect the start and the end of a command. Note that some high-level protocols like HTTP, TELNET, FTP,... define commands as the text that is located between two carriage return (CRLF).
Message Type, size and Protocol
The MLP protocol sends standard messages to the CCP layer. The CCP receives the datafield, type, size and protocol information. The actual implementation, supports two kinds of message types: Request and Answers. In order to reduce the message's size, the message type parameter is given in the type field of the MLP message directly. This is a small wrench to the modularity concept, but it is worth it.
Connection Concept
The sender (A) sends a command to the receiver (B). This command is a request message with a given sequence number. B receives this command, executes it and return an acknowledge to A. This acknowledge is an Answer Message with the sequence number corresponding to the sequence number of the request.
If A didn't receive an Answer in a given time, it will retransmit the request. This operation is done a certain number of times until the exchange is abandoned. To distinguish between two following commands, they must have different sequence number values. The sequence number of the second request must be equal to the sequence number of the first request plus 1. To initialize the sequence number on both side, A transmits a request with a command equal to SEQ_INIT. When B receives a request with such a command, it accepts and acknowledge it whatever the sequence number is. This allows remote synchronization. Since the communication is completely full-duplex, each exchange direction must manage its own sequence number.