1 / 49

Lecture 13 Mobile Agents

Lecture 13 Mobile Agents. Topics Basics Mobile Agent Model Applications Discussions Case study - Aglet Some Other Mobile Agents Concordia MOA. Basics. What is Mobile Agents?

falala
Download Presentation

Lecture 13 Mobile Agents

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. Lecture 13 Mobile Agents • Topics • Basics • Mobile Agent Model • Applications • Discussions • Case study - Aglet • Some Other Mobile Agents • Concordia • MOA

  2. Basics • What is Mobile Agents? • Mobile agents are programs that assist people and act on their behalf (agent), and they can travel in network • Mobility: Agents that can travel in network • Autonomy: migrate at times and to place of their own choosing • Compare to .. • Stationary agent • Mobile code (Applets) • Mobile object

  3. Basics • Network Computing Paradigms Client-Server Paradigm Code-onDemand Paradigm Server Know how Download (Applet) Client Client Know- how Know- how Server Mobile Agent Paradigm Agent Agent Network Know- how Know- how Host Host

  4. Basics • Limitation of Client/Server • Scaling -- Multiple servers • Quality of network connection • Reliability , latency , bandwidth • Protocol • Advantage of Mobile Agents • Every node is a server • Request Network connection • No application-level protocol

  5. Basics • Seven good reasons for Mobile Agents • Reduce network load • Overcome network latency • Encapsulate protocols • Execute asynchronously and autonomously • Adapt dynamically • Naturally heterogeneous • Fault-tolerant

  6. Mobile Agent Model • Agent travel to Host; work and interact with other agents in place (meeting place) Host Agent Place Resources Engine

  7. Mobile Agent Model • Key concepts: • Agent • the main entity in Mobile Agent System • Place • the environment where agents operate • Security • security policies for protecting agents, networks, and servers

  8. Mobile Agent Model • Agent • State: • needed for resume computation after traveling • Implementation: • needed for location-independent agent execution • Interface • needed for agent communication • Identifier • needed for recognize and locate traveling agents • Principals • needed to determinelegal and moral responsibility

  9. Mobile Agent Model • Place • Engine • Workhorse and virtual machines for one or more places • Resources • Databases, processors, and other services provided by the host • Location • The network address of a given place • Principals • Those legally responsible for the operation of a place

  10. Mobile Agent Model • Security • Agent protection –remote host, other agents, unauthorized third parties • Host protection –incoming agents, third parties • Network protection -- incoming agents • Security Services • Authentication • user, host, code, agent • Integrity • Confidentiality • Authorization • Non-repudiation • Auditing

  11. Mobile Agent Model • Agent Behavior • Agent Management • Creation • Disposal • Agent Transfer • Dispatch and Receive • Agent class transfer

  12. Mobile Agent Model • Creation • Instantiation and identifier assignment • Initialization • Autonomous execution • Disposal • Preparing for disposal • Suspension of execution

  13. Mobile Agent Model • Dispatch and Receive Sender Receiver Resume Execution Suspend Execution Serialize Agent Deserialize Agent Encode Data Decode Data Transfer Data Receive Data Network

  14. Mobile Agent Model • Agent Class Transfer Server Class at Server (code on demand) Class code Origin Server Agent Agent Class code Class code Class at origin Class at destination

  15. Mobile Agent Model - Standard • MASIF (Mobile Agent System Interoperability Facility) defines • Agent management • Agenttransfer • Agent and agent system names • Agent system type and location syntax • MASIF doesn’t do: • Language interoperability • Standardize local agent operations

  16. Mobile Agent Model - Standard • OSM (Open Service Model): A model for Global Information Brokerage and Distribution • The next generation framework for globally distributed Electronic Commerce and virtual trading market systems • Contain advanced Java based desktop components supporting a catalogue browsing, service inspection, monitoring and construction tools

  17. Mobile Agent Model - Standard OSM - Open Service Model

  18. Applications • Electronic Commerce • Personal Assistance • Distributed Information Retrieval • Telecommunication Network Service

  19. Applications • Example mobile agent systems • Java-based • Aglets (IBM) • Concordia (Mitsubishi’s) • Odyssey (General Magic Inc.) • Voyager (ObjectSpace) • Others • Agent Tcl (Dartmouth College) • Tacoma (Univ.of Tromso and Cornell Univ.)

  20. Benefits: Platform independence Secure execution Dynamic class loading Multithread programming Object serialization reflection Applications • Mobile Agent with Java • Drawbacks: • Inadequate support for resource control • No protection of references • No object ownership of references • No support for preservation and resumption of the execution state

  21. Discussions • Advantages of Mobile Agents • Reduced network load • Reduced resource usage of the client • Asynchronous processing • Reconfigurable services • Active behavior • Decentralized structure

  22. Discussions • Disadvantages of Mobile Agents • Security threats • Technical problems • transport/migration • efficiency • standards/interoperability • billing systems

  23. Case Study - Aglet • Aglet: A mobile agent that conforms to a set of security restrictions • A Java aglet is a mobile Java object • It can move from one host to another • It supports concepts of autonomous execution and dynamic routing on its itinerary. • Has its own thread of control • Is event-driven • Communicates by message passing

  24. Case Study - Aglet • Aglet Model • Proxy – a representative of an aglet • Context – an aglet’s workplace (place) • Identifier Aglet and Proxy: Client Interaction Proxy Aglet Host, Server process (Engine) and Context Host Context Context Server Process (Engine) Network

  25. Case Study - Aglet • Aglet Life Cycle • Creation • Cloning • Dispatching and Retraction (Mobility) • Activation and Deactivation (Persistence) • Disposal Dispose Context A Context B Clone Dispatch Aglet Aglet Retract Create Deactivate Activate Disk storage Class File

  26. Case Study - Aglet • Aglet Event Model • Clone listener • Mobility listener • Persistence listener Clone event CloneListener Aglet Mobility event MobilityListener PersistenceListener Persistence event

  27. Case Study - Aglet • Aglet Communication Model • Allows aglets to create and exchange messages in flexible ways • Key Components • Aglet, AgletProxy, Message, Future reply, Reply set Aglet/ Application Message Message Proxy Aglet Reply Reply

  28. Aglet Package: a Quick Tour • Aglet Class • AgletProxy Interface • AgletContext Interface • Message Class • FutureReply Class • AgletID Class

  29. Aglet Class Create a customized aglet: import com.ibm.aglet.*; Public class MyFirstAglet extends Aglet{ //put aglet’s methods here } Overriden methods: public void onCreation(Object init){ //do some initialization here… } public void run() { //do something here; }//main entry point //e.g. call dispatch(new URL(“atp://some.host.com//context”));

  30. Aglet Class • What happens when “dispatch”? • Object Serialization • Transfer • Deserialization and re-create state State Byte Code Host Host Sending Receiving State Byte Code Host Host

  31. AgletProxy • Why AgletProxy? • Acts as a shield object that protects an aglet from malicious aglets • Provide the aglet with location transparency • How to get a proxy? • Get proxy from a newly created aglet: • AgletContext.createAglet(), • AgletProxy.clone() • Get proxy from existing aglets • Aglet.getProxy() – get its own proxy • AgletContext.getAgletProxies() – retrieve an enum. of proxies in a context • AgletContext.getAgletProxy()–get an aglet proxy for a given aglet ID • Message passing – passed as an argument • AgletContext.setProperty – put proxy into context property and share it.

  32. AgletContext • An aglet uses AgletContext to • Get informationabout its environment (place) • Send message to the environment, including other aglets currently active in that environment • How it works: context=getAgletContext(); context.createAglet(); context.retractAglet(remoteContextURL,agletID);

  33. Message Class • Aglets communicate byexchangingobjects of the Message class • “kind” field: distinguishes messages Message myName=new Message(“my name”, “Jacob”); Message yourname=new Message(“your name?”); • Methods to send message (defined in AgletProxy class): • Object sendMessage(Message msg) • FutureReply sendFutureMessage(Message msg) • Void sendOnewayMessage(Message msg)

  34. Message handling Public boolean handleMessage(Message msg){ if(msg.samekind(“my name”)){ String name=(String)msg.getArg(); return true; //Yes, I handled this message } else if(msg.samekind(“your name?”)) { msg.sendReply(“Yina”); //Return its name return true; //Yes, I handled this message } else return false; //No, I did not handle this message } Message Class

  35. FutureReply Class • Returned by the asynchoronous message-sending method • Used to handle later receive the result asynchronously FutureReply future-proxy.sendFutureMessage(msg); While(!future.isAvailable()){ doPeriodicWork(); } Object reply= future.getReply();

  36. AgletID Class • Identity • Globally unique • Throughout lifetime • AgletID object • Hides the implementation-specific representation • Immutable • Use • AgletID aid=proxy.getAgletID(); • proxy=context.getAgletProxy(aid);

  37. Anatomy of an Aglet • Creation & Disposal • Clone • Mobility – Dispatch and Retract • Persistence – Activate and Deactivate

  38. Creation • public final AgletContext Aglet.getAgletContext() //Example: getAgletContext().createAglet(getCodeBase(),”SomeAglet”,null); • Methods that can be overridden protected Aglet.Aglet() Public void Aglet.onCreation(Object init) Public void Aglet.run() createAglet() Aglet() onCreation() run()

  39. Disposal public final void Aglet.dispose(); public void Aglet.onDisposing(); Dispose() onDisposing() run()

  40. Event • Event Types: • CloneEvent • MobilityEvent • PersistencyEvent • Delegation-Based Event Model • CloneListener CloneAdapter • MobilityListener MobilityAdapter • PersistencyListener PersistencyAdapter

  41. Cloning Public final Object Aglet.clone() Public final void Aglet.addCloneListener(CloneListener listener) Public final void Aglet.removeCloneListener(CloneListener listener) public CloneAdapter.CloneAdapter() public void CloneAdapter.onCloning(CloneEvent event) public void CloneAdapter.onClone(CloneEvent event) public void CloneAdapter.onCloned(CloneEvent event)

  42. public void run() { if (! _theClone) { //the original runs here… try{ clone(); } catch (Exception e) { System.out.println(e.getMessage()); } else {//the clone runs here…} } • Cloning (continued) public class CloningExample extends Aglet{ boolean _theClone=false; public void onCreation(Object o) { addCloneListener(new CloneAdapter(){ public void onCloning(CloneEvent e){ // print to the console } public void onClone(CloneEvent e){ // print to the console } public void onCloned(CloneEvent e){ // print to the console } } ); } run() original onCloning() onCloned() onClone() clone run()

  43. Mobility • Dispatching • Retracting run( ) Origin dispatch( ) onDispatching( ) onArrival( ) Destination run( ) retractAglet( ) Local onArrival( ) run( ) run( ) Remote onReverting( )

  44. Persistence • Persistence Aglet Context Activate Deactivate run( ) deactivate( ) Before onDeactivating( ) onActivation( ) After run( )

  45. Inside Aglets • Architecture Overview Services and User-defined aglets Aglet API • Aglet Runtime Layer • Core Framework • Management Components • CacheManager • SecurityManager • PersistanceManager Communication API Communication Layer

  46. Communication Layer • Communication API • Agent Transfer Protocol (ATP) • An ATP request consists of : a request line, header fields, content. • Four standard request method: • Dispatch • Retract • Fetch • Message ATP ATP Host Host HTTP HTTP Tunneling of ATP

  47. Aglet Security • Principals • Aglet • Context & Server • Network Domain • Permissions • Protection • Policy & Authority • Aglet owner • Context owner • Network Domain owner

  48. Some Other Mobile Agent Systems • Concordia

  49. Some Other Mobile Agent Systems • MOA (Mobile Objects and Agents )

More Related