date
slug
status
tags
summary
type
Implementing Remote Procedure Calls
Basic Idea of RPC
- use procedure call to achieve network communication
Goals
- programmability
- identical semantics as local procedure calls
- efficiency
- security
- generality: applications, hardware, programming language agnostic
RPC Overview

- support many data types(use serialization to support complex data types)
- layer of indirection: applications implemented in different languages, run on different hardware could communicate via RPC
Optimizations
Transport Protocols
- piggyback ACKs with response data
- synchronous
Processes
- use a pool of idle processes to serve RPC requests, avoiding process creation and teardown cost
Connection Management
- no explicit setup or teardown, client need to bind before use
Binding
- query grapevine database to bind at runtime
Exceptions and errors
- independent failures (client or server or network may fail)
RPC Today
- datacenters: gRPC, thrift
- HTTP
Summary
- RPC make remote functionality looks like it is local
- performance optimization
- stub, binding
Eliminating Receive Livelock in an Interrupt-driven Kernel
Targeted Applications
- packet processing: routing, firewall, VPN, load balancer
- services via networks
- streaming applications
- network monitoring
Their common properties: high rated, no flow control
Network Stack
- NIC → network driver → network thread → applications
Receive Livelock
- overloaded system spend all time handling interrupts

Alternative Approach: Polling
- software checks for new packets
Polling | Interrupts |
can achieve fairness because the processing is controlled | work is proportional to load (efficient at low load) |
high overhead when load is low | can have receive livelock |
have control on I/O processing | ㅤ |
Solutions: Hybrid Approach
- interrupt when new packets arrive and polling to collect a batch of packets
- remove a layer of queues, processing packets all the way down
- round robin scheduling on tasks
- reserve a portion of cpu time for applications
Summary
- the idea of receive livelock
- hybrid approach with polling & interrupts
- drop tasks ASAP when overloaded
- Author:Lifan Sun
- URL:stevensun.site/article/cse221-lec16
- Copyright:All articles in this blog, except for special statements, adopt BY-NC-SA agreement. Please indicate the source!
Relate Posts
CSE221 - lec18: File System Cont. : GFS

CSE221 - lec17: Networking: IX & Snap

CSE221 - lec15: Scalability: RCU & Analysis of Linux Scalability

CSE221 - lec14: Scheduling:Scheduler Activation & Decades of Wasted Cores

CSE221 - lec13: File System Consistency: Soft Updates & Split FS

CSE221 - lec12: File System: FFS & LFS
