chapter 5.4 distributed process implementaion prepared by: karthik v puttaparthi...

26
Chapter 5.4 DISTRIBUTED PROCESS IMPLEMENTAION Prepared by: Karthik V Puttaparthi [email protected]

Upload: dwain-fields

Post on 01-Jan-2016

225 views

Category:

Documents


3 download

TRANSCRIPT

Page 1: Chapter 5.4 DISTRIBUTED PROCESS IMPLEMENTAION Prepared by: Karthik V Puttaparthi kputtaparthi1@student.gsu.edu

Chapter 5.4

DISTRIBUTED PROCESS IMPLEMENTAION

Prepared by: Karthik V Puttaparthi

[email protected]

Page 2: Chapter 5.4 DISTRIBUTED PROCESS IMPLEMENTAION Prepared by: Karthik V Puttaparthi kputtaparthi1@student.gsu.edu

OUTLINE Logical Model of Local and Remote

Processes Application Scenarios Remote Service Remote Execution Process Migration Mobile Agents References

Page 3: Chapter 5.4 DISTRIBUTED PROCESS IMPLEMENTAION Prepared by: Karthik V Puttaparthi kputtaparthi1@student.gsu.edu

Logical Model [1] Front end Stub Processes facilitate the

creation of and communication between processes.

Stub Processes serve as a logical link making the physical boundary between the local and remote processes transparent.

Local Process Remote Process

Stub Process Stub Process

CLIENT SERVER

Page 4: Chapter 5.4 DISTRIBUTED PROCESS IMPLEMENTAION Prepared by: Karthik V Puttaparthi kputtaparthi1@student.gsu.edu

Application Scenarios [1] There are three significant application

scenarios depending on how request messages are interpreted.

Remote Service – Interpreted as a request for known service at the remote site.

Remote Execution – Contain a program to be executed at the remote site.

Process Migration – Represent a process being migrated to the remote site for continuing execution.

Page 5: Chapter 5.4 DISTRIBUTED PROCESS IMPLEMENTAION Prepared by: Karthik V Puttaparthi kputtaparthi1@student.gsu.edu

REMOTE SERVICE

Its primary application : resource sharing in distributed systems.

Request message for remote service can be generated at three different software levels.

• As remote procedure calls at the language level• As remote commands at the operating system level• As interpretive messages at the application level

Page 6: Chapter 5.4 DISTRIBUTED PROCESS IMPLEMENTAION Prepared by: Karthik V Puttaparthi kputtaparthi1@student.gsu.edu

Remote Procedure Calls At the Language Level [3]

At language level for remote service requests

Most suitable model : RPC It is service oriented and provides both access and location transparency

At the System Level,

There are some frequently used commands that need to invoke remote objects. These commands can be built in as part of the command shell and recognized by the local operating system.

Example: rsh host –l user ls in Unix can list the home directory files of the user, user on a remote host machine, host.

Page 7: Chapter 5.4 DISTRIBUTED PROCESS IMPLEMENTAION Prepared by: Karthik V Puttaparthi kputtaparthi1@student.gsu.edu

Remote Commands at the Operating System Level [3]

User Want to send message Remote host

Some user-defined operations at remote hostinvoke

Remote commands are limited only to shell commands. The concept can be generalized to process messages.

Stub process at Server site has capability of

-- Interpreting messages sent from client stub -- invoking respective operations

Based on the content of message

Example is ftp. The stubs are the ftp daemon processes. They interpret messages such as get and put for downloading and uploading files.

Page 8: Chapter 5.4 DISTRIBUTED PROCESS IMPLEMENTAION Prepared by: Karthik V Puttaparthi kputtaparthi1@student.gsu.edu

Interpretive Messages at the Application Level

Remote operations are initiated by

Remote procedure calls, remote commands and interpretive messages

Constrained to Services that are supported at the remote host

Primary Implementation Issues

I/O Redirection Security

Client stub

Server stub

copies Client process’ standard input to the remote command

Standard output and error of the remote command to client process

copies

Access to remote resources required authorization

Page 9: Chapter 5.4 DISTRIBUTED PROCESS IMPLEMENTAION Prepared by: Karthik V Puttaparthi kputtaparthi1@student.gsu.edu

REMOTE EXECUTION [1]• Remote operation initiated by client is created by the client

• Message sent from client to server is client program to be executed at the server

•Remote Execution or Processor Pool model – Selected host may be a system with specific resources for load sharing.

Selected host

System with specific resources for resource sharing

Remote Service

System with purpose of load sharing

Remote Execution

Implementation issueLoad sharing algorithm location independence system heterogeneity protection and security

Page 10: Chapter 5.4 DISTRIBUTED PROCESS IMPLEMENTAION Prepared by: Karthik V Puttaparthi kputtaparthi1@student.gsu.edu

Load Sharing Algorithm [4] Practical Implementation Each Process server maintains list of

registered hosts. First step is to select remote host Client process server indicate Resource

requirement to process server at remote site

If authenticated and its resource request can be met, Server grants permission for remote execution

Page 11: Chapter 5.4 DISTRIBUTED PROCESS IMPLEMENTAION Prepared by: Karthik V Puttaparthi kputtaparthi1@student.gsu.edu

LOCATION INDEPENDENCE

Process created by remote execution require

Coordination to accomplish common task

So, it is necessary to support logical view for the processes

Each remote process is represented by an agent process at the originating host

Page 12: Chapter 5.4 DISTRIBUTED PROCESS IMPLEMENTAION Prepared by: Karthik V Puttaparthi kputtaparthi1@student.gsu.edu

SYSTEM HETEROGENEITY

If remote execution is invoked on heterogeneous host

It is necessary to recompile the program

Overhead may be too high

Solution

Use canonical machine-independent intermediate language for program execution.

Page 13: Chapter 5.4 DISTRIBUTED PROCESS IMPLEMENTAION Prepared by: Karthik V Puttaparthi kputtaparthi1@student.gsu.edu

PROTECTION AND SECURITY

Remote execution powerful

Foreign code image can be Trojan horse

To Achieve Protection and Security,

• Accept only remote execution in source or intermediate codes

• Language used to describe a remote execution could be restricted to exclude potential problems

• Run-time checking of parameters and stack overflow is also necessary to protect the integrity of the remote hosts

Page 14: Chapter 5.4 DISTRIBUTED PROCESS IMPLEMENTAION Prepared by: Karthik V Puttaparthi kputtaparthi1@student.gsu.edu

PROCESS MIGRATION [2]

Process P1::::

Executionsuspended

Source Site Destination Site

ExecutionResumed

::::

Process P1

Transfer of control

Time

Freezingtime

Page 15: Chapter 5.4 DISTRIBUTED PROCESS IMPLEMENTAION Prepared by: Karthik V Puttaparthi kputtaparthi1@student.gsu.edu

LINK REDIRECTION [2]

Transfer ofaddress space

Sourcenode

Destinationnode

SuspendedMigrationdecision

resumed

Freezingtime

Transfer ofaddress space

Sourcenode

Destinationnode

Suspended

Migrationdecision

resumed

Freezingtime

Total Freezing Pretransferring

Merits: easy implementationDemerits: long delay time

Merits: freezing time reduceDemerits: total time extended

Page 16: Chapter 5.4 DISTRIBUTED PROCESS IMPLEMENTAION Prepared by: Karthik V Puttaparthi kputtaparthi1@student.gsu.edu

MESSAGE FORWARDING

Three types of messages:

1. Received when the process execution is stopped on the sourcenode and has not restarted on the destination node

2. Received on the source node after the execution started ondestination node

3. Sent to the migrant process after it started execution ondestination node

Page 17: Chapter 5.4 DISTRIBUTED PROCESS IMPLEMENTAION Prepared by: Karthik V Puttaparthi kputtaparthi1@student.gsu.edu

MESSAGE FORWARDING [2]

Sender

Origin

Dest 1

Dest 2

Receiver

Migrate

Migrate again

Resend

Resend again

Sender

Origin

Dest 1

Dest 2

Receiver

Migrate

Migrate again

Resending messagesAsk origin site

SendSend

Forward

Messages of type 1 and 2 are either dropped or negatively ack-ed, the sender is notified and it needs to locate the migrant process

Origin node keeps the info on the current location of the process created there, all messages are sent to origin whichforwards them to migrant process

Page 18: Chapter 5.4 DISTRIBUTED PROCESS IMPLEMENTAION Prepared by: Karthik V Puttaparthi kputtaparthi1@student.gsu.edu

MESSAGE FORWARDING [2]

Sender

Origin

Dest 1

Dest 2

Receiver

Migrate

Migrate again

Link traversal

Link

Link

Send

Forward

Forward

Send

Messages are queued and sent to destination node as part of migration procedure

Link is left on source node to redirectmessages, link contains the system-wide unique id of a process and its last known location

Page 19: Chapter 5.4 DISTRIBUTED PROCESS IMPLEMENTAION Prepared by: Karthik V Puttaparthi kputtaparthi1@student.gsu.edu

MESSAGE FORWARDING

Sender

Origin

Dest 1

Dest 2

Receiver

Migrate

Migrate again

Link Update

Send

New location

Send

New location

Send

Current location

During the transfer the source node sends the notification (link update) of the transfer to all the nodes to which the process communicates:

Messages are forwarded by the source node

Messages are sent directly to the destination node

Page 20: Chapter 5.4 DISTRIBUTED PROCESS IMPLEMENTAION Prepared by: Karthik V Puttaparthi kputtaparthi1@student.gsu.edu

MOBILE AGENTS [5]

• It is composition of computer software and data which is able to move from one computer to another autonomously and continue its execution on the destination computer.

• It refers to a process that can transport its state from one environment to another, with its data intact

• Mobile agents can decide when and where to move next

• When a mobile agent decides to move, it saves its own state and transports this saved state to next host and resume execution from the saved state.

Common applications include:• Resource availability, discovery, monitoring • Information retrieval • Network management • Dynamic software deployment

Page 21: Chapter 5.4 DISTRIBUTED PROCESS IMPLEMENTAION Prepared by: Karthik V Puttaparthi kputtaparthi1@student.gsu.edu

Mobile Agents

A mobile agent visits a collection of ORBs.

In each ORB along its path, it can install new components on the disk, dynamically link new components, inspect the state and configuration of the

ORB and the applications on top of it, reconfigure ORBs and applications.

Page 22: Chapter 5.4 DISTRIBUTED PROCESS IMPLEMENTAION Prepared by: Karthik V Puttaparthi kputtaparthi1@student.gsu.edu

A Flexible Framework Different NetworkBrokers support

different agent flavors. For example: simple, lightweight, script-based agents

(carrying data and DCP commands only). powerful, heavyweight, Java-based

agents (carrying data, bytecode, and dynamic state, taking autonomous decisions).

Simple agents are suitable for PDAs, embedded systems.

Page 23: Chapter 5.4 DISTRIBUTED PROCESS IMPLEMENTAION Prepared by: Karthik V Puttaparthi kputtaparthi1@student.gsu.edu

Reconfiguration with Mobile Agents

SysAdmins use a GUI to build agents for reconfiguration inspection

GUI is used to1. Build distribution

graph2. Select

reconfiguration and inspection commands

3. Visualize results.

Page 24: Chapter 5.4 DISTRIBUTED PROCESS IMPLEMENTAION Prepared by: Karthik V Puttaparthi kputtaparthi1@student.gsu.edu

Process Migration vs. Mobile Agents

Process Migration Mobile Agents

Navigational Autonomy

Migration decision is made by system.

Agents decide where and where to go

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

Most agents are coded in Java 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 destination.

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

Page 25: Chapter 5.4 DISTRIBUTED PROCESS IMPLEMENTAION Prepared by: Karthik V Puttaparthi kputtaparthi1@student.gsu.edu

References1. Distributed operating system and

algorithms Randy chow, Theodore Johnson

2. A Framework for Process Migration in Software DSM Environments ieeexplore.ieee.org/iel5/6662/17807/00823407.pdf …. ( 2000 )

3. http://birrell.org/andrew/papers/ImplementingRPC.pdf

4. http://www.informs-cs.org/wsc02papers/061.pdf

5. http://en.wikipedia.org/wiki/Mobile_agent

Page 26: Chapter 5.4 DISTRIBUTED PROCESS IMPLEMENTAION Prepared by: Karthik V Puttaparthi kputtaparthi1@student.gsu.edu

Thank You!!