Published on

Published in: Technology, Education
  • Be the first to comment

No Downloads
Total Views
On Slideshare
From Embeds
Number of Embeds
Embeds 0
No embeds

No notes for slide
  • Extended Binary Coded Decimal Interchange Code  ( EBCDIC ) American Standard Code for Information Interchange(ASCII)
  • Rpc

    1. 1. Remote Procedure Calls By P.SAHITHI CHAITANYA (1551210075) A.RAMPRAKASH REDDY(1551210077) G.V.R.SHASHANK(1551210080)
    2. 2. Introduction  Inter-process communication (IPC).  Another virtual address space.  Another process on the same machine.  Another process on different machine.  Hides remote interaction.  Network programming standard 1980s  Builds on named pipes or Winsock.  Remote Method Invocation (RMI)
    3. 3. How RPC Operates
    4. 4. Cont….  When client code calls a remote procedure, the client stub code  Retrieves the required parameters from the client address space.  Marshals1 the parameters as needed into a standard NDR2 format for transmission over the network.  Calls functions in the RPC client run-time library to send the request and its parameters to the server. 1 Marshalling (similar to serialization) is the process of transforming the memory representation of an object to a data format suitable for storage or transmission 2 Network Data Representation (NDR) is an implementation of the presentation layer in the OSI model.
    5. 5. Cont…  The server performs the following steps to call the remote procedure:  The server RPC run-time library functions accept the request and call the server stub procedure.  The server stub retrieves the parameters from the network buffer and converts (i.e. unmarshals) them from the network transmission format to the format the server needs.  The server stub calls the actual procedure on the server.
    6. 6. Stubs  Client stub  Packs parameter into message.  Calls : Send & Receive.  Server Stub  Calls : Receive & Send.  Unpacks parameter from the message.  Details of message passing are hidden – two libraries.
    7. 7. Cont…
    8. 8. Steps 1. The client procedure calls the client stub in the normal way. 2. The client stub builds a message and traps to the kernel. 3. The kernel sends the message to the remote kernel. 4. The remote kernel gives the message to the server stub. 5. The server stub unpacks the parameters and calls the server. 6. The server does the work and returns the result to the stub. 7. The server stub packs it in a message and traps to the kernel. 8. The remote kernel sends the message to the clients kernel. 9. The client’s kernel gives the message to the client stub. 10. The stub unpacks the result and returns to the client.
    9. 9. Parameter Passing  Parameter Marshaling.  Ex: Remote procedure “sum( i, j)”.  Identical machines.
    10. 10. Problems - Parameter Passing  Different Machine Types  Ex: IBM mainframes (EBCDIC) & IBM PCs(ASCII).  Different representation of Integers (1s compliment & 2s Compliment), Floating point numbers.  Numbering of bytes  Right to Left (Ex: Intel 486) – Little Endian.  Left to Right (Ex: Sun SPARC) – Big Endian.
    11. 11. Example - 1
    12. 12. Example - 2
    13. 13. Representation of Information  Canonical Form  Convert internal representation while marshaling.  Ex:  2’s compliment for integers.  0 for ASCII.  1 for Boolean.  IEEE format for floating point no.
    14. 14. Pointer Passing  One way is to forbid the pointers & reference parameters in general. – Highly undesirable  One strategy is copying the whole array/structure (simple) into message.  Call by reference is replaced by copy/restore.  Optimization – Buffer knows if stub is an input / output parameter. (Twice as efficient).  Pointer is followed (dereferenced) by putting it in the register. – Highly Inefficient.
    15. 15. Dynamic Binding  Hardwiring network add. of server into client – Extremely Inflexible  To avoid problems like  Replication of server  Relocation  Migration  Interface Change
    16. 16. Terms  Exports Interface  Imports Interface  Binder  Registering  Unique Id – Typically 32 bit long  Handle  System Dependent  IP Add. , Ethernet Add. , etc.
    17. 17. Disadvantages  Overhead Exporting & Importing  Costs Time  Many short lived client process may have to start over again.  Binder may act as bottleneck in distributed system.  Registering / Deregistering of interfaces creates more overhead.
    18. 18. RPC semantics-presence of failures  Unable to locate the server  Lost request message  Lost reply message  Server crashes  Client crashes
    19. 19. Unable to locate the server  When server is down it intimate the value -1  Client is unable to locate the server
    20. 20. Lost request message  Message send from client to server is lost
    21. 21. Lost reply message  Reply message from server to client is lost
    22. 22. Server crashes  Server crashes after receiving a request  Solutions  Atleast one semantic  Atmost one semantic  Exactly one semantic
    23. 23. Client crashes  Client crashes after sending a request  Solution is extermination
    24. 24. Protocols for RPCs 1. Request protocol 2. Request / Reply protocol 3. Request /Reply /Acknowledge-Reply protocol
    25. 25. Request (R) protocol Client Server First RPC Next RPC Request message Request message Procedure execution Procedure execution
    26. 26. Request / Reply (RR) protocol Client Server First RPC Next RPC Request message Request message Procedure execution Procedure execution Reply message Reply message Also serves as acknowledgement for the request message Also serves as acknowledgement for the request message Also serves as acknowledgement for the reply of the previous RPC
    27. 27. Request / Reply / Ack. (RRA) protocol Client Server First RPC Next RPC Request message Request message Procedure execution Procedure execution Reply message Reply message Reply acknowledgement message Reply acknowledgement message
    1. A particular slide catching your eye?

      Clipping is a handy way to collect important slides you want to go back to later.