You are on page 1of 23

CSS434 Process Migration

Textbook 7.4.2 and Non-Textbook Contents


Professor: Munehiro Fukuda

CSS434 Process Migration 1


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


Degrees of Mobility
Data Control Code Data Execution Navigational Transfer
State State Autonomy Direction

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

CSS434 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

CSS434 Process Migration 4


Remote Execution

Client Server  Procedure code is sent


Control
together with
Function/object arguments.
transfer
Function
Object  Server behaves like a
Main Argument transfer
Function general cycle server.
Program Arguments Dispatcher Object Remote
f( ) execution  Server can evolve itself.
Return value

CSS434 Process Migration 5


Code on Demand

Client Server  Server behaves like a general


remote object server.
Control Request a remote function/object  A remote function/object is
sent back as a return value.
Main
Program Function
Dispatcher
Remote
Function
 Client executes the
Object
func( ) Function/object itself Object function/object locally.
is returned.
Locally executed  Client execution control stays
in local while suspended
upon a request to a server.

CSS434 Process Migration 6


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

CSS434 Process Migration 7


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


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


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: easy implementation Merits: freezing time reduce Merits: quick migration
Demerits: long delay time Demerits: total time extended Demerits: large memory latency

CSS434 Process Migration 10


Process Migration
Message Forwarding Mechanisms
Resending messages Ask origin site
Origin Origin
Sender Receiver Sender Receiver
Send Send

Resend Migrate Migrate

Dest 1 Forward Dest 1


Resend again

Migrate again Migrate again

Dest 2 Dest 2

CSS434 Process Migration 11


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


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
Mobile Agents
Paradigm

Conventional Approach

client server
Network

Mobile Agent Approach


client client
server
agent Network agent

CSS434 Process Migration 14


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


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

Place Place Place


Agent Agent Agent

Agent Agent Agent

Communication Communication Communication


infrastructure infrastructure infrastructure

CSS434 Process Migration 16


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
Mobile Agents
Process Migration v.s. Mobile Agents

Process Migration Mobile Agents

Navigational Migration decision is made by Agents decide where and where


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

CSS434 Process Migration 18


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


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
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


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


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

You might also like