Operating System
OS Part-1
OS Part-2
- File Concepts and Access methods
- Free Space Management and Allocation methods
- Directory Systems and Protection
- File Organization, Sharing and Implementation issues
- Disk and Drum Scheduling
- I/O Devices Organisation & I/O Buffering
- I/O Hardware, Kernel I/O subsystem and Transforming I/O Requests to Hardware Operations
- Device Drivers and Path Management
- Device Driver Sub Modules and Procedure
- Device Scheduler and Handler
- Interrupt Service Routine (ISR)
- File System in Linux and Windows
OS Part-3
- Process and Process Control Block(PCB)
- Process Scheduling( Preemptive and Non Preemptive)
- Scheduling Algorithms
- Algorithm Evaluation
- Multiple Processor Scheduling
- Real Time Scheduling
- Operations on Processes
- Threads
- Inter-Process Communication
- Precedence Graphs
- Critical Section Problem
- Semaphores
- Classical Problems of Synchronization
- DeadLock
- Deadlock Prevention and Avoidance
- Deadlock Detection and Recovery
- Process Management in Linux
OS Part-4
- Memory Hierarchy in OS
- Concepts of Memory Management
- MFT and MVT
- Logical and Physical Address Space
- Swapping
- Contiguous and Non Contiguous Memory Allocation
- Paging
- Segmentation
- Paging Combined with Segmentation
- Structure and Implementation of Page Table
- Virtual Memory in OS
- Cache Memory Organization
- Demand Paging
- Page Replacement Algorithms
- Allocation of Frames and Thrashing
- Demand Segmentation
OS Part-5
- Distributed Operating System: Introduction and Types
- Distributed OS: Design Issues
- Distributed OS: File System
- Distributed OS: Remote File Access
- Remote Procedure Call(RPC)
- Remote Method Invocation(RMI)
- Distributed Shared Memory
- Parallel Processing and Concurrent Programming
- Security and Threats Protection in Distributed OS
- Security Design Principles and Authentication in Distributed OS
- Sensor Network and Parallel OS
Distributed Operating System: Remote Procedure Call (RPC)
Introduction
Remote Procedure Call (RPC) ek communication technique hai jo distributed systems me use hoti hai. Ye allow karta hai ki ek program remotely kisi doosre system ke procedure ko call kar sake bina uski implementation ki details jaane. RPC client-server model par kaam karta hai jisme ek process (client) remotely doosri process (server) ke function ko invoke karta hai jaise wo local function ho.
RPC ka real-world example hai Google Drive Sync, jisme ek client request karta hai remote Google server se file sync karne ke liye bina uski internal working ko samjhe.
How RPC Works?
Jab ek client RPC ka use karta hai to wo local function call karne jaisa lagta hai, lekin uska execution remotely hota hai. Is process me stubs aur marshalling ka use hota hai taaki remote function calls efficiently process ho sakein.
Diagram:
Client Process Server Process
+------+ +------+
| |Request Procedure| |
|Client| --------------> |Server|
| | | |
| | Return Result | |
| | <-------------- | |
+------+ +------+
Steps of RPC Execution:
Client function ek remote procedure ko call karta hai.
Client stub procedure ko serialize karta hai (marshalling) aur network ke through bhejta hai.
Server stub request receive karta hai, unmarshalling karta hai aur procedure execute karta hai.
Server function ka result wapas server stub ko bhejta hai.
Server stub result ko marshall karke network ke through client stub ko send karta hai.
Client stub unmarshalling karke client process ko result return karta hai.
Components of RPC
RPC system ke different components hote hain jo communication establish karte hain:
1. Client Process
Ye remote function ko call karta hai.
Client stub function ko initiate karta hai.
2. Client Stub
Function call ko network me send karne ke liye convert karta hai (marshalling).
Server se response receive karke result client ko return karta hai.
3. RPC Runtime
Ye communication module hai jo client aur server ke beech data transfer karta hai.
4. Server Stub
Request ko receive karke usko unmarshall karta hai.
Server procedure ko execute karata hai aur result wapas send karta hai.
5. Server Process
Remote function ka actual execution yahan hota hai.
Diagram Representing Components of RPC:
+-------+ +------+ +------+ +-------+
|Client |--->|Client|--->|Server|--->|Server |
|Process| | Stub | | Stub | |Process|
+-------+ +------+ +------+ +-------+
Types of RPC
RPC ko execution ke tareeke ke basis par different types me divide kiya jata hai:
1. Synchronous RPC
Client ek request bhejta hai aur response aane tak wait karta hai.
Example: Banking Transactions jisme ek transaction complete hone tak agli request nahi bheji jati.
2. Asynchronous RPC
Client request bhejta hai aur bina wait kiye next task execute karta hai.
Example: Email Services, jisme mail bhejne ke baad user doosra kaam kar sakta hai.
Advantages of RPC
Transparency: Remote function call bilkul local function jaisa lagta hai.
Modularity: Client aur server alag-alag design kiye ja sakte hain.
Efficiency: Network latency ko kam karne ke liye optimized stubs ka use hota hai.
Language Independent: C, Java, Python jaise alag-alag languages RPC ko support karti hain.
Challenges in RPC
Network Latency: Slow network hone par remote function calls slow ho sakti hain.
Failure Handling: Agar server crash ho jaye to client ko response nahi milega.
Security Issues: Data transmission me unauthorized access ka risk hota hai, isliye encryption ka use zaroori hai.
Compatibility: Different systems aur architectures ke beech RPC communication kaafi complex ho sakta hai.
Examples of RPC in Real World
System | Description |
---|---|
Google Drive Sync | Remote function calls ka use karke file synchronization karta hai. |
Remote Desktop Protocol (RDP) | Ek system remotely doosre system ko access kar sakta hai. |
Network File System (NFS) | Remote file sharing ke liye RPC ka use hota hai. |
Database Systems (MySQL, PostgreSQL) | Remote queries execute karne ke liye RPC architecture ka use hota hai. |
Security in RPC
Remote communication me security critical hoti hai. Isliye RPC Secure (RPCSEC) jaise protocols ka use hota hai.
Authentication: User verification ke liye login system ka use hota hai.
Encryption: Data transfer me security ensure karne ke liye SSL/TLS encryption ka use hota hai.
Access Control: Client ko sirf authorized functions access karne ki permission hoti hai.
Conclusion
RPC ek powerful communication mechanism hai jo distributed systems me client aur server ke beech seamless interaction provide karta hai. Ye system ko efficient, modular aur scalable banata hai.