22
Winter, 2004 CSS490 Process Migration 1 CSS490 Process Migration CSS490 Process Migration Textbook Ch8 Textbook Ch8 Instructor: Munehiro Fukuda These slides were compiled from the course textbook, the r eference books, and the instructor’s original materials.

Winter, 2004CSS490 Process Migration1 Textbook Ch8 Instructor: Munehiro Fukuda These slides were compiled from the course textbook, the reference books,

  • View
    222

  • Download
    4

Embed Size (px)

Citation preview

Page 1: Winter, 2004CSS490 Process Migration1 Textbook Ch8 Instructor: Munehiro Fukuda These slides were compiled from the course textbook, the reference books,

Winter, 2004 CSS490 Process Migration 1

CSS490 Process MigrationCSS490 Process MigrationTextbook Ch8Textbook Ch8

Instructor: Munehiro Fukuda

These slides were compiled from the course textbook, the reference books, and the instructor’s original materials.

Page 2: Winter, 2004CSS490 Process Migration1 Textbook Ch8 Instructor: Munehiro Fukuda These slides were compiled from the course textbook, the reference books,

Winter, 2004 CSS490 Process Migration 2

Degrees of Mobility

Data Control

Code

DataState

ExecutionState

NavigationalAutonomy

TransferDirection

Message Passing Move

In/Out

RPC Move

Move Out

Remote Execution Move

Move Move

Out

Code on Demand Move

Move

In

Process Migration Move

Move Move

Move Move In/Out

Mobile Agents (weak)

Move

Move Move

Move Own In/Out

Mobile Agents (strong)

Move

Move Move

Move Move Own In/Out

Page 3: Winter, 2004CSS490 Process Migration1 Textbook Ch8 Instructor: Munehiro Fukuda These slides were compiled from the course textbook, the reference books,

Winter, 2004 CSS490 Process Migration 3

System Examples

Types Systems

Message Passing Socket, PVM, MPI

RPC Xerox Courier, SunRPC, RMI

Remote Execution Servlets, Remote evaluation, Tacoma

Code on Demand Applets, VB/Jscripts

Process Migration Condor, Sprite, Olden

Mobile Agents (Weak Migration)

IBM Aglets, Voyager, Mole

Mobile Agents (Strong Migration)

Telescript, D’Agent, Ara

Page 4: Winter, 2004CSS490 Process Migration1 Textbook Ch8 Instructor: Munehiro Fukuda These slides were compiled from the course textbook, the reference books,

Winter, 2004 CSS490 Process Migration 4

Remote Execution

Procedure code is sent together with arguments.

Server behaves like a general cycle server.

Server can evolve itself.

MainProgram

FunctionObject

Client Server

DispatcherArgumentsFunctionObjectf( )

Function/objecttransfer

Argument transfer Remoteexecution

Return value

Control

Page 5: Winter, 2004CSS490 Process Migration1 Textbook Ch8 Instructor: Munehiro Fukuda These slides were compiled from the course textbook, the reference books,

Winter, 2004 CSS490 Process Migration 5

Code on Demand

Server behaves like a general remote object server.

A remote function/object is sent back as a return value.

Client executes the function/object locally.

Client execution control stays in local while suspended upon a request to a server.

MainProgram

func( )

Client Server

DispatcherRemoteFunctionObject

Request a remote function/object

FunctionObject

Function/object itselfis returned.

Control

Locally executed

Page 6: Winter, 2004CSS490 Process Migration1 Textbook Ch8 Instructor: Munehiro Fukuda These slides were compiled from the course textbook, the reference books,

Winter, 2004 CSS490 Process Migration 6

Process Migration

Selecting a process to be migrated

Selecting the destination node

Suspending the process Capturing the process

state Sending the state to the

destination Resuming the process Forwarding future

messages to the destination

Process P1::::

Executionsuspended

Source Site Destination Site

ExecutionResumed

::::

Process P1

Transfer of control

Time

Freezingtime

Page 7: Winter, 2004CSS490 Process Migration1 Textbook Ch8 Instructor: Munehiro Fukuda These slides were compiled from the course textbook, the reference books,

Winter, 2004 CSS490 Process Migration 7

Process MigrationBenefits

Better response time and execution speed-up Dynamic load balancing among multiple nodes Using a faster CPU

Higher throughput and Effective resource utilization Migrating I/O and CPU-bound processes to file and cycle

servers. Reducing network traffic

Migrating processes closer to the resources they are using most heavily.

Improving system reliability Migrating processes from a site in failure to more

reliable sites Replicating and migrating critical processes to a remote.

Page 8: Winter, 2004CSS490 Process Migration1 Textbook Ch8 Instructor: Munehiro Fukuda These slides were compiled from the course textbook, the reference books,

Winter, 2004 CSS490 Process Migration 8

Process MigrationState Capturing

CPU registers Captured upon a breeze

Address space Difficult to restore pointers

I/O state: Fast I/O Operations

Completed before a process migration Durable I/O Operations like files and user interactions

Difficult to carry files in use and to freeze/restore system calls.

Necessity to maintain a connection with I/O established at the source node.

Some popular files available at the destination node

Page 9: Winter, 2004CSS490 Process Migration1 Textbook Ch8 Instructor: Munehiro Fukuda These slides were compiled from the course textbook, the reference books,

Winter, 2004 CSS490 Process Migration 9

Process MigrationAddress Transfer Mechanisms

Transfer ofaddress space

Sourcenode

Destinationnode

SuspendedMigrationdecision

resumed

Freezingtime

Transfer ofaddress space

Sourcenode

Destinationnode

Suspended

Migrationdecision

resumed

Freezingtime

On-demandtransfer

Sourcenode

Destinationnode

SuspendedMigrationdecision

resumed

Freezingtime

Total Freezing Pretransferring Transfer-on-reference

Merits: easy implementationDemerits: long delay time

Merits: freezing time reduceDemerits: total time extended

Merits: quick migrationDemerits: large memory latency

Page 10: Winter, 2004CSS490 Process Migration1 Textbook Ch8 Instructor: Munehiro Fukuda These slides were compiled from the course textbook, the reference books,

Winter, 2004 CSS490 Process Migration 10

Process MigrationMessage Forwarding Mechanisms

Sender

Origin

Dest 1

Dest 2

Receiver

Migrate

Migrate again

Resend

Resend again

Sender

Origin

Dest 1

Dest 2

Receiver

Migrate

Migrate again

Resending messages Ask origin site

SendSend

Forward

Page 11: Winter, 2004CSS490 Process Migration1 Textbook Ch8 Instructor: Munehiro Fukuda These slides were compiled from the course textbook, the reference books,

Winter, 2004 CSS490 Process Migration 11

Process MigrationMessage Forwarding Mechanisms (Cont’d)

Sender

Origin

Dest 1

Dest 2

Receiver

Migrate

Migrate again

Link Update

SendSender

Origin

Dest 1

Dest 2

Receiver

Migrate

Migrate again

Link traversal

Link

Link

Send

Forward

Forward

SendNew location

Send

New location

Send

Current location

Page 12: Winter, 2004CSS490 Process Migration1 Textbook Ch8 Instructor: Munehiro Fukuda These slides were compiled from the course textbook, the reference books,

Winter, 2004 CSS490 Process Migration 12

Process MigrationHeterogeneous Systems

Using external data representation Floating-point data

External data representation must have at least as much space as the longest floating-point data representation

Process migration is restricted to only the machines that can avoid the over/underflow and the loss of precision.

Architectural-dependent data representation Singed-infinity and singed-zero

In general, process migration over heterogeneous systems are too expensive

Conversion work Architectural-dependent representation handling

Always interrupting external data representation Java

Page 13: Winter, 2004CSS490 Process Migration1 Textbook Ch8 Instructor: Munehiro Fukuda These slides were compiled from the course textbook, the reference books,

Winter, 2004 CSS490 Process Migration 13

Mobile AgentsParadigm

clientclientclientclient serverserverserverserver

clientclientagentagent

clientclientagentagent serverserverserverserverclientclient

agentagent

clientclientagentagent

NetworkNetworkNetworkNetwork

NetworkNetworkNetworkNetwork

Conventional ApproachConventional Approach

Mobile Agent ApproachMobile Agent Approach

Page 14: Winter, 2004CSS490 Process Migration1 Textbook Ch8 Instructor: Munehiro Fukuda These slides were compiled from the course textbook, the reference books,

Winter, 2004 CSS490 Process Migration 14

Mobile AgentsBenefits

Low network traffic and latency Agents-server communication takes place locally.

Encapsulation All code and data are carried with an agent.

Autonomous and asynchronous navigation Agent disconnect communication with their client

and visits servers as their own. Run-time adaptability

Agents can dynamically load new objects as they migrate over network.

Robustness Agents are active to get out of faulty nodes.

Page 15: Winter, 2004CSS490 Process Migration1 Textbook Ch8 Instructor: Munehiro Fukuda These slides were compiled from the course textbook, the reference books,

Winter, 2004 CSS490 Process Migration 15

HW/OSHW/OSHW/OSHW/OSHW/OSHW/OS

Mobile AgentsExecution Model - OMG/MASIF -

RegionRegion

CommunicationCommunicationinfrastructureinfrastructure

Agent SystemAgent System

PlacePlace

PlacePlace

AgentAgentAgentAgent

AgentAgentAgentAgent

AgentAgentAgentAgent

CommunicationCommunicationinfrastructureinfrastructure

Agent SystemAgent System

PlacePlace

PlacePlace

AgentAgentAgentAgent

AgentAgentAgentAgent

AgentAgentAgentAgent

CommunicationCommunicationinfrastructureinfrastructure

Agent SystemAgent System

PlacePlace

PlacePlace

AgentAgentAgentAgent

AgentAgentAgentAgent

AgentAgentAgentAgent

Page 16: Winter, 2004CSS490 Process Migration1 Textbook Ch8 Instructor: Munehiro Fukuda These slides were compiled from the course textbook, the reference books,

Winter, 2004 CSS490 Process Migration 16

Agents:1. State: Execution state to be resumed upon a migration2. Implementation: Architectural independent code3. Interface: Facility to communicate with places and

other agents4. Identifier: Agent identifier5. Authority/Principal: The owner of agent

Places:1. Engine: Place to execute agents2. Resource: CPU, memory, database, etc.3. Location: IP + logical location id4. Principal: The owner of place

Mobile AgentsDefinition of Agents and Places

Page 17: Winter, 2004CSS490 Process Migration1 Textbook Ch8 Instructor: Munehiro Fukuda These slides were compiled from the course textbook, the reference books,

Winter, 2004 CSS490 Process Migration 17

Mobile AgentsProcess Migration v.s. Mobile Agents

Process Migration Mobile Agents

Navigational Autonomy

Migration decision is made by system.

Agents decide where and where to go by calling go( ) or hop( ) method.

Code Execution Programs are fully compiled and executed in native mode.

Most agents are coded in Java and Tcl, and are interpreted by their execution engine.

Strong/Weak Migration

Execution is resumed where it has been suspended.

Java-based agents resume their execution from the top of a given method.

I/O State Long-term I/Os are forwarded to processes migrated to the desination.

Agents relinquish I/O connections every time they depart for their next destination.

Page 18: Winter, 2004CSS490 Process Migration1 Textbook Ch8 Instructor: Munehiro Fukuda These slides were compiled from the course textbook, the reference books,

Winter, 2004 CSS490 Process Migration 18

Mobile AgentsD’Agent: Strong Migration Example

proc who machine { // agent spawned from its parent global agent set list “” foreach m $machines { if ( [catch {agent_jump $m} result] } { // jump to a remote machine append list “$m: nunable to JUMP here ($result)nn” // jump failed } else { set users [exec who] // jump in success, execute who append list “$agent(local-server): n$usersnn” } }

agent_send $agent( root ) 0 $list // send a list to its parent agent exit}

The list of machinesNew line

Page 19: Winter, 2004CSS490 Process Migration1 Textbook Ch8 Instructor: Munehiro Fukuda These slides were compiled from the course textbook, the reference books,

Winter, 2004 CSS490 Process Migration 19

Mobile AgentsIBM Agelts: Weak Migration Example

Public class DispatchingExample extends Aglet { boolean remoteAgent = false; public void onCreation( object init ) { addMobilityListener( new MobilityAdapter( ) { public void onDispatching( MobilityEvent e ) { System.out.println( “The parent agent dispatched a child agent” ); } public void onArrival( MobilityEvent e ) { remoteAgent = true; System.out.println( “The child agent arrived at the destination” ); } } ); } public void run( ) { if ( remoteAgent ) { try { URL destination = new URL( (String)getAgletContext( ).getProperty( “uw1-320-lab” ); dispatch( destination ); } catch ( Exception e ) { System.out.println( e.getMessage( ) ); } } else { System.out.println( “The child starts run( ) at the destination” ); } }}

run

dispatch

onDispatching

onArrival

run

Source

Destination

Page 20: Winter, 2004CSS490 Process Migration1 Textbook Ch8 Instructor: Munehiro Fukuda These slides were compiled from the course textbook, the reference books,

Winter, 2004 CSS490 Process Migration 20

Mobile AgentsUW Messengers: What Former CSS499 Students

Developedpublic class MyAgent extends UWAgent implements Serializable { MyAgent( ) { } MyAgent( String[] args ) { } void init( ) { String[] args = new String[2]; args[0] = Integer.toString( 10 ); args[1] = Integer.toString( 3 ); hop( “uw1-320-01”, “power”, String[] funcArgs ); } void power( String[] args ) { base = Integer.parseInt( args[0] ); exp = Integer.parseInt( args[1] ); for ( int j = 0; j < exp; j++ ); pow += base; System.out.println( “host =” + getInetAddress( ) + “power =” + pow ); hop( “uw1-320-02”, “factorial”, String[] args ); } void factorial( String[] arg ) { base = Integer.parseInt( args[0] ); fact = 1; for ( int j = base; j > 0; j== ) fact *= j; System.out.println( “host =“ + getInetAddress( ) + “fact =“ + fact );}

Uw1-320-02Uw1-320-02Uw1-320-01Uw1-320-01Uw1-320-00Uw1-320-00

MyAgentinit( )

MyAgentpower( )

MyAgentFactorial( )

hop( ) hop( )

uw1-320-lab: ~css434/UW Messengers

Manual: UWMessengers.ps

Page 21: Winter, 2004CSS490 Process Migration1 Textbook Ch8 Instructor: Munehiro Fukuda These slides were compiled from the course textbook, the reference books,

Winter, 2004 CSS490 Process Migration 21

Exercises (No turn-in)

1. What are items to be taken into consider when migration decision is made?

2. Why is address space transfer so difficult when pointers are involved? What is necessary to transfer data structures on memory to the destination?

3. What is necessary to improve the performance of transfer-on-reference?

4. Why do mobile agents have more security concerns than process migration.

5. What made it possible to implement java-based mobile agents?6. Why do java-based mobile agents need to take weak migration?

Page 22: Winter, 2004CSS490 Process Migration1 Textbook Ch8 Instructor: Munehiro Fukuda These slides were compiled from the course textbook, the reference books,

Winter, 2004 CSS490 Process Migration 22

Paper Review by Students D’Agent IBM Aglets Ara Mole