Remote Procedure Calls (RPC) allow a program to execute a procedure in another address space without needing to know where it is located. RPC uses client and server stubs that conceal the underlying message passing between client and server processes. The client stub packs the procedure call into a message and sends it to the server stub, which unpacks it and executes the procedure before returning any results. This makes remote procedure calls appear as local procedure calls to improve transparency. IDL is used to define interfaces and generate client/server stubs automatically to simplify development of distributed applications using RPC.
The document discusses interprocess communication in distributed systems. It introduces four widely used communication models: remote procedure call (RPC), message-oriented middleware (MOM), stream-oriented communication, and multicast communication. RPC allows processes to call procedures located on other machines transparently. MOM supports persistent asynchronous communication through message queues.
Overview of the Sun Remote Procedure Call (ONC RPC) technology
RPC allows a client application to call procedures in a different address space on the same or on a remote machine (= transfer of control and data to a different address space and process).
This means that RPC extends sockets with remote procedure call semantics. Thus RPC is an early approach for distributed applications.
Different flavors of RPC evolved over time. An early standard was set forth by Sun Microsystems with ONC RPC. It is defined in RFC1057 (protocol) and RFC4506 (XDR - data presentation).
The binder (formerly portmapper) is a central component of the RPC architecture. It is a deamon that serves as a registry for registering server procedures and allows a client to lookup procedures for being called remotely.
RPC defines three different call semantics. Maybe call semantics mean that a request may be lost without further notice by the RPC system. For applications requiring higher quality of service, at-least-once call semantics ensure that the call is successfully executed at least once. However, the call may be duplicated in case of packet loss. Exactly-once call semantics provide assurance that the call is executed at least and at most once.
This document discusses remote procedure calls (RPC) and distributed deadlock detection. It begins with an overview of RPC, describing how it allows programs to call procedures located on other machines using the client-server model. It then covers some issues in RPC like structure, binding, and parameter/result passing. Finally, it briefly introduces distributed deadlock detection and the DDD algorithm.
This document provides an introduction and overview of Remote Procedure Call (RPC). It discusses what RPC is, why it is used, how RPC operates, how it is implemented in Windows, provides a practical example of implementing RPC, and discusses how RPC is used in QFS. Key points include that RPC allows a process to call a procedure in a different address space, it hides the remote interaction, and it operates by marshaling parameters for transmission over the network between client and server stubs.
Remote procedure call on client server computingSatya P. Joshi
Remote procedure call on client server computing, what is Remote procedure call on client server computing, Remote procedure call on java, Remote procedure call on client server computing
The document summarizes remote procedure calls (RPC), which allow programmers to call procedures or functions on other machines remotely, making distributed systems appear as a local procedure call. It discusses how RPC works by using stub functions to simulate a local procedure call, how data is marshaled and sent over the network, issues around parameter passing and data representation, and other aspects of designing and implementing an RPC system.
RPC allows a program to call a subroutine that resides on a remote machine. When a call is made, the calling process is suspended and execution takes place on the remote machine. The results are then returned. This makes the remote call appear local to the programmer. RPC uses message passing to transmit information between machines and allows communication between processes on different machines or the same machine. It provides a simple interface like local procedure calls but involves more overhead due to network communication.
The document discusses interprocess communication and summarizes the key points about client-server and group communication patterns. It describes the Java API for internet protocols, which provides datagram and stream communication using UDP and TCP. Specifically, it outlines how UDP supports message passing through datagrams, while TCP provides reliable, ordered streams between processes.
Inter-Process Communication in distributed systemsAya Mahmoud
Inter-Process Communication is at the heart of all distributed systems, so we need to know the ways that processes can exchange information.
Communication in distributed systems is based on Low-level message passing as offered by the underlying network.
Message Passing, Remote Procedure Calls and Distributed Shared Memory as Com...Sehrish Asif
Message Passing, Remote Procedure Calls and
Distributed Shared Memory as Communication Paradigms for Distributed Systems & Remote Procedure Call Implementation Using Distributed Algorithms
This document provides an introduction and overview of Remote Procedure Call (RPC). It discusses what RPC is, why it is used, how RPC operates, how it is implemented in Windows, provides a practical example of implementing RPC, and discusses how RPC is used in QFS. Key points include that RPC allows a process to call a procedure in a different address space, possibly on a different machine, and hides the remote interaction. It operates by marshaling parameters for transmission over the network and making function calls to send the request and receive the response.
There are several mechanisms for inter-process communication (IPC) in UNIX systems, including message queues, shared memory, and semaphores. Message queues allow processes to exchange data by placing messages into a queue that can be accessed by other processes. Shared memory allows processes to communicate by declaring a section of memory that can be accessed simultaneously. Semaphores are used to synchronize processes so they do not access critical sections at the same time.
This document discusses interprocess communication and distributed systems. It covers several key topics:
- Application programming interfaces (APIs) for internet protocols like TCP and UDP, which provide building blocks for communication protocols.
- External data representation standards for transmitting objects between processes on different machines.
- Client-server communication models like request-reply that allow processes to invoke methods on remote objects.
- Group communication using multicast to allow a message from one client to be sent to multiple server processes simultaneously.
한대희 Web proxy_개발_2006년11월_pas_ktfDaehee Han
스마트폰이 대중화되기 직전까지 KT이동통신(KTF)의 모든 단말기가 인터넷 콘텐트 접속시에 거쳐가는 Web Proxy (PAS라 불림)를 바닥부터 새로 개발한 개발 기록. multi thread 기반으로 동작. 한 thread에서 여러 단말(client)처리. Multi-connection per thread. ACE framework사용. Reactor패턴 사용. 부하(동시접속 단말 개수)에 따라 reactor thread 개수를 동적으로 자동 조절하는 pool 방식 구현. 설계를 다시하고 밑바닥부터 새로 만듦. 200TPS 의 기존 성능을 1,000 TPS 로 올림. 5~6번의 deploy 작업 끝에 memory leak 문제 등 모든 문제 해결하고, 30일 넘게 운영해도 죽지 않는 서버로 구현함. 2006년.
Golang Project Guide from A to Z: From Feature Development to Enterprise Appl...Kyuhyun Byun
This comprehensive presentation offers a deep dive into Go language development methodologies, covering projects of all scales. Whether you're working on a small prototype or a large-scale enterprise application, this guide provides valuable insights and best practices.
Key topics covered:
Distinguishing between small and large projects in Go
Code patterns for small, feature-focused projects
Comparison of Handler and HandlerFunc approaches
Enterprise application design using Domain Driven Design (DDD)
Detailed explanations of architectural layers: Presenter, Handler, Usecase, Service, Repository, and Recorder
NoSQL (DynamoDB) modeling techniques
Writing effective test code and using mocking tools like 'counterfeiter'
Essential tools for production-ready applications: APM, error monitoring, metric collection, and logging services
This presentation is ideal for Go developers of all levels, from beginners looking to structure their first projects to experienced developers aiming to optimize large-scale applications. It provides practical advice on code organization, testing strategies, and operational considerations to help you build robust, maintainable Go applications.
Whether you're starting a new project or looking to improve an existing one, this guide offers valuable insights into Go development best practices across different project scales and complexities.
Remote procedure call on client server computingSatya P. Joshi
Remote procedure call on client server computing, what is Remote procedure call on client server computing, Remote procedure call on java, Remote procedure call on client server computing
The document summarizes remote procedure calls (RPC), which allow programmers to call procedures or functions on other machines remotely, making distributed systems appear as a local procedure call. It discusses how RPC works by using stub functions to simulate a local procedure call, how data is marshaled and sent over the network, issues around parameter passing and data representation, and other aspects of designing and implementing an RPC system.
RPC allows a program to call a subroutine that resides on a remote machine. When a call is made, the calling process is suspended and execution takes place on the remote machine. The results are then returned. This makes the remote call appear local to the programmer. RPC uses message passing to transmit information between machines and allows communication between processes on different machines or the same machine. It provides a simple interface like local procedure calls but involves more overhead due to network communication.
The document discusses interprocess communication and summarizes the key points about client-server and group communication patterns. It describes the Java API for internet protocols, which provides datagram and stream communication using UDP and TCP. Specifically, it outlines how UDP supports message passing through datagrams, while TCP provides reliable, ordered streams between processes.
Inter-Process Communication in distributed systemsAya Mahmoud
Inter-Process Communication is at the heart of all distributed systems, so we need to know the ways that processes can exchange information.
Communication in distributed systems is based on Low-level message passing as offered by the underlying network.
Message Passing, Remote Procedure Calls and Distributed Shared Memory as Com...Sehrish Asif
Message Passing, Remote Procedure Calls and
Distributed Shared Memory as Communication Paradigms for Distributed Systems & Remote Procedure Call Implementation Using Distributed Algorithms
This document provides an introduction and overview of Remote Procedure Call (RPC). It discusses what RPC is, why it is used, how RPC operates, how it is implemented in Windows, provides a practical example of implementing RPC, and discusses how RPC is used in QFS. Key points include that RPC allows a process to call a procedure in a different address space, possibly on a different machine, and hides the remote interaction. It operates by marshaling parameters for transmission over the network and making function calls to send the request and receive the response.
There are several mechanisms for inter-process communication (IPC) in UNIX systems, including message queues, shared memory, and semaphores. Message queues allow processes to exchange data by placing messages into a queue that can be accessed by other processes. Shared memory allows processes to communicate by declaring a section of memory that can be accessed simultaneously. Semaphores are used to synchronize processes so they do not access critical sections at the same time.
This document discusses interprocess communication and distributed systems. It covers several key topics:
- Application programming interfaces (APIs) for internet protocols like TCP and UDP, which provide building blocks for communication protocols.
- External data representation standards for transmitting objects between processes on different machines.
- Client-server communication models like request-reply that allow processes to invoke methods on remote objects.
- Group communication using multicast to allow a message from one client to be sent to multiple server processes simultaneously.
한대희 Web proxy_개발_2006년11월_pas_ktfDaehee Han
스마트폰이 대중화되기 직전까지 KT이동통신(KTF)의 모든 단말기가 인터넷 콘텐트 접속시에 거쳐가는 Web Proxy (PAS라 불림)를 바닥부터 새로 개발한 개발 기록. multi thread 기반으로 동작. 한 thread에서 여러 단말(client)처리. Multi-connection per thread. ACE framework사용. Reactor패턴 사용. 부하(동시접속 단말 개수)에 따라 reactor thread 개수를 동적으로 자동 조절하는 pool 방식 구현. 설계를 다시하고 밑바닥부터 새로 만듦. 200TPS 의 기존 성능을 1,000 TPS 로 올림. 5~6번의 deploy 작업 끝에 memory leak 문제 등 모든 문제 해결하고, 30일 넘게 운영해도 죽지 않는 서버로 구현함. 2006년.
Golang Project Guide from A to Z: From Feature Development to Enterprise Appl...Kyuhyun Byun
This comprehensive presentation offers a deep dive into Go language development methodologies, covering projects of all scales. Whether you're working on a small prototype or a large-scale enterprise application, this guide provides valuable insights and best practices.
Key topics covered:
Distinguishing between small and large projects in Go
Code patterns for small, feature-focused projects
Comparison of Handler and HandlerFunc approaches
Enterprise application design using Domain Driven Design (DDD)
Detailed explanations of architectural layers: Presenter, Handler, Usecase, Service, Repository, and Recorder
NoSQL (DynamoDB) modeling techniques
Writing effective test code and using mocking tools like 'counterfeiter'
Essential tools for production-ready applications: APM, error monitoring, metric collection, and logging services
This presentation is ideal for Go developers of all levels, from beginners looking to structure their first projects to experienced developers aiming to optimize large-scale applications. It provides practical advice on code organization, testing strategies, and operational considerations to help you build robust, maintainable Go applications.
Whether you're starting a new project or looking to improve an existing one, this guide offers valuable insights into Go development best practices across different project scales and complexities.
Custom DevOps Monitoring System in MelOn (with InfluxDB + Telegraf + Grafana)Seungmin Yu
2016년도 데이터야놀자에서 발표한 자료입니다.
멜론에서 InfluxDB + Telegraf + Grafana 조합으로 모니터링 시스템을 구축하고 활용한 사례를 발표한 내용입니다. 다양한 메트릭데이터와 DevOps 측면의 활용 가치에 대해서도 생각해 볼 수 있을 것 같습니다.
2. Local Procedure Call (LPC)
Single Computer 안의 프로그램에서 Control 과 Data 를
이동 시킬 수 있는 잘 알려진 방식 함수 호출
Remote Procedure Call (RPC)
Network 로 연결되어 Address Space 가 서로 다른
컴퓨터들 간에 Control 과 Data 를 이동 시킬 수 있도록
Local Procedure Call 방식을 확장
: 분산 Application 을 구축 하려는 프로그래머들에게 쉽고 친숙한
방식 제공
Introduction
Background
3. RPC 를 구현 하기 위해 고려해야 했던 것들 (for Cedar Project)
전송 오류 및 원격 컴퓨터의 상태 등에 대한 정확한 Semantic
정의
Call by reference(address) 에 대한 처리 방법
기존 프로그래밍 환경으로의 통합 방법
RPC 를 하기 위한 Callee 를 찾는 방법: Binding
효율 적인 Control 및 Data 전송 방법
보안에 대한 고려
이 논문에서는 위 고려 사항들 중에 주요 결정 사항과
Binding 방법, 전송 계층 통신 프로토콜에 대한 내용을
포함한다.
Introduction
Background (cont’d)
4. …
인자 N
…
인자 1
Return 주소
이전 Frame Pointer (FP) 값 저장
지역 변수들
Introduction
Local Procedure Call
주소
증가
방향
현재 FP
Stack Bottom
Stack Top
• 동일한 Machine 안에서의
함수 호출은, Stack 을 이용해
Activation Record 를 관리
하면서 처리 됩니다.
5. Introduction
Remote Procedure Call
Client Server
RPC Runtime
Binder
Stub Stub
1
2
3 4
5
6
Stub 함수를 통해 인자 및 반환 값을 주고 받습니다.
Stub 함수 호출은 LPC 와 같이 프로그램에서 호출 될 때 스택이 사용되지만,
그 안에서는 인자와 반환 값을 주고 받기 위한 여러 일을 수행합니다.
6. Cedar programming environment
Xerox research internetwork
Cedar 는 single-user workstation 사용됨(서버 구축에도)
Dorado Machine (24 bits virtual address , 80 MB disk)
3 Mbit or 10 Mbit (packet round-trip time: 120 us) Ethernet
PUP family protocols
simple unreliable datagram
reliable flow controlled byte streams
Introduction
Environment
7. PARC Universal Packet (PUP)
Xerox PARC 연구팀에서 시작 (1970년대 중반)
Xerox Network Systems (XNS) 의 기본 프로토콜로 채택 (1980년대)
TCP/IP 와 유사
PUP 네트워크 주소의 구성
8-bit network number
8-bit host number
16-bit socket number
Rendezvous and Termination Protocol (RTP) 로 연결을 맺고, 이 후
Byte Stream Protocol (BSP) 을 통해 데이터 전달
동일한 Ethernet 상에서는 저 수준 RAW Ethernet packet 포맷 사용
가능
Introduction
Environment (cont’d)
8. 주로 Mesa 언어를 사용
1970 년대 후반 Xerox Palo Alto Research Center 에서
개발
ALGOL 스타일에 모듈러 프로그래밍을 지원
모든 소스파일은 아래 두 가지로 구성됨
1. 라이브러리의 인터페이스를 정의하는 파일
2. 인터페이스를 구현한 하나 이상의 프로그램 파일
Smalltalk, Interlisp 도 사용
Introduction
Environment (cont’d)
9. 분산 컴퓨팅을 좀 더 쉽게 할 수 있게 하자.
지금까지는 통신 전문가들이 도맡아 해야 하는 어려운 일이었다.
(실제 많은 경험을 가진 연구자들도 당시 존재 하는 도구들을 이용해
분산 시스템을 구축하는 것은 매우 어려워함)
강력한(?) 컴퓨팅 및 네트워크 파워를 활용하기 위해 분산 시스템은
필요했다.
다른 통신 방식은 분산 시스템을 구축하는데 있어 많은 제약을
가져왔다.
RPC 를 사용하면, LPC 를 사용하는 것과 같아서 분산 컴퓨팅에 보다
쉽게 접근할 수 있게 될 것이다.
RPC 가 불필요한 부분에서의 어려움을 제거하는데 도와줄 것이다.
(분산 컴퓨팅의 주요 문제들은 제외 하더라도… 타이밍 문제, 특정
구성 요수의 독립적인 오류 문제 및 독립된 실행 환경이 공존하는
환경등)
Introduction
Aims
10. RPC 의 효율을 높이자!
쉽게 접할 수 있는 Semantic 을 유지하면서, 효율적으로
암호화된 통신 지원
비밀 번호가 clear-text 로 네트워크상을 떠돌게 하지
않겠다. (물론 이전에도 유사 연구들이 있었지만, RPC
에는 적용되지 않았다)
Introduction
Aims (cont’d)
11. Message Passing 을 쓰는 것도 괜찮은 대안
그러나, Mesa 의 인터페이스 정의와 구현이 분리 되어 있는 모듈러
프로그래밍 방식은 RPC 에 매우 적합했다.
Shared Address Space 는 고려하지 않았다.
Network 로 연결된 컴퓨터들간에 Shared Address Space 를 Emulate 하는
것은 보류한다.
1. 원격지의 주소임을 현재 프로그래밍 언어에서 구분할 수 있는
방법이 있을지에 대한 의문
2. 과연 그것이 정말 효율 적인 것일지에 대한 의문
Local Procedure Call 과 같은 semantic 이 되도록!!
Timeout 이 사용자 함수에 노출되지 않도록 한다.
Introduction
Fundamental Decisions
12. User
클라이언트 프로그램 (함수 사용자)
User-stub
Parameter Marshalling,
Return value Un-marshalling
RPC Runtime
Retransmission, ack, routing, encryption
Server-stub
Parameter Un-marshalling
Return value marshalling
Server
서버 프로그램 (함수 제공자)
Introduction
Structure
13. Lupine – Mesa interface modules
“Stub” 을 생성하는데 사용하는 도구
Program Module 구현: Export / Import
user = import, server = export
개발자는,
user/server code 만 구현, 인자에 call by reference 안
쓰도록 주의(Lupine 도 체크함),
기계 또는 연결 오류 예외 처리 필요
Introduction
Structure (cont’d)
14. 무엇을 하고 싶은 거지?
Naming
어떻게 찾아가지?
Location
Binding
What it is,
User Server
RPC Runtime
Stub Stub
Binder
15. Naming
Representation
<Type, Instance>
Type
어떤 종류의 서비스를 사용하고 싶은지
Instance
어떤 머신에서 서비스를 받고 싶은지
ex) <Mail Server, John’s Mail Server>
Binding
Naming
16. Location
Grapevine distributed database!!!
Widely & Reliably available.
Database Entry 를 찾지 못한 적이 없었다.
Grapevine DB 말고 다른 대안이 있었으나,.
원격 서버의 주소를 프로그램에 직접 쓰는 방법
대부분의 app 이 항상 서버와 먼저 bind 되어있어야 했다.
브로드캐스팅을 통해 서버를 찾는 방법
여러 서버가 불필요하게 대기 상태로 유지되어야 했다.
Binding
Location
17. RName
Entry 의 Key string
두 종류의 Entry
Individuals
Groups
Entry 의 여러 속성 중 종류에 따라서,
Individual Entry : Connect Site 만 본다. (Network Address)
Group Entry : Member List 만 본다. (List of RName)
Binding
Grapevine Distributed DB
18. RPC Package 는 두 가지 Entry 만 쓴다.
Type Entry & Instance Entry
(Naming 이 <Type, Instance> 의 형식이므로)
Instance entry
Individual Entry 의 connect-site 속성
Type entry
Group Entry 의 member-list 속성
Binding
Grapevine Distributed DB (cont’d)
19. Binding
Grapevine Distributed DB (cont’d)
• FileAccess.Alpine type is exported by Ebbets.Alpine(3#22#)
and Luther.Alpine(3#276#)
• Group entry (Type)
• { FileAccess.Alpine, (Ebbets.Alpine, Luther.Alpine) }
• Individual entry (Instance)
• { Ebbets.Alpine, 3#22# }
{ Luther.Alpine, 3#276# }
• Ex) <FileAccess.Alpine, Ebbets.Alpine>
20. Sequence of Binding & Call
import
[A, B]
import
[A, B]
GetConnect Lookup
Bind[A,B]
RPCRuntime RPCRuntime Server-stub ServerUser-stubUser
Export
[A, B]
Export
[A, B, …]
Record in
Table;
SetConnectDo update
Add memberDo update
Return
Table
Lookup
Record
result
return
Local
Call
Pack
Argument
Transmit Receive &
Check UID
in table
Unpack
Argument
Call
Return
Pack
ResultTransmitReceive
Unpack
Argument
Local
Return
Caller Machine Grapevine DB Callee Machine
21. Export Interface
RPCRuntime::ExportInterface
(type, instance, procedure)
Lookup Table – Small Size Array
(Interface Name, Procedure, UID)
Export 되는 Procedure 정보의
Type/Instance/Proc 정보를
Callee 의 RPCRuntime 내 Table
에 저장 (Lookup Table)
Sequence of Binding & Call
Export Interface
22. Import Interface
RPCRuntime::ImportInterface
(Type, Instance)
Instance 를 지정하지 않으면, Grapevine DB 에서 찾는다.
Instance 가 주소가 될 수 도 있다.
그 경우 DB 거치지 않고 바로
사용한다.
Grapevine DB 에서 Instance 찾기
Instance 와 Binding
Callee 의 Lookup Table Index 와
UID 반환
Export 되어 있지 않으면 에러
Sequence of Binding & Call
Import Interface
23. RPC steps
User 에서 Stub Procedure 호출
Stub 내부에서 Binding 을 먼저 진행 함.
Parameter 와 Prcecedure 정보를 Packing
RPC Runtime 을 통해 Server 로 전달
Server Stub 은 Table Index 와 UID 로 Call 유효성 확인
Parameter Unpacking 후 Server Procedure 호출
Return value 를 Server-stub 에서 packing 하여 user 로 전달
User stub 은 전달 받은 return value 를 unpacking 한 후 user 로
전달
Sequence of Binding & Call
RPC Steps
24. Importer/Exporter 구조
Server 는 User crash 의 영향을 받지 않음
User (stub) 는 Server crash (Restart) 인지
UID 변경으로 Server 상태인지 가능 (Binding 끊어짐)
UID 대신 함수 주소를 직접 사용
보안 위험
(임의의 주소에 있는 함수에 접근 가능성 있음)
Grapevine DB 를 Update 할 수 있는 대상 제한
보안성 높임
Entry 정보는 인증된 Server 만 수정할 수 있도록
Discussion
25. Server 에서 명시적으로 Procedure 가 먼저 Export
되어야 한다.
User 가 Import 시점을 동적으로 결정할 수 있다.
필요할 때 Import
Binding Time 을 자유롭게 결정할 수 있다.
1. Name 에서 Instance 를 쓰지 않으면 동적 할당
2. RName 을 써서 Server 가 Export 할 때 까지 지연
3. 직접 지정해서 Compile 시 고정
Discussion (Cont’d)
26. 다양한 통신 프로토콜을 사용할 수 있었으나, 모두
만족하지 못함
PUP Byte stream protocol (또는 Xerox NS Sequenced
packet protocol) 이용
이전 다른 실험에서 PUP Byte streams 과 Xerox NS
“Courier” RPC Protocol 을 이용
Grapevine protocol: RPC 와 유사하며 PUP Byte steams
을 사용
Packet level transport protocol
Requirements
27. 새로운 프로토콜의 설계
Call 에서 Return 까지 실제 걸리는 시간을 최소화
연결을 위해 최소한의 state 정보와 handshaking
Call & Return Pair 보장
(No return: Exception 으로 처리하나, Caller 는 Crash 인지
연결 문제인지는 모름)
timeout 인자가 user 에게 노출 되지는 않음.
crash 나 연결 문제시에는 함수 호출 처리를 중단 (exception)
Remote Procedure 의 Infinite Loop / Dead lock 은 고려 안 함
(Local procedure call 과 같은 맥락)
Packet level transport protocol
Requirements (cont’d)
28. Simple Call .vs. Complicated Call
Simple Call
모든 인자와 필요 정보가 한 패킷 안으로 구성
함수의 리턴 값과 필요 정보도 한 패킷으로.
Complicated Call
한 패킷으로 구성이 안될 때
Packet level transport protocol
Call
29. Call
Simple Call
call
retransmission
return
ack
call
Call Identifier = Activity
1. 결과 패킷 구분
2. 중복된 호출 패킷에 대한 예외 처리
Activity <MachineID, ProcessID, SeqNo>
• Call 에 대한 Ack 는 Return 으로 대체
• Return 에 대한 Ack 는 다음 Call 로 대체
• Call 에 대한 Return 이 일정 시간 안에
오지 않으면 RPC Runtime 이 재전송
• Return 이 후 새로운 Call 이 일정 시간
안에 오지 않으면 RPC Runctime 이 Ack
30. Connection
Caller 와 Callee 사이의 공유된 상태 정보
(다른 프로토콜 들은 two-paired handshake 가 필요)
이 논문은 Call packet 받으면 암묵적으로 connection 성립
Active Connection
정의
1. 진행 중인 Call 이 있을 때
2. return 에 대한 Ack 대기 중
Caller 와 Callee 가 공유중인 연결 상태 정보가 있음.
Idle Connection
Server 가 SeqNo (Activity 중복 방지용) 만 유지
Call
Simple Call
31. Idle connection 유지를 위한 ping 은 없다
Disconnection 은 마지막 Ack 로 부터 일정 시간 (예를
들어 5분뒤 …) 이 지난 후 server 에서 state 정보를
지우는 것이다.
간단하긴 한데….
call 해 놓고 return 을 기다리는데,
서버 Crash 로 응답하지 못하는 상황이라면?
Call
Simple Call
32. 앞서 binding 에 사용했던 UID (table lookup) 이
있어서, server restart(crash) 를 인지 할 수 있으므로,
caller 가 retransmit 을 하는 경우는 방지할 수 있다.
user 가 재 시작되어도, activity 의 seqNo 가 중복
사용되는 경우는 없게 하여 서버가 call packet 을
discard 시키는 경우는 없게 한다.
SeqNo 는 Monotonic time 을 사용한다.
Call
Simple Call
33. Probe packet.
Call 해 놓고 return 기다리는데, 너무 오래 걸리는 지를
확인하기 위해서, 살아 있냐고 확인 패킷을 주기적으로
보낸다.
보내기 시작 하는 시점은?
기기간 round-trip 시간 보다 조금 더 뒤 부터
보내는 주기는?
점진적으로 늘려가다가 10분 뒤부터는 5분 주기로 보내게
된다
Communication Level 의 Failure 를 detect 하는 용도임
Callee 의 deadlock 상태를 detect 하는 용도가 아님
Call
Complicated Call
34. Call
Complicated Call (sequence)
Caller Machine Callee Machine
User RPC + Stub ServerRPC + Stub
call
Send call pkt
Wait for ack
Start arg record
Build next pkt
Acknowledge
wait next pkt
inovke call
Transmit it
Wait for pkt
Retransmit
Wait for ack
Wait for result
return
acknowledge
acknowledge
Send result
Wait for ack
Retransmit
Wait for ack
idle
Do call
return
Call[callid, pkt=0, plzAck, …]
Ack[CallID, Pkt=0]
Data[callid, pkt=1, dontAck, …]
Data[callid, pkt=1, plzAck, …]
Ack[CallID, Pkt=1]
Result[CallID, Pkt=2,dontAck, ..]
Result[CallID, Pkt=2,plzAck, ..]
Ack[CallID, Pkt=2]
35. Call 이 N 개의 Packet 으로 구성되는 경우, N – 1 개의
Packet 까지는 Ack 를 요청한다.
마지막 N 번째 Packet 은 Return Packet 으로 Ack 를
대체한다.
Call 이 후 Return 까지 시간이 오래 걸리는 경우, 마지막
Packet 을 Retransmission 하는데, 이 때는 Ack 를 요청한다.
Return 을 보낸 후 일정 시간 안에 다음 Call 이 없는 경우,
Return packet 을 Retransmission 하되 Ack 를 요청한다.
Call
Complicated Call (sequence)
36. Mesa – “Catch” phrase.
Java 나 C++ 의 try-catch 와 유사
Exception 이 발생하면, Signal 을 통해 알림
Signal 이 발생하면, Catch 구문이 실행 됨
RPC 도 같은 동일한 맥락으로 처리함
RPC 에서 Callee 수행 도중 Exception 이 발생하면,
Result packet 에 Exception 정보를 담아 Caller 에게 전달.
Caller 의 RPC Runtime 은 Exception 정보 에 맞는 Signal 을 생성
Caller 의 Catch 구문을 찾아 처리
Catch 구문이 있으면, 수행 결과를 callee 에게 전달
Catch 구문이 없으면, callee 가 unwind 처리 할 수 있도록 전달
Exception 처리와 관련된 함수도 Server 에서 Export 해야 함
Exception handling
37. Idle server process 들을 생성 해 둠
Incoming packet 처리
Call 처리가 끝나면 idle state 로 전환
(종료 하지 않음, 단 수가 많은 경우 종료 시킬 수 있음)
Call Packet 은 Destination PID, Source PID 등의 정보를 가짐
Ethernet Device Driver 에 Process 가 기다리는 packet 이 있음을
알려둔다.
Incoming packet 이 등록된 특정 process 의 것이면, 바로 해당
프로세스로 전달한다.
등록된 프로세스가 없다면, idle server 프로세스에게 보내서,
Ack 를 보낼지, Discard 시킬지, 새로운 Call 요청인지 처리.
Uses of processes
38. NIC Device Driver 를 수정하여, RPC Packet 인 경우에는 일반
Network protocol S/W layer 를 bypass 시켜 최적화를 했다.
(Caller 와 Callee 가 같은 network 에 있는 경우)
고려 했으나, 적용하지 않은 최적화들
로컬 네트워크인 경우 인터넷 프로토콜을 쓰지 않을 수 도
있었다.
Simple call 을 위해 특별한 프로토콜을 쓸 수 도 있었다.
특별한 목적의 network microcode 도 쓸 수 있었다.
RPC 통신이 아닌 것은 차단할 수 있었다.
Busy-wait 으로 process switching 을 줄일 수 있었다.
각각이 경우에 따라 좋지 못했기 때문에, 적용하지 않았다.
Other optimization
Editor's Notes
#3: Remote Procedure Call 에 대한 설명을 합니다.
Remote Procedure 를 호출 하면, 실제 함수가 실행 될 곳으로 인자를 전달하고, 함수를 수행 한 후, 그 결과를 다시 돌려 받는다. Caller 는 Callee 로 부터 결과를 받을 때 까지 기다린다. (단, caller 에서 병렬 처리가 가능한 환경인 경우, 다른 일도 가능)
#4: RPC Package 를 구현하면서 고려해야 했던 많은 이슈들 중에, 이 논문에서는 이런 것들을 다루고 있습니다.
#5: 배경 지식에 대한 정리를 위해 Local Procedure Call 에 대해 알아 보겠습니다.
우리가 일반적으로 사용하고 있는 C 언어에서, Call by Reference 와 Call by Value, Call by Pointer 에 대해 구분해 보겠습니다.
Activation Record 는 Programming Language 에서 말하는 용어로 현재 실행 중인 함수와 관련된 정보 집합을 의미합니다.
실제로는 Stack 에 함수가 호출될 때 push 된 인자들과, 복귀할 주소 및 이전 Frame 의 주소가 저장됩니다.
#6: Binder 를 통해 연결할 원격 컴퓨터 정보 및 함수 정보를 얻어 오고,
RPC Runtime 을 통해 인자와 반환 값을 주고 받습니다.
RPC Runtime 은 Client/Server 간 메시지를 주고 받기 위한 일들을 처리합니다. (send/recv)
#7: Cedar 프로그래밍 환경을 개발하는… 단일화된, 대화형 사용자 인터페이스. 프로그램 구축 및 디버깅이 용이함
Cedar 는 S
#10: 불필요한 부분: Distributed Computing 을 위해 개발자가 커뮤니케이션 방식을 알거나, 그것을 직접 구현해야 하는 어려움
Send/Recv 를 직접 쓴다던지.. 해야 하는..
#12: 물론 현재의 Virtual Address Mapping 이나 Paging 은 Shared Address Space 를 구축할 수는 있겠지만,
우리는 다음 연구에서도 Shared Address Space 는 없다고 가정할 것이다.
#13: Marshalling / Unmarshalling
과
Serialization 과 Deserialization 에 대한 차이를 설명해준다.
추가적인 Meta data 를 가질 수 있는가가 가장 큰 차이임
Serialization 은 Marshalling 의 Pass-by-value 를 구현하는 한 방법
#15: Binding…
뭔가 연결을 하는건데요..
뭔가를 찾아서 연결을 하려면…
이름을 알아야 하고, 그게 어디 있는지를 알아야 하죠…
“지금” “클라이언트가” “어디에 있는” “무엇을” “사용” 하겠다.
5W1H 에서, “어디에 있는 무엇을” 이라는 걸 이 Binding 에서 해결합니다.
Stub 과 RPC Runime 은 어떻게, Client 와 Server 는 “누가” 로 보면 되겠죠.
#18: Grapevine DB 은 여러 개의 Entry 들의 집합으로 구성하는데요.
각 Entry 의 Key string 을 Grapevine RName 이라고 합니다.
Entry 에 두가지 종류를 두는데, Individual 과 Group 입니다.
entry 에는 여러가지 정보가 있는데,
논문 저자는
Individual entry 를 위해서는 connect site 라는 속성만 보겠다고 하고,
Group entry 를 위해서는 Member-list 속성만 보겠다고 합니다.
그럼 대체 이게 앞에서 얘기했던 Naming 과 Location 과 어떤 관계가 있는거냐… 하면,
#19: Type 을 Group entry 로 보고,
Instance 를 Individual entry 로 봅니다.
예를 들면,
#20: Ebbets 과 Luther 라는 애들이 FileAccess 라는 걸 export 한다고 하면,
Group Entry 에는 FileAccess.Alpine 이라는 RName 으로 Ebeets.alpine, luther.alpin 이라는 이름 목록이 들어갑니다.
그리고 Individual entry 로 Ebbet.Alpine 이라는 RName 으로 3#22# 이라고 저장을합니다.
나중에 이름을 부를 때 이렇게 부르죠..
<FileAccess.Alpine 이라는 것을, Ebbets.Alpine 에 있는 걸로 쓰자..> 입니다.
#21: Server 가 Interface Export 를 합니다. Service A, Instance B.
그럼 server stub 은 Service A 에 Instance B 이고, Procedure 는 이거고 라고 해서 RPC Runtime 의 ExportInterface 를 호출하고,
RPCRuntime 은 이걸 받아서 UID 를 만들고 Table 에 저장합니다.
그리고 Grapevine DB 를 업데이트 하게 됩니다.
이제 Client (user) 가 Import 를 합니다.
A 라는 서비스를 B 라는 인스턴스를 이용해 사용하겠다. 그러면 user stub 이 RPCRuntime 에 ImportInterface 를 호출 하고, RPC Runtime 은 Grapevine DB 를 뒤져서 연결 정보를 찾아냅니다.
그리고 실제 server 와 Bind 를 시도합니다.
이때, Server 는 해당 함수에 대한 정보를 Table 에서 찾아서 User 에게 UID 정보를 알려줍니다.
User 는 이걸 받아서 기억하고 import 를 마칩니다.
쭉 설명…
Table 에는 Seq No 를 저장해 놓고,
#22: 지금까지 이제 Grapevine DB 를 어떻게 쓰겠다고 설명을 드렸는데요.
이 DB 에 뭔가 등록을 하기 위한 방법이 Export 라는 방법이고,
이 DB 에서 뭔가 찾아가는 방법이 Import 라고 하고 있습니다.
RPC Runime 에서 Export Interface 와 Import Interface 를 제공해주고 있는데요,
ExportInterface 를 할 때, Type (FileAccess.Alpine) Instance (Luther.Alpine, 주소), 그리고 어떤 함수 인지 함수 이름? 또는 주소? 또는 인덱스를 씁니다. 함수 주소를 쓰는것에 대해서는 뒤에 얘기가 다시 나옵니다.
여기서 이 논문 저자는 성능을 최적화 하기 위해서, proceduer 에 UID 를 사용해서 array indexing 방식으로 함수를 찾아가게 하겠다고 합니다.
이 Table 에는
<MachineID, ProcessID, SeqNo>
Activity
정보도 저장해 두고 있어서, 중복 요청에 대한 처리를 합니다.
#31: 일반적으로 현재 TCP 소켓 프로그래밍을 해보면, Client 와 Server 간 Connection 이 맺어진다.
TCP 는 연결 지향이기 때문에, 내부적으로 Connection 관리를 해 준다.
UDP 는 비연결 지향이기 때문에, Connection 관리가 되지 않는다.
이 논문에서는 RPC Packet 을 구현 하면서, Connection 관리를 따로 하지 않고,
Call 이 발생하는 시점 부터 Connection 이 맺어진 것으로 간주하고, Ack 가 올 때까지 관련 정보를 유지한다.
Return 에 대한 Ack 는 (다음 call 이거나 진짜 ack)
#32: 마지막 질문, 즉 call 해 놓고, 서버가 살아있나 죽어 있나에 대한 상태는 뒷장에서 probe 패킷으로 설명한다.
#33: SeqNo 가 중복되지 않도록 하는 것은 Sequencing 을 하는 것이 아니고, monotonic 값을 사용한다.
#35: Call packet 이 여러 개라면, Send 를 할 때, Ack 를 명시적으로 요청한다.
이는 양쪽에 한 개의 패킷 버퍼만을 사용하는 것으로 구현이 가능하게 한다.
Buffering 과 Flow control 에 대한 고민을 하지 않아도 되게 한다.
Bulk data 를 전송하는 효율적인 방법에 대한 고민을 따로 하지는 않았다..