Agent Seminar Using Jabber instant messaging for text
Agent Seminar Using Jabber instant messaging for text and binary data message exchange Daryl Lee, Chin Siong Civilian, Singapore
Demo 1. Text-based Event Monitoring 2. Binary data transfer using Jabber
Introduction Open n Extensible n Event-based n Secure n 6/13/2021
Core Jabber Protocol Message n Presence n Info/Query (IQ) n <message xml: lang=“en-us” to=“savage@conference. xchat. movesinstitute. org” type=“groupchat”> <body>This is a test message</body> </message> 6/13/2021
Message Generation Standard Jabber Client n HTML Form n Customized Jabber Client n 6/13/2021
Event Monitoring 1. Standard Jabber Client Data Jabber Protocol Jabber server Jabber protocol Regular expression parser to detect relevant messages Data only, no files can be sent AUV Workbench Jabber Client Key-in event in Message Subject and Body Audible/visual event alert Operator Commander THE MOVES INSTITUTE
Event Monitoring Standard Jabber Client Listen to incoming chat messages Extract positional data and plot Agent at local machine Operator at remote machine THE MOVES INSTITUTE
Event Monitoring Standard Jabber Client Listen to incoming chat messages “visual” alert 2 D Mission Planner If matches, extract data and raise alert “sound” alert Play sound Operator at remote machine List of Watch Events List of Alerts THE MOVES INSTITUTE “url” alert Display in associated application
Defining Watch Events <XTCMonitor> Regular expression <Monitor. Default> <Watch. Event name="Mine" desc="Look out for Mines" expr="^. *(? i)MINE[s|S]? . *[ (]{1, 2}(d*), [ ]{0, 2}(d*)? +"> <Alert type="visual" src="image/mine. gif" enabled="true"/> <Alert type="sound" src="sound/alert. wav" enabled="true"/> <Alert type="url" src="C: /auv/index. htm" enabled="false"/> </Watch. Event> Alerts Watch Event <Watch. Event name="Ship" desc="Look out for Ships" expr="^. *(? i)SHIP[s|S]? . *[ (]{1, 2}(d*), [ ]{0, 2}(d*)"> <Alert type="visual" src="image/ship. gif" enabled="true"/> </Watch. Event> </Monitor. Default> </XTCMonitor> 6/13/2021
Event Monitoring 2. Web-based using HTML forms Data and Files via HTTP-Jabber Protocol Storage for uploaded files storage HTTP POST of both data and files using HTTP protocol Servlet on web server Jabber protocol Jabber server Package HTML data and files into XHTML format and send out HTML form in Internet browser AUV Workbench Key-in event in pre-formatted HTML page Operator Unpack incoming XHTML Jabber message and display data and files Audible/visual event alert THE MOVES INSTITUTE Commander
Event Monitoring 3. Customized Jabber Client Data and Files via both HTTP-Jabber and Jabber Protocol Storage for uploaded files storage HTTP POST of both data and files using HTTP protocol Customized Jabber Client Servlet on web server Jabber protocol Jabber server Package HTML data and files into XHTML format and send out Package data and files into XHTML format and send out AUV Workbench Audible/visual event alert Key-in event Operator Unpack incoming XHTML Jabber message and display data and files THE MOVES INSTITUTE Commander
Customized Client Message Sender/Receiver List of messages from another user or chat-room THE MOVES INSTITUTE
Event Monitoring Overview storage logging Storage for uploaded binary data HTML form in Internet browser Message subject and body is keyed-into a pre-formatted HTML page HTTP protocol Servlet on web server Package data and perform a HTTP POST or retrieve binary data via HTTP GET Customized Jabber client 6/13/2021 Able to display both standard Jabber message and also process/display binary data, if any Jabber protocol (peer-to-peer or chat -room type) Jabber server Jabber protocol Jabber client Able to display standard Jabber message information (e. g. subject and body)
Overview Human and Agent Interaction Human Peer-to-peer IM interaction between people Chat-room Human “Publish-Subscribe” mechanism to enable multiple agents to listen and react to messages posted. Chat-room resides on Jabber server Agent monitoring chat-room for specific messages Agent 1 Peer-to-peer IM interaction between agents flat file Agent 2 database Archival of messages Unique Jabber ID to identify each agent e. g. agent 1@surfaris. cs. nps. navy. mil 6/13/2021
Not just text messages Jabber message packet Header Subject and Body Payload Sample payloads Text XML Images Plug-ins Applications 6/13/2021
Sample XHTML message Compressed and base-64 encoded <message id="5 euk 4 -4" to=“ savage@conference. xchat. movesinstitute. org " Normal data type=“groupchat" from="auvrobot@surfaris. cs. nps. navy. mil "> <subject>Subject</subject><body>This is a test message with (XHTML)</body> <html xmlns="http: //jabber. org/protocol/xhtml-im "> <body> <Agent. Jabber> XHTML data <!–- Payload --> <Agent. Payload checksum="1234567" content-transfer-encoding="base-64" Header information content-type="application/x-zip-compressed " desc="Description here" filename="GAMMA. bmp“ timestamp=“ 20040115235959”> <![CDATA[H 4 s. IAAAAAO 3 Qs. U 0 DQRh. E 4 Tsw 4 FKog. Bxyen. IRboa. ABmjqu. DNISKs. XTPZWa. Ob. Tyb. DR 0//2/v. W 5 3 PZy. Wpbn/fe 6 f 6/rsqz. L+f. Z+/Vj+tv 5++y 77 tw 1/XC 4//2 zbtn. Rd 9 z+3 neej. Bw. A 9 AOg. BQA 8 Aeg. DQA 4 Ae. APQAo Ac. APQDo. AUAPAHo. A 0 AOAHg. D 0 AKAHg. PHhc. YKNj. Xb. Psd 4 p. W++Ur. Xf. K 1 jtl 652 y 9 U 7 Zeqdsv. VO 23 ilb 75 Std 8 r. WO 2 Xrnb. L 1 Ttn. GO 81 ADw. B 6 ANADg. B 4 A 9 ACg. Bw. A 9 AOg. BQA 8 Aeg. DQA 4 Ae. APQAo. Ac. APQDo. AUAPAHo. A 0 AOAHg. D 0 AKAHAD 0 A 6 AFADw. B 6 ALjb 5 q. MHAds 451 mo. Ac. APQDo. AUAPAHo. A 0 AOAHg. D 0 AKAHAD 0 A 6 AFADw. B 6 ANADg. B 4 A 9 ACg. Bw. A 9 AOg. BQ A 8 Aeg. DQA 4 Ae. APQAo. Ac. APQCctvno. AUAPAHo. A 0 AOAHg. D 0 AKAHAD 0 A 6 AFADw. B 6 ANADg. B 4 A 9 ACg. Bw. A 9 AOg. BQA 8 Aeg DQA 4 Ae. APQAo. Ac. APQDo. AUAPAHo. A 0 APA+HA/wc. ZGu+d. Y 75 Std 8 r. WO 2 Xrnb. L 1 Ttl 6 p 2 y 9 U 7 be. KVvvl. K 13 yt. Y 7 Zeu dsv. VO 2 Xqnb. OOd. Zq. AHAD 0 A 6 AFADw. B 6 ANADg. B 4 A 9 ACg. Bw. A 9 AOg. BQA 8 Aeg. DQA 4 Ae. APQAo. Ac. APQDo. AUAPAHo. A 0 AOAHg. D 0 AKAHg. PHh. YYKNj. Xb. Psd 4 p. W++Ur. Xf. K 1 jtl 652 y 9 U 7 Zeqdsv. VO 23 ilb 75 St 02 mddv. Kv. QAA]]> <url>http: //server 1/GAMMA. bmp</ url> <url>http: //server 2/GAMMA. bmp</ url> Hyperlinks to storage locations <url>http: //server 3/GAMMA. bmp</ url> </Agent. Payload> </Agent. Jabber> </body></html> 6/13/2021 </message> Compressed and base-64 encoded data (textual & binary)
Sample XHTML message In clear <message id="5 euk 4 -4" to=“ savage@conference. xchat. movesinstitute. org " Normal data type=“groupchat" from="auvrobot@surfaris. cs. nps. navy. mil "> <subject>Subject</subject><body>This is a test message with (XHTML)</body> <html xmlns="http: //jabber. org/protocol/xhtml-im "> <body> <Agent. Jabber> XHTML data <!–- Payload --> <Agent. Payload checksum="1234567" content-transfer-encoding="base-64" Header information content-type=“text/xml " desc="Description here" filename=“ Daml. xml“ timestamp=“ 20040115235959”> <![CDATA[<daml: Ontology rdf: about=""><daml: version. Info>$Id: daml+people-ex. daml, v 1. 4 2003/12/12 18: 34: 13 dom Exp $</daml: version. Info><rdfs: comment>An example ontology, XML data in clear with data types taken from XML Schema</ rdfs: comment><daml: imports rdf: resource="http: //www. w 3. org/2001/10/daml+people" /></ daml: Ontology>]]> <url>http: //server 1/Daml 1. xml</ url> <url>http: //server 2/Daml 2. xml</ url> Hyperlinks to storage locations <url>http: //server 3/Daml 3. xml</ url> </Agent. Payload> </Agent. Jabber> </body></html> </message> 6/13/2021
Anatomy of a Jabberenabled agent Agent interior Jabber Server 1…N Agent can be connected simultaneously to multiple Jabber servers Agent Jabber communications Message formatting Jabber message packet Header Body Payload Handle Jabber instant messaging Packaging of message format Compression and decompression To reduce the size of the message packet Base-64 encode and decode To handle non-textual data e. g. images, audio and video Message processing Configuration THE MOVES INSTITUTE Trigger alerts, other events or archive to database/flat file Read in settings e. g. watch events and alerts
Message Package Incoming Start 1 2 Receive JABBER message either through chatroom or another JID user Is CDATA section found? No Extract list of hyperlinks from <url> elements Save as binary data in predefined temporary location Loop through list and try to download contents Invoke respective application to process binary data Yes Extract XHTML data from Jabber message body No Is CDATA content in zipped format? Yes 1 Perform GZIP decompression Perform base-64 decoding 2 THE MOVES INSTITUTE Create a list of Agent. Payload objects End
Message Package Outgoing Start 1 2 Load physical files to be packaged Set “content-type” attribute to “application/x-zipcompressed” Set “content-type” attribute to based on file format Is file size within specified limit? No 3 4 Save as XML file in predefined temporary location for storage purposes Perform base 64 encoding Generate XML document and formup XML string Add hyperlinks Insert XML string as XHTML data in Jabber message body Yes Is data compressable? No Yes Perform GZIP compression using Java ZIP package 1 2 3 Generate XML document and insert base 64 encoded data in CDATA section (if any) Send out JABBER message to addressee 4 End THE MOVES INSTITUTE
Possible Applications ØData-mining of structured data ØIntegration with graphical display systems: n n Target tracking Target aggregation ØLogging & auditing 6/13/2021
Issues ØMessage payload size ØMessage expiry 6/13/2021
Future Work ØBinary-to-text algorithms ØApply domain-specific compression ØData streaming ØPerform load test 6/13/2021
References n Jabber Software. Foundations http: //www. jabber. org/ n Jabber Studio http: //www. jabberstudio. org/ n Jive. Software Smack Library n http: //www. jivesoftware. com/xmpp/smack/documentation/ Iain Shigeoka. Instant Messaging in Java. Manning March 2002. 6/13/2021
Thank You
Poster THE MOVES INSTITUTE
- Slides: 26