SlideShare a Scribd company logo
Remote Procedure Calls Paul Krzyzanowski [email_address] [email_address] Distributed Systems Except as otherwise noted, the content of this presentation is licensed under the Creative Commons Attribution 2.5 License.
Problems with sockets Sockets interface is straightforward [connect] read/write [disconnect] BUT … it forces read/write mechanism  We usually use a procedure call To make distributed computing look more like centralized: I/O is not the way to go
RPC 1984: Birrell & Nelson Mechanism to call procedures on other machines Remote Procedure Call Goal:  it should appear to the programmer that a normal call is taking place
How do  regular  procedure calls work in programming languages?
Regular procedure calls Machine instructions for call & return but the compiler really makes the procedure call abstraction work: Parameter passing Local variables Return data
Regular procedure calls You write: x = f(a, “test”, 5); The compiler parses this and generates code to: Push the value 5 on the stack Push the address of the string “test” on the stack Push the current value of a on the stack Generate a call to the function f In compiling f, the compiler generates code to: Push registers that will be clobbered on the stack to save the values Adjust the stack to make room for local and temporary variables Before a return, unadjust the stack, put the return data in a register, and issue a return instruction
Implementing RPC No architectural support for remote procedure calls Simulate it  with tools we have (local procedure calls) Simulation makes RPC a language-level construct instead of an operating system construct
Implementing RPC The trick: Create  stub functions  to make it appear to the user that the call is local Stub function contains the function’s interface
Stub functions network routines server functions server stub (skeleton) network routines 1. Client calls stub (params on stack) client functions client stub client server
Stub functions server functions server stub (skeleton) network routines 2. Stub marshals params to net message client functions client stub network routines client server
Stub functions 3. Network message sent to server client functions client stub network routines server functions server stub (skeleton) network routines client server
Stub functions 4. Receive message: send to stub client functions client stub network routines server functions server stub (skeleton) network routines client server
Stub functions 5. Unmarshal parameters, call server func client functions client stub network routines server functions server stub (skeleton) network routines client server
Stub functions 6. Return from server function client functions client stub network routines server functions server stub (skeleton) network routines client server
Stub functions 7. Marshal return value and send message client functions client stub network routines server functions server stub (skeleton) network routines client server
Stub functions 8. Transfer message over network client functions client stub network routines server functions server stub (skeleton) network routines client server
Stub functions 9. Receive message: direct to stub client functions client stub network routines server functions server stub (skeleton) network routines client server
Stub functions 10. Unmarshal return, return to client code client functions client stub network routines server functions server stub (skeleton) network routines client server
Benefits Procedure call interface Writing applications is simplified RPC hides all network code into stub functions Application programmers don’t have to worry about details Sockets, port numbers, byte ordering RPC: presentation layer in OSI model
RPC has issues
Parameter passing Pass by value Easy: just copy data to network message Pass by reference Makes no sense without shared memory
Pass by reference? Copy items referenced to message buffer Ship them over Unmarshal data at server Pass  local  pointer to server stub function Send new values back To support complex structures Copy structure into pointerless representation Transmit Reconstruct structure with local pointers on server
Representing data No such thing as incompatibility problems  on local system Remote machine may have: Different byte ordering Different sizes of integers and other types Different floating point representations Different character sets Alignment requirements
Representing data 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 main() { unsigned int n; char *a = (char *)&n; n = 0x11223344; printf("%02x, %02x, %02x, %02x\n", a[0], a[1], a[2], a[3]); } Output on a Pentium: 44, 33, 22, 11 Output on a PowerPC: 11, 22, 33, 44
Representing data Need standard encoding to enable communication between heterogeneous systems e.g. Sun’s RPC uses XDR (eXternal Data Representation) ASN.1 (ISO Abstract Syntax Notation)
Representing data Implicit typing only values are transmitted, not data types or parameter info e.g., Sun XDR Explicit typing Type is transmitted with each value e.g., ISO’s ASN.1, XML
Where to bind? Need to locate host and correct server process
Where to bind? – Solution 1 Maintain centralized DB that can locate a host that provides a particular service (Birrell & Nelson’s 1984 proposal)
Where to bind? – Solution 2 A server on each host maintains a DB of  locally  provided services Solution 1 is problematic for Sun NFS – identical file servers serve different file systems
Transport protocol Which one? Some implementations may offer only one (e.g. TCP) Most support several Allow programmer (or end user) to choose
When things go wrong Local procedure calls do not fail If they core dump, entire process dies More opportunities for error with RPC: Transparency breaks here Applications should be prepared to deal with RPC failure
When things go wrong Semantics of remote procedure calls Local procedure call:  exactly once A remote procedure call may be called: 0 times: server crashed or server process died before executing server code 1 time: everything worked well 1 or more: excess latency or lost reply from server and client retransmission
RPC semantics Most RPC systems will offer either: at least once  semantics or  at most once  semantics Understand application: idempotent  functions: may be run any number of times without harm non-idempotent   functions: side-effects
More issues Performance RPC is slower … a lot slower Security messages visible over network Authenticate client Authenticate server
Programming with RPC Language support Most programming languages (C, C++, Java, …) have no concept of remote procedure calls Language compilers will not generate client and server stubs Common solution: Use a separate compiler to generate stubs (pre-compiler)
Interface Definition Language Allow programmer to specify remote procedure interfaces (names, parameters, return values) Pre-compiler can use this to generate client and server stubs: Marshaling code Unmarshaling code Network transport routines Conform to defined interface Similar to function prototypes
RPC compiler IDL client code (main) server functions RPC compiler client stub headers server skeleton data conv. data conv. compiler compiler server client Code you write Code RPC compiler generates
Writing the program Client code has to be modified Initialize RPC-related options Transport type Locate server/service Handle failure of remote procedure call Server functions Generally need little or no modification
RPC API What kind of services does an RPC system need? Name service operations Export/lookup binding information (ports, machines) Support dynamic ports Binding operations Establish client/server communications using appropriate protocol (establish endpoints) Endpoint operations Listen for requests, export endpoint to name server
RPC API What kind of services does an RPC system need? Security operations Authenticate client/server Internationalization operations Marshaling/data conversion operations Stub memory management Dealing with “reference” data, temporary buffers Program ID operations Allow applications to access IDs of RPC interfaces
The end.
Ad

More Related Content

What's hot (20)

Inter-Process Communication in distributed systems
Inter-Process Communication in distributed systemsInter-Process Communication in distributed systems
Inter-Process Communication in distributed systems
Aya Mahmoud
 
NFS(Network File System)
NFS(Network File System)NFS(Network File System)
NFS(Network File System)
udamale
 
Osi , tcp/ip protocol and Addressing
Osi , tcp/ip protocol and Addressing Osi , tcp/ip protocol and Addressing
Osi , tcp/ip protocol and Addressing
marwan aldulaimy
 
MAT Chapter 1
MAT Chapter 1MAT Chapter 1
MAT Chapter 1
IF Engineer 2
 
Distributed objects & components of corba
Distributed objects & components of corbaDistributed objects & components of corba
Distributed objects & components of corba
Mayuresh Wadekar
 
Message Passing, Remote Procedure Calls and Distributed Shared Memory as Com...
Message Passing, Remote Procedure Calls and  Distributed Shared Memory as Com...Message Passing, Remote Procedure Calls and  Distributed Shared Memory as Com...
Message Passing, Remote Procedure Calls and Distributed Shared Memory as Com...
Sehrish Asif
 
Chap 12 tcp
Chap 12 tcpChap 12 tcp
Chap 12 tcp
Sparsh Samir
 
CS9222 ADVANCED OPERATING SYSTEMS
CS9222 ADVANCED OPERATING SYSTEMSCS9222 ADVANCED OPERATING SYSTEMS
CS9222 ADVANCED OPERATING SYSTEMS
Kathirvel Ayyaswamy
 
Distributed Transactions(flat and nested) and Atomic Commit Protocols
Distributed Transactions(flat and nested) and Atomic Commit ProtocolsDistributed Transactions(flat and nested) and Atomic Commit Protocols
Distributed Transactions(flat and nested) and Atomic Commit Protocols
Sachin Chauhan
 
TCP - Transmission Control Protocol
TCP - Transmission Control ProtocolTCP - Transmission Control Protocol
TCP - Transmission Control Protocol
Peter R. Egli
 
Multimedia networking
Multimedia networkingMultimedia networking
Multimedia networking
Kikima Jimmy
 
Address resolution protocol (ARP)
Address resolution protocol (ARP)Address resolution protocol (ARP)
Address resolution protocol (ARP)
NetProtocol Xpert
 
Chapter 4 a interprocess communication
Chapter 4 a interprocess communicationChapter 4 a interprocess communication
Chapter 4 a interprocess communication
AbDul ThaYyal
 
Design issues for the layers
Design issues for the layersDesign issues for the layers
Design issues for the layers
jayaprakash
 
Application layer : DNS
Application layer : DNSApplication layer : DNS
Application layer : DNS
Kongu Engineering College, Perundurai, Erode
 
Address resolution protocol
Address resolution protocolAddress resolution protocol
Address resolution protocol
asimnawaz54
 
Distributed Systems
Distributed SystemsDistributed Systems
Distributed Systems
Rupsee
 
Message passing in Distributed Computing Systems
Message passing in Distributed Computing SystemsMessage passing in Distributed Computing Systems
Message passing in Distributed Computing Systems
Alagappa Govt Arts College, Karaikudi
 
Ethernet and token ring
Ethernet and token ringEthernet and token ring
Ethernet and token ring
Abhijeet Shah
 
Dhcp ppt
Dhcp pptDhcp ppt
Dhcp ppt
Hema Dhariwal
 
Inter-Process Communication in distributed systems
Inter-Process Communication in distributed systemsInter-Process Communication in distributed systems
Inter-Process Communication in distributed systems
Aya Mahmoud
 
NFS(Network File System)
NFS(Network File System)NFS(Network File System)
NFS(Network File System)
udamale
 
Osi , tcp/ip protocol and Addressing
Osi , tcp/ip protocol and Addressing Osi , tcp/ip protocol and Addressing
Osi , tcp/ip protocol and Addressing
marwan aldulaimy
 
Distributed objects & components of corba
Distributed objects & components of corbaDistributed objects & components of corba
Distributed objects & components of corba
Mayuresh Wadekar
 
Message Passing, Remote Procedure Calls and Distributed Shared Memory as Com...
Message Passing, Remote Procedure Calls and  Distributed Shared Memory as Com...Message Passing, Remote Procedure Calls and  Distributed Shared Memory as Com...
Message Passing, Remote Procedure Calls and Distributed Shared Memory as Com...
Sehrish Asif
 
CS9222 ADVANCED OPERATING SYSTEMS
CS9222 ADVANCED OPERATING SYSTEMSCS9222 ADVANCED OPERATING SYSTEMS
CS9222 ADVANCED OPERATING SYSTEMS
Kathirvel Ayyaswamy
 
Distributed Transactions(flat and nested) and Atomic Commit Protocols
Distributed Transactions(flat and nested) and Atomic Commit ProtocolsDistributed Transactions(flat and nested) and Atomic Commit Protocols
Distributed Transactions(flat and nested) and Atomic Commit Protocols
Sachin Chauhan
 
TCP - Transmission Control Protocol
TCP - Transmission Control ProtocolTCP - Transmission Control Protocol
TCP - Transmission Control Protocol
Peter R. Egli
 
Multimedia networking
Multimedia networkingMultimedia networking
Multimedia networking
Kikima Jimmy
 
Address resolution protocol (ARP)
Address resolution protocol (ARP)Address resolution protocol (ARP)
Address resolution protocol (ARP)
NetProtocol Xpert
 
Chapter 4 a interprocess communication
Chapter 4 a interprocess communicationChapter 4 a interprocess communication
Chapter 4 a interprocess communication
AbDul ThaYyal
 
Design issues for the layers
Design issues for the layersDesign issues for the layers
Design issues for the layers
jayaprakash
 
Address resolution protocol
Address resolution protocolAddress resolution protocol
Address resolution protocol
asimnawaz54
 
Distributed Systems
Distributed SystemsDistributed Systems
Distributed Systems
Rupsee
 
Ethernet and token ring
Ethernet and token ringEthernet and token ring
Ethernet and token ring
Abhijeet Shah
 

Viewers also liked (7)

RPC: Remote procedure call
RPC: Remote procedure callRPC: Remote procedure call
RPC: Remote procedure call
Sunita Sahu
 
Remote procedure call on client server computing
Remote procedure call on client server computingRemote procedure call on client server computing
Remote procedure call on client server computing
Satya P. Joshi
 
Sun RPC (Remote Procedure Call)
Sun RPC (Remote Procedure Call)Sun RPC (Remote Procedure Call)
Sun RPC (Remote Procedure Call)
Peter R. Egli
 
Introduction to Remote Procedure Call
Introduction to Remote Procedure CallIntroduction to Remote Procedure Call
Introduction to Remote Procedure Call
Abdelrahman Al-Ogail
 
RPC
RPCRPC
RPC
crack_708
 
Inter process communication
Inter process communicationInter process communication
Inter process communication
RJ Mehul Gadhiya
 
Inter Process Communication
Inter Process CommunicationInter Process Communication
Inter Process Communication
Anil Kumar Pugalia
 
RPC: Remote procedure call
RPC: Remote procedure callRPC: Remote procedure call
RPC: Remote procedure call
Sunita Sahu
 
Remote procedure call on client server computing
Remote procedure call on client server computingRemote procedure call on client server computing
Remote procedure call on client server computing
Satya P. Joshi
 
Sun RPC (Remote Procedure Call)
Sun RPC (Remote Procedure Call)Sun RPC (Remote Procedure Call)
Sun RPC (Remote Procedure Call)
Peter R. Egli
 
Introduction to Remote Procedure Call
Introduction to Remote Procedure CallIntroduction to Remote Procedure Call
Introduction to Remote Procedure Call
Abdelrahman Al-Ogail
 
Inter process communication
Inter process communicationInter process communication
Inter process communication
RJ Mehul Gadhiya
 
Ad

Similar to Rpc (Distributed computing) (20)

Network and distributed systems
Network and distributed systemsNetwork and distributed systems
Network and distributed systems
Sri Prasanna
 
Rpc
RpcRpc
Rpc
RAMPRAKASH REDDY ARAVA
 
Rpc
RpcRpc
Rpc
Abhishek Pachisia
 
5. Distributed Operating Systems
5. Distributed Operating Systems5. Distributed Operating Systems
5. Distributed Operating Systems
Dr Sandeep Kumar Poonia
 
Rpc Case Studies (Distributed computing)
Rpc Case Studies (Distributed computing)Rpc Case Studies (Distributed computing)
Rpc Case Studies (Distributed computing)
Sri Prasanna
 
Advanced driver debugging (13005399) copy
Advanced driver debugging (13005399)   copyAdvanced driver debugging (13005399)   copy
Advanced driver debugging (13005399) copy
Burlacu Sergiu
 
Lecture9
Lecture9Lecture9
Lecture9
Sheikh Amjad Zia
 
FMS Administration Seminar
FMS Administration SeminarFMS Administration Seminar
FMS Administration Seminar
Yoss Cohen
 
Cs556 section3
Cs556 section3Cs556 section3
Cs556 section3
farshad33
 
Cs556 section3
Cs556 section3Cs556 section3
Cs556 section3
sehrish saba
 
05 rpc-case studies
05 rpc-case studies05 rpc-case studies
05 rpc-case studies
hushu
 
03 sockets
03 sockets03 sockets
03 sockets
Pavan Illa
 
CocoaConf: The Language of Mobile Software is APIs
CocoaConf: The Language of Mobile Software is APIsCocoaConf: The Language of Mobile Software is APIs
CocoaConf: The Language of Mobile Software is APIs
Tim Burks
 
Remote Procedure Call
Remote Procedure CallRemote Procedure Call
Remote Procedure Call
Nadia Nahar
 
Driver Configuration Webinar
Driver Configuration WebinarDriver Configuration Webinar
Driver Configuration Webinar
AVEVA
 
Chapter 4 communication2
Chapter 4 communication2Chapter 4 communication2
Chapter 4 communication2
DBU
 
Use perl creating web services with xml rpc
Use perl creating web services with xml rpcUse perl creating web services with xml rpc
Use perl creating web services with xml rpc
Johnny Pork
 
layering.pdf
layering.pdflayering.pdf
layering.pdf
BoostHub
 
2.communcation in distributed system
2.communcation in distributed system2.communcation in distributed system
2.communcation in distributed system
Gd Goenka University
 
jkljklj
jkljkljjkljklj
jkljklj
hoefo
 
Network and distributed systems
Network and distributed systemsNetwork and distributed systems
Network and distributed systems
Sri Prasanna
 
Rpc Case Studies (Distributed computing)
Rpc Case Studies (Distributed computing)Rpc Case Studies (Distributed computing)
Rpc Case Studies (Distributed computing)
Sri Prasanna
 
Advanced driver debugging (13005399) copy
Advanced driver debugging (13005399)   copyAdvanced driver debugging (13005399)   copy
Advanced driver debugging (13005399) copy
Burlacu Sergiu
 
FMS Administration Seminar
FMS Administration SeminarFMS Administration Seminar
FMS Administration Seminar
Yoss Cohen
 
Cs556 section3
Cs556 section3Cs556 section3
Cs556 section3
farshad33
 
05 rpc-case studies
05 rpc-case studies05 rpc-case studies
05 rpc-case studies
hushu
 
CocoaConf: The Language of Mobile Software is APIs
CocoaConf: The Language of Mobile Software is APIsCocoaConf: The Language of Mobile Software is APIs
CocoaConf: The Language of Mobile Software is APIs
Tim Burks
 
Remote Procedure Call
Remote Procedure CallRemote Procedure Call
Remote Procedure Call
Nadia Nahar
 
Driver Configuration Webinar
Driver Configuration WebinarDriver Configuration Webinar
Driver Configuration Webinar
AVEVA
 
Chapter 4 communication2
Chapter 4 communication2Chapter 4 communication2
Chapter 4 communication2
DBU
 
Use perl creating web services with xml rpc
Use perl creating web services with xml rpcUse perl creating web services with xml rpc
Use perl creating web services with xml rpc
Johnny Pork
 
layering.pdf
layering.pdflayering.pdf
layering.pdf
BoostHub
 
2.communcation in distributed system
2.communcation in distributed system2.communcation in distributed system
2.communcation in distributed system
Gd Goenka University
 
jkljklj
jkljkljjkljklj
jkljklj
hoefo
 
Ad

More from Sri Prasanna (20)

Qr codes para tech radar
Qr codes para tech radarQr codes para tech radar
Qr codes para tech radar
Sri Prasanna
 
Qr codes para tech radar 2
Qr codes para tech radar 2Qr codes para tech radar 2
Qr codes para tech radar 2
Sri Prasanna
 
assds
assdsassds
assds
Sri Prasanna
 
assds
assdsassds
assds
Sri Prasanna
 
asdsa
asdsaasdsa
asdsa
Sri Prasanna
 
dsd
dsddsd
dsd
Sri Prasanna
 
About stacks
About stacksAbout stacks
About stacks
Sri Prasanna
 
About Stacks
About  StacksAbout  Stacks
About Stacks
Sri Prasanna
 
About Stacks
About  StacksAbout  Stacks
About Stacks
Sri Prasanna
 
About Stacks
About  StacksAbout  Stacks
About Stacks
Sri Prasanna
 
About Stacks
About  StacksAbout  Stacks
About Stacks
Sri Prasanna
 
About Stacks
About  StacksAbout  Stacks
About Stacks
Sri Prasanna
 
About Stacks
About StacksAbout Stacks
About Stacks
Sri Prasanna
 
About Stacks
About StacksAbout Stacks
About Stacks
Sri Prasanna
 
Introduction & Parellelization on large scale clusters
Introduction & Parellelization on large scale clustersIntroduction & Parellelization on large scale clusters
Introduction & Parellelization on large scale clusters
Sri Prasanna
 
Mapreduce: Theory and implementation
Mapreduce: Theory and implementationMapreduce: Theory and implementation
Mapreduce: Theory and implementation
Sri Prasanna
 
Other distributed systems
Other distributed systemsOther distributed systems
Other distributed systems
Sri Prasanna
 
Distributed file systems
Distributed file systemsDistributed file systems
Distributed file systems
Sri Prasanna
 

Recently uploaded (20)

Web and Graphics Designing Training in Rajpura
Web and Graphics Designing Training in RajpuraWeb and Graphics Designing Training in Rajpura
Web and Graphics Designing Training in Rajpura
Erginous Technology
 
Into The Box Conference Keynote Day 1 (ITB2025)
Into The Box Conference Keynote Day 1 (ITB2025)Into The Box Conference Keynote Day 1 (ITB2025)
Into The Box Conference Keynote Day 1 (ITB2025)
Ortus Solutions, Corp
 
TrsLabs - Fintech Product & Business Consulting
TrsLabs - Fintech Product & Business ConsultingTrsLabs - Fintech Product & Business Consulting
TrsLabs - Fintech Product & Business Consulting
Trs Labs
 
Electronic_Mail_Attacks-1-35.pdf by xploit
Electronic_Mail_Attacks-1-35.pdf by xploitElectronic_Mail_Attacks-1-35.pdf by xploit
Electronic_Mail_Attacks-1-35.pdf by xploit
niftliyevhuseyn
 
Andrew Marnell: Transforming Business Strategy Through Data-Driven Insights
Andrew Marnell: Transforming Business Strategy Through Data-Driven InsightsAndrew Marnell: Transforming Business Strategy Through Data-Driven Insights
Andrew Marnell: Transforming Business Strategy Through Data-Driven Insights
Andrew Marnell
 
Top 10 IT Help Desk Outsourcing Services
Top 10 IT Help Desk Outsourcing ServicesTop 10 IT Help Desk Outsourcing Services
Top 10 IT Help Desk Outsourcing Services
Infrassist Technologies Pvt. Ltd.
 
Social Media App Development Company-EmizenTech
Social Media App Development Company-EmizenTechSocial Media App Development Company-EmizenTech
Social Media App Development Company-EmizenTech
Steve Jonas
 
Manifest Pre-Seed Update | A Humanoid OEM Deeptech In France
Manifest Pre-Seed Update | A Humanoid OEM Deeptech In FranceManifest Pre-Seed Update | A Humanoid OEM Deeptech In France
Manifest Pre-Seed Update | A Humanoid OEM Deeptech In France
chb3
 
Splunk Security Update | Public Sector Summit Germany 2025
Splunk Security Update | Public Sector Summit Germany 2025Splunk Security Update | Public Sector Summit Germany 2025
Splunk Security Update | Public Sector Summit Germany 2025
Splunk
 
Procurement Insights Cost To Value Guide.pptx
Procurement Insights Cost To Value Guide.pptxProcurement Insights Cost To Value Guide.pptx
Procurement Insights Cost To Value Guide.pptx
Jon Hansen
 
Are Cloud PBX Providers in India Reliable for Small Businesses (1).pdf
Are Cloud PBX Providers in India Reliable for Small Businesses (1).pdfAre Cloud PBX Providers in India Reliable for Small Businesses (1).pdf
Are Cloud PBX Providers in India Reliable for Small Businesses (1).pdf
Telecoms Supermarket
 
Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...
Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...
Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...
Noah Loul
 
ThousandEyes Partner Innovation Updates for May 2025
ThousandEyes Partner Innovation Updates for May 2025ThousandEyes Partner Innovation Updates for May 2025
ThousandEyes Partner Innovation Updates for May 2025
ThousandEyes
 
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc
 
Increasing Retail Store Efficiency How can Planograms Save Time and Money.pptx
Increasing Retail Store Efficiency How can Planograms Save Time and Money.pptxIncreasing Retail Store Efficiency How can Planograms Save Time and Money.pptx
Increasing Retail Store Efficiency How can Planograms Save Time and Money.pptx
Anoop Ashok
 
TrsLabs Consultants - DeFi, WEb3, Token Listing
TrsLabs Consultants - DeFi, WEb3, Token ListingTrsLabs Consultants - DeFi, WEb3, Token Listing
TrsLabs Consultants - DeFi, WEb3, Token Listing
Trs Labs
 
Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...
Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...
Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...
Aqusag Technologies
 
Generative Artificial Intelligence (GenAI) in Business
Generative Artificial Intelligence (GenAI) in BusinessGenerative Artificial Intelligence (GenAI) in Business
Generative Artificial Intelligence (GenAI) in Business
Dr. Tathagat Varma
 
Semantic Cultivators : The Critical Future Role to Enable AI
Semantic Cultivators : The Critical Future Role to Enable AISemantic Cultivators : The Critical Future Role to Enable AI
Semantic Cultivators : The Critical Future Role to Enable AI
artmondano
 
Unlocking the Power of IVR: A Comprehensive Guide
Unlocking the Power of IVR: A Comprehensive GuideUnlocking the Power of IVR: A Comprehensive Guide
Unlocking the Power of IVR: A Comprehensive Guide
vikasascentbpo
 
Web and Graphics Designing Training in Rajpura
Web and Graphics Designing Training in RajpuraWeb and Graphics Designing Training in Rajpura
Web and Graphics Designing Training in Rajpura
Erginous Technology
 
Into The Box Conference Keynote Day 1 (ITB2025)
Into The Box Conference Keynote Day 1 (ITB2025)Into The Box Conference Keynote Day 1 (ITB2025)
Into The Box Conference Keynote Day 1 (ITB2025)
Ortus Solutions, Corp
 
TrsLabs - Fintech Product & Business Consulting
TrsLabs - Fintech Product & Business ConsultingTrsLabs - Fintech Product & Business Consulting
TrsLabs - Fintech Product & Business Consulting
Trs Labs
 
Electronic_Mail_Attacks-1-35.pdf by xploit
Electronic_Mail_Attacks-1-35.pdf by xploitElectronic_Mail_Attacks-1-35.pdf by xploit
Electronic_Mail_Attacks-1-35.pdf by xploit
niftliyevhuseyn
 
Andrew Marnell: Transforming Business Strategy Through Data-Driven Insights
Andrew Marnell: Transforming Business Strategy Through Data-Driven InsightsAndrew Marnell: Transforming Business Strategy Through Data-Driven Insights
Andrew Marnell: Transforming Business Strategy Through Data-Driven Insights
Andrew Marnell
 
Social Media App Development Company-EmizenTech
Social Media App Development Company-EmizenTechSocial Media App Development Company-EmizenTech
Social Media App Development Company-EmizenTech
Steve Jonas
 
Manifest Pre-Seed Update | A Humanoid OEM Deeptech In France
Manifest Pre-Seed Update | A Humanoid OEM Deeptech In FranceManifest Pre-Seed Update | A Humanoid OEM Deeptech In France
Manifest Pre-Seed Update | A Humanoid OEM Deeptech In France
chb3
 
Splunk Security Update | Public Sector Summit Germany 2025
Splunk Security Update | Public Sector Summit Germany 2025Splunk Security Update | Public Sector Summit Germany 2025
Splunk Security Update | Public Sector Summit Germany 2025
Splunk
 
Procurement Insights Cost To Value Guide.pptx
Procurement Insights Cost To Value Guide.pptxProcurement Insights Cost To Value Guide.pptx
Procurement Insights Cost To Value Guide.pptx
Jon Hansen
 
Are Cloud PBX Providers in India Reliable for Small Businesses (1).pdf
Are Cloud PBX Providers in India Reliable for Small Businesses (1).pdfAre Cloud PBX Providers in India Reliable for Small Businesses (1).pdf
Are Cloud PBX Providers in India Reliable for Small Businesses (1).pdf
Telecoms Supermarket
 
Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...
Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...
Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...
Noah Loul
 
ThousandEyes Partner Innovation Updates for May 2025
ThousandEyes Partner Innovation Updates for May 2025ThousandEyes Partner Innovation Updates for May 2025
ThousandEyes Partner Innovation Updates for May 2025
ThousandEyes
 
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc
 
Increasing Retail Store Efficiency How can Planograms Save Time and Money.pptx
Increasing Retail Store Efficiency How can Planograms Save Time and Money.pptxIncreasing Retail Store Efficiency How can Planograms Save Time and Money.pptx
Increasing Retail Store Efficiency How can Planograms Save Time and Money.pptx
Anoop Ashok
 
TrsLabs Consultants - DeFi, WEb3, Token Listing
TrsLabs Consultants - DeFi, WEb3, Token ListingTrsLabs Consultants - DeFi, WEb3, Token Listing
TrsLabs Consultants - DeFi, WEb3, Token Listing
Trs Labs
 
Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...
Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...
Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...
Aqusag Technologies
 
Generative Artificial Intelligence (GenAI) in Business
Generative Artificial Intelligence (GenAI) in BusinessGenerative Artificial Intelligence (GenAI) in Business
Generative Artificial Intelligence (GenAI) in Business
Dr. Tathagat Varma
 
Semantic Cultivators : The Critical Future Role to Enable AI
Semantic Cultivators : The Critical Future Role to Enable AISemantic Cultivators : The Critical Future Role to Enable AI
Semantic Cultivators : The Critical Future Role to Enable AI
artmondano
 
Unlocking the Power of IVR: A Comprehensive Guide
Unlocking the Power of IVR: A Comprehensive GuideUnlocking the Power of IVR: A Comprehensive Guide
Unlocking the Power of IVR: A Comprehensive Guide
vikasascentbpo
 

Rpc (Distributed computing)

  • 1. Remote Procedure Calls Paul Krzyzanowski [email_address] [email_address] Distributed Systems Except as otherwise noted, the content of this presentation is licensed under the Creative Commons Attribution 2.5 License.
  • 2. Problems with sockets Sockets interface is straightforward [connect] read/write [disconnect] BUT … it forces read/write mechanism We usually use a procedure call To make distributed computing look more like centralized: I/O is not the way to go
  • 3. RPC 1984: Birrell & Nelson Mechanism to call procedures on other machines Remote Procedure Call Goal: it should appear to the programmer that a normal call is taking place
  • 4. How do regular procedure calls work in programming languages?
  • 5. Regular procedure calls Machine instructions for call & return but the compiler really makes the procedure call abstraction work: Parameter passing Local variables Return data
  • 6. Regular procedure calls You write: x = f(a, “test”, 5); The compiler parses this and generates code to: Push the value 5 on the stack Push the address of the string “test” on the stack Push the current value of a on the stack Generate a call to the function f In compiling f, the compiler generates code to: Push registers that will be clobbered on the stack to save the values Adjust the stack to make room for local and temporary variables Before a return, unadjust the stack, put the return data in a register, and issue a return instruction
  • 7. Implementing RPC No architectural support for remote procedure calls Simulate it with tools we have (local procedure calls) Simulation makes RPC a language-level construct instead of an operating system construct
  • 8. Implementing RPC The trick: Create stub functions to make it appear to the user that the call is local Stub function contains the function’s interface
  • 9. Stub functions network routines server functions server stub (skeleton) network routines 1. Client calls stub (params on stack) client functions client stub client server
  • 10. Stub functions server functions server stub (skeleton) network routines 2. Stub marshals params to net message client functions client stub network routines client server
  • 11. Stub functions 3. Network message sent to server client functions client stub network routines server functions server stub (skeleton) network routines client server
  • 12. Stub functions 4. Receive message: send to stub client functions client stub network routines server functions server stub (skeleton) network routines client server
  • 13. Stub functions 5. Unmarshal parameters, call server func client functions client stub network routines server functions server stub (skeleton) network routines client server
  • 14. Stub functions 6. Return from server function client functions client stub network routines server functions server stub (skeleton) network routines client server
  • 15. Stub functions 7. Marshal return value and send message client functions client stub network routines server functions server stub (skeleton) network routines client server
  • 16. Stub functions 8. Transfer message over network client functions client stub network routines server functions server stub (skeleton) network routines client server
  • 17. Stub functions 9. Receive message: direct to stub client functions client stub network routines server functions server stub (skeleton) network routines client server
  • 18. Stub functions 10. Unmarshal return, return to client code client functions client stub network routines server functions server stub (skeleton) network routines client server
  • 19. Benefits Procedure call interface Writing applications is simplified RPC hides all network code into stub functions Application programmers don’t have to worry about details Sockets, port numbers, byte ordering RPC: presentation layer in OSI model
  • 21. Parameter passing Pass by value Easy: just copy data to network message Pass by reference Makes no sense without shared memory
  • 22. Pass by reference? Copy items referenced to message buffer Ship them over Unmarshal data at server Pass local pointer to server stub function Send new values back To support complex structures Copy structure into pointerless representation Transmit Reconstruct structure with local pointers on server
  • 23. Representing data No such thing as incompatibility problems on local system Remote machine may have: Different byte ordering Different sizes of integers and other types Different floating point representations Different character sets Alignment requirements
  • 24. Representing data 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 main() { unsigned int n; char *a = (char *)&n; n = 0x11223344; printf("%02x, %02x, %02x, %02x\n", a[0], a[1], a[2], a[3]); } Output on a Pentium: 44, 33, 22, 11 Output on a PowerPC: 11, 22, 33, 44
  • 25. Representing data Need standard encoding to enable communication between heterogeneous systems e.g. Sun’s RPC uses XDR (eXternal Data Representation) ASN.1 (ISO Abstract Syntax Notation)
  • 26. Representing data Implicit typing only values are transmitted, not data types or parameter info e.g., Sun XDR Explicit typing Type is transmitted with each value e.g., ISO’s ASN.1, XML
  • 27. Where to bind? Need to locate host and correct server process
  • 28. Where to bind? – Solution 1 Maintain centralized DB that can locate a host that provides a particular service (Birrell & Nelson’s 1984 proposal)
  • 29. Where to bind? – Solution 2 A server on each host maintains a DB of locally provided services Solution 1 is problematic for Sun NFS – identical file servers serve different file systems
  • 30. Transport protocol Which one? Some implementations may offer only one (e.g. TCP) Most support several Allow programmer (or end user) to choose
  • 31. When things go wrong Local procedure calls do not fail If they core dump, entire process dies More opportunities for error with RPC: Transparency breaks here Applications should be prepared to deal with RPC failure
  • 32. When things go wrong Semantics of remote procedure calls Local procedure call: exactly once A remote procedure call may be called: 0 times: server crashed or server process died before executing server code 1 time: everything worked well 1 or more: excess latency or lost reply from server and client retransmission
  • 33. RPC semantics Most RPC systems will offer either: at least once semantics or at most once semantics Understand application: idempotent functions: may be run any number of times without harm non-idempotent functions: side-effects
  • 34. More issues Performance RPC is slower … a lot slower Security messages visible over network Authenticate client Authenticate server
  • 35. Programming with RPC Language support Most programming languages (C, C++, Java, …) have no concept of remote procedure calls Language compilers will not generate client and server stubs Common solution: Use a separate compiler to generate stubs (pre-compiler)
  • 36. Interface Definition Language Allow programmer to specify remote procedure interfaces (names, parameters, return values) Pre-compiler can use this to generate client and server stubs: Marshaling code Unmarshaling code Network transport routines Conform to defined interface Similar to function prototypes
  • 37. RPC compiler IDL client code (main) server functions RPC compiler client stub headers server skeleton data conv. data conv. compiler compiler server client Code you write Code RPC compiler generates
  • 38. Writing the program Client code has to be modified Initialize RPC-related options Transport type Locate server/service Handle failure of remote procedure call Server functions Generally need little or no modification
  • 39. RPC API What kind of services does an RPC system need? Name service operations Export/lookup binding information (ports, machines) Support dynamic ports Binding operations Establish client/server communications using appropriate protocol (establish endpoints) Endpoint operations Listen for requests, export endpoint to name server
  • 40. RPC API What kind of services does an RPC system need? Security operations Authenticate client/server Internationalization operations Marshaling/data conversion operations Stub memory management Dealing with “reference” data, temporary buffers Program ID operations Allow applications to access IDs of RPC interfaces