50
Mobile Agents Diwakar Yagyasen Asst. Prof. Deptt of CSE, BBDNITM, Lucknow, UP, India [email protected]

Mobile Agents Diwakar Yagyasen Asst. Prof. Deptt of CSE ...dylucknow.weebly.com/uploads/6/7/3/1/6731187/mobile_agents_co… · Mobile Agents Diwakar Yagyasen Asst. Prof. Deptt of

  • Upload
    others

  • View
    2

  • Download
    0

Embed Size (px)

Citation preview

Mobile AgentsDiwakar Yagyasen Asst. Prof. Deptt of CSE, BBDNITM, Lucknow, UP, [email protected]

Mobile Agents Tutorial – Diwakar Yagyasen- BBDNITM, Lucknow, India2

Outline

l Overview of Agents and Mobile Agentsl Characterization of Mobilityl Advantages of Mobile Agentsl System Componentsl Language / Design Issuesl Applicationsl Challengesl Survey of Mobile Agent Systemsl Summary

Mobile Agents Tutorial – Diwakar Yagyasen- BBDNITM, Lucknow, India3

Definition of Software Agents

l Computer programl Autonomous behaviorl Represents some entityl Has authority (delegation)l Reacts and learns about environmentl Communicates using high-level Agent

Communication Languages (ACLs)

Mobile Agents Tutorial – Diwakar Yagyasen- BBDNITM, Lucknow, India4

Mobile Agents

Definition– Software agents– Move from one computer to another

l User-directed or autonomous

Mobile Agents Tutorial – Diwakar Yagyasen- BBDNITM, Lucknow, India5

Outline

l Overview of Agents and Mobile Agents

l Characterization of Mobilityl Advantages of Mobile Agentsl System Componentsl Language / Design Issuesl Applicationsl Challengesl Survey of Mobile Agent Systemsl Summary

Mobile Agents Tutorial – Diwakar Yagyasen- BBDNITM, Lucknow, India6

Characterizing Mobility

l Three capabilities– Mobile code– Mobile computation– Mobile state

l Various combinations are possible

MobileCode

Mob

ileC

ompu

tatio

n

Mobile

State

RPC, Servlets,Stored Procedures

RemoteInstallation

Checkpointing

Mobile Agents Tutorial – Diwakar Yagyasen- BBDNITM, Lucknow, India7

Mobile Code

l Allows executable code to be moved to a new host

l May use the push or pull model– Pull: Applets– Push: Remote Installation

l Mobile agents use push– Sometimes, an agent push may result in a code pull

l Code may be binary (intermediate or native) or source

Mobile Agents Tutorial – Diwakar Yagyasen- BBDNITM, Lucknow, India8

Mobile Code

l Advantages:– Dynamically change capabilities

l Download new code to add / change / update capabilities of platform

l Remove code when no longer needed

l Problems:– Security concerns due to untrusted / unchecked

codel Code could be malicious, buggy, and/or tampered

Mobile Agents Tutorial – Diwakar Yagyasen- BBDNITM, Lucknow, India9

Mobile Computation

l Evolution of Remote Computation– RPC, RSH, RMI, Servlets, Stored Procedures,

CORBAl Allows one system to run a computation on

another systeml Utilize resources on remote system

– CPU, memoryl Access resources on remote system

– Files, databases, etc.

Mobile Agents Tutorial – Diwakar Yagyasen- BBDNITM, Lucknow, India10

Mobile State

l Evolution of State Capture– Checkpointing

l Allows execution state of a process to be captured and moved

l State may be machine specific or machine independent

l May contain– State of single or multiple threads– Code

Mobile Agents Tutorial – Diwakar Yagyasen- BBDNITM, Lucknow, India11

Combinations of Capabilities

MobileCode

Mob

ileC

ompu

tatio

n

Mobile

State

RPC, Servlets,Stored Procedures

RemoteInstallation

Checkpointing

WeakMobility

ProcessMigration

StrongMobility

Mobile Agents Tutorial – Diwakar Yagyasen- BBDNITM, Lucknow, India12

Strong Mobility

l Move execution state with agentl Why is it important?

– Computationally equivalent to weak mobility– However, simpler, more natural abstraction– Therefore, easier to write mobile agents

l More importantly – mobile state allowsforced mobility

Mobile Agents Tutorial – Diwakar Yagyasen- BBDNITM, Lucknow, India13

Weak Mobility Example

public class Example extends Aglet { boolean _theRemote = false; public void onCreation (Object init) { addMobilityListener( new MobilityAdapter() { public void onArrival (MobilityEvent e) { _theRemote = true; } } ); } public void run() { if (!_theRemote) { System.out.println (“On Source”); dispatch(destination); } else { System.out.println (“On Destination”); } }}

Mobile Agents Tutorial – Diwakar Yagyasen- BBDNITM, Lucknow, India14

Strong Mobility Example

public class Example extends Agent{ public static void main (String[] args) { System.out.println (“On source”); go (destination); System.out.println (“On destination”); }}

Mobile Agents Tutorial – Diwakar Yagyasen- BBDNITM, Lucknow, India15

Outline

l Overview of Agents and Mobile Agentsl Characterization of Mobility

l Advantages of Mobile Agentsl System Componentsl Language / Design Issuesl Applicationsl Challengesl Survey of Mobile Agent Systemsl Summary

Mobile Agents Tutorial – Diwakar Yagyasen- BBDNITM, Lucknow, India16

Client-Server Versus Mobile Agents

Client

Server Server

Client

Agent

Server

Client

Agent

Server

Client

Agent

Traditional Mobile Agent-Based

Mobile Agents Tutorial – Diwakar Yagyasen- BBDNITM, Lucknow, India17

Advantages of Mobile Agents

l Reduced network bandwidthl Disconnected operation

– Short “On-Line” times– Low-power requirements– Support for mobile units

l Low-latency interaction

Mobile Agents Tutorial – Diwakar Yagyasen- BBDNITM, Lucknow, India18

Jini Versus Mobile Agents

Client

Device

Client

Device

Proxy

Client

Device

Client

Device

Agent

Client

Device

Agent

Mobile Agents Tutorial – Diwakar Yagyasen- BBDNITM, Lucknow, India19

Advantages of Mobile Agents

l Highly Dynamic and Flexible Systems– Enabled my mobile code– Download new capabilities / services– Remove old / unused capabilities

l “Swapping” for memory constrained devices– Structure systems around mobile code

l “Universal” serverl Open Services Gateway Initiative (OSGI)

Mobile Agents Tutorial – Diwakar Yagyasen- BBDNITM, Lucknow, India20

Advantages of Mobile Agents

l Unique capability:Send an executable program that does your bidding

on someone else’s computer

l Very powerful but… can be dangerous!– Only one step removed from a Virus

Mobile Agents Tutorial – Diwakar Yagyasen- BBDNITM, Lucknow, India21

Agent Programming Paradigms

l Itinerant Agents– Use an itinerary that dictates mobility of agents

l Reactive Agents– Event-based approach– Events trigger mobility of agents

l Agent-Minion– Minions: Small mobile agents spawned by larger

agents

Mobile Agents Tutorial – Diwakar Yagyasen- BBDNITM, Lucknow, India22

Outline

l Overview of Agents and Mobile Agentsl Characterization of Mobilityl Advantages of Mobile Agents

l System Componentsl Language / Design Issuesl Challengesl Survey of Mobile Agent Systemsl Summary

Mobile Agents Tutorial – Diwakar Yagyasen- BBDNITM, Lucknow, India23

System Components

ExecutionEnvironment

ExecutionEnvironment

Agent Transfer Protocol

DirectoryService

MessagingService

PolicyManager

Interpreter

VisualizationTools

AdministrationTools

Agent Messaging Protocol

AuthenticationEncryption

GlobalDirectoryService

LoggingService

GlobalLoggingService

Other Frameworks(DARPA CoABS Grid, etc.)

PersistenceService

Mobile Agents Tutorial – Diwakar Yagyasen- BBDNITM, Lucknow, India24

Outline

l Overview of Agents and Mobile Agentsl Characterization of Mobilityl Advantages of Mobile Agentsl System Components

l Language / Design Issuesl Applicationsl Challengesl Survey of Mobile Agent Systemsl Summary

Mobile Agents Tutorial – Diwakar Yagyasen- BBDNITM, Lucknow, India25

Languages for Mobile Agents

l Java– Numerous Systems

l TCL– D’Agents, SMIA

l C/C++– Omniware

l Miscellaneous– Telescript– Lisp, Scheme, custom, etc.

Mobile Agents Tutorial – Diwakar Yagyasen- BBDNITM, Lucknow, India26

Advantages of Java

l Platform independent

l Virtual Machine execution environment– Important for isolation

l Small footprint

l “Real” programming language– Compared to TCL

l Most security conscious– Though still not adequate!

Mobile Agents Tutorial – Diwakar Yagyasen- BBDNITM, Lucknow, India27

Limitations of Java

l No state capturel Importance:

– Mobile statel Mobile agent systemsl Load balancing (distributed systems)l Forced migrationl Cloning (fault tolerance)

– Checkpointingl Faster VM startupl Restarting crashed applicationsl Persisting processes for later resumption

Mobile Agents Tutorial – Diwakar Yagyasen- BBDNITM, Lucknow, India28

Limitations of Java

l No resource controll Importance:

– Protect against denial-of-service attacksl Malicious codel Buggy code

– Prioritize tasks– Foundation for providing QoS guarantees

Mobile Agents Tutorial – Diwakar Yagyasen- BBDNITM, Lucknow, India29

Limitations of Java

l No resource accountingl Importance:

– Measuring resource consumptionl Charging / billing resource usage

– Observing behavior of code

Mobile Agents Tutorial – Diwakar Yagyasen- BBDNITM, Lucknow, India30

Directory Service Issues

l Difficult to find an agent– Chase agent around

l Fast Moving Agents– May be difficult/inefficient to update directory service

Mobile Agents Tutorial – Diwakar Yagyasen- BBDNITM, Lucknow, India31

Authentication Issues

l Agent Anonymity– Agent may want to be anonymous on a host– Analogy: Window shopping

l Multiple Hop– Agent may not want to carry credentials

l Credentials could be stolen by malicious hosts

Mobile Agents Tutorial – Diwakar Yagyasen- BBDNITM, Lucknow, India32

Outline

l Overview of Agents and Mobile Agentsl Characterization of Mobilityl Advantages of Mobile Agentsl System Componentsl Language / Design Issues

l Applicationsl Challengesl Survey of Mobile Agent Systemsl Summary

Mobile Agents Tutorial – Diwakar Yagyasen- BBDNITM, Lucknow, India33

Applications of Mobile Agents

Information Retrieval– Mobile agents reduce network bandwidth– Depends on:

l Quantity of information searchedl Quantity of information retrievedl Size of mobile agent

– Comprehensive study for DARPAl Dartmouth College, Lockheed Martin ATL,

University of West Florida

Mobile Agents Tutorial – Diwakar Yagyasen- BBDNITM, Lucknow, India34

Applications of Mobile Agents

l Monitoring– Computer programs can be very patient

l Remote Controll Dynamic Systems

– Universal serversl Active Mail

– Send executable content as email

Mobile Agents Tutorial – Diwakar Yagyasen- BBDNITM, Lucknow, India35

Outline

l Overview of Agents and Mobile Agentsl Characterization of Mobilityl Advantages of Mobile Agentsl System Componentsl Language / Design Issuesl Applications

l Challengesl Survey of Mobile Agent Systemsl Summary

Mobile Agents Tutorial – Diwakar Yagyasen- BBDNITM, Lucknow, India36

Challenges for Mobile Agents

l Security Issues– Protecting network communication– Protecting hosts from agents

l Illegal accessl Denial of service

– Protecting agents from hostsl Tamperingl Extracting informationl Capture / Replay

l System-wide Administration / Management– Policies– Tracking / Visualization

Mobile Agents Tutorial – Diwakar Yagyasen- BBDNITM, Lucknow, India37

Challenges for Mobile Agents

l Access to non-mobile resources– Network endpoints– Files

l Deployment (of environments)l Interoperability

– OMG MASIF – Not successful– DARPA CoABS – We shall see…

l Debugging– Highly Asynchronous

Mobile Agents Tutorial – Diwakar Yagyasen- BBDNITM, Lucknow, India38

Outline

l Overview of Agents and Mobile Agentsl Characterization of Mobilityl Advantages of Mobile Agentsl System Componentsl Language / Design Issuesl Applicationsl Challenges

l Survey of Mobile Agent Systemsl Summary

Mobile Agents Tutorial – Diwakar Yagyasen- BBDNITM, Lucknow, India39

Survey of Mobile Agent Systems

Commercial Systems– Telescript/Odyssey - General Magic

– Voyager - ObjectSpace

– Aglets - IBM

– Concordia - Mitsubishi Electric ITA

– Jumping Beans - AdAstra

Mobile Agents Tutorial – Diwakar Yagyasen- BBDNITM, Lucknow, India40

Survey of Mobile Agent Systems

Research Systems– NOMADS– KAoS– D’Agents– Agents for Remote Action (ARA)– Mole– Sumatra– Many others...Mobile Agent List:http://www.informatik.uni-stuttgart.de/ipvr/vs/projekte/mole/mal/mal.html

Mobile Agents Tutorial – Diwakar Yagyasen- BBDNITM, Lucknow, India41

NOMADS

Java-based mobile agent system– Strong mobility

l Capture full execution state of running agentsl Provides anytime mobility – simplifies writing mobile

agentsl Provides forced mobility – arbitrary Java code can be

moved– Strong security

l Dynamically control resource usage (rates and quantities)l Allows platform owner full control over agent executionl Protect against denial of service attacks

Mobile Agents Tutorial – Diwakar Yagyasen- BBDNITM, Lucknow, India42

Strong Security

l Limitations of current Java systems– Rely on JDK security

l Does not provide resource control– Either assume agents are safe

l Does not scale– Or rely on code signing

l Not a preventive measure

l Goal: Build secure execution environments– Run untrusted or partially-trusted code

Mobile Agents Tutorial – Diwakar Yagyasen- BBDNITM, Lucknow, India43

Aroma Virtual Machine

l Clean-room implementationl State capture mechanisml Dynamic, fine-grained resource control

– Disk, Network, CPUl JDK 1.2.2 compatible

– Uses Java Platform API from JRE 1.2.2– No AWT / Swing

l Ported to Win32 (x86), Linux (x86), Solaris (SPARC)l No Just-In-Time compilationl (Almost) No optimization

Mobile Agents Tutorial – Diwakar Yagyasen- BBDNITM, Lucknow, India44

State Capture

l Aroma supports two modes– Full VM state

l All threads, loaded classes, objectsl State may be restored into a “blank” VMl Size: Approx 1.5 MB

– Individual thread statel Method stack and all reachable objectsl Thread may be restored into running VMl Size: Approx 4 KB

Mobile Agents Tutorial – Diwakar Yagyasen- BBDNITM, Lucknow, India45

State Capture

l State capture is fine-grained– Between any two Java bytecode instructions– Supports blocked, waiting, sleeping, and suspended

threadsl State is platform independentl State may be stored in memory, saved to disk,

or streamed over the network

Mobile Agents Tutorial – Diwakar Yagyasen- BBDNITM, Lucknow, India46

Resource Control

Rate control– Control rate at which resources are used– Dynamically adjustable– Fine grained– Examples:

l CPU limited to 10%l Disk write rate limited to 30 KB/secl Network read rate limited to 10 KB/sec

Disk Usage Rate

Mobile Agents Tutorial – Diwakar Yagyasen- BBDNITM, Lucknow, India47

Resource Control

Quantity control– Control quantity of resources used– Dynamically adjustable– Fine grained– Examples:

l Disk space limited to 1.8 MBl Total network writes limited to 1024 KB

– Still needed: memory

Disk Usage Quantity

Mobile Agents Tutorial – Diwakar Yagyasen- BBDNITM, Lucknow, India48

Benefits of Resource Control

l Protect host from malicious agents– Prevent denial of service attacks

l Simplify agent writer’s task– Agents do not need to worry about resource

control / limitsl Means of prioritization

– Raising limits increases priorityl Basis for Quality of Servicel Means of accounting

Mobile Agents Tutorial – Diwakar Yagyasen- BBDNITM, Lucknow, India49

Outline

l Overview of Agents and Mobile Agentsl Characterization of Mobilityl Advantages of Mobile Agentsl System Componentsl Language / Design Issuesl Applicationsl Challengesl Survey of Mobile Agent Systems

l Summary

Mobile Agents Tutorial – Diwakar Yagyasen- BBDNITM, Lucknow, India50

Summary

l Mobile Agents are Good – Code mobility adds significant flexibility

l Security is Criticall Deployment is Difficultl No Interoperability

MH MP MPD