aboutsummaryrefslogtreecommitdiff
path: root/HACKING
diff options
context:
space:
mode:
Diffstat (limited to 'HACKING')
-rw-r--r--HACKING25
1 files changed, 15 insertions, 10 deletions
diff --git a/HACKING b/HACKING
index 77f66201f..8d214c642 100644
--- a/HACKING
+++ b/HACKING
@@ -6,22 +6,27 @@ the code, add features, fix bugs, etc.
Read the README file first, so you can get familiar with the basics.
-1. The pieces.
+1. The programs.
-1.1. Routers. Onion routers, as far as the 'or' program is concerned,
+1.1. "or". This is the main program here. It functions as both a server
+and a client, depending on which config file you give it. ...
+
+2. The pieces.
+
+2.1. Routers. Onion routers, as far as the 'or' program is concerned,
are a bunch of data items that are loaded into the router_array when
the program starts. After it's loaded, the router information is never
changed. When a new OR connection is started (see below), the relevant
information is copied from the router struct to the connection struct.
-1.2. Connections. A connection is a long-standing tcp socket between
+2.2. Connections. A connection is a long-standing tcp socket between
nodes. A connection is named based on what it's connected to -- an "OR
connection" has an onion router on the other end, an "OP connection" has
an onion proxy on the other end, an "exit connection" has a website or
other server on the other end, and an "AP connection" has an application
proxy (and thus a user) on the other end.
-1.3. Circuits. A circuit is a single conversation between two
+2.3. Circuits. A circuit is a single conversation between two
participants over the onion routing network. One end of the circuit has
an AP connection, and the other end has an exit connection. AP and exit
connections have only one circuit associated with them (and thus these
@@ -29,20 +34,20 @@ connection types are closed when the circuit is closed), whereas OP and
OR connections multiplex many circuits at once, and stay standing even
when there are no circuits running over them.
-1.4. Cells. Some connections, specifically OR and OP connections, speak
+2.4. Cells. Some connections, specifically OR and OP connections, speak
"cells". This means that data over that connection is bundled into 128
byte packets (8 bytes of header and 120 bytes of payload). Each cell has
a type, or "command", which indicates what it's for.
-2. Important parameters in the code.
+3. Important parameters in the code.
-2.1. Role.
+3.1. Role.
3. Robustness features.
-3.1. Bandwidth throttling. Each cell-speaking connection has a maximum
+4.1. Bandwidth throttling. Each cell-speaking connection has a maximum
bandwidth it can use, as specified in the routers.or file. Bandwidth
throttling occurs on both the sender side and the receiving side. The
sending side sends cells at regularly spaced intervals (e.g., a connection
@@ -64,7 +69,7 @@ The bandwidth throttling uses TCP to push back when we stop reading.
We extend it with token buckets to allow more flexibility for traffic
bursts.
-3.2. Data congestion control. Even with the above bandwidth throttling,
+4.2. Data congestion control. Even with the above bandwidth throttling,
we still need to worry about congestion, either accidental or intentional.
If a lot of people make circuits into same node, and they all come out
through the same connection, then that connection may become saturated
@@ -101,7 +106,7 @@ already guarantee in-order delivery of each cell. Rather than trying
to build some sort of tcp-on-tcp scheme, we implement this minimal data
congestion control; so far it's enough.
-3.3. Router twins. In many cases when we ask for a router with a given
+4.3. Router twins. In many cases when we ask for a router with a given
address and port, we really mean a router who knows a given key. Router
twins are two or more routers that all share the same private key. We thus
give routers extra flexibility in choosing the next hop in the circuit: if