1 / 19

Bee-gent Communication

Bee-gent Communication. ANTS Meeting, 9/30/99. Overview. What communication “services” does Bee-gent provide? Transport, session, presentation, application services for multi-agent systems How does it do it? “ ACL/XML”, security, directory services, etc. Implementation. What is Provided?.

kort
Download Presentation

Bee-gent Communication

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Bee-gent Communication ANTS Meeting, 9/30/99

  2. Overview • What communication “services” does Bee-gent provide? • Transport, session, presentation, application services for multi-agent systems • How does it do it? • “ACL/XML”, security, directory services, etc. • Implementation

  3. What is Provided? • Transport – message assembly, ordering • Session – “conversations” • Presentation – format for message exchange • Application – directory services, security, agent migration (this “Agent Systems Interconnect” model lives on top of OSI… mostly)

  4. How are services implemented? • Security: [Weak?] encryption, 64 bit ciphers • Directory “services” • Agents register with one another • Maintained in file, automatically updated • “Setting and consistency management of names are left to designers' responsibility” (Bee-gent tutorial) • Integration with LDAP (?) • ACL + XML = “ACL/XML” • ACL specifies content • XML specifies format

  5. Bee-gents ACL • Pre-defined and user-defined performatives • Types of messages • Designers define meaning of each message type • Expected message content • An ACL message specifies: - Performative - Sender and Reviever - Content (performative-specific) - Protocol - Reply-with - Ontology

  6. Example ACL message… Performative: “Request” Sender: “Mediation Agent” Reciever: “Agent Wrapper” Content: “Agent wrapper should perform action one with null parameters” Protocol: “Request-inform” Reply-with: “Conversation identification 1” Ontology: “Default”

  7. …and XML format <!DOCTYPE request SYSTEM "request.dtd"> <request> <sender>Mediation Agent</sender> <receiver>Agent Wrapper</receiver> <content> <action>act1</action> <actor>Agent Wrapper</actor> <args>null</args> </content> <protocol>Request-inform</protocol> <reply-with>MSG-ID:1</reply-with> <ontology>default</ontology> </request>

  8. Implementation • First, need brief overview of Bee-gents • 2 types: Agent Wrappers and Mediation Agents • Agent Wrappers encapsulate “legacy” functionality, host “bees” • Mediation Agents (bees) - mobile • Communication is permitted to/from both types (but need forwarding…) • State-based programming model

  9. Implementation - Example • Goal: 2 agents, Jack and Jill, that exchange “greetings” and “farewells” • Jill starts the conversation • Jack randomly responds or dies • Jill randomly responds • Steps • Define performatives • Define names and addresses of agents • Code state behavior of agents

  10. Define Performatives • DTD file (specs) and XML file (defaults) • In .\xml directory below each agent class farewell.dtd <?xml encoding="US-ASCII"?> <!ELEMENT farewell (sender,receiver,content,protocol,in-reply-to,ontology)> <!ELEMENT sender (#PCDATA)> <!ELEMENT receiver (#PCDATA)> <!ELEMENT content (#PCDATA)> <!ELEMENT protocol (#PCDATA)> <!ELEMENT in-reply-to (#PCDATA)> <!ELEMENT ontology (#PCDATA)> farewell.xml <?xml version="1.0"?> <!DOCTYPE farewell SYSTEM "farewell.dtd"> <farewell> <sender>TBD</sender> <receiver>TBD</receiver> <content>TBD</content> <protocol>TBD</protocol> <in-reply-to>TBD</in-reply-to> <ontology>TBD</ontology> </farewell>

  11. Define agent names and addresses • In .\conf\Name2Addresses.csv • For each agent JACK,http://localhost:9441/ JILL,http://localhost:9442/

  12. Code it – JACK.java public class JACK extends AgentWrapper{ JACK(String s){ super(s); } public static void main(String[] argv) throws Exception{ JACK aw = new JACK("JACK"); aw.printLog(true); aw.fileLog(true); aw.setPassword("kawamura"); aw.addPublicIPStates(); aw.startIP(); } }

  13. Code states • Agent employs all IP state classes in same directory • Communication taken care of by XmlAcl class

  14. public class AwrIPStateS1 extends AwrIPState{ public AwrIPStateS1(){ super("INIT"); } public void action(){ XmlAcl xa = null; String perf = new String(); String sender = new String(); // Receive XML/ACL // Wait for someone to say hello while(waitXML(0)){ xa = getXML(); perf = xa.getTag2Value("performative"); sender = xa.getTag2Value("sender"); if(perf.equals("greeting")) break; if(perf.equals("farewell")) break; } // Send XML/ACL // Got a greeting or farewell // Randomly say either hello or goodbye or quit int rand = new Random(System.currentTimeMillis()).nextInt(); int dice = Math.abs(rand) % 3; switch(dice){ case 1: xa = new XmlAcl(); xa.setTag2Value("performative",“greeting"); xa.setTag2Value("sender", getMyname()); xa.setTag2Value("receiver“ , sender); xa.setTag2Value("content" , "farewell"); xa.setTag2Value("protocol", "nonsensetalk"); xa.setTag2Value("in-reply-to", "MSG1"); xa.setTag2Value("ontology", "default"); setPostcond("INIT"); break; default: setPostcond("END"); return; } if(!sendXML(xa)) Debug.printLog(getMyname(),"failed to send XML/ACL."); } }

  15. What does Jill have to say? JILL AgentWrapper started. JILL Loaded State: AwrIPStateS1 JILL Loaded State: AwrIPStateS2 JILL Invoke : AwrIPStateS1 JILL Send by http : <!DOCTYPE request SYSTEM "request.dtd"><request> <sender>JILL</sender><receiver>http://localhost:9441</receiver><content><action> forward</action><actor>http://localhost:9441</actor><args><!DOCTYPE greeting SYSTEM "greeting.dtd"><greeting><sender>JILL</sender><receiver>JACK</receiver> <content>somecontent</content><protocol>nonsensetalk</protocol><in-reply-to>MSG1 </in-reply-to><ontology>default</ontology></greeting></args></content><protocol> forward(internal)</protocol><in-reply-to>none</in-reply-to><ontology>default </ontology></request> JILL Reply by http : <!DOCTYPE inform SYSTEM "inform.dtd"><inform><sender>JAC K</sender><receiver>http://localhost:9442/</receiver><content>Done forward</cont ent><protocol>forward(internal)</protocol><in-reply-to>none</in-reply-to><ontolo gy>default</ontology></inform> JILL Invoke : AwrIPStateS2 JILL Waiting message... • Why is JILL sending “request”, when she’s supposed to only know “greeting” or “farewell” performatives?

  16. Message Forwarding • Apparently all messages are forwarded via the “request” performative • Actual message is contained in content field • Why? • Support for agent mobility? • Support for transport protocols? • Encryption?

  17. Our message JILL AgentWrapper started. JILL Loaded State: AwrIPStateS1 JILL Loaded State: AwrIPStateS2 JILL Invoke : AwrIPStateS1 JILL Send by http : <!DOCTYPE request SYSTEM "request.dtd"><request> <sender>JILL</sender><receiver>http://localhost:9441</receiver><content><action> forward</action><actor>http://localhost:9441</actor><args><!DOCTYPE greeting SYSTEM "greeting.dtd"><greeting><sender>JILL</sender><receiver>JACK </receiver><content>somecontent</content><protocol>nonsensetalk </protocol><in-reply-to>MSG1</in-reply-to><ontology>default</ontology> </greeting></args></content><protocol>forward(internal)</protocol><in-reply-to> none</in-reply-to><ontology>default</ontology></request> JILL Reply by http : <!DOCTYPE inform SYSTEM "inform.dtd"><inform><sender> JACK</sender><receiver>http://localhost:9442/</receiver><content>Done forward </content><protocol>forward(internal)</protocol><in-reply-to>none</in-reply-to> <ontology>default</ontology></inform> JILL Invoke : AwrIPStateS2 JILL Waiting message... • JACK immediately responds using inform performative and says msg was forwarded

  18. JACK does get the message • JACK then replies, again using the request performative so JILL can forward the message to herself. JACK AgentWrapper started. JACK Loaded State: AwrIPStateS1 JACK Invoke : AwrIPStateS1 JACK Waiting message... JACK Received : <!DOCTYPE greeting SYSTEM "greeting.dtd"><greeting> <sender>JILL</sender><receiver>JACK</receiver><content>somecontent </content><protocol>nonsensetalk</protocol><in-reply-to>MSG1 </in-reply-to><ontology>default</ontology></greeting> • Seems to work…

  19. Conclusions • It’s a beta package • Documentation is sketchy (forwarding?) • But surprisingly error-free so far (using Sun JRE) • Need to learn more about: • Message forwarding • Agent mobility • Passing objects in tags • Applet for viewing agent messages

More Related