Consistent terminology: Cell, Envelope, Message
This comes from discussions on arti#775 (closed) and arti!1839 (merged) . Briefly, we want to standardize our terminology so that we do not mix up different types of object, or get confused about what we are encoding and decoding.
Here is what I think we have settled on:
- A cell is always what we send over a channel. So for example, there can be a "CREATE2 cell" or a "NETINFO cell" or a "RELAY cell", but never a "BEGIN cell" or a "DATA cell" (since those are messages.)
- A "
RELAY
cell" is one whose command field is 3 (that is,RELAY
). - A "
RELAY_EARLY
cell" is one whose command field is 9 (that is,RELAY_EARLY
). - A "relay cell" is a
RELAY
cell or aRELAY_EARLY
cell.
- A "
- A message or relay message is always what we send over a circuit, encoded in a series of relay cells. We can say "
BEGIN
messages" and "DATA
messages", but never "CREATE
messages" or "NETINFO
messages".- When we refer to a "message", we are not including its
stream_id
.
- When we refer to a "message", we are not including its
- When we want to refer to a message plus its (optional)
stream_id
, we call that an message envelope.
In terms of relationships:
- Some cells are relay cells. Some are not.
- All relay cells are used to encode message envelopes.
- Before prop340, there was a 1:1 relationship between relay cells and message envelopes.
- After prop340, there will be an m:n relationship between relay cells and message envelopes.
- Every message envelopes holds exactly one message. Some message envelopes additionally hold a stream_id.
I'll start making these edits after making sure that everybody agrees. I'll also rename the relevant objects in arti again.
Edited by Nick Mathewson