From 3a3efa401424a05e1da780119a14001cf0a5560c Mon Sep 17 00:00:00 2001 From: Nick Mathewson Date: Wed, 14 Feb 2024 08:10:28 -0500 Subject: Use abbrevs to compress relay command table a bit more --- spec/tor-spec/relay-cells.md | 82 +++++++++++++++++++++++--------------------- 1 file changed, 42 insertions(+), 40 deletions(-) diff --git a/spec/tor-spec/relay-cells.md b/spec/tor-spec/relay-cells.md index 3fabbcc..a665c4f 100644 --- a/spec/tor-spec/relay-cells.md +++ b/spec/tor-spec/relay-cells.md @@ -32,41 +32,41 @@ enveloped relay message, encoded as follows: The relay commands are: -| Command | Identifier | Direction | Control? -| ------- | ---------- | --------- | -------- -| 1 | BEGIN | forward | -| 2 | DATA | forward or backward | -| 3 | END | forward or backward | -| 4 | CONNECTED | backward | -| 5 | SENDME | forward or backward | sometimes control -| 6 | EXTEND | forward | control -| 7 | EXTENDED | backward | control -| 8 | TRUNCATE | forward | control -| 9 | TRUNCATED | backward | control -| 10 | DROP | forward or backward | control -| 11 | RESOLVE | forward | -| 12 | RESOLVED | backward | -| 13 | BEGIN_DIR | forward | -| 14 | EXTEND2 | forward | control -| 15 | EXTENDED2 | backward | control -| 16..18 | Reserved for UDP; Not yet in use, see [prop339]. -| 19 | CONFLUX_LINK | forward | control -| 20 | CONFLUX_LINKED | backward | control -| 21 | CONFLUX_LINKED_ACK | forward | control -| 22 | CONFLUX_SWITCH | forward or backward | control -| 32 | ESTABLISH_INTRO | forward | control -| 33 | ESTABLISH_RENDEZVOUS | forward | control -| 34 | INTRODUCE1 | forward | control -| 35 | INTRODUCE2 | backward | control -| 36 | RENDEZVOUS1 | forward | control -| 37 | RENDEZVOUS2 | backward | control -| 38 | INTRO_ESTABLISHED | backward | control -| 39 | RENDEZVOUS_ESTABLISHED | backward | control -| 40 | INTORDUCE_ACK | backward | control -| 41 | PADDING_NEGOTIATE | forward | control -| 42 | PADDING_NEGOTIATED | backward | control -| 43 | XON (See Sec 4 of [prop324]) | forward or backward | -| 44 | XOFF (See Sec 4 of [prop324]) | forward or backward | +| Command | Identifier | Type +| ------- | ---------- | ---- +| 1 | BEGIN | **F** +| 2 | DATA | **F**/**B** +| 3 | END | **F**/**B** +| 4 | CONNECTED | **B** +| 5 | SENDME | **F**/**B**, **C?** +| 6 | EXTEND | **F**, **C** +| 7 | EXTENDED | **B**, **C** +| 8 | TRUNCATE | **F**, **C** +| 9 | TRUNCATED | **B**, **C** +| 10 | DROP | **F**/**B**, **C** +| 11 | RESOLVE | **F** +| 12 | RESOLVED | **B** +| 13 | BEGIN_DIR | **F** +| 14 | EXTEND2 | **F**, **C** +| 15 | EXTENDED2 | **B**, **C** +| 16..18 | Reserved; see [prop339]. +| 19 | CONFLUX_LINK | **F**, **C** +| 20 | CONFLUX_LINKED | **B**, **C** +| 21 | CONFLUX_LINKED_ACK | **F**, **C** +| 22 | CONFLUX_SWITCH | **F**/**B**, **C** +| 32 | ESTABLISH_INTRO | **F**, **C** +| 33 | ESTABLISH_RENDEZVOUS | **F**, **C** +| 34 | INTRODUCE1 | **F**, **C** +| 35 | INTRODUCE2 | **B**, **C** +| 36 | RENDEZVOUS1 | **F**, **C** +| 37 | RENDEZVOUS2 | **B**, **C** +| 38 | INTRO_ESTABLISHED | **B**, **C** +| 39 | RENDEZVOUS_ESTABLISHED | **B**, **C** +| 40 | INTRODUCE_ACK | **B**, **C** +| 41 | PADDING_NEGOTIATE | **F**, **C** +| 42 | PADDING_NEGOTIATED | **B**, **C** +| 43 | XON (See Sec 4 of [prop324]) | **F**/**B** +| 44 | XOFF (See Sec 4 of [prop324]) | **F**/**B** [prop324]: ../proposals/324-rtt-congestion-control.txt [prop329]: ../proposals/329-traffic-splitting.md @@ -74,10 +74,12 @@ The relay commands are: [rendezvous spec]: ../rend-spec/index.md ["Circuit-level padding"]: ../padding-spec/circuit-level-padding.md#circuit-level-padding -Commands labelled as "forward" must only be sent by the originator -of the circuit. Commands labelled as "backward" must only be sent by -other nodes in the circuit back to the originator. Commands marked -as either can be sent either by the originator or other nodes. +- **F** (Forward): Must only be sent by the originator of the circuit. +- **B** (Backward): Must only be sent by other nodes in the circuit + back towards the originator. +- **F**/**B** (Forward or backward): May be sent in either direction. +- **C**: (Control) must have a zero-valued stream ID. + (Other commands must have a nonzero stream ID.) The 'recognized' field is used as a simple indication that the cell is still encrypted. It is an optimization to avoid calculating @@ -112,7 +114,7 @@ All relay messages pertaining to the same tunneled stream have the same stream ID. StreamIDs are chosen arbitrarily by the OP. No stream may have a StreamID of zero. Rather, relay messages that affect the entire circuit rather than a particular stream use a StreamID of zero --- they are marked in the table above as "\[control\]" style +-- they are marked in the table above as "**C**" ([control") style cells. (Sendme cells are marked as "sometimes control" because they can include a StreamID or not depending on their purpose -- see [Flow control](./flow-control.md#flow-control).) -- cgit v1.2.3-54-g00ecf