Академический Документы
Профессиональный Документы
Культура Документы
Middleware
Heterogeneity
Different data representations (little-endian vs. big-
endian, ASCII vs. EBCDIC)
Addressing
How to identify a remote process?
Partial failure
What happens if the server crashes during execution?
Can we guarantee at least once semantics?
What happens if the client crashes?
Can we detect and remove orphans?
What happens if a crashed machine is rebooted?
Can addresses survive a reboot?
Client-side proxy
Implements the interface of the target procedure on
the client side
Client calls this interface locally ( transparency)
Procedure is invoked on a remote machine
Server-side proxy
Implements the interface of the target procedure on
the server side
Incoming requests are dispatched to this interface
locally
Server does not realize that the call is a remote call
The result: almost distribution transparency
if there is no failure
Distributed Systems Torben Weis 8
University Duisburg-Essen
Proxy Generation
reply
request
Server
wait for request Call local procedure wait for request
and return result
time
Client Server
Client process Server process
reply reply
receipt
Distributed Systems Torben Weis 12
University Duisburg-Essen
Calling Semantics
Local case
Call-by-value
Call-by-reference
Call-by-reference remotely is difficult
Simulate by call-by-copy/restore
Transmit copy of the data and transmit changed copy
back
Slightly different semantics!
Increased overhead for collections (graphs, lists,)
module shops {
interface bookshop {
struct Book {
string name;
long isbn;
};
struct Receipt {
string bank;
long accountnumber;
int amount;
};
Receipt order(in Book[] books);
Book[] search(in string keyword);
};
};
Distributed Systems Torben Weis 18
University Duisburg-Essen
IDL in the Tool Chain
shop.idl
Pros
Language neutral
Cons
Generated interface can be ugly
Example: CORBA and C++
Developers have to master two languages
Requires top-down approach
First IDL, then implementation
Cannot simply use existing code & data structures
Solutions? Yes!
Java RMI or .NET Remoting do not require any IDL
Fault detection
Wait for expected response
After timeout failure
What is a good timeout?
Maybe the network is too slow
Maybe the other computer is too slow
Usually no real-time Calculation of optimal timeout
is impossible
No way to find out what went wrong
Remote machine does not respond. Why?
Machine crashed?
Message loss?
The procedure
proc is invoked by
Client1 proc(x) Server1 Client2 while it is
working on the
request of Client1
Client2 proc(y)
Solution:
Serialize
requests
Beware of terms
Serialization of objects/data
Context: data representation
Transforming data to an external format
Also known as marshalling or pickling
Serialization of requests
Context: transaction management
Bringing requests into an order
proc(y)
Sun RPC
Used by the Network File System (NFS)
Distributed Computing Environment (DCE) RPC
Basis for Microsoft's DCOM (Component Object Model)
RPC (i.e. DCOM) has been used in several exploits
Distributed application
Middleware
receive()
Persistency
Security
Naming
Events
Transaction
Trader
Accounting
Machine A Machine B
Process B1
Process A1 Remote invocation O4
O1 O3
Remote invocation
Local invocation
O2
O5
Process B2
Client Server
receipt
Distributed Systems Torben Weis 43
University Duisburg-Essen
Difference to RPC
Bookstore example:
We treat every book as an object
Every remotely accessible object has a remote object
reference
However, books are stored in a database
We cannot hold all book objects in memory
Solution
Create object references for virtual objects, for
example
(www.mybookstore.com, 80, ISBN:1-12345-434-5)
Virtual objects are incarnated (i.e. created from the
database) upon invocation
They are garbage collected afterwards
Distributed Systems Torben Weis 46
University Duisburg-Essen
Remote Object Activation
Server
Remote object
Remote object
Remote object Data
dispatch method call base
to requested object
activate object:
Proxy object incarnate from database
Language integrated
Definition of remote objects at language level
Easy to use
Language dependent
E.g. Java RMI
Language independent
IDL to specify interface
Objects can be implemented in any language
Even in a procedural language using procedures and
data structures as object state
More programming overhead
E.g. CORBA
Static invocation
Interface of the remote objects is known while client
is being developed
Client must be recompiled when interface changes
Example: C++, Java
Dynamic invocation
Compose method invocation at runtime
Inspect target object or interface implicit in client
implementation
Available methods, parameters,
any invoke(object, method, parameters[])
Typically used for interpreted languages & scripting
languages e.g. TCL, Python, Ruby,
Distributed Systems Torben Weis 49
University Duisburg-Essen