|
1 | | -* Homa Protocol Synopsis |
| 1 | +# Homa Protocol Synopsis |
2 | 2 |
|
3 | | -This file contains a terse summary of the Homa protocol as implemented |
4 | | -by this Linux driver. |
| 3 | +This file contains a terse summary of the packet protocol used by this |
| 4 | +driver for communication between client and server machines. |
| 5 | + |
| 6 | +## Basics |
| 7 | +Homa implements RPCs (remote procedure calls), in which a client sends |
| 8 | +a *request message* to a server, the server carries out an operation |
| 9 | +described in the request message, and then the server returns a |
| 10 | +*response message* to the client. Each message contains one or more |
| 11 | +packets of data. |
| 12 | + |
| 13 | +## Packet types |
| 14 | +Homa supports the following packet types; for complete details, see the |
| 15 | +declarations in homa_impl.h. |
| 16 | + |
| 17 | +**DATA**: contains a contiguous range of bytes from a message, along with |
| 18 | +additional metadata such as the total length of the message, and the |
| 19 | +total number of bytes of the message that the sender will transmit |
| 20 | +without additional grants. |
| 21 | + |
| 22 | +**GRANT**: sent by receivers to authorize senders to send additional |
| 23 | +bytes of the message. Contains the total number of bytes of the message |
| 24 | +the sender is now permitted to transmit, along with the priority to use in |
| 25 | +any future DATA packets for this message. |
| 26 | + |
| 27 | +**RESEND**: sent by receivers to request that the sender retransmit a |
| 28 | +given range of bytes of the message; also includes the priority to use |
| 29 | +for the retransmitted data. |
| 30 | + |
| 31 | +**UNKNOWN**: sent by either sender or receiver when it receives |
| 32 | +a packet for an RPC that is unknown to it. |
| 33 | + |
| 34 | +**BUSY**: sent as a response to a RESEND packet when the sender is not |
| 35 | +willing to transmit data for this message right now (e.g. because it has |
| 36 | +other higher-priority messages to transmit). Used to prevent timeouts. |
| 37 | + |
| 38 | +**CUTOFFS**: contains new values for the priority cutoffs the recipient |
| 39 | +should use when sending unscheduled bytes. |
| 40 | + |
| 41 | +**FREEZE**: used for debugging and performance analysis: causes the |
| 42 | +recipient to freeze its timetrace. |
| 43 | + |
| 44 | +**NEED_ACK**: sent by servers to ask that a client explicitly acknowledge |
| 45 | +receipt of the response for an RPC. |
| 46 | + |
| 47 | +**ACK**: sent by a client to acknowledge that it has received responses |
| 48 | +for one or more RPCs, so the server can discard its state for that RPC. |
| 49 | + |
| 50 | +## Basics of an RPC |
| 51 | +When a client wishes to initiate an RPC, it transmits the request message to the |
| 52 | +RPC's server using one or more DATA packets. A client is allowed to transmit |
| 53 | +the first bytes of a message unilaterally, without permission; these bytes are |
| 54 | +called *unscheduled bytes*. After that, additional packets may only be |
| 55 | +transmitted when authorized by GRANT packets received from the server. The |
| 56 | +number of unscheduled bytes is determined by the `rtt_bytes` configuration |
| 57 | +parameter; its value is normally chosen so that by the time all of the unscheduled |
| 58 | +bytes have been transmitted, there will have been enough time for the first |
| 59 | +DATA packet to have reached the receiver and for it to have returned a |
| 60 | +GRANT packet. This means that a single message can consume the entire |
| 61 | +link bandwidth of the sender if the system is unloaded. If the number of |
| 62 | +unscheduled bytes does not represent an integral number of full DATA packets, it is |
| 63 | +rounded up to the next full packet boundary; likewise for grants. |
| 64 | + |
| 65 | +Once the server has received the request, it passes that message up to |
| 66 | +the application. Eventually the application returns a response message, |
| 67 | +which the server transmits back to the client using the same protocol |
| 68 | +as for the request. |
| 69 | + |
| 70 | +## Retransmission |
| 71 | +Retransmission is driven by the receiver of a message (the server for requests |
| 72 | +and the client for responses). If a timeout period elapses during which the |
| 73 | +receiver has |
0 commit comments