Skip to content
Snippets Groups Projects

Proposal 340 clarifications

Merged Jim Newsome requested to merge jnewsome/torspec:p340-tweaks into main
6 unresolved threads

Notably:

  • end-of-message marker is omitted when message data ends at exactly a relay cell boundary.
  • packing is more for hiding control messages from network observers than for network efficiency.
  • Specify the new subprotocol RelayCell.
  • Explicitly state that cells with unrecognized relay commands should result in immediate circuit closure, even if the rest of the message hasn't arrived yet due to fragmentation.
  • Add note that initial packing algorithm needs to be updated.

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
118 123
119 An unrecognized `command` is considered invalid and thus MUST result in the
120 circuit being immediately destroyed.
124 A message header with an unrecognized `command` is considered invalid and thus
125 MUST result in the circuit being immediately destroyed (without waiting for the
126 rest of the relay message to arrive, in the case of a fragmented message).
121 127
122 ## Negotiation (OBSOLETE)
128 ## New subprotocol `RelayCell`
123 129
124 > We do not want to do it this way. Instead, we want to use the system
125 > described in the forthcoming proposal, "xxx-protovers-again.md".
130 We introduce a new subprotocol `RelayCell` to specify the relay cell ABI. The
131 new format specified in this proposal, supporting packing and fragmentation,
132 corresponds to `RelayCell` version 1. The ABI prior to this proposal is
133 `RelayCell` version 0.
  • Comment on lines +130 to +133

    We don't actually need to define a new subprotocol for this if we don't want to, now that we accepted proposal 346, which makes subprotocol versions count as flags rather than as strictly increasing version numbers.

    IOW, we could use Relay for this if we want. That is, we could say "Relay=6 (or whatever) declares support for this message format."

  • We did though agreed some months ago to try to expand our protover to be more specific. Which would also avoid having 1 protover handle all protocol change for instance.

    So RelayCell for me is still logical in that sense and allows us to negotiate the relay cell ABI on the wire with the end point.

  • Okay; if you prefer RelayCell that's okay.

  • Please register or sign in to reply
  • Nick Mathewson
    Nick Mathewson @nickm started a thread on commit 25a93860
  • 125 > described in the forthcoming proposal, "xxx-protovers-again.md".
    130 We introduce a new subprotocol `RelayCell` to specify the relay cell ABI. The
    131 new format specified in this proposal, supporting packing and fragmentation,
    132 corresponds to `RelayCell` version 1. The ABI prior to this proposal is
    133 `RelayCell` version 0.
    126 134
    127 This message format requires a new `Relay` subprotocol version to indicate
    128 support. If a client wants to indicate support for this format, it sends the
    129 following extension as part of its `ntor3` handshake:
    135 All clients and relays implicitly support `RelayCell` version 0.
    130 136
    131 EXT_FIELD_TYPE:
    137 > XXX: Do we want to consider some migration path for eventually removing
    138 > support for `RelayCell` version 0? e.g. maybe this should be something like
    139 > "Support for any of `Relay` versions 1-5 imply support for `RelayCell`
    140 > version 0"?
    • Comment on lines +138 to +140

      We can just remove support for the existing thing once everybody has the new one, I'd think. (See prop 346: we don't want subprotocol versions to imply "all previous subprotocol versions")

      That is, once v1 is required for all clients and relays, we can remove support for running without it.

    • Author Developer

      What exactly does this look like? I suppose something like:

      • Once the protover (e.g. RelayCell=1 assuming we go with that) is in required-relay-protocols, relays no longer need to explicitly advertise it.
      • Once the protover is in required-client-protocols, relays could start rejecting clients that don't negotiate it. (maybe a separate consensus variable would control whether they actually do?)
      • Do we ever stop requiring clients to explicitly negotiate it?
    • Almost! I was thinking:

      • At some point well after the protover is in required-relay-protocols, we can make clients assume that all relays have it.
      • At some point well after the protover is in required-client-protocols, we can have relays rejecting clients that don't negotiate it.
      • We never drop it from the negotiation...
        • ... though someday we might add an omnibus "assume all options that were required as of 202x" flag.
    • Please register or sign in to reply
  • Nick Mathewson
    Nick Mathewson @nickm started a thread on commit 25a93860
  • 126 rest of the relay message to arrive, in the case of a fragmented message).
    121 127
    122 ## Negotiation (OBSOLETE)
    128 ## New subprotocol `RelayCell`
    123 129
    124 > We do not want to do it this way. Instead, we want to use the system
    125 > described in the forthcoming proposal, "xxx-protovers-again.md".
    130 We introduce a new subprotocol `RelayCell` to specify the relay cell ABI. The
    131 new format specified in this proposal, supporting packing and fragmentation,
    132 corresponds to `RelayCell` version 1. The ABI prior to this proposal is
    133 `RelayCell` version 0.
    126 134
    127 This message format requires a new `Relay` subprotocol version to indicate
    128 support. If a client wants to indicate support for this format, it sends the
    129 following extension as part of its `ntor3` handshake:
    135 All clients and relays implicitly support `RelayCell` version 0.
    • We may want to remove discussion of "v0" from this section, or clarify that it is orthogonal to the protover list. We don't really have the concept of an "implicitly supported" protover.

    • Please register or sign in to reply
  • Nick Mathewson
    Nick Mathewson @nickm started a thread on an outdated change in commit 25a93860
  • 139
    140 EXT_FIELD_TYPE:
    141
    142 [04] -- Packed and Fragmented Cell Response
    143
    144 Again, the extension presence indicates to the client that the Exit has
    145 acknowledged the feature and is ready to use it. If the extension is not
    146 present, the client MUST not use the packed and fragmented feature even though
    147 the Exit has advertised the correct protover.
    148
    149 The client MUST reject the handshake and thus close the circuit if:
    150
    151 - The response extension is seen for a non-ntorv3 handshake.
    152 - The response extension is seen but no request was made initially.
    145 To use a `RelayCell` version other than 0, that version must be negotiated with
    146 every relay on the circuit using an `ntor_v3` extension, as per [proposal
  • Nick Mathewson
    Nick Mathewson @nickm started a thread on an outdated change in commit 25a93860
  • 181 179 with as much data as possible. Otherwise, the client sends the cell
    182 180 with no packed data.
    183 181
    182 > XXX: This isn't quite right. What was actually implemented in tor, and
    183 > what we want in arti, is to defer sending some "control" messages like
    184 > xon, xoff, and confluence switch, until they can be invisibly packed
    185 > into a cell for a DATA message.
    186 > dgoulet: Could you update this section?
    • Comment on lines +182 to +186

      Well, we can't defer these messages indefinitely. That is, if we want to send an xoff right now because we are overloaded, and we have no current data to send, we don't want to wait until we have data, do we?

    • Yeah correct. So the Conflux switch is defer, the first XON is not but the next XONs can be defer. The XOFF needs to be sent immediately yes. So we have a mixed bag of control cell that need to be sent immediately without being packed. And some we must pack.

    • Author Developer

      For this MR I mainly just wanted to get in a note in that the first draft algorithm above isn't what is actually getting implemented, along with a TODO to flesh out the details of the actual algorithm.

      But yeah I think there are a lot of details that would be helpful to specify. e.g.

      • If we have data to send, but the corresponding DATA messages don't leave enough room to pack in the deferred control message(s), what do we do? If we continue deferring could we end up deferring forever if the application always writes in chunks that happen to align this way?
      • Since cells containing any part of a DATA message is subject to congestion windows, does that mean if our congestion window is empty we can't send these control messages either (until the window becomes non-empty)?
    • Jim Newsome changed this line in version 2 of the diff

      changed this line in version 2 of the diff

    • Please register or sign in to reply
  • Nick Mathewson
    Nick Mathewson @nickm started a thread on commit 25a93860
  • 93 93 | Padding | 10 |
    94 94 | FlowCtrl | 11 |
    95 95 | Conflux | 12 |
    96 | Datagram | 13 |
    96 | RelayCell| 13 |
  • Hi! I've made some notes here; I hope they make sense.

  • Jim Newsome added 3 commits

    added 3 commits

    • b07437e5 - squash! Proposal 340 clarifications
    • 19ca9eec - squash! Proposal 340 clarifications
    • 749d2ef0 - squash! Proposal 340 clarifications

    Compare with previous version

  • Jim Newsome marked this merge request as draft from jnewsome/torspec@b07437e5

    marked this merge request as draft from jnewsome/torspec@b07437e5

  • (I'm okay with the other changes here so far)

  • Ok lets get this in.

  • David Goulet approved this merge request

    approved this merge request

  • David Goulet marked this merge request as ready

    marked this merge request as ready

  • David Goulet mentioned in commit b749595a

    mentioned in commit b749595a

  • merged

  • Please register or sign in to reply
    Loading