Week 1 and Week 2 Intro and RPC
Week 1 and Week 2 Intro and RPC
Week 1 and Week 2 Intro and RPC
• Email:
[email protected]
a) Introduction
b) Remote Procedure Call
c) Remote Method Invocation (RMI)
PLO1 – Knowledge
PLO5 – Social Skills, Teamwork and Responsibilities
PLO6 – Values, Attitudes and Professionalism
• Lecture
• Tutorial
• Case Study (Individual and Group)
Hence,
• We are now moving from the traditional
topic based teaching to outcome-based
education
It’s
NOT
What we want to teach,
It’s
What You should learn
Computer network
connects two or more
autonomous computers.
Hardware
Software and
Information
Resource Sharing
Hardware (computing resources, disks, printers)
Software (application software)
Information Sharing
Easy accessibility from anywhere (files,
databases)
Search Capability (WWW)
Communication
Email
Message broadcast
Remote computing
Distributed processing (GRID Computing)
Physical Media
Interconnecting Devices
Computers
Networking Software
Applications
E-mail
Searchable Data (Web Sites)
E-Commerce
News Groups
Internet Telephony (VoIP)
Video Conferencing
Chat Groups
Instant Messengers
Internet Radio
CT024-3-3 DCOMS-Distributed Computer Systems Introduction & RPC
32 of 95
Distributed Systems
Topics
– What is a Distributed System?
– Why Distributed Systems?
– Examples of Distributed Systems
– Distributed System Requirements
– Transparency in Distributed Systems
Host-1 Host-n
Component-1 … Component-n
Middleware
Network OS
Hardware
Host-1
Middleware Middleware
Network OS Network OS
Hardware Hardware
Host-1 Host-2
Network
Component-1 … Component-n Component-1 … Component-n
Middleware Middleware
Network OS Network OS
Hardware Hardware
Host-n Host-3
Payables/
Receivables
Sales Accounting
Manufacturing
Inventory
Shipping/
Receiving
Engineering
Authorization
Customer Services
Information
Services
Trading
Services
ATM
Services
• Dimensions of transparency in DS
– Access Transparency
– Location Transparency
– Migration Transparency
– Replication Transparency
– Concurrency Transparency
– Scalability Transparency
– Performance Transparency
– Failure Transparency
Caller
Machine 1 Machine 2
local
call
remote Implementor
call
Proxy
• Client-side stub
– Looks like local server function
– Same interface as local function
– Bundles arguments into message, sends to server-
side stub
– Waits for reply, un-bundles results
– returns
• Linking:–
– Server programmer implements the service’s
functions and links with the server-side stubs
– Client programmer implements the client program and
links it with client-side stubs
• Operation:–
– Stubs manage all of the details of remote
communication between client and server
SampleServer remoteObject;
int s;
…
s = remoteObject.sum(1,2);
1,2
public int sum(int a,int b)
{
3 }
return a + b;
System.out.println(s);
registry to establish
remote references. return call lookup
skeleton
Stub
RMI Client RMI Server
return
import java.rmi.*;
public interface AddServerInterface extends Remote
{
public int sum(int a,int b);
}
catch(Exception e)
{
System.out.println(e);
}
}
}
CT024-3-3 DCOMS-Distributed Computer Systems Introduction & RPC
72 of 95
Create Client Application
/* SampleServer.java */
import java.rmi.*;
/* SampleServerImpl.java */
import java.rmi.*;
import java.rmi.server.*;
import java.rmi.registry.*;
System.out.println("Server waiting.....");
}
catch (java.net.MalformedURLException me) {
System.out.println("Malformed URL: " + me.toString()); }
catch (RemoteException re) {
System.out.println("Remote exception: " + re.toString()); }
}
elpis:~/rmi> rmiregistry
• Distributed systems
• Centralized systems vs distributed systems
• The need for distributed systems --- application’s non-functional
requirements
• Transparencies
• Dependencies among different dimensions of transparencies
• RPC Model
• RPC Stubs
• Marshalling Arguments
• RMI
Q&A