rpc by ashrafp




                                                               Diskless Support      Other Distributed
                                                        S           Service          Services (Future)      M
                                                        e                                                   a
       Remote Procedure Calls                           c
                                                                       Distributed File Service
                                                        u                                                   a
              (RPC)                                     r
                                                              Remote Procedure Calls
                                                                       Remote Procedure Calls


                                                               OPERATING SYSTEM AND TRANSPORT

    Local Procedures                                  Remote Procedures


                           Procedure                                                              Procedure
            Main                                            Body

                                                            Client            Network              Server

    Why RPC?                                          DCE RPC

                                                    • Provides interoperability for heterogeneous
•   Extend familiar local procedure call paradigm     systems
•   Hide underlying networking technologies         • Works consistently with different types of
•   Mask differences in data representations
                                                    • Includes application development tools and
•   A useful mechanism for distributing               runtime support
    processing at a high level                      • Integrated with other DCE services:
      - Easier to use and more powerful than             - Threads
                                                         - Directory services
                                                         - Security
Interfacing Local and Remote Procedures                  An Example Interface Definition in IDL

                   RPC interface,                      [ uuid(a01d0280-2d27-11c9-9fd3-08002b0ecef1),
                   specified in IDL                       version(1.0) ]

      A( )              A(    )       Procedure A( )   interface math{
                                                              const long ARRAY_SIZE = 10;
  Procedure B( )                                              typedef long array_type[ARRAY_SIZE];
       C( )                                                   long get_sum([in] long first, [in] long second);
                        C(    )       Procedure C( )
                                                              void get_sums([in] array_type a,
                                                                              [in] array_type b,
     Client                             Server                                [out] array_type c);

Stubs                                                    Overview of RPC Operation

                                                            Calling    1                       5 Remote
                                        Procedure          Program                               Procedure

   Main                  Client        Server             RPC Interface                       RPC Interface
   Body                  Stubs         Stubs               Client                                  Server
                                                            Stub     2        8       6        4    Stub

                                                            RPC                                     RPC
                                                           Runtime     3a    7b     7a        3b Runtime
     Client         Network           Server                                  Network
                                                              Client                           Server

Where Stubs Come From                                    More on IDL

                                                       • IDL is a purely declarative language
                                       Client Stub          - Defines only types and procedure headers
                                                       • Its syntax is similar to C
Interface                                              • It supports:
definition          Compiler          Header File           - Interface definition files (.idl)
  in IDL
                                                            - Attribute configuration files (.acf)
                                                       • Familiar programming language data typing
                                      Server Stub           - Extensions for distributed programming are
     Interface Identification: UUIDs                             RPC Application Development: A Diagram

                                                              Client Source                                            C            Client
    Interface                                                                                                        Compiler     Executable
    definition                                  Client Stub
      in IDL
                                                                                                  Client Stub Source
Defines RPC
interface                   IDL                                 Interface
                                                                                      IDL                                RPC
                          Compiler              Header File     Definition                             Header File      Runtime
           UUID                                                    File                                                 Library

                                                                Attribute                        Server Stub Source
UUID Generator                                 Server Stub        File
  (uuidgen)                                                                                                            C            Server
                                                              Server Source
                                                                                                                     Compiler     Executable

Requirements for Effective RPC                                DCE RPC Runtime Library

•    Resolve differences in data representation                                              Application Code
•    Support a variety of execution semantics
•    Support multi-threaded programming
                                                                                                     RPC Stub
•    Provide good reliability
•    Provide independence from transport protocols
•    Ensure high degree of security                                          Communication        Directory          Security
•    Locate required services across networks                                   Service            Service            Service

                                                                                               Runtime Library

Resolution of Data Representation Differences                 RPC Execution Semantics (1)

    • RPC automatically resolves data representation          • If a request is sent, but no response is received, what
                                                                should the requestor do?
      differences between heterogeneous systems
                                                                  – If the request is blindly retransmitted, the remote procedure might
    • Support is implemented in stubs generated by the IDL          be executed twice (or more)
      compiler                                                    – If the request is not retransmitted, the remote procedure might not
    • DCE uses a receiver makes right scheme                        be executed at all
    • DCE’s approach maximizes RPC performance                • Some remote procedures can safely be executed twice
      between homogeneous systems                                 – Such procedures are said to be idempotent
RPC Execution Semantics (2)                                              Integration of RPC with Threads
                                                                                                                 Clients can make    Servers can service
• Remote procedures must execute with desired behavior                     Client                 Server         multiple requests   multiple clients
                                                                                                                 simultaneously      simultaneously
• Execution semantics in DCE RPC:
   –   At most once (Default)                                             Calling                 Called
                                                                          Code                    Remote
   –   Idempotent: at least once, possibly many times                                             Procedure
   –   Broadcast: a special case of idempotent semantics                                                                                  Server

   –   Maybe: no response is expected, and the request might not get
       through, either
                                                                                              RPC Thread
                                                                       Calling thread (blocks
                                                                       & waits for RPC thread)                       Client

DCE RPC Protocols                                                        Specifying Protocols

                                                                         • Client and server must specify a protocol sequence (called
                                                                           a protseq)
                                                     RPC                 • A protseq contains:
       DG RPC                     CN RPC
                                                                              – RPC protocol
                                                                              – Network address family
                                                                              – Transport protocol
                                                     Network             • Server has a choice with protocol sequences:
       UDP/IP                     TCP/IP             Protocols
                                                                              – Support all available protocol sequences
                                                                              – Select the protocol sequence(s) to support

Daemons: rpcd and dced                                                   RPC Security (1)

• In DCE 1.0, a daemon called rpcd runs on every system                  • Distributed applications may require a number of security
  that supports RPC servers                                                measures, including:
   – It stores transport endpoints (ports) in an endpoint map                 –     Authentication
   – Clients contact it to learn server endpoints                             –     Authorization (access control)
• In DCE 1.1, rpcd is replaced by dced                                        –     Data integrity
   – It performs the functions of rpcd                                        –     Data privacy
   – It improves the security of the endpoint map                        • DCE Security provides high level of security
   – It starts servers on demand                                         • RPC is integrated with DCE Security
RPC Security (2)
                                                                                        Location of Services (1)

                                                                                        • In a distributed environment
  RPC              Authentication                        Authentication       RPC
  Runtime          Runtime                               Runtime              Runtime      – Servers need to advertise their services
                                                                                           – Clients need to identify compatible servers
  Client                                                                   Server
                                                                                        • The DCE Directory Service is used for this
                                                  Obj1           Obj2      Obj3         • The RPC runtime can access the Directory Service
  Clients request services                                                                 – The Directory Service API used by RPC applications is called the
  via authenticated RPC
                                                                                             Name Service Interface (NSI)
  RPCs can use checksums
  for data integrity and                          Servers make access decisions
  encryption for data privacy                     using Access Control Lists
                                                  attached to objects

Location of Services (2)                                                                Summary

                                                                                        • DCE RPC is a commercial-strength offering
                                Directory                        export                 • DCE RPC service provides:
   Client                                                                 Server
                                Service                                                    – Runtime facility
                                                                                           – Development tools
                                                                                        • It is an integrated package
                                                                                           – Integrated with directory service
                                    Information                                            – Integrated with threads
                                                                                           – Integrated with security
                                                                                        • A flexible tool for developers

To top