12
Remote Procedure Call and Serialization BY: AARON MCKAY

Remote Procedure Call and Serialization

  • Upload
    thora

  • View
    47

  • Download
    0

Embed Size (px)

DESCRIPTION

Remote Procedure Call and Serialization. By: Aaron Mckay. Remote Procedure Call (RPC). What is RPC? An inter-process communication that allows a computer to cause a subroutine or procedure to execute in another space (such as another computer on a network) RPC on the OSI model - PowerPoint PPT Presentation

Citation preview

Page 1: Remote Procedure Call and Serialization

Remote Procedure Call and

SerializationBY: AARON MCKAY

Page 2: Remote Procedure Call and Serialization

Remote Procedure Call (RPC)

What is RPC? An inter-process communication that allows a computer to cause a

subroutine or procedure to execute in another space (such as another computer on a network)

RPC on the OSI model Contains elements of session and presentation layers

Why use RPC? To make distribution more transparent and easier to accomplish

Page 3: Remote Procedure Call and Serialization

RPC Toolkits

Typical toolkits automatically handle: Reliability such as communication errors and transactions

Security

Serialization

Page 4: Remote Procedure Call and Serialization

RPC Model

Page 5: Remote Procedure Call and Serialization

Serialization

Serialization – The process of translating data structures or object state into a format that can be stored and reconstructed in the same or another computer environment.

When referring to RPC, Serialization is used to transmit data across a network and deserialization is used to extract a data structure.

There are many different versions of serialization. Custom serialization is even an option as long as the serialization and deserialization processes are defined for the object.

Page 6: Remote Procedure Call and Serialization

Serialization

Page 7: Remote Procedure Call and Serialization

Local Procedure Call vs Remote Procedure Call

Local Procedure Call Transfer control from one part of a process to another. The control

must be returned at the end of the procedure.

Remote Procedure Call Local process starts a process on a remote system.

Waits for a response from this system.

Page 8: Remote Procedure Call and Serialization

Transparency

Network code is hidden in the client and server stubs.

The stubs are usually generated automatically

Keeps the user from having to deal with sockets, byte ordering, acknowledgements, etc.

Page 9: Remote Procedure Call and Serialization

Call Semantics

Exactly Once Procedure was executed exactly once (subtracting money from a

bank account)

At Most Once If a normal return to caller occurs then the procedure occurred one

time. If an error is made then it is uncertain if the procedure executed once or not at all.

At Least Once Client stub keeps making procedure calls until it receives a valid

response.

Page 10: Remote Procedure Call and Serialization

Iterative RPC Server

Loop

{

Wait for RPC request

Receive RPC request

decode arguments

execute desired function

reply result to client

}

Problem: RPC server cannot accept new RPC until function is executed

Page 11: Remote Procedure Call and Serialization

Concurrent RPC Server

Loop

{

Wait for RPC request

Receive RPC request

decode arguments

Spawn a process or thread

{

execute desired function

reply result to client

}

}

Page 12: Remote Procedure Call and Serialization

Summary

RPC is useful for having transparent communication.

It is the basis for many client/server applications

Easy to use

It will end world hunger

Enjoy catching Pokémon on Google Maps