110 likes | 400 Views
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
E N D
Objectives • RPC(Remote Procedure Call)의 기본 개념 및 종류에 대해 이해한다. • RPC 주소에 대해 이해한다. • rpcbind의 사용에 대해 이해한다. • XDR에서 동적 메모리 할당 방식에 대해 이해한다.
Remote & Local Procedure Calling arguments Client Server calling procedure called procedure results Local Procedure Call Client Server calling procedure called procedure arguments arguments results results Client Stub Server Stub network transport network transport request messages reply messages reply messages request messages Network Remote Procedure Call
Remote Procedure Call • 하나의client가네트워크상의다른컴퓨터나server의procedure를실행 • User programming tool • low-level network socket interface보다프로그래밍이용이 • protocol compiler를사용 • 통신프로토콜정의 • Distributed Computing Environment 하에서분산응용을개발하기위한toolkit
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
RPC Function Address Program number Version number (0) Version number (v) Procedure number (0) Procedure number (m) Procedure number (0) Procedure number (m)
Range Description 0x00000000 to 0x1FFFFFFF 0x20000000 to 0x3FFFFFFF 0x40000000 to 0x5FFFFFFF 0x60000000 to 0xFFFFFFFF Defined by Sun User-defined Transient Reserved Program Number
RPC in More Detail Client process Server process Client function Server function Local Procedure Call Local Procedure Call Result Result Client Stub Server Dispatch Function RPC Call Message RPC Reply Message RPC Reply Message RPC Call Message Networking Software Networking Software Transport Mechanism
RPC Call Message Format Transaction ID(XID) 4 Message type(call = 0) 4 RPC version(2) 4 Program number 4 Version number 4 Procedure number 4 Authentication flavor 4 Credential length 4 Credential data Up to 400 byte Authentication flavor 4 Verifier length 4 Verifier data Up to 400 byte Arguments …
Transaction ID(XID) Transaction ID(XID) 4 4 Message type(reply = 1) Message type(reply = 1) 4 4 Reply status( 1 = reject) Reply status( 0 = accept) 4 4 Authentication flavor Authentication flavor 4 4 Verifier length Verifier length 4 4 Verifier data Verifier data Up to 400 byte Up to 400 byte Reject status(0=success) Accept status(0=success) 4 4 Procedure Results … Reject Data … RPC Reply Message Format Accepted Reply Rejected Reply
Client Machine Server Machine rpcbind port A # 2 port B # 1 Client Program Server Program port C # 3 rpcbind • #1 rpcbind에 port number 등록 • #2 server 기계의 rpcbind에 해당 port number를 찾음 • #3 request를 보내고 서버에선 reply를 함