I'm trying to understand how tor multiplexing work. I went through all their design documentation and original research paper, but there is very little mention of it. Examining Tor source code, didn't do much.

My main question, what is being multiplexed, where does it happen, and how is it happening?

Is it at Tor client? If so, what is being multiplexed? Is it the connections? or is it streams belonging to same circuit? is multiplexing always guaranteed? Or is it governed by some conditions?

I'm asking this, because as I far as I can see from the code, streams are being written to circuits as they are received from the browser.

Any help, clue or references is much appreciated.

  • Streams are multiplexed inside of circuits, circuits consist of cells, cells for circuits are sent multiplexed across a TLS tunnel between nodes. In which context do you mean?
    – cacahuatl
    Feb 19 '17 at 1:35
  • Hey canon \ I'm taking in the context of relays, i.e. pure application data packed in relay cells. I know that TCP streams should be multiplexed into circuits, however, by going over the implementation in relay.c class, I can see that Tor takes payload from browser (TCP stream contents), pack it into cells, and write it immediately to the circuit channel. Where exactly is the multiplexing happening? Feb 19 '17 at 5:23
  • @canonizingironize see above \ forgot to mention you Feb 19 '17 at 5:31
  • It's by nature of the way the protocol is designed? When you pack them into cells they're routed across the TLS tunnel and you have multiple circuits inside TLS and multiple streams inside the circuits. Have a read of the Tor Specification, particularly sections 5 and 6 ("Circuit management" and "Application connections and stream management").
    – cacahuatl
    Feb 19 '17 at 22:20

Browse other questions tagged or ask your own question.