Title of Presentation

gayheadtibburInternet and Web Development

Feb 5, 2013 (4 years and 2 months ago)

149 views

Request/Reply Communication
Mary Hudachek
-
Buswell

GSU CSC 8320, Section 4.2

Fall 2011

Outline of Background

Introduction

Request /Reply Communication

Remote Procedure Call (RPC)

RPC Operations

Parameter Passing

Data Conversion

Binding

RPC Compilation

RPC Errors and Failure

Exception

Failure Handling

RPC Security

2

Introduction


Request/Reply





Request/Reply Communication

Send a single block of data/packet, then
wait for a reply before sending another
packet

Request/Reply protocols include FTP,
HTTP, SMTP, POP, IMAP, etc…

Remote Procedure Call (RPC); the
Internet's most widely used
request/reply communication model


3

Introduction


Request/Reply Communication

Requestor

Replier

Request Queue

Reply Queue

4

Client Process

Introduction


Remote Procedure Call

Client


(request initiated)

Client Stub


(pack request for transfer)

RPC Runtime
Library

call

return

return

call

Server Process

Manager
Procedures

Server Stub


(unpack request )

RPC Runtime
Library

call

return

return

call

Interface

Apparent Flow

Transport Network

Messages

call

return

return

call

http://publib.boulder.ibm.com/infocenter/aix/v6r1/index.jsp?topic=%2Fcom.ibm.aix.progcomm%2Fdoc%2Fprogcomc%2Frpc_mod.

5

RPC
Operations







Parameter Passing
-

what data can be
passed

Data Conversion
-

how is the data
represented

Binding
-

locating server and registering
the service

RPC Compilation
-

origination of stub
procedures and linking

6

RPC
Operations
-

Parameter Passing



Single process: via parameters and/or global variables

Multiple processes on the same host: via message
passing

Passing parameters is typically the only way that RPC
-
based clients and servers share information

Parameter marshaling
: Rules for parameter passing
and data/message conversion is the primary
responsibility of Stub procedure


Parameter
-
passing modes
:


IN: pass info from caller to receiver


OUT: receiver writes a value in the caller


IN/OUT: caller tells receiver value of variable, which may be
updated by receiver

7

RPC
Operations
-

Parameter
Passing

Call
-
by
-
value
:
just copy data to network message where
value passed to procedure is copied to local variable, client
stub performs copy

Call
-
by
-
reference:

pass pointer address and same memory
location is referred to in passing, hard to implement in
distributed systems with non
-
shared memory.

Call
-
by
-
copy/restore:

combination of call
-
by
-
value and call
-
by
-
reference. Call
-
by
-
value at the entry of call and call
-
by
-
reference to the exit of the call

Call
-
by
-
name:

requires dynamic run
-
time evaluation of
symbolic expression.

Most RPC implementations assume that parameters are
passed by call
-
by
-
value and call
-
by
-
copy/restore.

8

RPC
Operations
-

Data
Conversion

Three areas requiring conversion between
data and message

Data typing

Data representation

Data transfer syntax

Incompatibility issues of data passed from local
machine to remote machine

Different byte ordering

Different sizes of integers and other types

Different floating point representations

Different character sets

Alignment requirements

9

RPC
Operations
-

Data
Conversion

Needed standard encoding to enable
communication between heterogeneous systems
using
symmetric

conversion

ASN.1 (ISO Abstract Syntax Notation)

Most important developments in standards.

Used to define data structures.

Used for specifying formats of protocol data units in network
communications.

Data types are checked during stub generation and
compilation.

Sun’s RPC uses XDR (eXternal Data
Representation)

10

RPC
Operations
-

Data
Conversion

For example: IP (headers) forced all to use ‘big endian’ byte ordering
for 16 and 32 bit values

Most significant byte in low memory

Sparc, 680x0, MIPS, PowerPC G5

x86/Pentiums use little endian

Symmetric

Conversion

Client data

big endian

Server data

little endian

Convert data

Convert data

htonl()… (host to network)

11

ntohl()… (network to host)

RPC
Operations
-

Data
Conversion

Network Data Representation (NDR) is used in the
Distributed Computing Environment (DCE)

Uses asymmetric “receiver
-
makes
-
right”

Open Source Foundation’s Distributed Computing
Environment R
PC uses IDL (Interface Definition Language)

Client data

big endian

Server data

little endian

Convert data

12

Asymmetric

Conversion

Binding is the process of connecting the
client to the server


Services are specified by a server
interface with interface definition
language such as XDR.

RPC
Operations
-

Binding

13

1.
The server starts up

Register its communication endpoint by sending a request
(program, version number, port number) to the port mapper .

Port mapper manages the mapping.

2.
Before RPC, client call RPC run
-
time library routine
create, which contacts the port mapper to obtain a
handle for accessing.

Create message contains the server name, program, version
number, transport protocol.

3.
Port mapper verifies the program and version numbers,
returns the port number of the server to the client.

4.
Client builds a client handle for subsequent use in RPC.
This establishes socket connections between clients and
server.

RPC
Operations
-

Binding

14

client

port mapper

server

directory server

1. register

2. create

3. port #

4. handle

Register service (if
server is unknown)

Server machine address or
handle to server

15

RPC
Operations
-

Binding

Compilation of RPC requires the
followings:

1.
An interface specification file

2.
An RPC generator : input is the interface
specification file and output is the client
and server stub procedure source codes.

3.
A run
-
time library for supporting execution
of an RPC, including support for binding,
data conversion, and communication

RPC
Operations
-

Compilation

16

RPC
Operations
-

Compilation

17

Interface Specification File

Server Stub

Server Code

RPC Generator

Language
Compiler

Client Stub

Header File

Server
Application

Language
Compiler

Client Code

Client
Application

RPC Errors and
Failure


Exception Handling

Exceptions are abnormal conditions raised by the
execution of server stub and procedures.

Exceptions that occur

in server application, server
stub, and server run
-
time library (above the transport
layer) are propagated to the client

If a server routine encounters an error that prevents
it from executing the RPC, it raises an exception after
cleaning up and before returning to the RPC run time,

Server routine doesn’t return a value to RPC that only
the server routine recognizes as an error

Examples of exceptions: Overflow/underflow,
protection violation

18

RPC Errors and
Failure


Exception Handling

19

Exceptions must be reported to the clients.

Question: how the server report status information to clients?

A client may have to stop the execution of a server
procedure.

Question: how does a client send control information to a
server?


In local procedure call: global variables and signals.

In computer network, the exchange of control and
status information must rely on a data channel.

In
-
band signaling, or out
-
band signaling (flag).

Separate channel (socket connection)


more flexible for RPC

It is implemented as part of the stub library support and
should be transparent.


RPC Errors and
Failure


Failure Handling

20

Problems caused by crashes of clients
and servers, or the communication
network.

Cannot locate the server

Nonexistent server, or outdated program

Handle like an exception.

Messages can be delayed or lost

Eventually detected by a time
-
out or by no response
from the server

The messages can be retransmitted

RPC Errors and
Failure


Failure Handling

21

Problem with Retransmission of requests.

Delay case: server gets multiple requests

Idempotent case: request executed multiple
times with no change in result

Idempotent case of impossible (lock servers),
each request has sequence number.

Typically RPC do not use sequence
numbers


only requests
-
based.


RPC Errors and
Failure


Failure Handling

22

Crash of a server

Client attempts to reestablish a connection, and retransmits its
request.

If server not fail, but TCP connection fail: examine the cache table
for duplicated message.

If server failed, then cache table lost. Then raise exception.


Three assumptions for RPC semantics in failures.

Server raise exception, client retries.
At least once

Server raise exception, client give up immediately
At most once

No error report from server, client resubmits until it gets or give
up
Maybe


RPC Errors and
Failure


Failure Handling

23

Most desirable RPC semantics occur exactly once

But hard to implement.

Loss of cache table: at least once and log the cache table to
storage.

Reload the cache table when server recovers.

Overhead since each service must be executed as a transaction at
the server


RPC Errors and
Failure


Failure Handling

24

Crash of a client process

Server has an orphan communication and its reply is
undeliverable.

Orphan computation waste server resources, may confuse the
client with invalid replies from previous connections.

How to eliminate orphan communication? But hard to implement

Client: On reboot, cleans up all previous requests.

Server: Occasionally locate owners of requests.

Expiration: Each remote operation is given a maximum
lifetime.

RPC Errors and
Failure


Failure Handling

25

http://www.cherrypy.org/chrome/common/2.2/docs/book/chunk/ch03.html

Security areas in RPC resulting from

RPC introduces vulnerability because it opens doors
for attacks.

RPC is a cornerstone of client/server
communication


Primary security issues

Authentication of processes.

Confidentiality of messages.

Access control authorization from client to server.

RPC
Security

26

Authentication protocol for RPC should
establish:

Mutual authentication.

Message integrity, confidentiality, and originality.


Design of a secure authentication protocol

How strong the security goals.

What possible attacks

Some inherent limitations of the system.

Short
-
term solution: additional security features.

RPC
Security

27

Sun’s Secure RPC

Built into Sun’s basic RPC.

Assume a trusted Network Information Service
(NIS), which keeps a database and secret keys.

The keys are for generating a true crypto graphical
session key.

When user login, NIS gives the key. With user
password, the key used to decrypt the secret key,
discard password.

Passwords are not transmitted in the network.

RPC
Security


Sun Secure RPC

28

RPC
Security


Sun Secure RPC

Sun secure RPC


RPC message may contain
more

Timestamp : check message expiration

Nonce : protect against the replay of a message

Message digest: detect any tampering.

Sun secure RPC is simple, using existing NIS.

30

RPC
Security


Sun Secure RPC

History

Examples of somewhat recent designs

GridRPC

ICE

Recent research activity

Multiple Grid

FlexRPC

SpartanRPC

S
-
RPC

Serial

Multicast

Outline of RPC Current & Future

31

History of RPC

70s Remote Procedure Call

(RPC)

80s Communication protocol models focused on the
network layer

Microsoft's Distributed Computing Environment (DCE)

Network File System (NFS)

by Sun Microsystems

90s Object RPC (ORPC) codified the mapping of a
communication endpoint to a language
-
level object

DCOM distributed extension

builds an ORPC)layer on top of DCE
RPC

(Microsoft)

Common Object Request Broker Architecture (CORBA)

does the same on
Unix systems

Any solution built on these protocols will be dependent on a single vendors
implementation,

Both these protocols depend on a closely administered environment

Late in 90s

Doors (Solaris) for UNIX operating system

32

00s improved object and component

Java’s Remote Method Invocation (RMI) is their traditional method of
performing remote communications and uses a non
-
standardized protocol

Microsoft Transaction Server

(MTS) component
-
based transaction
processing system

DDObjects for

Borland Delphi

and

C++ Builder

based on DCOM, RMI, Corba

Late 00s Grid computing is composed of many
networked

loosely coupled computers acting together to
perform very large tasks.

GridRPC distributes individual applications and serves as a base for higher

level substrates such as distributed scientific components, Ninf and
NetSolve

ICE (Internet Communications Engine) for grid computing

History of RPC

http://www.ibm.com/developerworks/webservices/library/


33

GridRPC

Grid computing distributes individual applications and serves as a
base for higher

level substrates such as distributed scientific
components, RPC much more complicated

Two different grid computing systems to look at: NetSolve and Ninf

Both support remote procedure calls (RPCs) on the Grid



Standardized at GridRPC

Standardizing only minimal set of APIs

Higher
-
level features can be built on top

Providing several reference implementations



Usage scenarios

Remote library calls for executing compute
-
intensive tasks

Executing large scale task
-
parallel processing

34

GridRPC Ninf
-
G2

http://www.globus.org/grid_software/computation/ninf
-
g.php

Implementation of GridRPC

Constructed on top of Globus, online grid
computing

Globus is introduced in many sites

No more security halls are required in introducing
Ninf
-
G2

Ninfied applications can be executed on many sites


Globus provides primitive functions/tools for grid
computing

Concentrating on the development of RPC specific
functions

Easy to use other tools on Globus

Ninf
-
G2 hides complicated mechanisms of Globus

Grid applications/middleware can be easily
constructed

35

ICE is object
-
oriented middleware providing
RPC, grid computing, and publish/subscribe
functionality.

Influenced by CORBA (Common Object Request
Broker Architecture) in its design, and
developed by ZeroC, Inc.


Supports C++, Java, .NET
-
languages, Objective
-
C, Python, PHP, and Ruby on most major
operating systems.


36

ICE (Internet Communications Engine)

ICE (Internet Communications Engine)

37

http://en.wikipedia.org/wiki/Internet_Communications_Engine

ICE

Ice middleware in the New Solar Telescope’s
Telescope Control System, 2008 [5]

NST (new solar telescope) is an off
-
axis solar
telescope with the world largest aperture.

Develop TCS (telescope control system) to control all
aspects of the telescope


Ice advantages

Provides
Simple ,
fast and scalable communications.

Ice Embedded (Ice
-
E) supports Microsoft Windows
Mobile operating system for handheld devices.

Source code of Ice is provided under the GNU
(General Public License)

Continuously updated.


38

ICE

TCS Implementation (sample of RPC)

Star
-
like structure: all subsystems through HQ
(headquarters).

Each subsystem acts as a server and a client.

Each subsystem use the same ICE interface.

Interface for every object includes seven operations;

Register, Unregister, SendError, SendCommand,
RequestInformation
,
SendNotification
,
SendReply
,
Error

Subsystems can be started in any order, only need to
register with HQ and
IcePack

registry.

39

Integrating Computing Resources on
Multiple

Grid
-
enabled Job Scheduling Systems
Through a

Grid

RPC System 2006

Framework for parallel programming by RPC


Bridge created for large scale computing resource
pools managed by multiple grid enabled job scheduling
systems

User can exploit remote

servers, clusters, and
computing resources on

grid
-
enabled job scheduling
systems located on different sites

New Research: Multiple Grid (2006)

40

Nakajima, Y.; Sato, M.; Aida, Y.;
Boku
, T.;
Cappello
, F.; , "Integrating Computing Resources on
Multiple Grid
-
enabled Job Scheduling Systems Through a Grid RPC System,"

Cluster
Computing and the Grid, 2006. CCGRID 06. Sixth IEEE International Symposium on

, vol.1,
no., pp. 296
-

300, 16
-
19 May 2006

New Research: FlexRPC (2007)

FlexRPC, a flexible user
-
level RPC system that
enables to develop high
-
performance cluster file
systems easily.

Ensures client
-
side thread
-
safeness and fully supports
multithreaded RPC servers.


Parallel and serial multicasting mechanisms

Concurrent call requests handled by worker threads on client
and server side

Remote procedures are designed to be similar to
SunRPC

Improves latency and bandwidth

Building a working prototype of cluster file system called
Kadoop

on top of FlexRPC.

41

Sang
-
Hoon

Kim;
Youngjae

Lee; Jin
-
Soo

Kim; , "FlexRPC: A flexible Remote Procedure Call facility
for modern cluster file systems,"

Cluster Computing, 2007 IEEE International Conference on

,
vol., no., pp.275
-
284, 17
-
20 Sept. 2007

Routing

Control plane, part of the router architecture, is concerned
with drawing the network map, or the information in a
routing table that defines what to do with incoming packets.

Multicast

Communication between a single sender and multiple
receivers over a network

Routing requires an additional table for multicast routes.

Serial Multicasting

Instead of sending a RPC request to multiple receivers, each
receiver forwards the RPC request to the “closest” receiver in
the network topology that has not received the request

New Research: Serial Multicast Info

42

Modeling and evaluation of serial multicast
remote procedure calls (RPCs)

Serial

multicast

RPC are needed in many distributed
systems to avoid network bottlenecks

and

high
-
latency links

Present a mathematical model of serial multicast
calls to better understand performance behavior

Model
is very effective in predicting the
performance

of

serial

multicast

RPCs.

New Research: Serial Multicast (2009)

43

Sang
-
hoon

Kim; Jin
-
Soo

Kim;
Seungryoul

Maeng
; , "Modeling and evaluation of serial
multicast remote procedure calls (RPCs),"

Communications Letters, IEEE

, vol.13, no.4,
pp.283
-
285, April 2009

Wireless sensor network (WSN) consists of
spatially distributed autonomous sensors to
monitor physical conditions

New Research: WSN Info

44

http://en.wikipedia.org/wiki/Wireless_sensor_network

http://embedsoftdev.com/embedded/wireless
-
sensor
-
network
-
wsn/

Spartan RPC: Secure WSN middleware for cooperating
domains

Middleware technology for wireless sensor network (WSN)
applications supporting cooperation between distinct
protection domains

SpartanRPC extends the
nesC

programming language

Provides a link
-
layer

remote

procedure

call

(RPC)
mechanism

Incorporates capability
-
based security architecture for
protection of RPC resources in heterogeneous
environments

New Research: SpartanRPC (2010)

Chapin, P.;
Skalka
, C.; , "SpartanRPC: Secure WSN middleware for cooperating
domains,"

Mobile
Adhoc

and Sensor Systems (MASS), 2010 IEEE 7th International
Conference on

, vol., no., pp.61
-
70, 8
-
12 Nov. 2010

45

S
-
RPC, lightweight framework for

remote

procedure

calls
on wireless sensor and actuator nodes

Enables seamless interoperability between nodes with
common interface to

remote

method invocations

Previous communication between embedded devices took
place over proprietary protocols tailored for the given use
case which limits integration of new functions

S
-
RPC

allows unified access to functions on remote devices

Permits dynamic integration of new devices with different
functions into the network



New Research: S
-
RPC (2011)

46

Reinhardt, A.;
Mogre
, P.S.; Steinmetz, R.; , "Lightweight remote procedure calls for wireless
sensor and actuator networks,"

Pervasive Computing and Communications Workshops
(PERCOM Workshops), 2011 IEEE International Conference on

, vol., no., pp.172
-
177, 21
-
25
March 2011

1.
Ice in Wikipedia,
http://en.wikipedia.org/wiki/Internet_Communications_Engine

2.
Interprocess

Commnications
,
http://en.wikipedia.org/wiki/Interprocess_communication


3.
Randy Chow, Theodore Johnson, “Distributed Operating
Systems & Algorithms”, 1997.

4.
Shumko
,
Sergij
. "Ice middleware in the New Solar Telescope's
Telescope Control System". Astronomical Data Analysis
Software and Systems XVII, ASP Conference Series, Vol. XXX,
2008., Canada.

5.
Sun RPC,
www.cdk4.net/additional/rmi/Ed2/SunRPC.pdf


6.
Zeros, Inc.
http://zeroc.com/ice.html


References