FIPA Agent Message Transport Envelope Representation in Bit-Efficient Encoding Specification


Document title

FIPA AMT Envelope Representation in Bit-Efficient Encoding Specification

Document number


Document source

FIPA TC Agent Management

Document status


Date of this status





Change history

See Informative Annex B — ChangeLog










© 1996-2002 Foundation for Intelligent Physical Agents
Geneva, Switzerland


Use of the technologies described in this specification may infringe patents, copyrights or other intellectual property rights of FIPA Members and non-members. Nothing in this specification should be construed as granting permission to use any of the technologies described. Anyone planning to make use of technology covered by the intellectual property rights of others should first obtain permission from the holder(s) of the rights. FIPA strongly encourages anyone implementing any part of this specification to determine first whether part(s) sought to be implemented are covered by the intellectual property of others, and, if so, to obtain appropriate licenses or other permission from the holder(s) of such intellectual property prior to implementation. This specification is subject to change without notice. Neither FIPA nor any of its Members accept any responsibility whatsoever for damages or liability, direct or consequential, which may result from the use of this specification.


The Foundation for Intelligent Physical Agents (FIPA) is an international organization that is dedicated to promoting the industry of intelligent agents by openly developing specifications supporting interoperability among agents and agent-based applications. This occurs through open collaboration among its member organizations, which are companies and universities that are active in the field of agents. FIPA makes the results of its activities available to all interested parties and intends to contribute its results to the appropriate formal standards bodies where appropriate.

The members of FIPA are individually and collectively committed to open competition in the development of agent-based applications, services and equipment. Membership in FIPA is open to any corporation and individual firm, partnership, governmental body or international organization without restriction. In particular, members are not bound to implement or use specific agent-based standards, recommendations and FIPA specifications by virtue of their participation in FIPA.

The FIPA specifications are developed through direct involvement of the FIPA membership. The status of a specification can be either Preliminary, Experimental, Standard, Deprecated or Obsolete. More detail about the process of specification may be found in the FIPA Document Policy [f-out-00000] and the FIPA Specifications Policy [f-out-00003]. A complete overview of the FIPA specifications and their current status may be found on the FIPA Web site.

FIPA is a non-profit association registered in Geneva, Switzerland. As of June 2002, the 56 members of FIPA represented many countries worldwide. Further information about FIPA as an organization, membership information, FIPA specifications and upcoming meetings may be found on the FIPA Web site at


1     Scope. 1

2     Bit-Efficient Envelope Representation. 2

2.1      Component Name. 2

2.2      ACC Processing of Bit-Efficient Envelope. 2

2.3      Concrete Message Envelope Syntax. 3

2.4      Notes on the Grammar Rules. 5

3     References. 7

4     Informative Annex A — Examples. 8

5     Informative Annex B — ChangeLog. 12

5.1      2002/11/01 – version C by TC X2S. 12

1         Scope

This document deals with message transportation between inter-operating agents and also forms part of the FIPA Agent Management Specification [FIPA00023]. It contains specifications for:


·         Syntactic representation of a message envelope in bit-efficient form.


Informative examples of the bit-efficient envelope syntax are given in Section 4.


2         Bit-Efficient Envelope Representation

This section gives the concrete syntax for the message envelope specification that must be used to transport messages over a Message Transport Protocol (MTP - see [FIPA00067]). This concrete syntax is designed to complement [FIPA00069].


The message envelope transport syntax is expressed in standard EBNF format[1] (see Table 1).


Grammar rule component


Terminal tokens are enclosed in double quotes


Non-terminals are written as capitalised identifiers


Square brackets denote an optional construct

[ "," OptionalArg ]

Vertical bars denote an alternative between choices

Integer | Float

Asterisk denotes zero or more repetitions of the preceding expression


Plus denotes one or more repetitions of the preceding expression


Parentheses are used to group expansions

( A | B )*

Productions are written with the non-terminal name on the left-hand side, expansion on the right-hand side and terminated by a full stop

ANonTerminal = "terminal".

0x?? is a hexadecimal byte



Table 1: EBNF Rules


2.1        Component Name

The name assigned to this component is:




2.2        ACC Processing of Bit-Efficient Envelope

According to [FIPA00067], a FIPA compliant ACC is not allowed to modify any element of the envelope that it receives. It is however allowed to update a value in any of the envelope’s parameters by adding a new ExtEnvelope element at the beginning of the messageEnvelopes sequence. This new element is required to have only those parameter values that the ACC wishes to add or update plus a new ReceivedObject element[2].


The following pseudo code algorithm may be used to obtain the latest values for each of the envelope’s parameters.


EnvelopeWithAllParams := new empty Envelope

while (not all envelopes processed) {

  tempEnvelope = getNextEnvelope;

  foreach parameter in an envelope {

    if ((this parameter has no value in EnvelopeWithAllParams)

       AND (this parameter has a value in tempEnvelope))

    then copy the value of this parameter to EnvelopeWithAllParams




EnvelopeWithAllParams now contains the latest values for all the parameters set in the envelope.


2.3        Concrete Message Envelope Syntax

MessageEnvelope         = (ExtEnvelope)* BaseEnvelope Payload.


BaseEnvelope            = BaseEnvelopeHeader (Parameter)* EndOfEnvelope.


ExtEnvelope             = ExtEnvelopeHeader (Parameter)* EndOfEnvelope.


BaseEnvelopeHeader      = BaseMsgId EnvLen ACLRepresentation Date.


ExtEnvelopeHeader       = ExtMsgId EnvLen ReceivedObject.


EnvLen                  = Len16

                        | JumboEnvelope.        /* See comment 1 (Section 2.4) */


JumboEnvelope           = EmptyLen16 Len32.


BaseMsgId               = 0xFE.          


ExtMsgId                = 0xFD.    


EndOfEnvelope           = EndOfCollection.


Payload                 =                       /* See comment 2 (Section 2.4) */


Parameter               = PredefinedParameter

                        | UserDefinedParameter. /* See comment 5 (Section 2.4) */


PredefinedParameter     = 0x02 AgentIdentifierSequence      /* to                   */

| 0x03 AgentIdentifier              /* from                 */

| 0x04 ACLRepresentation            /* acl-representation  */

| 0x05 Comments                     /* comments             */

                        | 0x06 PayloadLength                /* payload-length       */

                        | 0x07 PayloadEncoding              /* payload-encoding     */

                        | 0x09 IntendedReceiver             /* intended-receiver    */

                        | 0x0a ReceivedObject               /* received             */

                        | 0x0b TransportBehaviour.          /* transport-behaviour  */


ACLRepresentation       = UserDefinedACLRepresentation

                        | 0x10          /* fipa.acl.rep.bitefficient.std [FIPA00069] */

                        | 0x11          /* fipa.acl.rep.string.std [FIPA00070]       */

                        | 0x12.         /* fipa.acl.rep.xml.std [FIPA00071]          */


Date                    = BinDateTimeToken.


Comments                = NullTerminatedString.


PayloadLength           = BinNumber.


PayloadEncoding         = NullTerminatedString.


IntendedReceiver        = AgentIdentifierSequence.


TransportBehaviour      = Any.



                        = 0x00 NullTerminatedString.


ReceivedObject          = By








By                      = URL.


From                    = 0x02 URL.


Id                      = 0x03 NullTerminatedString.


Via                     = 0x04 NullTerminatedString.


BinNumber               = Digits.               /* See comment 4 (Section 2.4) */


Digits                  = CodedNumber+.


NullTerminatedString    = String 0x00.   


UserDefinedParameter    = 0x00 Keyword NullTerminatedString.


KeyWord                 = NullTerminatedString.


Any                     = 0x14 NullTerminatedString

                        | ByteLenEncoded.


ByteLenEncoded          = 0x16 Len8 ByteSequence

                        | 0x17 Len16 ByteSequence

                        | 0x19 Len32 ByteSequence.


ByteSequence            = Byte*.


AgentIdentifierSequence = (AgentIdentifier)* EndOfCollection.


AgentIdentifier         = 0x02 AgentName






AgentName               = NullTerminatedString.


Addresses               = 0x02 UrlSequence.


Resolvers               = 0x03 AgentIdentifierSequence.


UserDefinedParameter    = 0x05 NullTerminatedString Any.


UrlSequence             = (URL)* EndOfCollection.


URL                     = NullTerminatedString.


StringSequence          = (NullTerminatedString)* EndOfCollection.


BinDateTimeToken        = 0x20 BinDate                      /* Absolute time     */

                        | 0x21 BinDate                     /* Relative time (+) */

                        | 0x22 BinDate                      /* Relative time (-) */

                        | 0x24 BinDate TypeDesignator      /* Absolute time     */

                        | 0x25 BinDate TypeDesignator.      /* Relative time (+) */

                        | 0x26 BinDate TypeDesignator.      /* Relative time (-) */


BinDate                 = Year Month Day Hour Minute Second Millisecond.

                                          /* See comment 3 (Section 2.4) */

EndOfCollection         = 0x01.


EmptyLen16              = 0x00 0x00.


Len8                    = Byte.           /* See comment 6 (Section 2.4) */


Len16                   = Short.          /* See comment 6 (Section 2.4) */


Len32                   = Long.           /* See comment 6 (Section 2.4) */


Year                    = Byte Byte.


Month                   = Byte.


Day                     = Byte.


Hour                    = Byte.


Minute                  = Byte.


Second                  = Byte.


Millisecond             = Byte Byte.


String                  =                 /* As in [FIPA00070]           */


CodedNumber             =                 /* See comment 4 (Section 2.4) */


TypeDesignator          =                 /* As in [FIPA00070]           */


2.4        Notes on the Grammar Rules

1.       Normally, the length of an envelope does not exceed 65536 bytes (2^16). Therefore, only two bytes are reserved for envelope length (len16). However, the syntax also allows envelopes with greater lengths. In this case, the sender sets the reserved envelope length parameter (two bytes) to length zero and the following four bytes are used to represent the real length (maximum envelope length is therefore 2^32 bytes).


The length of the envelope comprises all the parts of the envelope, including the message identifier and the length parameter itself. The length of the envelope is expressed in the network byte order.


2.       The payload (ACL message) starts at the first byte after the BaseEnvelope. White space is allowed between the envelope and the ACL message only if the syntax of ACL allows this. For instance, fipa.acl.rep.string.std allows white space, but fipa.acl.rep.bitefficient.std does not.


3.       Dates are coded as numbers, that is, four bits are reserved for each ASCII number (see comment 4 below). Information as to whether the type designator is present or not is coded into an identifier byte. These parameters always have static length (two bytes for year and milliseconds, one byte for other components).


4.       Numbers are coded by reserving four bits for each digit in the number’s ASCII representation, that is, two ASCII numbers are coded into one byte. Table 2 shows a 4-bit code for each number and special codes that may appear in ASCII coded numbers.


If the ASCII presentation of a number contains an odd number of characters, the last four bits of the coded number are set to zero (the Padding token), otherwise an additional 0x00 byte is added to the end of the coded number. If the number to be coded is either an integer, decimal number, or octal number, the identifier byte 0x12 is used. For hexadecimal numbers, the identifier byte 0x13 is used. Hexadecimal numbers are converted to integers before coding (the coding scheme does not allow characters from a through f to appear in number form).









































Table 2: Binary Representation of Number Tokens


5.       All envelope parameters defined in [FIPA00067] have a predefined code. If an envelope contains a user-defined parameter, an extension mechanism is used (byte 0x00). The names of the user-defined envelope parameters should have the prefix “X-CompanyName-”.


6.       Byte is a one-byte code word, Short is a short integer (two bytes, network byte order) and Long is a long integer (four bytes, network byte order).


3         References

[FIPA00067]      FIPA Agent Message Transport Service Specification. Foundation for Intelligent Physical Agents, 2000.

[FIPA00069]      FIPA ACL Message Representation in Bit-Efficient Encoding Specification. Foundation for Intelligent Physical Agents, 2000.


[FIPA00070]      FIPA ACL Message Representation in String Specification. Foundation for Intelligent Physical Agents, 2000.

[FIPA00071]      FIPA ACL Message Representation in XML Specification. Foundation for Intelligent Physical Agents, 2000.


4         Informative Annex A — Examples

1.       Here is a simple example of an envelope encoded using XML representation:


<?xml version="1.0"?>


  <params index="1">























      <received-by value=""/>

      <received-date value="20000508T042651481"/>

      <received-id value="123456789"/>





Using the bit-efficient representation, the envelope becomes:


0xfe 0x00 0x88 0x12 0x20 0x31 0x11 0x06 0x19 0x15 0x37 0x62 0x59 0x20 0x02 0x03 0x02

‘r’  ‘e’  ‘c’  ‘e’  ‘i’  ‘v’  ‘e’  ‘r’  ‘@’  ‘f’  ‘o’  ‘o’  ‘.’  ‘c’  ‘o’  ‘m’  0x00

0x02 ‘h’  ‘t’  ‘t’  ‘p’  ‘:’  ‘/’  ‘/’  ‘f’  ‘o’  ‘o’  ‘.’  ‘c’  ‘o’  ‘m’  ‘/’  ‘a’ 

‘c’  ‘c’  0x00 0x01 0x01 0x02 ‘s’  ‘e’  ‘n’  ‘d’  ‘e’  ‘r’  ‘@’  ‘b’  ‘a’  ‘r’  ‘.’ 

‘c’  ‘o’  ‘m’  0x00 0x02 ‘h’  ‘t’  ‘t’  ‘p’  ‘:’  ‘/’  ‘/’  ‘b’  ‘a’  ‘r’  ‘.’  ‘c’ 

‘o’  ‘m’  ‘/’  ‘a’  ‘c’  ‘c’  0x00 0x01 0x01 0x0a ‘h’  ‘t’  ‘t’  ‘p’  ‘:’  ‘/’  ‘/’

‘b’  ‘a’  ‘r’  ‘.’  ‘c’  ‘o’  ‘m’  ‘/’  ‘a’  ‘c’  ‘c’  0x00 0x20 0x31 0x11 0x06 0x19

0x15 0x37 0x62 0x59 0x20 0x03 ‘1’  ‘2’  ‘3’  ‘4’  ‘5’  ‘6’  ‘7’  ‘8’  ‘9’  0x00 0x01


The length of the original message is about 584 bytes and the encoded result is 136 bytes giving a compression ratio of about 4:1.


2.       Here is an example that covers all aspects of an envelope.


<?xml version="1.0"?>


  <params index="1">







































  <comments>No comments!</comments>








































    <received-by value="" />

    <received-from value="" />

    <received-date value="20000508T042651481" />

    <received-id value="123456789" />

    <received-via value="" />







Using the bit-efficient representation, the envelope becomes:


0xfe 0x01 0xdb 0x12 0x20 0x31 0x11 0x06 0x19 0x15 0x37 0x62 0x59 0x20 0x02 0x02 ‘r’

‘e’  ‘c’  ‘e’  ‘i’  ‘v’  ‘e’  ‘r’  ‘@’  ‘f’  ‘o’  ‘o’  ‘.’  ‘c’  ‘o’  ‘m’  0x00 0x02

‘h’  ‘t’  ‘t’  ‘p’  ‘:’  ‘/’  ‘/’  ‘f’  ‘o’  ‘o’  ‘.’  ‘c’  ‘o’  ‘m’  ‘/’  ‘a’  ‘c’ 

‘c’  0x00 0x01 0x03 0x02 ‘s’  ‘e’  ‘n’  ‘d’  ‘e’  ‘r’  ‘@’  ‘b’  ‘a’  ‘r’  ‘.’  ‘c’ 

‘o’  ‘m’  0x00 0x02 ‘h’  ‘t’  ‘t’  ‘p’  ‘:’  ‘/’  ‘/’  ‘b’  ‘a’  ‘r’  ‘.’  ‘c’  ‘o’ 

‘m’  ‘/’  ‘a’  ‘c’  ‘c’  0x00 0x01 0x07 ‘U’  ‘S’  ‘-’  ‘A’  ‘S’  ‘C’  ‘I’  ‘I’  0x00

0x01 0x09 0x02 ‘i’  ‘n’  ‘t’  ‘e’  ‘n’  ‘d’  ‘e’  ‘d’  ‘r’  ‘e’  ‘c’  ‘e’  ‘i’  ‘v’

‘e’  ‘r’  ‘@’  ‘f’  ‘o’  ‘o’  ‘b’  ‘a’  ‘r’  ‘.’  ‘c’  ‘o’  ‘m’  0x00 0x02 ‘h’  ‘t’

‘t’  ‘p’  ‘:’  ‘/’  ‘/’  ‘f’  ‘o’  ‘o’  ‘b’  ‘a’  ‘r’  ‘.’  ‘c’  ‘o’  ‘m’  ‘/’  ‘a’ 

‘c’  ‘c’  ‘1’  0x00 ‘h’  ‘t’  ‘t’  ‘p’  ‘:’  ‘/’  ‘/’  ‘f’  ‘o’  ‘o’  ‘b’  ‘a’  ‘r’ 

‘.’  ‘c’  ‘o’  ‘m’  ‘/’  ‘a’  ‘c’  ‘c’  ‘2’  0x00 ‘h’  ‘t’  ‘t’  ‘p’  ‘:’  ‘/’  ‘/’ 

‘f’  ‘o’  ‘o’  ‘b’  ‘a’  ‘r’  ‘.’  ‘c’  ‘o’  ‘m’  ‘/’  ‘a’  ‘c’  ‘c’  ‘3’  0x00 0x01

0x03 0x02 ‘r’  ‘e’  ‘s’  ‘o’  ‘l’  ‘v’  ‘e’  ‘r’  ‘@’  ‘f’  ‘o’  ‘o’  ‘b’  ‘a’  ‘r’ 

‘.’  ‘c’  ‘o’  ‘m’  0x00 0x02 ‘h’  ‘t’  ‘t’  ‘p’  ‘:’  ‘/’  ‘/’  ‘f’  ‘o’  ‘o’  ‘b’ 

‘a’  ‘r’  ‘.’  ‘c’  ‘o’  ‘m’  ‘/’  ‘a’  ‘c’  ‘c’  ‘1’  0x00 ‘h’  ‘t’  ‘t’  ‘p’  ‘:’ 

‘/’  ‘/’  ‘f’  ‘o’  ‘o’  ‘b’  ‘a’  ‘r’  ‘.’  ‘c’  ‘o’  ‘m’  ‘/’  ‘a’  ‘c’  ‘c’  ‘2’ 

0x00 ‘h’  ‘t’  ‘t’  ‘p’  ‘:’  ‘/’  ‘/’  ‘f’  ‘o’  ‘o’  ‘b’  ‘a’  ‘r’  ‘.’  ‘c’  ‘o’ 

‘m’  ‘/’  ‘a’  ‘c’  ‘c’  ‘3’  0x00 0x01 0x03 0x02 ‘r’  ‘e’  ‘s’  ‘o’  ‘l’  ‘v’  ‘e’ 

‘r’  ‘@’  ‘f’  ‘o’  ‘o’  ‘b’  ‘a’  ‘r’  ‘.’  ‘c’  ‘o’  ‘m’ 0x00 0x02  ‘h’  ‘t’  ‘t’ 

‘p’  ‘:’  ‘/’  ‘/’  ‘f’  ‘o’  ‘o’  ‘b’  ‘a’  ‘r’  ‘.’  ‘c’  ‘o’  ‘m’  ‘/’  ‘a’  ‘c’ 

‘c’  ‘1’  0x00 ‘h’  ‘t’  ‘t’  ‘p’  ‘:’  ‘/’  ‘/’  ‘f’  ‘o’  ‘o’  ‘b’  ‘a’  ‘r’  ‘.’ 

‘c’  ‘o’  ‘m’  ‘/’  ‘a’  ‘c’  ‘c’  ‘2’  0x00 ‘h’  ‘t’  ‘t’  ‘p’  ‘:’  ‘/’  ‘/’  ‘f’ 

‘o’  ‘o’  ‘b’  ‘a’  ‘r’  ‘.’  ‘c’  ‘o’  ‘m’  ‘/’  ‘a’  ‘c’  ‘c’  ‘3’  0x00 0x01 0x01

0x0a ‘h’  ‘t’  ‘t’  ‘p’  ‘:’  ‘/’  ‘/’  ‘f’  ‘o’  ‘o’  ‘.’  ‘c’  ‘o’  ‘m’  ‘/’  ‘a’ 

‘c’  ‘c’  0x00 0x20 0x31 0x11 0x06 0x19 0x15 0x37 0x62 0x59 0x20 0x02 ‘h’  ‘t’  ‘t’ 

‘p’  ‘:’  ‘/’  ‘/’  ‘f’  ‘o’  ‘o’  ‘b’  ‘a’  ‘r’  ‘.’  ‘c’  ‘o’  ‘m’  ‘/’  ‘a’  ‘c’ 

‘c’  0x00 0x03 ‘1’  ‘2’  ‘3’  ‘4’  ‘5’  ‘6’  ‘7’  ‘8’  ‘9’  0x00 0x01 0x01 0x04 ‘h’ 

‘t’  ‘t’  ‘p’  ‘:’  ‘/’  ‘/’  ‘b’  ‘a’  ‘r’  ‘.’  ‘c’  ‘o’  ‘m’  ‘/’  ‘a’  ‘c’  ‘c’

0x00  0x01


The length of the original message is about 2360 bytes and the encoded result is 475 bytes giving a compression ratio of about 5:1.


5         Informative Annex B — ChangeLog

5.1        2002/11/01 – version C by TC X2S

Entire document:           Removed encrypted field

Page 4, line 159:           Added optional UserDefinedParameter to the ReceivedObject

Page 4, line 202:           Changed the identifier byte of the UserDefinedParameter from 0x04 to 0x05

Page 4, line 210:           Added signs to BinDateTimeToken

Page 7, lines 281-464:    Moved Section 3 to Informative Annex A


[1] White space is not allowed between tokens.

[2] The new ReceivedObject parameter s forced, syntactically, to be in all envelopes of the messageEnvelopes sequence except the first one.