Remote Invocation Flashcards
What is Remote Invocation?
It allows a program running on one computer to execute code on another computer over a network.
What are the Steps of Remote Invocation?
- Client Request.
- Communication.
- Server Processing.
- Response.
What does the Request- Reply Protocol do?
-Identifiers are used to identify both messages and senders.
-Duplicate request messages can be discarded to avoid serving the same request more than once.
-If a duplicate request message is received after a reply has already been sent the server should redo the operation.
-Server could also maintain a history of replies but this has a memory overhead.
What are the 3 Request Styles?
-Request (R) protocol = used when no reply expected
-Request-reply (RR) protocol
-Request-reply-acknowledge (RRA) protocol
Describe how the Client Stub acts in the Remote Procedure Call.
-RPC client maintains a local stub with identical signature.
-Stub acts as placeholder for remote procedure.
-Stub gathers required parameters and sends them to RPC client runtime.
Describe how the Client Runtime acts in the Remote Procedure Call.
-The client runtime defines the environment, libraries and setup used such as time out options.
-It uses the transport layer to communicate with the server process.
Steps happen in reverse until the Server Application.
What are the call semantics in the Remote Procedure Call?
-Maybe: no fault-tolerance
-At-least-once: retransmit request messages
-At-most-once: retransmit request messages, filter duplicates, retransmit replies
-Exactly-once: Only for local procedure calls
How do RPC interfaces operate?
-An interface specifies the procedures provided by a server.
-It separates the implementation from the specification.
-Clients cannot directly access the server module’s variables.
-Addresses cannot serve as inputs or outputs for remote calls.
RPC interfaces are usually defined in an Interface Definition Language. Can you give an example?
message Card { required string cardNumber = 1; required Timestamp expiry = 2;
required int32 CVC = 3;
}
enum Currency { GBP = 1; USD = 2; }
message Charge { required Card card = 1;
required int64 amount = 2;
required Currency currency = 3;
}
message Status { required bool status = 1; optional string errorMessage = 2; }
service PaymentService
{
rpc processPayment(Charge) returns Status {}
}
What is Remote Method Invocation (RMI)?
-RMI is the Object-oriented equivalent of RPC.
-RMI enables the full use of object-oriented programming.
-Objects can be used as parameters.
-Remote object references are used to identify remote objects.
RMI needs to consider using Garbage Collection. Can you describe it?
-A distributed object needs to coordinate w the garbage collector to ensure its lifecycle is handled correctly using reference counting.