# A Receiver-Driven Low-Latency Transport Protocol

## Homa – A Receiver-Driven Low-Latency Transport Protocol Using Network Priorities

### 0x00 引言

In simulations, Homa’s latency is roughly equal to pFabric and significantly better than pHost, PIAS, and NDP for almost all message sizes and workloads. Homa can also sustain higher network loads than pFabric, pHost, or PIAS.
-----
Our implementation of Homa achieves 99th percentile round trip latencies less than 15 μs for small messages at 80% network load with 10 Gbps link speeds, and it does this even in the presence of competing large messages. Across a wide range of message sizes and work- loads, Homa achieves 99th percentile latencies at 80% network load that are within a factor of 2–3.5x of the minimum possible latency on an unloaded network.


Homa倾向于为short messages设计。

### 0x01 KEY IDEAS

Homa的设计有4个key design principles ：

(i) transmitting short messages blindly;

(ii) using in-network priorities;

(iii) allocating priorities dynamically at receivers in conjunction with receiver-driven rate control;



Homa这么设计出于一下的考虑：

1. There is no time to schedule every packet.


2. Buffering is a necessary evil.


3. In-network priorities are a must.


4. Making best use of limited priorities requires receiver control.


5. Receivers must allocate priorities dynamically.


6. Receivers must overcommit their downlink in a controlled manner.


7. Senders need SRPT(shortest remaining processing time first) also.


### 0x02 基本设计

Homa有以下特点：

Homa contains several unusual features:
it is message-oriented, rather than stream-oriented;
it is connectionless;
it uses no explicit acknowledgments;
and it implements at-least-once semantics, rather than the more traditional at-most-once semantics.


#### RPCs, not connections

Homa是无连接的，一个来讲client的request message 对应一个来自server的 response message。由一个全局唯一的RPCid表示(id由客户端生成)。有以下的packet类型：

#### Packet priorities

The most novel feature in Homa, and the key to its performance, is its use of priorities. Each receiver determines the priorities for all of its incoming DATA packets in order to approximate the SRPT policy. It uses different mechanisms for unscheduled and scheduled packets.


#### Lost packets

Homa认为包丢失是概率很小的事件。主要关注2种类型的包丢失：

corruption in the network, and buffer overflow


 Receivers use a simple timeout-based mechanism to detect lost packets. If a long time period (a few milliseconds) elapses without additional packets arriving for a message, the receiver sends a RESEND packet that identifies the first range of missing bytes; the sender will then retransmit those bytes.


#### At-least-once semantics

Homa实现的语义是至少一次，我们知道至少一次的基本套路就是一直重试到收到确认为止。Homa又是为RPC设计的，那Homa是如何处理被多次执行的呢？答案很简单粗暴：

Homa assumes that higher level software will either tolerate redundant executions of RPCs or filter them out.


### 0x03 LIMITATIONS

Paper还很罕见的讨论了这个协议的缺点(暴露自己缺点的paper很少见啊)，我们从之前的内容中也可以发现，Homa协议是建立在很多的假设上的，这也让我对其实际的可用性造成了很大的怀疑，它更加像一个在特定的环境下为特定的应用设计的传输协议，没有通用型可言:

  Homa is designed for use in datacenter networks and capital- izes on the properties of those networks; it is unlikely to work well in wide-area networks.
Homa assumes that congestion occurs primarily at host down- links, not in the core of the network. Homa assumes per-packet spraying to ensure load balancing across core links, combined with sufficient overall capacity. .... We hypothesize that congestion in the core of datacenter networks will be uncommon because it will not be cost-effective. ...
...
Homa also assumes a single implementation of the protocol for each host-TOR link, such as in an operating system kernel running on bare hardware, so that Homa is aware of all incoming and outgoing traffic.
...
Homa assumes that the most severe forms of incast are pre- dictable because they are self-inflicted by outgoing RPCs;


## 参考

1. Homa: A Receiver-Driven Low-Latency Transport Protocol Using Network Priorities, SIGCOMM 2018;