I have learned Tor's congestion control policy from the paper: Tor:The Second-Generation Onion Router. But I don't understand Tor's Packaging Window and Delivery Window.

The paper said: "The packaging window tracks how many relay data cells the OR is allowed to package (from incoming TCP streams) for transmission back to the OP, and the delivery window tracks how many relay data cells it is willing to deliver to TCP streams outside the network."

I think the process is:

enter image description here

The packaging window tracks data from incoming TCP stream to be packaged to a cell, and the delivery window tracks cells to be sent. Am I right? What on earth is the difference between these two windows?

Could anyone help me? Thanks!

  • Your diagram isn't clear to me, could you try redrawing it? And Tor's circuit flow control is between the client (the OP) and each relay in the circuit, so there are multiple pairs of packaging/delivery windows.
    – Steve
    Mar 31, 2020 at 16:59
  • @Steve Thx. I've redrawn the picture.
    – y4ung
    Apr 1, 2020 at 2:06

1 Answer 1


Here's a quick diagram I made showing the different deliver/package windows. Tor uses package windows for both streams and circuits, and sends RELAY_SENDME cells to inform the other node when it can send more data/cells. Data flows across streams/circuits in both directions so the deliver/package windows always come in pairs. This is described in sections 7.3-7.4 here: https://gitweb.torproject.org/torspec.git/tree/tor-spec.txt

For reference, circuit windows are stored in struct crypt_path_t and struct circuit_t, while stream windows are stored in struct edge_connection_t.

enter image description here

  • Wow, your picture is so pretty and much clear! Thank you so much!
    – y4ung
    Apr 1, 2020 at 5:15
  • No problem, hope it helps!
    – Steve
    Apr 1, 2020 at 5:24
  • I read your answer again. Now I know that the circuit window is the circuit between the OP and each middle node (Guard, Middle, Exit). And maybe the stream window includes all the circuits? Is that correct?
    – y4ung
    Sep 22, 2020 at 3:24
  • @y4ung: The circuit and stream windows are essentially just counters. These windows are completely separate. For each circuit, the OP has a circuit window with each hop of the circuit. For each TCP stream that passes through a circuit, the OP has an end-to-end stream window with the last hop.
    – Steve
    Sep 22, 2020 at 3:50

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .