Skip to main content

DFS; RMI communication between objects

Short answer

A DFS stores files on network servers and provides transparent shared access like local disks. RMI communication uses a client proxy that marshals a method call, a communication module sending it to the server, and a dispatcher/skeleton that unmarshals, invokes the remote object, and returns the reply; a registry supplies remote references.

Define DFS. How does RMI perform communication between distributed objects? Explain.

Distributed file system (DFS)

A distributed file system stores files at servers on a network and gives clients transparent, shared access to them as though they were on local disks (for example NFS, AFS). It provides a common name space, location transparency, caching, replication and access control.

How RMI performs communication between distributed objects

Remote Method Invocation (RMI) is the object-oriented extension of RPC. An object in one process invokes a method of an object in another process (possibly on another host) through a remote object reference. In Java, RMI is built into the language; CORBA does the same for many languages.

Architecture

 Client                         Server
 +-------------+                +-------------+
 | Client obj  |                | Remote obj  |
 | Proxy (stub)|                | Skeleton    |
 | Remote ref  |<-- network --->| Dispatcher  |
 | module      |                | Remote ref  |
 | Comm module |                | Comm module |
 +-------------+                +-------------+
        ^        Remote reference module: translates local <-> remote refs
        +--- Object registry / naming service: look up by name
  • Proxy (stub): local representative of the remote object; marshals arguments and sends the request.
  • Skeleton / dispatcher: unmarshals the request, selects the method and calls the object, then marshals the reply.
  • Remote reference module: converts between local and remote object references.
  • Communication module: carries request-reply messages with a chosen invocation semantics.
  • Registry / binder: the client finds the remote object by name.

Steps of an invocation

  1. The client calls a method on the proxy (looked up by name in the registry).
  2. The proxy marshals the method id and arguments (objects serialised, remote objects as references) into a request message.
  3. The communication module sends the request message to the server named in the remote object reference (address and object id).
  4. The server's communication module gives it to the dispatcher, which selects the skeleton by the method id.
  5. The skeleton unmarshals the arguments, invokes the method on the remote object, and marshals the result or exception.
  6. The reply returns to the proxy, which unmarshals it and returns it to the client.

Java RMI uses at-most-once invocation semantics, achieved with timeouts, retransmission and duplicate filtering.

✓ Answer checked by Claude Opus 5.5 (high effort)

All Distributed System chapter 2 questions →