08-Process Migration

Degree of mobility Implementation Issues in Process Migration --State capturing --Address transfer mechanisms --Message forwarding mechanisms Mobile agents --D’Agent --IBM Aglets --UWAgents

1. CSS434 Process Migration Textbook 7.4.2 and Non-Textbook Contents Professor: Munehiro Fukuda CSS434 Process Migration 1

2.Outline  Degree of mobility  Implementation Issues in Process Migration  State capturing  Address transfer mechanisms  Message forwarding mechanisms  Mobile agents  D’Agent  IBM Aglets  UWAgents CSS434 Process Migration 2

3. Degrees of Mobility Data Contro Cod Data Executio Navigation Transfer l e State n al Directio State Autonomy n Message Passing Mov In/Out e RPC Mov Move Out e Remote Execution Mov Move Mov Out e e Code on Demand Mov Mov In e e Process Migration Mov Move Mov Move Move In/Out e e Mobile Agents Mov Move Mov Move Own In/Out (weak) e e Mobile Agents Mov Move Mov Move Move Own In/Out (strong) e e CSS434 Process Migration 3

4. 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 IBM Aglets, Voyager, Mole Migration) Mobile Agents (Strong Telescript, D’Agent, Ara Migration) CSS434 Process Migration 4

5. Remote Execution Client  Procedure code is sent Server together with Control Function/object arguments. Function transfer  Server behaves like a Object general cycle server. Function Main Argument transfer Program Arguments Dispatcher Object f( ) Remote  Server can evolve itself. execution Return value CSS434 Process Migration 5

6. Code on Demand Client  Server behaves like a Server general remote object ControlRequest a remote function/object server.  A remote function/object is Main sent back as a return value. Remote Program Function Object Dispatcher Function  Client executes the Function/object itself Object func( ) is returned. function/object locally. Locally executed  Client execution control stays in local while suspended upon a request to a server. CSS434 Process Migration 6

7. Process Migration Time  Selecting a process to be Source Site Destination Site migrated Process P1 :  Selecting the destination : : node : Execution  Suspending the process Freezing suspended  Capturing the process state Transfer of time control  Sending the state to the Execution Resumed destination : :  Resuming the process : :  Forwarding future Process P1 messages to the destination CSS434 Process Migration 7

8. Process Migration Benefits  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. CSS434 Process Migration 8

9. Process Migration State Capturing  CPU registers  Captured upon a freeze  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 CSS434 Process Migration 9

10. Process Migration Address Transfer Mechanisms Total Freezing Pretransferring Transfer-on-reference Source Destination Source Destination Source Destination node node node node node node Suspended Migration Migration Migration Suspended decision decision Freezing decision time Freezing Transfer of Transfer of On-demand resumed time address space Suspended address space transfer Freezing resumed time resumed Merits: freezing time reduceMerits: quick migration erits: easy implementation emerits: long delayDemerits: time Demerits: total time extended large memory lat CSS434 Process Migration 10

11. Process Migration Message Forwarding Mechanisms Resending messages Ask origin site Origin Origin Sender Receiver Sender Receiver Send Send ResendMigrate Migrate Dest 1 Forward Dest 1 Resend again Migrate again Migrate again Dest 2 Dest 2 CSS434 Process Migration 11

12. Process Migration Message Forwarding Mechanisms (Cont’d) Link traversal Link Update Origin Origin Sender Receiver Sender Receiver Send Send Forward New location Send Link Migrate Migrate Send Dest 1 Dest 1 Forward New location Link Migrate again Send Migrate again Current location Dest 2 Dest 2 CSS434 Process Migration 12

13. Process Migration Heterogeneous 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 CSS434 Process Migration 13

14. Mobile Agents Paradigm Conventional Approach client server server client Network Network Mobile Agent Approach client client client client server server agent agent Network Network agent agent CSS434 Process Migration 14

15. Mobile Agents Benefits  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. CSS434 Process Migration 15

16. Mobile Agents Execution Model - OMG/MASIF - HW/OS HW/OS HW/OS Region Agent System Agent System Agent System Place Place Place Agent Agent Agent Agent Agent Agent Place Place Place Agent Agent Agent Agent Agent Agent Agent Agent Agent Agent Agent Agent Communication Communication Communication infrastructure infrastructure infrastructure CSS434 Process Migration 16

17. Mobile Agents Definition of Agents and Places  Agents: 1. State: Execution state to be resumed upon a migration 2. Implementation: Architectural independent code 3. Interface: Facility to communicate with places and other agents 4. Identifier: Agent identifier 5. Authority/Principal: The owner of agent  Places: 1. Engine: Place to execute agents 2. Resource: CPU, memory, database, etc. 3. Location: IP + logical location id 4. Principal: The owner of place CSS434 Process Migration 17

18. Mobile Agents Process Migration v.s. Mobile Agents Process Migration Mobile Agents Navigational Migration decision is made Agents decide where and Autonomy by system. where to go by calling go( ) or hop( ) method. Code Execution Programs are fully compiled Most agents are coded in Java a and executed in native nd Tcl, and are interpreted by t mode. heir execution engine. Strong/Weak Execution is resumed where Java-based agents resume Migration it has been suspended. their execution from the top of a given method. I/O State Long-term I/Os are forwarded t Agents relinquish I/O o processes migrated to the de connections every time they sination. depart for their next destination. CSS434 Process Migration 18

19. Mobile Agents D’Agent: Strong Migration Example proc who machine { // agent spawned from its parent global agent set list “” The list of machines foreach m $machines { New line 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 } CSS434 Process Migration 19

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

21. Mobile Agents UW Messengers: What Former CSS499 Students Developed public class MyAgent extends UWAgent implements Serializable { MyAgent( ) { } MyAgent( String[] args ) { uw1-320-lab: ~css434/hw3/uwagent } void init( ) { String[] args = new String[2]; args[0] = Integer.toString( 10 ); args[1] = Integer.toString( 3 ); hop( ) hop( ) hop( “uw1-320-01”, “power”, String[] funcArgs ); } void power( String[] args ) { base = Integer.parseInt( args[0] ); MyAgent MyAgent MyAgent exp = Integer.parseInt( args[1] ); init( ) power( ) Factorial( ) for ( int j = 0; j < exp; j++ ); pow += base; System.out.println( “host =” + getInetAddress( ) + “power =” + pow ); hop( “uw1-320-02”, “factorial”, String[] args ); Uw1-320-00 Uw1-320-01 Uw1-320-02 } 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 ); } CSS434 Process Migration 21

22.System Comparison  D’Agent  IBM Aglets  Ara  Mole  Discussions:  Which systems use strong migration? How has strong migration been implemented?  Which systems use weak migration? Why did they end up with weak migration?  Which system uses the concept of agent proxy? What is the agent proxy?  Which system uses allowance? What is it? CSS434 Process Migration 22

23. 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. Why do mobile agents have more security concerns than process migration. 4. What made it possible to implement java-based mobile agents? 5. Why do java-based mobile agents need to take weak migration? CSS434 Process Migration 23