01.12.2014 Views

FIPA ACL Message Representation in Bit-efficient Encoding ...

FIPA ACL Message Representation in Bit-efficient Encoding ...

FIPA ACL Message Representation in Bit-efficient Encoding ...

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

1<br />

2<br />

3<br />

4<br />

5<br />

6<br />

FOUNDATION FOR INTELLIGENT PHYSICAL AGENTS<br />

<strong>FIPA</strong> <strong>ACL</strong> <strong>Message</strong> <strong>Representation</strong> <strong>in</strong><br />

<strong>Bit</strong>-Efficient Encod<strong>in</strong>g Specification<br />

7<br />

8<br />

Document title <strong>FIPA</strong> <strong>ACL</strong> <strong>Message</strong> <strong>Representation</strong> <strong>in</strong> <strong>Bit</strong>-Efficient Encod<strong>in</strong>g Specification<br />

Document number XC00069E Document source <strong>FIPA</strong> Agent Management<br />

Document status Experimental Date of this status 2001/08/10<br />

Supersedes <strong>FIPA</strong>00024<br />

Contact<br />

fab@fipa.org<br />

Change history<br />

2000/07/25 Approved for Experimental<br />

2001/06/25 Added clarification about code table usage; added grammar rule for “hour”;<br />

removed unnecessary superscripts from ExprStart rule<br />

2001/08/10 L<strong>in</strong>e number<strong>in</strong>g added<br />

9<br />

10<br />

11<br />

12<br />

13<br />

14<br />

15<br />

16<br />

17<br />

© 2000 Foundation for Intelligent Physical Agents - http://www.fipa.org/<br />

Geneva, Switzerland<br />

Notice<br />

Use of the technologies described <strong>in</strong> this specification may <strong>in</strong>fr<strong>in</strong>ge patents, copyrights or other <strong>in</strong>tellectual property<br />

rights of <strong>FIPA</strong> Members and non-members. Noth<strong>in</strong>g <strong>in</strong> this specification should be construed as grant<strong>in</strong>g permission to<br />

use any of the technologies described. Anyone plann<strong>in</strong>g to make use of technology covered by the <strong>in</strong>tellectual property<br />

rights of others should first obta<strong>in</strong> permission from the holder(s) of the rights. <strong>FIPA</strong> strongly encourages anyone<br />

implement<strong>in</strong>g any part of this specification to determ<strong>in</strong>e first whether part(s) sought to be implemented are covered by<br />

the <strong>in</strong>tellectual property of others, and, if so, to obta<strong>in</strong> appropriate licenses or other permission from the holder(s) of<br />

such <strong>in</strong>tellectual property prior to implementation. This specification is subject to change without notice. Neither <strong>FIPA</strong><br />

nor any of its Members accept any responsibility whatsoever for damages or liability, direct or consequential, which<br />

may result from the use of this specification.


18<br />

19<br />

20<br />

21<br />

22<br />

23<br />

24<br />

25<br />

26<br />

27<br />

28<br />

29<br />

30<br />

31<br />

32<br />

33<br />

34<br />

35<br />

36<br />

Foreword<br />

The Foundation for Intelligent Physical Agents (<strong>FIPA</strong>) is an <strong>in</strong>ternational organization that is dedicated to promot<strong>in</strong>g the<br />

<strong>in</strong>dustry of <strong>in</strong>telligent agents by openly develop<strong>in</strong>g specifications support<strong>in</strong>g <strong>in</strong>teroperability among agents and agentbased<br />

applications. This occurs through open collaboration among its member organizations, which are companies and<br />

universities that are active <strong>in</strong> the field of agents. <strong>FIPA</strong> makes the results of its activities available to all <strong>in</strong>terested parties<br />

and <strong>in</strong>tends to contribute its results to the appropriate formal standards bodies.<br />

The members of <strong>FIPA</strong> are <strong>in</strong>dividually and collectively committed to open competition <strong>in</strong> the development of agentbased<br />

applications, services and equipment. Membership <strong>in</strong> <strong>FIPA</strong> is open to any corporation and <strong>in</strong>dividual firm,<br />

partnership, governmental body or <strong>in</strong>ternational organization without restriction. In particular, members are not bound to<br />

implement or use specific agent-based standards, recommendations and <strong>FIPA</strong> specifications by virtue of their<br />

participation <strong>in</strong> <strong>FIPA</strong>.<br />

The <strong>FIPA</strong> specifications are developed through direct <strong>in</strong>volvement of the <strong>FIPA</strong> membership. The status of a<br />

specification can be either Prelim<strong>in</strong>ary, Experimental, Standard, Deprecated or Obsolete. More detail about the process<br />

of specification may be found <strong>in</strong> the <strong>FIPA</strong> Procedures for Technical Work. A complete overview of the <strong>FIPA</strong><br />

specifications and their current status may be found <strong>in</strong> the <strong>FIPA</strong> List of Specifications. A list of terms and abbreviations<br />

used <strong>in</strong> the <strong>FIPA</strong> specifications may be found <strong>in</strong> the <strong>FIPA</strong> Glossary.<br />

<strong>FIPA</strong> is a non-profit association registered <strong>in</strong> Geneva, Switzerland. As of January 2000, the 56 members of <strong>FIPA</strong><br />

represented 17 countries worldwide. Further <strong>in</strong>formation about <strong>FIPA</strong> as an organization, membership <strong>in</strong>formation, <strong>FIPA</strong><br />

specifications and upcom<strong>in</strong>g meet<strong>in</strong>gs may be found at http://www.fipa.org/.<br />

ii


37<br />

38<br />

39<br />

40<br />

41<br />

42<br />

43<br />

44<br />

45<br />

Contents<br />

1 Scope.......................................................................................................................................................................... 1<br />

2 <strong>Bit</strong>-Efficient <strong>ACL</strong> <strong>Representation</strong>................................................................................................................................. 2<br />

2.1 Component Name................................................................................................................................................ 2<br />

2.2 Syntax.................................................................................................................................................................. 2<br />

2.3 Us<strong>in</strong>g Dynamic Code Tables ............................................................................................................................... 5<br />

2.4 Notes on the Grammar Rules .............................................................................................................................. 7<br />

3 References.................................................................................................................................................................. 9<br />

iii


45<br />

46<br />

47<br />

48<br />

49<br />

50<br />

51<br />

1 Scope<br />

This document is part of the <strong>FIPA</strong> specifications and deals with message transportation between <strong>in</strong>ter-operat<strong>in</strong>g agents.<br />

This document also forms part of the <strong>FIPA</strong> Agent Management Specification [<strong>FIPA</strong>00023] and conta<strong>in</strong>s specifications<br />

for:<br />

Syntactic representation of <strong>ACL</strong> <strong>in</strong> a bit-<strong>efficient</strong> form.


© 2000 Foundation for Intelligent Physical Agents <strong>FIPA</strong> <strong>ACL</strong> <strong>Message</strong> <strong>Representation</strong> <strong>in</strong> <strong>Bit</strong>-Efficient Encod<strong>in</strong>g<br />

51<br />

52<br />

53<br />

54<br />

55<br />

56<br />

57<br />

58<br />

59<br />

60<br />

61<br />

62<br />

63<br />

64<br />

65<br />

66<br />

67<br />

68<br />

69<br />

70<br />

71<br />

72<br />

73<br />

74<br />

75<br />

76<br />

77<br />

78<br />

79<br />

80<br />

81<br />

82<br />

83<br />

84<br />

85<br />

86<br />

87<br />

88<br />

89<br />

90<br />

91<br />

92<br />

93<br />

2 <strong>Bit</strong>-Efficient <strong>ACL</strong> <strong>Representation</strong><br />

This section def<strong>in</strong>es the message transport syntax for a bit-<strong>efficient</strong> encod<strong>in</strong>g which is expressed <strong>in</strong> standard EBNF<br />

format (see Table 1).<br />

Note that this representation is not compatible with [<strong>FIPA</strong>00075].<br />

Grammar rule component<br />

Example<br />

Term<strong>in</strong>al tokens are enclosed <strong>in</strong> double quotes "("<br />

Non-term<strong>in</strong>als are written as capitalised identifiers<br />

Expression<br />

Square brackets denote an optional construct [ "," OptionalArg ]<br />

Vertical bars denote an alternative between choices<br />

Integer | Float<br />

Asterisk denotes zero or more repetitions of the preced<strong>in</strong>g expression Digit*<br />

Plus denotes one or more repetitions of the preced<strong>in</strong>g expression Alpha+<br />

Parentheses are used to group expansions ( A | B )*<br />

Productions are written with the non-term<strong>in</strong>al name on the left-hand side, ANonTerm<strong>in</strong>al = "term<strong>in</strong>al".<br />

expansion on the right-hand side and term<strong>in</strong>ated by a full stop<br />

0x?? is a hexadecimal byte<br />

0x00<br />

Table 1: EBNF Rules<br />

White space is not allowed between tokens.<br />

2.1 Component Name<br />

The name assigned to this component is:<br />

fipa.acl.rep.bit<strong>efficient</strong>.std<br />

2.2 Syntax<br />

<strong>ACL</strong>CommunicativeAct = <strong>Message</strong>.<br />

<strong>Message</strong><br />

= Header <strong>Message</strong>Type <strong>Message</strong>Parameter* EndofMsg.<br />

Header<br />

= <strong>Message</strong>Id Version.<br />

<strong>Message</strong>Id<br />

= 0xFA<br />

| 0xFB<br />

| 0xFC. /* see comment 1 below */<br />

Version = Byte. /* see comment 2 below */<br />

EndofMsg<br />

= EndOfCollection.<br />

EndOfCollection = 0x01.<br />

<strong>Message</strong>Type<br />

= Predef<strong>in</strong>edMsgType<br />

| UserDef<strong>in</strong>edMsgType. /* see comment 3 below */<br />

UserDef<strong>in</strong>edMsgType = 0x00 MsgTypeName.<br />

MsgTypeName<br />

= B<strong>in</strong>Word.<br />

<strong>Message</strong>Parameter = Predef<strong>in</strong>edParam<br />

| UserDef<strong>in</strong>edMsgParam. /* see comment 4 below */<br />

UserDef<strong>in</strong>edMsgParam = 0x00 ParameterName ParameterValue.<br />

2


© 2000 Foundation for Intelligent Physical Agents <strong>FIPA</strong> <strong>ACL</strong> <strong>Message</strong> <strong>Representation</strong> <strong>in</strong> <strong>Bit</strong>-Efficient Encod<strong>in</strong>g<br />

94<br />

95<br />

96<br />

97<br />

98<br />

99<br />

100<br />

101<br />

102<br />

103<br />

104<br />

105<br />

106<br />

107<br />

108<br />

109<br />

110<br />

111<br />

112<br />

113<br />

114<br />

115<br />

116<br />

117<br />

118<br />

119<br />

120<br />

121<br />

122<br />

123<br />

124<br />

125<br />

126<br />

127<br />

128<br />

129<br />

130<br />

131<br />

132<br />

133<br />

134<br />

135<br />

136<br />

137<br />

138<br />

139<br />

140<br />

141<br />

142<br />

143<br />

144<br />

145<br />

146<br />

147<br />

148<br />

149<br />

150<br />

151<br />

152<br />

153<br />

154<br />

155<br />

156<br />

157<br />

ParameterName<br />

= B<strong>in</strong>Word.<br />

ParamterValue<br />

= B<strong>in</strong>Expression.<br />

Predef<strong>in</strong>edMsgType = 0x01 /* accept-proposal */<br />

| 0x02 /* agree */<br />

| 0x03 /* cancel */<br />

| 0x04 /* cfp */<br />

| 0x05 /* confirm */<br />

| 0x06 /* disconfirm */<br />

| 0x07 /* failure */<br />

| 0x08 /* <strong>in</strong>form */<br />

| 0x09 /* <strong>in</strong>form-if */<br />

| 0x0a /* <strong>in</strong>form-ref */<br />

| 0x0b /* not-understood */<br />

| 0x0c /* propagate */<br />

| 0x0d /* propose */<br />

| 0x0e /* proxy */<br />

| 0x0f /* query-if */<br />

| 0x10 /* query-ref */<br />

| 0x11 /* refuse */<br />

| 0x12 /* reject-proposal */<br />

| 0x13 /* request */<br />

| 0x14 /* request-when */<br />

| 0x15 /* request-whenever */<br />

| 0x16. /* subscribe */<br />

Predef<strong>in</strong>edMsgParam = 0x02 AgentIdentifier /* :sender */<br />

| 0x03 RecipientExpr /* :receiver */<br />

| 0x04 MsgContent /* :content */<br />

| 0x05 ReplyWithParam /* :reply-with */<br />

| 0x06 ReplyByParam /* :reply-by */<br />

| 0x07 InReplyToParam /* :<strong>in</strong>-reply-to */<br />

| 0x08 ReplyToParam /* :reply-to */<br />

| 0x09 Language /* :language */<br />

| 0x0a Encod<strong>in</strong>g /* :encod<strong>in</strong>g */<br />

| 0x0b Ontology /* :ontology */<br />

| 0x0c Protocol /* :protocol */<br />

| 0x0d ConversationID. /* :conversation-id */<br />

AgentIdentifier<br />

= 0x02 AgentName<br />

[Addresses]<br />

[Resolvers]<br />

(UserDef<strong>in</strong>edParameter)*<br />

EndOfCollection.<br />

AgentName<br />

= B<strong>in</strong>Word.<br />

Addresses<br />

= 0x02 UrlCollection.<br />

Resolvers<br />

= 0x03 AgentIdentifierCollection.<br />

UserDef<strong>in</strong>edParameter = 0x04 B<strong>in</strong>Word B<strong>in</strong>Expression.<br />

UrlCollection<br />

= (Url)* EndofCollection.<br />

Url<br />

= B<strong>in</strong>Word.<br />

AgentIdentifierCollection<br />

= (AgentIdentifier)* EndOfCollection.<br />

RecipientExpr<br />

= AgentIdentifierCollection.<br />

3


© 2000 Foundation for Intelligent Physical Agents <strong>FIPA</strong> <strong>ACL</strong> <strong>Message</strong> <strong>Representation</strong> <strong>in</strong> <strong>Bit</strong>-Efficient Encod<strong>in</strong>g<br />

158<br />

159<br />

160<br />

161<br />

162<br />

163<br />

164<br />

165<br />

166<br />

167<br />

168<br />

169<br />

170<br />

171<br />

172<br />

173<br />

174<br />

175<br />

176<br />

177<br />

178<br />

179<br />

180<br />

181<br />

182<br />

183<br />

184<br />

185<br />

186<br />

187<br />

188<br />

189<br />

190<br />

191<br />

192<br />

193<br />

194<br />

195<br />

196<br />

197<br />

198<br />

199<br />

200<br />

201<br />

202<br />

203<br />

204<br />

205<br />

206<br />

207<br />

208<br />

209<br />

210<br />

211<br />

212<br />

213<br />

214<br />

215<br />

216<br />

217<br />

218<br />

219<br />

220<br />

221<br />

MsgContent<br />

= B<strong>in</strong>Expression.<br />

ReplyWithParam<br />

= B<strong>in</strong>Expression.<br />

ReplyByParam<br />

= B<strong>in</strong>DateTimeToken.<br />

InReplyToParam<br />

= B<strong>in</strong>Expression.<br />

ReplyToParam<br />

= RecipientExpr.<br />

Language<br />

= B<strong>in</strong>Expression.<br />

Encod<strong>in</strong>g<br />

= B<strong>in</strong>Expression.<br />

Ontology<br />

= B<strong>in</strong>Expression.<br />

Protocol<br />

= B<strong>in</strong>Word.<br />

ConversationID<br />

= B<strong>in</strong>Expression.<br />

B<strong>in</strong>Word<br />

= 0x10 Word 0x00<br />

| 0x11 Index.<br />

B<strong>in</strong>Number = 0x12 Digits /* Decimal Number */<br />

| 0x13 Digits. /* Hexadecimal Number */<br />

Digits<br />

= CodedNumber+.<br />

B<strong>in</strong>Str<strong>in</strong>g = 0x14 Str<strong>in</strong>g 0x00 /* New str<strong>in</strong>g literal */<br />

| 0x15 Index /* Str<strong>in</strong>g literal from code table*/<br />

| 0x16 Len8 ByteSeq /* New ByteLengthEncoded str<strong>in</strong>g */<br />

| 0x17 Len16 ByteSeq /* New ByteLengthEncoded str<strong>in</strong>g */<br />

| 0x18 Index /* ByteLengthEncoded from code table*/<br />

| 0x19 Len32 ByteSeq. /* New ByteLengthEncoded str<strong>in</strong>g */<br />

B<strong>in</strong>DateTimeToken = 0x20 B<strong>in</strong>Date<br />

| 0x21 B<strong>in</strong>Date TypeDesignator.<br />

B<strong>in</strong>Date<br />

= Year Month Day Hour M<strong>in</strong>ute Second Millisecond.<br />

/* see comment 9 below */<br />

B<strong>in</strong>Expression<br />

= B<strong>in</strong>Expr<br />

| 0xFF B<strong>in</strong>Str<strong>in</strong>g. /* See comment 10 below */<br />

B<strong>in</strong>Expr<br />

= B<strong>in</strong>Word<br />

| B<strong>in</strong>Str<strong>in</strong>g<br />

| B<strong>in</strong>Number<br />

| ExprStart B<strong>in</strong>Expr* ExprEnd.<br />

ExprStart = 0x60 /* Level down (i.e. ‘(’ –character) */<br />

| 0x70 Word 0x00 /* Level down, new word follows */<br />

| 0x71 Index /* Level down, word code follows */<br />

| 0x72 Digits /* Level down, number follows */<br />

| 0x73 Digits /* Level down, hex number follows */<br />

| 0x74 Str<strong>in</strong>g 0x00 /* Level down, new str<strong>in</strong>g follows */<br />

| 0x75 Index /* Level down, str<strong>in</strong>g code follows */<br />

| 0x76 Len8 Str<strong>in</strong>g /* Level down, new byte str<strong>in</strong>g (1 byte) */<br />

| 0x77 Len16 Str<strong>in</strong>g /* Level down, new byte str<strong>in</strong>g (2 byte) */<br />

| 0x78 Len32 Str<strong>in</strong>g /* Level down, new byte str<strong>in</strong>g (4 byte) */<br />

| 0x79 Index. /* Level down, byte str<strong>in</strong>g code follows */<br />

ExprEnd = 0x40 /* Level up (i.e. ‘)’ –character) */<br />

| 0x50 Word 0x00 /* Level up, new word follows */<br />

| 0x51 Index /* Level up, word code follows */<br />

4


© 2000 Foundation for Intelligent Physical Agents <strong>FIPA</strong> <strong>ACL</strong> <strong>Message</strong> <strong>Representation</strong> <strong>in</strong> <strong>Bit</strong>-Efficient Encod<strong>in</strong>g<br />

222<br />

223<br />

224<br />

225<br />

226<br />

227<br />

228<br />

229<br />

230<br />

231<br />

232<br />

233<br />

234<br />

235<br />

236<br />

237<br />

238<br />

239<br />

240<br />

241<br />

242<br />

243<br />

244<br />

245<br />

246<br />

247<br />

248<br />

249<br />

250<br />

251<br />

252<br />

253<br />

254<br />

255<br />

256<br />

257<br />

258<br />

259<br />

260<br />

261<br />

262<br />

263<br />

264<br />

265<br />

266<br />

267<br />

268<br />

269<br />

270<br />

271<br />

272<br />

273<br />

274<br />

275<br />

276<br />

277<br />

278<br />

| 0x52 Digits /* Level up, number follows */<br />

| 0x53 Digits /* Level up, hexadecimal number follows */<br />

| 0x54 Str<strong>in</strong>g 0x00 /* Level up, new str<strong>in</strong>g follows */<br />

| 0x55 Index /* Level up, str<strong>in</strong>g code follows */<br />

| 0x56 Len8 Str<strong>in</strong>g /* Level up, new byte str<strong>in</strong>g (1 byte) */<br />

| 0x57 Len16 Str<strong>in</strong>g /* Level up, new byte str<strong>in</strong>g (2 byte) */<br />

| 0x58 Len32 Str<strong>in</strong>g /* Level up, new byte str<strong>in</strong>g (4 byte) */<br />

| 0x59 Index. /* Level up, byte str<strong>in</strong>g code follows */<br />

ByteSeq<br />

= Byte*.<br />

Index<br />

= Byte<br />

| Short. /* See comment 7 below */<br />

Len8 = Byte. /* See comment 8 below */<br />

Len16 = Short. /* See comment 8 below */<br />

Len32 = Long. /* See comment 8 below */<br />

Year<br />

= Byte Byte.<br />

Month<br />

= Byte.<br />

Day<br />

= Byte.<br />

Hour<br />

= Byte.<br />

M<strong>in</strong>ute<br />

= Byte.<br />

Second<br />

= Byte.<br />

Millisecond<br />

= Byte Byte.<br />

Word = /* as <strong>in</strong> [<strong>FIPA</strong>00070] */<br />

Str<strong>in</strong>g = /* as <strong>in</strong> [<strong>FIPA</strong>00070] */<br />

CodedNumber = /* See comment 5 below */<br />

TypeDesignator = /* as <strong>in</strong> [<strong>FIPA</strong>00070] */<br />

2.3 Us<strong>in</strong>g Dynamic Code Tables<br />

The transport syntax can be used with or without dynamic code table. Us<strong>in</strong>g dynamic code tables is an optional feature,<br />

which gives more compact output but might not be appropriate if communicat<strong>in</strong>g peers does not have sufficient memory<br />

(for example, <strong>in</strong> case of low-end PDAs or smart phones).<br />

To use dynamic code tables the encoder <strong>in</strong>serts new entries (for example, Word, Str<strong>in</strong>g, etc.) <strong>in</strong>to a code table while<br />

construct<strong>in</strong>g bit-<strong>efficient</strong> representation for <strong>ACL</strong> message. The code table is <strong>in</strong>itially empty and whenever a new entry is<br />

added to the code table, the smallest available code number is allocated to it. There is no need to transfer these <strong>in</strong>dex<br />

codes explicitly over the communication channel. Once the code table becomes full and a new code needs to be added,<br />

the sender first removes size>>3 1 entries from the code table us<strong>in</strong>g a Least Recently Used (LRU) algorithm and then<br />

adds a new entry to code table. For example, should the code table size be 512 entries, 64 entries are removed.<br />

Correspond<strong>in</strong>gly the decoder removes entries from the code table when it receives a new entry from the encoder.<br />

The size of the code table, if used, is between 256 (2 8 ) and 65536 (2 16 ) entries. The output of this code table is always<br />

one or two bytes (one byte only when the code table size is 2 8 ). Us<strong>in</strong>g two-byte output code wastes some bits, but<br />

1<br />

Right shifted by 3 bit positions – approximately 10%.<br />

5


© 2000 Foundation for Intelligent Physical Agents <strong>FIPA</strong> <strong>ACL</strong> <strong>Message</strong> <strong>Representation</strong> <strong>in</strong> <strong>Bit</strong>-Efficient Encod<strong>in</strong>g<br />

279<br />

280<br />

281<br />

282<br />

283<br />

284<br />

285<br />

286<br />

allows for much faster pars<strong>in</strong>g of messages. The code table is unidirectional, that is, if sender A adds someth<strong>in</strong>g to the<br />

code table when send<strong>in</strong>g a message to B, then B cannot use this code table entry when send<strong>in</strong>g a message back to A.<br />

Both peers must agree the code table size before its usage; this process is not part of this specification. Furthermore,<br />

hav<strong>in</strong>g more compact output, one code table should be applied to more than one message; the method of mapp<strong>in</strong>g<br />

messages to appropriate code table is not part of this specification.<br />

6


© 2000 Foundation for Intelligent Physical Agents <strong>FIPA</strong> <strong>ACL</strong> <strong>Message</strong> <strong>Representation</strong> <strong>in</strong> <strong>Bit</strong>-Efficient Encod<strong>in</strong>g<br />

286<br />

287<br />

288<br />

289<br />

290<br />

291<br />

292<br />

293<br />

294<br />

295<br />

296<br />

297<br />

298<br />

299<br />

300<br />

301<br />

302<br />

303<br />

304<br />

305<br />

306<br />

307<br />

308<br />

309<br />

310<br />

311<br />

312<br />

313<br />

314<br />

315<br />

316<br />

317<br />

318<br />

319<br />

320<br />

321<br />

322<br />

323<br />

324<br />

325<br />

326<br />

2.4 Notes on the Grammar Rules<br />

1. The first byte def<strong>in</strong>es the message identifier. The identifier byte can be used to separate bit-<strong>efficient</strong> <strong>ACL</strong> messages<br />

from (for example) str<strong>in</strong>g-based messages and separate different cod<strong>in</strong>g schemes. The value 0xFA def<strong>in</strong>es a bit<strong>efficient</strong><br />

cod<strong>in</strong>g scheme without dynamic code tables and the value 0xFB def<strong>in</strong>es a bit-<strong>efficient</strong> cod<strong>in</strong>g scheme with<br />

dynamic code tables. The message identifier 0xFC is used when dynamic code tables are be<strong>in</strong>g used, but the<br />

sender does not want to update code tables (even if message conta<strong>in</strong>s str<strong>in</strong>gs that should be added to code table).<br />

2. The second byte def<strong>in</strong>es the version number. The version number byte conta<strong>in</strong>s the major version number <strong>in</strong> the<br />

upper four bits and m<strong>in</strong>or version number <strong>in</strong> the lower four bits. This specification def<strong>in</strong>es version 1.0 (coded as<br />

0x10).<br />

3. All message types def<strong>in</strong>ed <strong>in</strong> this specification have a predef<strong>in</strong>ed code. If an encoder sends an <strong>ACL</strong> message with<br />

a message type which has no predef<strong>in</strong>ed code, it must use the extension mechanism which adds a new message<br />

type <strong>in</strong>to code table (if code tables are be<strong>in</strong>g used).<br />

4. All message parameters def<strong>in</strong>ed <strong>in</strong> this specification have a predef<strong>in</strong>ed code. If a message conta<strong>in</strong>s a user def<strong>in</strong>ed<br />

message parameter, an extension mechanism is used (byte 0x00) and new entry is added to code table (if code<br />

table is used).<br />

5. Numbers are coded by reserv<strong>in</strong>g four bits for each digit <strong>in</strong> the number’s ASCII representation, that is, two ASCII<br />

numbers are coded <strong>in</strong>to one byte. Table 1 shows a 4-bit code for each number and special codes that may appear<br />

<strong>in</strong> ASCII coded numbers.<br />

If the ASCII presentation of a number conta<strong>in</strong>s odd number characters, the last four bits of the coded number are<br />

set to zero (the Padd<strong>in</strong>g token), otherwise an additional 0x00 byte is added to end of coded number. If the<br />

number to be coded is <strong>in</strong>teger, decimal number, or octal number, the identifier byte 0x12 is used. For hexadecimal<br />

numbers, the identifier byte 0x13 is used. Hexadecimal numbers are converted to <strong>in</strong>tegers before cod<strong>in</strong>g (the<br />

cod<strong>in</strong>g scheme does not allow characters from a through f to appear <strong>in</strong> number form).<br />

Numbers are never added to a dynamic code table.<br />

Token Code Token Code<br />

Padd<strong>in</strong>g 0000 7 1000<br />

0 0001 8 1001<br />

1 0010 9 1010<br />

2 0011 + 1100<br />

3 0100 E 1101<br />

4 0101 - 1110<br />

5 0110 . 1111<br />

6 0111<br />

6. Table 1: B<strong>in</strong>ary <strong>Representation</strong> of Number Tokens<br />

7. Index is a po<strong>in</strong>ter to code table entry and its size (<strong>in</strong> bits) depends on the code table size. If the code table size is<br />

256 entries, the size of the <strong>in</strong>dex is one byte; otherwise its size is two bytes (represented <strong>in</strong> network byte order).<br />

8. Byte is a one-byte code word, Short is a short <strong>in</strong>teger (two bytes, network byte order) and Long is a long <strong>in</strong>teger<br />

(four bytes, network byte order).<br />

7


© 2000 Foundation for Intelligent Physical Agents <strong>FIPA</strong> <strong>ACL</strong> <strong>Message</strong> <strong>Representation</strong> <strong>in</strong> <strong>Bit</strong>-Efficient Encod<strong>in</strong>g<br />

327<br />

328<br />

329<br />

330<br />

331<br />

332<br />

333<br />

334<br />

9. Dates are coded as numbers, that is, four bits are reserved for each ASCII number (see comment 5 above).<br />

Information whether the type designator is present or not, is coded <strong>in</strong>to identifier byte. These fields always have<br />

static length (two bytes for year and milliseconds, one byte for other components).<br />

10. None of the actual content of the message (the <strong>in</strong>formation conta<strong>in</strong>ed <strong>in</strong> the :content parameter of the <strong>ACL</strong><br />

message) is coded nor are any of its components are added to a code table.<br />

8


© 2000 Foundation for Intelligent Physical Agents <strong>FIPA</strong> <strong>ACL</strong> <strong>Message</strong> <strong>Representation</strong> <strong>in</strong> <strong>Bit</strong>-Efficient Encod<strong>in</strong>g<br />

334<br />

335<br />

336<br />

337<br />

338<br />

339<br />

340<br />

341<br />

342<br />

343<br />

344<br />

3 References<br />

[<strong>FIPA</strong>00023] <strong>FIPA</strong> Agent Management Specification. Foundation for Intelligent Physical Agents, 2000.<br />

http://www.fipa.org/specs/fipa00023/<br />

[<strong>FIPA</strong>00067] <strong>FIPA</strong> Agent <strong>Message</strong> Transport Service Specification. Foundation for Intelligent Physical Agents, 2000.<br />

http://www.fipa.org/specs/fipa00067/<br />

[<strong>FIPA</strong>00070] <strong>FIPA</strong> <strong>ACL</strong> <strong>Message</strong> <strong>Representation</strong> <strong>in</strong> Str<strong>in</strong>g Specification. Foundation for Intelligent Physical Agents,<br />

2000.<br />

http://www.fipa.org/specs/fipa00070/<br />

[<strong>FIPA</strong>00075] <strong>FIPA</strong> Agent <strong>Message</strong> Transport Protocol for IIOP Specification. Foundation for Intelligent Physical<br />

Agents, 2000.<br />

http://www.fipa.org/specs/fipa00075/<br />

9

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!