Module 8 – Introduction to Remote Procedure Call

11
Module 8 – Introduction to Remote Procedure Call

description

Module 8 – Introduction to Remote Procedure Call. Objectives. RPC(Remote Procedure Call) 의 기본 개념 및 종류에 대해 이해한다 . RPC 주소에 대해 이해한다 . rpcbind 의 사용에 대해 이해한다 . XDR 에서 동적 메모리 할당 방식에 대해 이해한다. Remote & Local Procedure Calling. arguments. Client. Server. calling procedure. called - PowerPoint PPT Presentation

Transcript of Module 8 – Introduction to Remote Procedure Call

Page 1: Module 8 – Introduction to Remote Procedure Call

Module 8 – Introduction to Remote Procedure Call

Page 2: Module 8 – Introduction to Remote Procedure Call

Objectives

• RPC(Remote Procedure Call) 의 기본 개념 및 종류에 대해 이해한다 .

• RPC 주소에 대해 이해한다 .• rpcbind 의 사용에 대해 이해한다 .• XDR 에서 동적 메모리 할당 방식에 대해 이해한다 .

Page 3: Module 8 – Introduction to Remote Procedure Call

Remote & Local Procedure Calling

Clientcallingprocedure

networktransport

Servercalledprocedure

networktransport

Network

requestmessages

Client Stub

results

Server Stub

Clientcallingprocedure

Servercalledprocedure

arguments

results

arguments arguments

requestmessages

replymessages

replymessages

results

Remote Procedure CallRemote Procedure Call

Local Procedure CallLocal Procedure Call

Page 4: Module 8 – Introduction to Remote Procedure Call

Remote Procedure Call

• 하나의 client 가 네트워크 상의 다른 컴퓨터나 server 의 procedure 를 실행

• User programming tool• low-level network socket interface 보다 프로그래밍이 용이• protocol compiler 를 사용

– 통신 프로토콜 정의• Distributed Computing Environment 하에서 분산 응용을 개발하기 위한

toolkit

Page 5: Module 8 – Introduction to Remote Procedure Call

RPC Issue

• Parameters, result passing– Call by value, call by reference ?– A single parameter, passed by reference

• Binding– ONC RPC uses rpcbind

• Transport protocol– Used TCP and UDP

• Call semantics• Data representation

Page 6: Module 8 – Introduction to Remote Procedure Call

RPC Function Address

Program numberProgram number

Procedure number(0)

Procedure number(0)

Version number(0)

Version number(0) Version number

(v)

Version number(v)

Procedure number(m)

Procedure number(m)

Procedure number(0)

Procedure number(0)

Procedure number(m)

Procedure number(m)

Page 7: Module 8 – Introduction to Remote Procedure Call

Program Number

Defined by SunUser-definedTransientReserved

Range Description

0x00000000 to 0x1FFFFFFF0x20000000 to 0x3FFFFFFF0x40000000 to 0x5FFFFFFF0x60000000 to 0xFFFFFFFF

Page 8: Module 8 – Introduction to Remote Procedure Call

RPC in More Detail

Serverfunction

Serverfunction

ServerDispatchFunction

ServerDispatchFunction

ClientStub

ClientStub

Clientfunction

Clientfunction

LocalProcedureCall

ResultLocalProcedureCall

Result

NetworkingSoftware

NetworkingSoftware

NetworkingSoftware

NetworkingSoftware

RPCCallMessage

RPCReplyMessage

RPCCallMessage

RPCReplyMessage

Transport Mechanism

Client process Server process

Page 9: Module 8 – Introduction to Remote Procedure Call

RPC Call Message FormatTransaction ID(XID)

Message type(call = 0)

Program number

RPC version(2)

Version number

Procedure number

Authentication flavor

Credential length

Authentication flavor

Credential data

Verifier length

Verifier data

Arguments…

4

4

4

4

4

4

4

4

Up to 400 byte

Up to 400 byte

4

4

Page 10: Module 8 – Introduction to Remote Procedure Call

RPC Reply Message Format

Transaction ID(XID)

Message type(reply = 1)

Reply status( 0 = accept)

Authentication flavor

Verifier length

Verifier data

4

4

4

Up to 400 byte

4

4

Accept status(0=success)

Procedure Results

4

Transaction ID(XID)

Message type(reply = 1)

Reply status( 1 = reject)

Authentication flavor

Verifier length

Verifier data

4

4

4

Up to 400 byte

4

4

Reject status(0=success)

Reject Data

4

Accepted Reply Rejected Reply

Page 11: Module 8 – Introduction to Remote Procedure Call

rpcbind• #1 rpcbind 에 port number 등록• #2 server 기계의 rpcbind 에 해당 port number 를 찾음• #3 request 를 보내고 서버에선 reply 를 함

Client Machine

Client Program

Server Machine

port B

port A

rpcbind

Server Programport C

# 3

# 2

# 1