Module 4 - Communication Flashcards
In the layered network model, there exists a middleware protocol in which IPC is facilitated below the application layer.
What is the purpose of this middleware protocol?
In order to provide access transparency my isolating the application from the transport layer (TCP & UDP)

What are RPCs (Remote Procedure Calls)
What happens to the stack in RPCs?
<p></p>
<p>A transient communication abstraction, which behaves similarly to a conventional procedure call which passes parameters on the stack</p>

<p></p>
<p>RPCs are implemented using a client-server protocol. How does this work?</p>
<p></p>
<p>The application calls an RPC using a client stub that translates the call to a protocol message that is received and processed at the server by a server stub
<br></br>
<br></br>Note that the image is an example of a synchronous RPC</p>

<p></p>
<p>What is a "stub"</p>
<p></p>
<p>A stub is a small program routine that substitutes for a longer program, possibly to be loaded later or that is located remotely</p>
What are the 10 steps of the execution of an RPC
- this one is hard :’) *
- The client process invokes the client stub using an ordinary procedure call
- The client stub builds a message and passes it to the client’s OS
- The client’s OS sends the message to the server’s OS
- The server’s OS delivers the message to the server stub
- The server stub unpacks the parameters and invokes the appropriate service handler in the server process
- The service handler does the work and returns the result to the server stub
- The server stub packs the result into a message and passes it to the server OS
- The server’s OS sends the message to the client’s OS
- The client’s OS delivers the message to the client stub
- The client stub unpacks the result and returns it to the client process

<p></p>
<p>What is parameter mashalling?</p>
<p></p>
<p>The act of packing parameter values into a message (building a message)</p>
<p></p>
<p>In what way are values such as numbers and strings represented on different hardware platforms?</p>
<p></p>
<p>little-endian vs big-endian
<br></br>
<br></br>For example, intel x86 is little-endian but JVM stores data items in big-endian</p>
<p></p>
<p>Does endianness concern the implementation of network protocols?</p>
<p></p>
<p>Yes, it does. Bit transmission can be little or big endian. IP uses a big-endian network byte layer</p>
<p>How are RPC signatures defined? What is the mechanism behind this?</p>
<p>Using interface definition language (IDL)
<br></br>
<br></br>The IDL is compiled into a client stub and a server stub.</p>
<p>What defines the RPC's mutual agreement regarding the metadata between the client and the server? How much detail is provided?</p>
<p>The IDL compiler determines the high-level format of protocol messages for a given RPC, including details about the order of parameters, size of parameters, endianness, binary format, etc</p>
<p>Outline the difference between Synchronous and Asynchronous RPCs</p>
<p>Synchronous RPC: The client waits for the return value while the server executes the procedure
<br></br>
<br></br>Asynchronous RPC: The client resumes executing as soon as the server acknowledges the receipt of the request. There is a callback function that is called by the server to return the result back to the client.</p>
<p>Do Asynchronous RPC clients wait for acknowledgements of completion from the server?</p>
<p>No. They are one-way RPCs</p>
<p>In Asynchronous RPC clients, when does the client stop waiting in the timeline?</p>
<p>Clients stop waiting after the server acknowledges that the request has been received - this is before the result of the request is computed</p>

<p>In Asynchronous RPC clients, how does the client get back the response data from the server?</p>
<p>The server invokes a callback which is provided by the client to record the response which was computed on the server.<br></br>
<br></br>
The callback function may execute in a dedicated thread</p>

<p>An alternative to RPCs is the message queuing model. What sets apart the message queuing model from RPCs?</p>
<p>Message queues persists sent messages until they are consumed by a receiver. RPCs simply invoke a call on a remote process</p>
<p>Describe how the message queuing model works for sending and receiving messages & with respect to time</p>
<p>When messages are sent, they are persisted until they are consumed by a receiver. This enables persistent communication which is loosely coupled with time (time does not matter)</p>
<p>What are the 4 primitives for the message queuing model? Describe their meaning</p>
PUT - Append a message to a specified queue
GET - Block until the specified queue is nonempty, and remove the first message (FIFO)
POLL - Check a specified queue for messages, and remove the first. Never block
NOTIFY - Install a callback function to be called when a message is put into the specified queue
What are some disadvantages to using the message queuing model?
- The delivery of a message after it is sent depends on the receiver, and cannot be guaranteed by the sender
- More infrastructure is required
<p>The message queueing model, and the publish-subscribe model are examples of what type of middleware? How is it characterized?</p>
<p>They are message-oriented middleware (MOM), characterized by asynchronous message passing</p>
What is Referential coupling?
List an example with RPC and MOM
Referential coupling is when one process explicitly references another process.
RPC example: RPC client connects to server using an IP address and a port number
MOM example: Publisher inserts a news item into a message queue andknows exactlywhich Subscriber will read it
What is Temporalcoupling?
Give an example with RPC and MOM
A type of coupling in which both communicating processes must be up and running
RPC example: A client cannot execute an RPC if the server is down
MOM example: A client cannot get a response if it places a message in a queue and it never gets consumed
Compare RPC (Remote-Procedure Call)to MOM (Message-Oriented Model) extensively
- RPC is used mostly for two-way communication in which client requires immediate response from the serverwhereas MOM is used mostly for one-way communication where the sender does not care about a response
- In RPC,the middleware is linked into the client and server processes and no additional software infrastructure is needed, whereas in MOM, the middleware is a separate component sandwiched between the sender and the receiver
- RPC is more tightly coupled, and the server failure can halt the client whereas MOM is more loosely coupled and it isolates the processes from each other, contributing to scalability and flexibility