tor-design.tex 85 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684
  1. \documentclass[times,10pt,twocolumn]{article}
  2. \usepackage{latex8}
  3. \usepackage{times}
  4. \usepackage{url}
  5. \usepackage{graphics}
  6. \usepackage{amsmath}
  7. \pagestyle{empty}
  8. \renewcommand\url{\begingroup \def\UrlLeft{<}\def\UrlRight{>}\urlstyle{tt}\Url}
  9. \newcommand\emailaddr{\begingroup \def\UrlLeft{<}\def\UrlRight{>}\urlstyle{tt}\Url}
  10. % If an URL ends up with '%'s in it, that's because the line *in the .bib/.tex
  11. % file* is too long, so break it there (it doesn't matter if the next line is
  12. % indented with spaces). -DH
  13. %\newif\ifpdf
  14. %\ifx\pdfoutput\undefined
  15. % \pdffalse
  16. %\else
  17. % \pdfoutput=1
  18. % \pdftrue
  19. %\fi
  20. \newenvironment{tightlist}{\begin{list}{$\bullet$}{
  21. \setlength{\itemsep}{0mm}
  22. \setlength{\parsep}{0mm}
  23. % \setlength{\labelsep}{0mm}
  24. % \setlength{\labelwidth}{0mm}
  25. % \setlength{\topsep}{0mm}
  26. }}{\end{list}}
  27. \begin{document}
  28. %% Use dvipdfm instead. --DH
  29. %\ifpdf
  30. % \pdfcompresslevel=9
  31. % \pdfpagewidth=\the\paperwidth
  32. % \pdfpageheight=\the\paperheight
  33. %\fi
  34. \title{Tor: Design of a Second-Generation Onion Router}
  35. %\author{Roger Dingledine \\ The Free Haven Project \\ arma@freehaven.net \and
  36. %Nick Mathewson \\ The Free Haven Project \\ nickm@freehaven.net \and
  37. %Paul Syverson \\ Naval Research Lab \\ syverson@itd.nrl.navy.mil}
  38. \maketitle
  39. \thispagestyle{empty}
  40. \begin{abstract}
  41. We present Tor, a connection-based low-latency anonymous communication
  42. system. Tor is the successor to Onion Routing
  43. and addresses many limitations in the original Onion Routing design.
  44. Tor works in a real-world Internet environment,
  45. % it's user-space too
  46. requires little synchronization or coordination between nodes, and
  47. protects against known anonymity-breaking attacks as well
  48. as or better than other systems with similar design parameters.
  49. % and we present a big list of open problems at the end
  50. % and we present a new practical design for rendezvous points
  51. \end{abstract}
  52. %\begin{center}
  53. %\textbf{Keywords:} anonymity, peer-to-peer, remailer, nymserver, reply block
  54. %\end{center}
  55. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  56. \Section{Overview}
  57. \label{sec:intro}
  58. Onion Routing is a distributed overlay network designed to anonymize
  59. low-latency TCP-based applications such as web browsing, secure shell,
  60. and instant messaging. Clients choose a path through the network and
  61. build a \emph{virtual circuit}, in which each node (or ``onion router'')
  62. in the path knows its
  63. predecessor and successor, but no others. Traffic flowing down the circuit
  64. is sent in fixed-size \emph{cells}, which are unwrapped by a symmetric key
  65. at each node (like the layers of an onion) and relayed downstream. The
  66. original Onion Routing project published several design and analysis
  67. papers
  68. \cite{or-jsac98,or-discex00,or-ih96,or-pet00}. While there was
  69. a wide area Onion Routing network for a several weeks,
  70. % how long is briefly? a day, a month? -RD
  71. the only long-running and publicly accessible
  72. implementation was a fragile proof-of-concept that ran on a single
  73. machine (which nonetheless processed several tens of thousands of connections
  74. daily from thousands of global users).
  75. Many critical design and deployment issues were never resolved,
  76. and the design has not been updated in several years.
  77. Here we describe Tor, a protocol for asynchronous, loosely
  78. federated onion routers that provides the following improvements over
  79. the old Onion Routing design, and over other low-latency anonymity systems:
  80. \begin{tightlist}
  81. \item \textbf{Perfect forward secrecy:} The original Onion Routing
  82. design was vulnerable to a single hostile node recording traffic and later
  83. compromising successive nodes in the circuit and forcing them to
  84. decrypt it.
  85. Rather than using a single onion to lay each circuit,
  86. Tor now uses an incremental or \emph{telescoping}
  87. path-building design, where the initiator negotiates session keys with
  88. each successive hop in the circuit. Once these keys are deleted,
  89. subsequently compromised nodes cannot decrypt old traffic.
  90. As a side benefit, onion replay detection is no longer
  91. necessary, and the process of building circuits is more reliable, since
  92. the initiator knows when a hop fails and can then try extending to a new node.
  93. % Perhaps mention that not all of these are things that we invented. -NM
  94. \item \textbf{Separation of protocol cleaning from anonymity:}
  95. The original Onion Routing design required a separate ``application
  96. proxy'' for each
  97. supported application protocol---most
  98. of which were never written, so many applications were never supported.
  99. Tor uses the standard and near-ubiquitous SOCKS
  100. \cite{socks4,socks5} proxy interface, allowing us to support most TCP-based
  101. programs without modification. This design change allows Tor to
  102. use the filtering features of privacy-enhancing
  103. application-level proxies such as Privoxy \cite{privoxy} without having to
  104. incorporate those features itself.
  105. \item \textbf{Many TCP streams can share one circuit:} The original
  106. Onion Routing design built a separate circuit for each application-level
  107. request.
  108. This hurt performance by requiring multiple public key operations for
  109. every request, and also presented
  110. a threat to anonymity (see Section~\ref{maintaining-anonymity}).
  111. \footnote{The first Onion Routing design \cite{or-ih96} protected against
  112. this threat to some
  113. extent by requiring users to hide network access behind an onion
  114. router/firewall that was also forwarding traffic from other nodes.
  115. However, it is desirable for users to
  116. benefit from Onion Routing even when they can't run their own
  117. onion routers.
  118. %Such users, especially if they engage in certain unusual
  119. %communication behaviors, may be identifiable \cite{wright03}.
  120. %To
  121. %complicate the possibility of such attacks Tor multiplexes many
  122. %stream down each circuit, but still rotates the circuit
  123. %periodically to avoid too much linkability from requests on a single
  124. %circuit.
  125. %
  126. % [This digression probably belongs in maintaining-anonymity. -NM
  127. }
  128. The current Tor design multiplexes multiple TCP streams along each virtual
  129. circuit, in order to improve efficiency and anonymity.
  130. \item \textbf{No mixing, padding, or traffic shaping:} The original
  131. Onion Routing design called for mixing of data from each circuit,
  132. plus full link padding both between onion routers and between onion
  133. proxies (that is, users) and onion routers \cite{or-jsac98}. The
  134. later analysis paper \cite{or-pet00} suggested \emph{traffic shaping}
  135. to provide similar protection but use less bandwidth, but did not go
  136. into detail. However, recent research \cite{econymics} and deployment
  137. experience \cite{freedom21-security} suggest that this level of resource
  138. use is not practical or economical; and even full link padding is still
  139. vulnerable \cite{defensive-dropping}. Thus, until we have a proven and
  140. convenient design for traffic shaping or low-latency mixing that will help
  141. anonymity against a realistic adversary, we leave these strategies out.
  142. \item \textbf{Leaky-pipe circuit topology:} Through in-band
  143. signalling within the
  144. circuit, Tor initiators can direct traffic to nodes partway down the
  145. circuit. This not only allows for long-range padding to frustrate traffic
  146. shape and volume attacks at the initiator \cite{defensive-dropping},
  147. but because circuits are used by more than one application, it also
  148. allows traffic to exit the circuit from the middle---thus
  149. frustrating traffic shape and volume attacks based on observing exit
  150. points.
  151. \item \textbf{Congestion control:} Earlier anonymity designs do not
  152. address traffic bottlenecks. Unfortunately, typical approaches to load
  153. balancing and flow control in overlay networks involve inter-node control
  154. communication and global views of traffic. Tor's decentralized ack-based
  155. congestion control maintains reasonable anonymity while allowing nodes
  156. at the edges of the network to detect congestion or flooding attacks
  157. and send less data until the congestion subsides.
  158. \item \textbf{Directory servers:} The original Onion Routing design
  159. planned to flood link-state information through the network---an
  160. approach which can be unreliable and
  161. open to partitioning attacks or outright deception. Tor takes a simplified
  162. view towards distributing link-state information. Certain more trusted
  163. onion routers also serve as directory servers; they provide signed
  164. \emph{directories} describing all routers they know about, and which
  165. are currently up. Users periodically download these directories via HTTP.
  166. \item \textbf{End-to-end integrity checking:} Without integrity checking
  167. on traffic going through the network, any onion router on the path
  168. can change the contents of cells as they pass by---for example, to redirect a
  169. connection on the fly so it connects to a different webserver, or to
  170. tag encrypted traffic and look for the tagged traffic at the network
  171. edges \cite{minion-design}. Tor hampers these attacks by checking data
  172. integrity before it leaves the network.
  173. \item \textbf{Robustness to failed nodes:} A failed node in a traditional
  174. mix network means lost messages, but thanks to Tor's step-by-step
  175. circuit building, users can notice failed
  176. nodes while building circuits and route around them. Additionally,
  177. liveness information from directories allows users to avoid
  178. unreliable nodes in the first place.
  179. %We further provide a
  180. %simple mechanism that allows connections to be established despite recent
  181. %node failure or slightly dated information from a directory server. Tor
  182. %permits onion routers to have \emph{router twins} --- nodes that share
  183. %the same private decryption key. Note that because connections now have
  184. %perfect forward secrecy, an onion router still cannot read the traffic
  185. %on a connection established through its twin even while that connection
  186. %is active. Also, which nodes are twins can change dynamically depending
  187. %on current circumstances, and twins may or may not be under the same
  188. %administrative authority.
  189. %
  190. %[Commented out; Router twins provide no real increase in robustness
  191. %to failed nodes. If a non-twinned node goes down, the
  192. %circuit-builder notices this and routes around it. Circuit-building
  193. %is offline, so there shouldn't even be a latency hit. -NM]
  194. \item \textbf{Variable exit policies:} Tor provides a consistent
  195. mechanism for
  196. each node to specify and advertise a policy describing the hosts and
  197. ports to which it will connect. These exit policies
  198. are critical in a volunteer-based distributed infrastructure, because
  199. each operator is comfortable with allowing different types of traffic
  200. to exit the Tor network from his node.
  201. \item \textbf{Implementable in user-space:} Because it only attempts to
  202. anonymize TCP streams, Tor differs from other anonymity systems like
  203. Freedom \cite{freedom} in that it does not require patches to an operating
  204. system's network stack in order to operate. Although this approach is less
  205. flexible, it has proven valuable to Tor's portability and deployability.
  206. \item \textbf{Rendezvous points and location-protected servers:} Tor
  207. provides an integrated mechanism for responder anonymity via
  208. location-protected servers. Previous Onion Routing designs included
  209. long-lived ``reply onions'' which could be used to build virtual
  210. circuits to a hidden server, but this approach is
  211. brittle because a reply onion becomes useless if any node in the
  212. path goes down or rotates its keys, and it's also
  213. %vulnerable to flooding attacks,
  214. % no it isn't. no more than our rendezvous point approach at least -RD
  215. incompatible with forward security. In Tor's
  216. current design, clients use {\it introduction points} to negotiate {\it
  217. rendezvous points} to connect with hidden servers; and reply onions
  218. are no longer required.
  219. \end{tightlist}
  220. [XXX carefully mention implementation, emphasizing that experience
  221. deploying isn't there yet, and not all features are implemented.
  222. Mention that it runs, is kinda alpha, kinda deployed, runs on win32.]
  223. We review previous work in Section \ref{sec:background}, describe
  224. our goals and assumptions in Section \ref{sec:assumptions},
  225. and then address the above list of improvements in Sections
  226. \ref{sec:design}-\ref{sec:maintaining-anonymity}. We then summarize
  227. how our design stands up to known attacks, and conclude with a list of
  228. open problems.
  229. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  230. \Section{Background and threat model}
  231. \label{sec:background}
  232. \SubSection{Related work}
  233. \label{sec:related-work}
  234. Modern anonymity designs date to Chaum's Mix-Net\cite{chaum-mix} design of
  235. 1981. Chaum proposed hiding sender-recipient connections by wrapping
  236. messages in several layers of public key cryptography, and relaying them
  237. through a path composed of ``Mixes.'' These mixes in turn decrypt, delay,
  238. and re-order messages, before relaying them along the sender-selected
  239. path towards their destinations.
  240. Subsequent relay-based anonymity designs have diverged in two
  241. principal directions. Some have attempted to maximize anonymity at
  242. the cost of introducing comparatively large and variable latencies,
  243. for example, Babel\cite{babel}, Mixmaster\cite{mixmaster-spec}, and
  244. Mixminion\cite{minion-design}. Because of this
  245. trade-off, such \emph{high-latency} networks are well-suited for anonymous
  246. email, but introduce too much lag for interactive tasks such as web browsing,
  247. internet chat, or SSH connections.
  248. Tor belongs to the second category: \emph{low-latency} designs that attempt
  249. to anonymize interactive network traffic. Because these protocols typically
  250. involve a large number of packets that must be delivered quickly, it is
  251. difficult for them to prevent an attacker who can eavesdrop both ends of the
  252. interactive communication from points from correlating the timing and volume
  253. of traffic entering the anonymity network with traffic leaving it. These
  254. protocols are also vulnerable against certain active attacks in which an
  255. adversary introduces timing patterns into traffic entering the network, and
  256. looks
  257. for correlated patterns among exiting traffic.
  258. Although some work has been done to frustrate
  259. these attacks,\footnote{
  260. The most common approach is to pad and limit communication to a constant
  261. rate, or to limit
  262. the variation in traffic shape. Doing so can have prohibitive bandwidth
  263. costs and/or performance limitations.
  264. %One can also use a cascade (fixed
  265. %shared route) with a relatively fixed set of users. This assumes a
  266. %significant degree of agreement and provides an easier target for an active
  267. %attacker since the endpoints are generally known.
  268. } most designs protect primarily against traffic analysis rather than traffic
  269. confirmation \cite{or-jsac98}---that is, they assume that the attacker is
  270. attempting to learn who is talking to whom, not to confirm a prior suspicion
  271. about who is talking to whom.
  272. The simplest low-latency designs are single-hop proxies such as the
  273. Anonymizer \cite{anonymizer}, wherein a single trusted server removes
  274. identifying users' data before relaying it. These designs are easy to
  275. analyze, but require end-users to trust the anonymizing proxy. Furthermore,
  276. concentrating the traffic to a single point makes traffic analysis easier: an
  277. adversary need only eavesdrop on the proxy in order to become a global
  278. observer against the entire anonymity network.
  279. More complex are distributed-trust, channel-based anonymizing systems. In
  280. these designs, a user establishes one or more medium-term bidirectional
  281. end-to-end tunnels to exit servers, and uses those tunnels to deliver a
  282. number of low-latency packets to and from one or more destinations per
  283. tunnel. Establishing tunnels is comparatively expensive and typically
  284. requires public-key cryptography, whereas relaying packets along a tunnel is
  285. comparatively inexpensive. Because a tunnel crosses several servers, no
  286. single server can learn the user's communication partners.
  287. In some distributed-trust systems, such as the Java Anon Proxy (also known as
  288. JAP or WebMIXes), users
  289. build their tunnels along a fixed shared route or
  290. ``cascade.'' Like a single-hop proxy, a single cascade increases anonymity
  291. sets by concentrating concurrent traffic into a single communication pipe.
  292. Concentrating traffic, however, can become a liability: as with a single-hop
  293. proxy, an attacker only needs to observe a limited number of servers (in this
  294. case, both ends of the cascade) in order
  295. to bridge all the system's traffic.
  296. The Java Anon Proxy's design seeks to prevent this by padding
  297. between end users and the head of the cascade \cite{web-mix}. However, the
  298. current implementation does no padding and thus remains vulnerable
  299. to both active and passive bridging.
  300. Systems such as earlier versions of Freedom and the original Onion Routing
  301. build the anonymous channel all at once, using a layered ``onion'' of
  302. public-key encrypted messages, each layer of which provides a set of session
  303. keys and the address of the next server in the channel. Tor as described
  304. herein, later designs of Freedom, and AnonNet \cite{anonnet} build the
  305. channel in stages, extending it one hop at a time. This approach
  306. makes perfect forward secrecy feasible.
  307. Distributed-trust anonymizing systems differ in how they prevent attackers
  308. from controlling too many servers and thus compromising too many user paths.
  309. Some protocols rely on a centrally maintained set of well-known anonymizing
  310. servers. The current Tor design falls into this category.
  311. Others (such as Tarzan and MorphMix) allow unknown users to run
  312. servers, while using a limited resource (DHT space for Tarzan; IP space for
  313. MorphMix) to prevent an attacker from owning too much of the network.
  314. Crowds uses a centralized ``blender'' to enforce Crowd membership
  315. policy. For small crowds it is suggested that familiarity with all
  316. members is adequate. For large diverse crowds, limiting accounts in
  317. control of any one party is more complex:
  318. ``(e.g., the blender administrator sets up an account for a user only
  319. after receiving a written, notarized request from that user) and each
  320. account to one jondo, and by monitoring and limiting the number of
  321. jondos on any one net- work (using IP address), the attacker would be
  322. forced to launch jondos using many different identities and on many
  323. different networks to succeed'' \cite{crowds-tissec}.
  324. Another low-latency design that was proposed independently and at
  325. about the same time as the original Onion Routing was PipeNet
  326. \cite{pipenet}. It provided anonymity protections that were stronger
  327. than Onion Routing's, but at the cost of allowing a single user to
  328. shut down the network simply by not sending. It was also never
  329. implemented or formally published. Low-latency anonymous communication
  330. has also been designed for other types of systems, including
  331. ISDN \cite{isdn-mixes}, and mobile applications such as telephones and
  332. active badging systems \cite{federrath-ih96,reed-protocols97}.
  333. Some systems, such as Crowds \cite{crowds-tissec}, do not rely on changing the
  334. appearance of packets to hide the path; rather they try to prevent an
  335. intermediary from knowing whether it is talking to an initiator
  336. or just another intermediary. Crowds uses no public-key
  337. encryption, but the responder and all data are visible to all
  338. nodes on the path; so anonymity of the connection initiator depends on
  339. filtering all identifying information from the data stream. Crowds only
  340. supports HTTP traffic.
  341. Hordes \cite{hordes-jcs} is based on Crowds but also uses multicast
  342. responses to hide the initiator. Herbivore \cite{herbivore} and
  343. P5 \cite{p5} go even further, requiring broadcast.
  344. Each uses broadcast in different ways, and trade-offs are made to
  345. make broadcast more practical. Both Herbivore and P5 are designed primarily
  346. for communication between communicating peers, although Herbivore
  347. permits external connections by requesting a peer to serve as a proxy.
  348. Allowing easy connections to nonparticipating responders or recipients
  349. is a practical requirement for many users, e.g., to visit
  350. nonparticipating Web sites or to exchange mail with nonparticipating
  351. recipients.
  352. Tor is not primarily designed for censorship resistance but rather
  353. for anonymous communication. However, Tor's rendezvous points, which
  354. enable connections between mutually anonymous entities, also
  355. facilitate connections to hidden servers. These building blocks to
  356. censorship resistance and other capabilities are described in
  357. Section~\ref{sec:rendezvous}. Location-hidden servers are an
  358. essential component for the anonymous publishing systems such as
  359. Eternity\cite{eternity}, Publius\cite{publius},
  360. Free Haven\cite{freehaven-berk}, and Tangler\cite{tangler}.
  361. STILL NOT MENTIONED:
  362. real-time mixes\\
  363. rewebbers\\
  364. cebolla\\
  365. [XXX Close by mentioning where Tor fits.]
  366. \Section{Design goals and assumptions}
  367. \label{sec:assumptions}
  368. \subsection{Goals}
  369. Like other low-latency anonymity designs, Tor seeks to frustrate
  370. attackers from linking communication partners, or from linking
  371. multiple communications to or from a single point. Within this
  372. main goal, however, several design considerations have directed
  373. Tor's evolution.
  374. \begin{description}
  375. \item[Deployability:] The design must be one which can be implemented,
  376. deployed, and used in the real world. This requirement precludes designs
  377. that are expensive to run (for example, by requiring more bandwidth than
  378. volunteers are willing to provide); designs that place a heavy liability
  379. burden on operators (for example, by allowing attackers to implicate onion
  380. routers in illegal activities); and designs that are difficult or expensive
  381. to implement (for example, by requiring kernel patches, or separate proxies
  382. for every protocol). This requirement also precludes systems in which
  383. users who do not benefit from anonymity are required to run special
  384. software in order to communicate with anonymous parties.
  385. % XXX Our rendezvous points require clients to use our software to get to
  386. % the location-hidden servers.
  387. % Or at least, they require somebody near the client-side running our
  388. % software. We haven't worked out the details of keeping it transparent
  389. % for Alice if she's using some other http proxy somewhere. I guess the
  390. % external http proxy should route through a Tor client, which automatically
  391. % translates the foo.onion address? -RD
  392. %
  393. % 1. Such clients do benefit from anonymity: they can reach the server.
  394. % Recall that our goal for location hidden servers is to continue to
  395. % provide service to priviliged clients when a DoS is happening or
  396. % to provide access to a location sensitive service. I see no contradiction.
  397. % 2. A good idiot check is whether what we require people to download
  398. % and use is more extreme than downloading the anonymizer toolbar or
  399. % privacy manager. I don't think so, though I'm not claiming we've already
  400. % got the installation and running of a client down to that simplicity
  401. % at this time. -PS
  402. \item[Usability:] A hard-to-use system has fewer users---and because
  403. anonymity systems hide users among users, a system with fewer users
  404. provides less anonymity. Usability is not only a convenience for Tor:
  405. it is a security requirement \cite{econymics,back01}. Tor
  406. should work with most of a user's unmodified applications; shouldn't
  407. introduce prohibitive delays; and should require the user to make as few
  408. configuration decisions as possible.
  409. \item[Flexibility:] The protocol must be flexible and
  410. well-specified, so that it can serve as a test-bed for future research in
  411. low-latency anonymity systems. Many of the open problems in low-latency
  412. anonymity networks (such as generating dummy traffic, or preventing
  413. pseudospoofing attacks) may be solvable independently from the issues
  414. solved by Tor; it would be beneficial if future systems were not forced to
  415. reinvent Tor's design decisions. (But note that while a flexible design
  416. benefits researchers, there is a danger that differing choices of
  417. extensions will render users distinguishable. Thus, experiments
  418. on extensions should be limited and should not significantly affect
  419. the distinguishability of ordinary users.
  420. % To run an experiment researchers must file an
  421. % anonymity impact statement -PS
  422. of implementations should
  423. not permit different protocol extensions to coexist in a single deployed
  424. network.)
  425. \item[Conservative design:] The protocol's design and security parameters
  426. must be conservative. Because additional features impose implementation
  427. and complexity costs, Tor should include as few speculative features as
  428. possible. (We do not oppose speculative designs in general; however, it is
  429. our goal with Tor to embody a solution to the problems in low-latency
  430. anonymity that we can solve today before we plunge into the problems of
  431. tomorrow.)
  432. % This last bit sounds completely cheesy. Somebody should tone it down. -NM
  433. \end{description}
  434. \subsection{Non-goals}
  435. In favoring conservative, deployable designs, we have explicitly deferred
  436. a number of goals. Many of these goals are desirable in anonymity systems,
  437. but we choose to defer them either because they are solved elsewhere,
  438. or because they present an area of active research lacking a generally
  439. accepted solution.
  440. \begin{description}
  441. \item[Not Peer-to-peer:] Tarzan and Morphmix aim to
  442. scale to completely decentralized peer-to-peer environments with thousands
  443. of short-lived servers, many of which may be controlled by an adversary.
  444. Because of the many open problems in this approach, Tor uses a more
  445. conservative design.
  446. \item[Not secure against end-to-end attacks:] Tor does not claim to provide a
  447. definitive solution to end-to-end timing or intersection attacks. Some
  448. approaches, such as running an onion router, may help; see Section
  449. \ref{sec:analysis} for more discussion.
  450. \item[No protocol normalization:] Tor does not provide \emph{protocol
  451. normalization} like Privoxy or the Anonymizer. In order to make clients
  452. indistinguishable when they use complex and variable protocols such as HTTP,
  453. Tor must be layered with a filtering proxy such as Privoxy to hide
  454. differences between clients, expunge protocol features that leak identity,
  455. and so on. Similarly, Tor does not currently integrate tunneling for
  456. non-stream-based protocols like UDP; this too must be provided by
  457. an external service.
  458. % Actually, tunneling udp over tcp is probably horrible for some apps.
  459. % Should this get its own non-goal bulletpoint? The motivation for
  460. % non-goal-ness would be burden on clients / portability.
  461. \item[Not steganographic:] Tor does not try to conceal which users are
  462. sending or receiving communications; it only tries to conceal whom they are
  463. communicating with.
  464. \end{description}
  465. \SubSection{Adversary Model}
  466. \label{subsec:adversary-model}
  467. A global passive adversary is the most commonly assumed when
  468. analyzing theoretical anonymity designs. But like all practical low-latency
  469. systems, Tor is not secure against this adversary. Instead, we assume an
  470. adversary that is weaker than global with respect to distribution, but that
  471. is not merely passive. Our threat model expands on that from
  472. \cite{or-pet00}.
  473. %%%% This is really keen analytical stuff, but it isn't our threat model:
  474. %%%% we just go ahead and assume a fraction of hostile nodes for
  475. %%%% convenience. -NM
  476. %
  477. %% The basic adversary components we consider are:
  478. %% \begin{description}
  479. %% \item[Observer:] can observe a connection (e.g., a sniffer on an
  480. %% Internet router), but cannot initiate connections. Observations may
  481. %% include timing and/or volume of packets as well as appearance of
  482. %% individual packets (including headers and content).
  483. %% \item[Disrupter:] can delay (indefinitely) or corrupt traffic on a
  484. %% link. Can change all those things that an observer can observe up to
  485. %% the limits of computational ability (e.g., cannot forge signatures
  486. %% unless a key is compromised).
  487. %% \item[Hostile initiator:] can initiate (or destroy) connections with
  488. %% specific routes as well as vary the timing and content of traffic
  489. %% on the connections it creates. A special case of the disrupter with
  490. %% additional abilities appropriate to its role in forming connections.
  491. %% \item[Hostile responder:] can vary the traffic on the connections made
  492. %% to it including refusing them entirely, intentionally modifying what
  493. %% it sends and at what rate, and selectively closing them. Also a
  494. %% special case of the disrupter.
  495. %% \item[Key breaker:] can break the key used to encrypt connection
  496. %% initiation requests sent to a Tor-node.
  497. %% % Er, there are no long-term private decryption keys. They have
  498. %% % long-term private signing keys, and medium-term onion (decryption)
  499. %% % keys. Plus short-term link keys. Should we lump them together or
  500. %% % separate them out? -RD
  501. %% %
  502. %% % Hmmm, I was talking about the keys used to encrypt the onion skin
  503. %% % that contains the public DH key from the initiator. Is that what you
  504. %% % mean by medium-term onion key? (``Onion key'' used to mean the
  505. %% % session keys distributed in the onion, back when there were onions.)
  506. %% % Also, why are link keys short-term? By link keys I assume you mean
  507. %% % keys that neighbor nodes use to superencrypt all the stuff they send
  508. %% % to each other on a link. Did you mean the session keys? I had been
  509. %% % calling session keys short-term and everything else long-term. I
  510. %% % know I was being sloppy. (I _have_ written papers formalizing
  511. %% % concepts of relative freshness.) But, there's some questions lurking
  512. %% % here. First up, I don't see why the onion-skin encryption key should
  513. %% % be any shorter term than the signature key in terms of threat
  514. %% % resistance. I understand that how we update onion-skin encryption
  515. %% % keys makes them depend on the signature keys. But, this is not the
  516. %% % basis on which we should be deciding about key rotation. Another
  517. %% % question is whether we want to bother with someone who breaks a
  518. %% % signature key as a particular adversary. He should be able to do
  519. %% % nearly the same as a compromised tor-node, although they're not the
  520. %% % same. I reworded above, I'm thinking we should leave other concerns
  521. %% % for later. -PS
  522. %% \item[Hostile Tor node:] can arbitrarily manipulate the
  523. %% connections under its control, as well as creating new connections
  524. %% (that pass through itself).
  525. %% \end{description}
  526. %
  527. %% All feasible adversaries can be composed out of these basic
  528. %% adversaries. This includes combinations such as one or more
  529. %% compromised Tor-nodes cooperating with disrupters of links on which
  530. %% those nodes are not adjacent, or such as combinations of hostile
  531. %% outsiders and link observers (who watch links between adjacent
  532. %% Tor-nodes). Note that one type of observer might be a Tor-node. This
  533. %% is sometimes called an honest-but-curious adversary. While an observer
  534. %% Tor-node will perform only correct protocol interactions, it might
  535. %% share information about connections and cannot be assumed to destroy
  536. %% session keys at end of a session. Note that a compromised Tor-node is
  537. %% stronger than any other adversary component in the sense that
  538. %% replacing a component of any adversary with a compromised Tor-node
  539. %% results in a stronger overall adversary (assuming that the compromised
  540. %% Tor-node retains the same signature keys and other private
  541. %% state-information as the component it replaces).
  542. First, we assume that a threshold of directory servers are honest,
  543. reliable, accurate, and trustworthy.
  544. %% the rest of this isn't needed, if dirservers do threshold concensus dirs
  545. % To augment this, users can periodically cross-check
  546. %directories from each directory server (trust, but verify).
  547. %, and that they always have access to at least one directory server that they trust.
  548. Second, we assume that somewhere between ten percent and twenty
  549. percent\footnote{In some circumstances---for example, if the Tor network is
  550. running on a hardened network where all operators have had background
  551. checks---the number of compromised nodes could be much lower.}
  552. of the Tor nodes accepted by the directory servers are compromised, hostile,
  553. and collaborating in an off-line clique. These compromised nodes can
  554. arbitrarily manipulate the connections that pass through them, as well as
  555. creating new connections that pass through themselves. They can observe
  556. traffic, and record it for later analysis. Honest participants do not know
  557. which servers these are.
  558. (In reality, many realistic adversaries might have `bad' servers that are not
  559. fully compromised but simply under observation, or that have had their keys
  560. compromised. But for the sake of analysis, we ignore, this possibility,
  561. since the threat model we assume is strictly stronger.)
  562. % This next paragraph is also more about analysis than it is about our
  563. % threat model. Perhaps we can say, ``users can connect to the network and
  564. % use it in any way; we consider abusive attacks separately.'' ? -NM
  565. Third, we constrain the impact of hostile users. Users are assumed to vary
  566. widely in both the duration and number of times they are connected to the Tor
  567. network. They can also be assumed to vary widely in the volume and shape of
  568. the traffic they send and receive. Hostile users are, by definition, limited
  569. to creating and varying their own connections into or through a Tor
  570. network. They may attack their own connections to try to gain identity
  571. information of the responder in a rendezvous connection. They can also try to
  572. attack sites through the Onion Routing network; however we will consider this
  573. abuse rather than an attack per se (see
  574. Section~\ref{subsec:exitpolicies}). Other than abuse, a hostile user's
  575. motivation to attack his own connections is limited to the network effects of
  576. such actions, such as denial of service (DoS) attacks. Thus, in this case,
  577. we can view user as simply an extreme case of the ordinary user; although
  578. ordinary users are not likely to engage in, e.g., IP spoofing, to gain their
  579. objectives.
  580. In general, we are more focused on traffic analysis attacks than
  581. traffic confirmation attacks.
  582. %A user who runs a Tor proxy on his own
  583. %machine, connects to some remote Tor-node and makes a connection to an
  584. %open Internet site, such as a public web server, is vulnerable to
  585. %traffic confirmation.
  586. That is, an active attacker who suspects that
  587. a particular client is communicating with a particular server can
  588. confirm this if she can modify and observe both the
  589. connection between the Tor network and the client and that between the
  590. Tor network and the server. Even a purely passive attacker can
  591. confirm traffic if the timing and volume properties of the traffic on
  592. the connection are unique enough. (This is not to say that Tor offers
  593. no resistance to traffic confirmation; it does. We defer discussion
  594. of this point and of particular attacks until Section~\ref{sec:attacks},
  595. after we have described Tor in more detail.)
  596. % XXX We need to say what traffic analysis is: How about...
  597. On the other hand, we {\it do} try to prevent an attacker from
  598. performing traffic analysis: that is, attempting to learn the communication
  599. partners of an arbitrary user.
  600. % XXX If that's not right, what is? It would be silly to have a
  601. % threat model section without saying what we want to prevent the
  602. % attacker from doing. -NM
  603. % XXX Also, do we want to mention linkability or building profiles? -NM
  604. Our assumptions about our adversary's capabilities imply a number of
  605. possible attacks against users' anonymity. Our adversary might try to
  606. mount passive attacks by observing the edges of the network and
  607. correlating traffic entering and leaving the network: either because
  608. of relationships in packet timing; relationships in the volume of data
  609. sent; [XXX simple observation??]; or relationships in any externally
  610. visible user-selected options. The adversary can also mount active
  611. attacks by trying to compromise all the servers' keys in a
  612. path---either through illegitimate means or through legal coercion in
  613. unfriendly jurisdiction; by selectively DoSing trustworthy servers; by
  614. introducing patterns into entering traffic that can later be detected;
  615. or by modifying data entering the network and hoping that trashed data
  616. comes out the other end. The attacker can additionally try to
  617. decrease the network's reliability by performing antisocial activities
  618. from reliable servers and trying to get them taken down.
  619. % XXX Should there be more or less? Should we turn this into a
  620. % bulleted list? Should we cut it entirely?
  621. We list these attacks and more, and describe our defenses against them
  622. in Section~\ref{sec:attacks}.
  623. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  624. \Section{The Tor Design}
  625. \label{sec:design}
  626. The Tor network is an overlay network; each node is called an onion router
  627. (OR). Onion routers run on normal computers without needing any special
  628. privileges. Each OR maintains a long-term TLS connection to every other
  629. OR (although we look at ways to relax this clique-topology assumption in
  630. section \ref{subsec:restricted-routes}). A subset of the ORs also act as
  631. directory servers, tracking which routers are currently in the network;
  632. see section \ref{subsec:dirservers} for directory server details. Users
  633. run local software called an onion proxy (OP) that fetches directories,
  634. establishes paths (called \emph{virtual circuits}) over the network,
  635. and handles connections from the user applications. Onion proxies accept
  636. TCP streams and multiplex them across the virtual circuit. The onion
  637. router on the other side
  638. % I don't mean other side, I mean wherever it is on the circuit. But
  639. % don't want to introduce complexity this early? Hm. -RD
  640. of the circuit connects to the destinations of
  641. the TCP streams and relays data.
  642. Onion routers have three types of keys. The first key is the identity
  643. (signing) key. An OR uses this key to sign TLS certificates, to sign its
  644. router descriptor (a summary of its keys, address, bandwidth, exit policy,
  645. etc), and to sign directories if it is a directory server. Changing the
  646. identity key of a router is considered equivalent to creating a new
  647. router. The second key is the onion (decryption) key, which is used
  648. for decrypting requests from users to set up a circuit and negotiate
  649. ephemeral keys. Thirdly, each OR shares link keys (generated by TLS)
  650. with the other ORs it's connected to. We discuss rotating these keys in
  651. Section \ref{subsec:rotating-keys}.
  652. Section \ref{subsec:cells} discusses the structure of the fixed-size
  653. \emph{cells} that are the unit of communication in Tor. We describe
  654. in Section \ref{subsec:circuits} how circuits work, and how they are
  655. built, extended, truncated, and destroyed. Section \ref{subsec:tcp}
  656. discusses the process of opening TCP streams through Tor, and finally
  657. Section \ref{subsec:congestion} talks about congestion control and
  658. fairness issues.
  659. \SubSection{Cells}
  660. \label{subsec:cells}
  661. Traffic passes from node to node in fixed-size cells. Each cell is 256
  662. bytes, and consists of a header and a payload. The header includes the
  663. circuit identifier (ACI) which specifies which circuit the cell refers to
  664. (many circuits can be multiplexed over the single TCP connection between
  665. ORs or between an OP and an OR), and a command to describe what to do
  666. with the cell's payload. Cells are either control cells, meaning they are
  667. intended to be interpreted by the node that receives them, or relay cells,
  668. meaning they carry end-to-end stream data. Controls cells can be one of:
  669. \emph{padding} (currently used for keepalive, but can be used for link
  670. padding), \emph{create} or \emph{created} (to set up a new circuit),
  671. or \emph{destroy} (to tear down a circuit).
  672. Relay cells have an additional header (the relay header) after the
  673. cell header, which specifies the stream identifier (many streams can
  674. be multiplexed over a circuit), an end-to-end checksum for integrity
  675. checking, the length of the relay payload, and a relay command. Relay
  676. commands can be one of: \emph{relay
  677. data} (for data flowing down the stream), \emph{relay begin} (to open a
  678. stream), \emph{relay end} (to close a stream), \emph{relay connected}
  679. (to notify the OP that a relay begin has succeeded), \emph{relay
  680. extend} and \emph{relay extended} (to extend the circuit by a hop,
  681. and to acknowledge), \emph{relay truncate} and \emph{relay truncated}
  682. (to tear down only part of the circuit, and to acknowledge), \emph{relay
  683. sendme} (used for congestion control), and \emph{relay drop} (used to
  684. implement long-range dummies).
  685. We will talk more about each of these cell types below.
  686. % Nick: should there have been a table here? -RD
  687. \SubSection{Circuits and streams}
  688. \label{subsec:circuits}
  689. While the original Onion Routing design built one circuit for each stream,
  690. Tor circuits can be used by many streams. Thus because circuits can
  691. take several tenths of a second to construct due to crypto and network
  692. latency, users construct circuits preemptively. Users build a new circuit
  693. periodically (currently every minute) if the previous one has been used,
  694. and expire old used circuits that are no longer in use. Thus even very
  695. active users spend a negligible amount of time and CPU in building
  696. circuits, but only a limited number of requests can be linked to each
  697. other by a given exit node.
  698. Users set up circuits incrementally, negotiating a symmetric key with
  699. each hop one at a time. To create a new circuit, the user (call her
  700. Alice) sends a \emph{create} cell to the first node in her chosen
  701. path. The payload is the first half of the Diffie-Hellman handshake,
  702. encrypted to the onion key of the OR (call him Bob). Bob responds with a
  703. \emph{created} cell with the second half of the DH handshake, along with
  704. a hash of $K=g^{xy}$. The goal is to get unilateral entity authentication
  705. (Alice knows she's handshaking with Bob, Bob doesn't care who it is ---
  706. recall that Alice has no key and is trying to remain anonymous) and
  707. unilateral key authentication (Alice and Bob agree on a key, and Alice
  708. knows Bob is the only other person who could know it --- if he is
  709. honest, etc.). We also want perfect forward secrecy, key freshness, etc.
  710. \begin{equation}
  711. \begin{aligned}
  712. \mathrm{Alice} \rightarrow \mathrm{Bob}&: E_{PK_{Bob}}(g^x) \\
  713. \mathrm{Bob} \rightarrow \mathrm{Alice}&: g^y, H(K | \mathrm{``handshake"}) \\
  714. \end{aligned}
  715. \end{equation}
  716. The second step shows both that it was Bob
  717. who received $g^x$, and that it was Bob who came up with $y$. We use
  718. PK encryption in the first step (rather than, e.g., using the first two
  719. steps of STS, which has a signature in the second step) because we
  720. don't have enough room in a single cell for a public key and also a
  721. signature. Preliminary analysis with the NRL protocol analyzer shows
  722. the above protocol to be secure (including providing PFS) under the
  723. traditional Dolev-Yao model.
  724. % cite Cathy? -RD
  725. % did I use the buzzwords correctly? -RD
  726. To extend a circuit past the first hop, Alice sends a \emph{relay extend}
  727. cell to the last node in the circuit, specifying the address of the new
  728. OR and an encrypted $g^x$ for it. That node copies the half-handshake
  729. into a \emph{create} cell, and passes it to the new OR to extend the
  730. circuit. When it responds with a \emph{created} cell, the penultimate OR
  731. copies the payload into a \emph{relay extended} cell and passes it back.
  732. % Nick: please fix my "that OR" pronouns -RD
  733. Once Alice has established the circuit (so she shares a key with each
  734. OR on the circuit), she can send relay cells.
  735. %The stream ID in the relay header indicates to which stream the cell belongs.
  736. % Nick: should i include the above line?
  737. % Paul says yes. -PS
  738. Alice can address each relay cell to any of the ORs on the circuit. To
  739. construct a relay cell destined for a given OR, she iteratively
  740. encrypts the cell payload (that is, the relay header and payload)
  741. with the symmetric key of each hop up to that node. Then, at each hop
  742. down the circuit, the OR decrypts the cell payload and checks whether
  743. it recognizes the stream ID. A stream ID is recognized either if it
  744. is an already open stream at that OR, or if it is equal to zero. The
  745. zero stream ID is treated specially, and is used for control messages,
  746. e.g. starting a new stream. If the stream ID is unrecognized, the OR
  747. passes the relay cell downstream. This \emph{leaky pipe} circuit design
  748. allows Alice's streams to exit at different ORs, for example to tolerate
  749. different exit policies, or to keep the ORs from knowing that two streams
  750. originate at the same person.
  751. To tear down a circuit, Alice sends a destroy control cell. Each OR
  752. in the circuit receives the destroy cell, closes all open streams on
  753. that circuit, and passes a new destroy cell forward. But since circuits
  754. can be built incrementally, they can also be torn down incrementally:
  755. Alice can send a relay truncate cell to a node along the circuit. That
  756. node will send a destroy cell forward, and reply with an acknowledgement
  757. (relay truncated). Alice might truncate her circuit so she can extend it
  758. to different nodes without signaling to the first few nodes (or somebody
  759. observing them) that she is changing her circuit. That is, nodes in the
  760. middle are not even aware that the circuit was truncated, because the
  761. relay cells are encrypted. Similarly, if a node on the circuit goes down,
  762. the adjacent node can send a relay truncated back to Alice. Thus the
  763. ``break a node and see which circuits go down'' attack is weakened.
  764. \SubSection{Opening and closing streams}
  765. \label{subsec:tcp}
  766. When Alice's application wants to open a TCP connection to a given
  767. address and port, it asks the OP (via SOCKS) to make the connection. The
  768. OP chooses the newest open circuit (or creates one if none is available),
  769. chooses a suitable OR on that circuit to be the exit node (usually the
  770. last node, but maybe others due to exit policy conflicts; see Section
  771. \ref{sec:exit-policies}), chooses a new random stream ID for this stream,
  772. and delivers a relay begin cell to that exit node. It uses a stream ID
  773. of zero for the begin cell (so the OR will recognize it), and the relay
  774. payload lists the new stream ID and the destination address and port.
  775. Once the exit node completes the connection to the remote host, it
  776. responds with a relay connected cell through the circuit. Upon receipt,
  777. the OP notifies the application that it can begin talking.
  778. There's a catch to using SOCKS, though -- some applications hand the
  779. alphanumeric address to the proxy, while others resolve it into an IP
  780. address first and then hand the IP to the proxy. When the application
  781. does the DNS resolution first, Alice broadcasts her destination. Common
  782. applications like Mozilla and ssh have this flaw.
  783. In the case of Mozilla, we're fine: the filtering web proxy called Privoxy
  784. does the SOCKS call safely, and Mozilla talks to Privoxy safely. But a
  785. portable general solution, such as for ssh, is an open problem. We could
  786. modify the local nameserver, but this approach is invasive, brittle, and
  787. not portable. We could encourage the resolver library to do resolution
  788. via TCP rather than UDP, but this approach is hard to do right, and also
  789. has portability problems. Our current answer is to encourage the use of
  790. privacy-aware proxies like Privoxy wherever possible, and also provide
  791. a tool similar to \emph{dig} that can do a private lookup through the
  792. Tor network.
  793. Ending a Tor stream is analogous to ending a TCP stream: it uses a
  794. two-step handshake for normal operation, or a one-step handshake for
  795. errors. If one side of the stream closes abnormally, that node simply
  796. sends a relay teardown cell, and tears down the stream. If one side
  797. % Nick: mention relay teardown in 'cell' subsec? good enough name? -RD
  798. of the stream closes the connection normally, that node sends a relay
  799. end cell down the circuit. When the other side has sent back its own
  800. relay end, the stream can be torn down. This two-step handshake allows
  801. for TCP-based applications that, for example, close a socket for writing
  802. but are still willing to read.
  803. \SubSection{Integrity checking on streams}
  804. In the old Onion Routing design, traffic was vulnerable to a malleability
  805. attack: without integrity checking, an adversary could
  806. guess some of the plaintext of a cell, xor it out, and xor in his own
  807. plaintext. Even an external adversary could do this despite the link
  808. encryption!
  809. For example, an adversary could change a create cell to a
  810. destroy cell; change the destination address in a relay begin cell
  811. to the adversary's webserver; or change a user on an ftp connection
  812. from typing ``dir'' to typing ``delete *''. Any node or observer along
  813. the path can introduce such corruption in a stream.
  814. Tor solves this malleability attack with respect to external adversaries
  815. simply by using TLS. Addressing the insider malleability attack is more
  816. complex.
  817. Rather than doing integrity checking of the relay cells at each hop
  818. (like Mixminion \cite{minion-design}), which would increase packet size
  819. by a function of path length\footnote{This is also the argument against
  820. using recent cipher modes like EAX \cite{eax} --- we don't want the added
  821. message-expansion overhead at each hop, and we don't want to leak the path
  822. length (or pad to some max path length).}, we choose to accept passive
  823. timing attacks, and do integrity
  824. checking only at the edges of the circuit. When Alice negotiates a key
  825. with that hop, they both start a SHA-1 with some derivative of that key,
  826. thus starting out with randomness that only the two of them know. From
  827. then on they each incrementally add all the data bytes flowing across
  828. the stream to the SHA-1, and each relay cell includes the first 4 bytes
  829. of the current value of the hash.
  830. The attacker must be able to guess all previous bytes between Alice
  831. and Bob on that circuit (including the pseudorandomness from the key
  832. negotiation), plus the bytes in the current cell, to remove or modify the
  833. cell. The computational overhead isn't so bad, compared to doing an AES
  834. % XXX We never say we use AES. Say it somewhere above?
  835. crypt at each hop in the circuit. We use only four bytes per cell to
  836. minimize overhead; the chance that an adversary will correctly guess a
  837. valid hash, plus the payload the current cell, is acceptly low, given
  838. that Alice or Bob tear down the circuit if they receive a bad hash.
  839. %% probably don't need to even mention this, because the randomness
  840. %% covers it:
  841. %The fun SHA1 attack where the bad guy can incrementally add to a hash
  842. %to get a new valid hash doesn't apply to us, because we never show any
  843. %hashes to anybody.
  844. \SubSection{Website fingerprinting attacks}
  845. % this subsection probably wants to move to analysis -RD
  846. old onion routing is vulnerable to website fingerprinting attacks like
  847. david martin's from usenix sec and drew's from pet2002. so is tor. we
  848. need to send some padding or something, including long-range padding
  849. (to foil the first hop), to solve this. let's hope somebody writes
  850. a followup to \cite{defensive-dropping} that tells us what, exactly,
  851. to do, and why, exactly, it helps.
  852. \SubSection{Rate limiting and fairness}
  853. Nodes use a token bucket approach \cite{foo} to limit the number of
  854. bytes they receive. Tokens are added to the bucket each second (when
  855. the bucket is full, new tokens are discarded.) Each token represents
  856. permission to receive one byte from the network --- to receive a byte,
  857. the connection must remove a token from the bucket. Thus if the bucket
  858. is empty, that connection must wait until more tokens arrive. The number
  859. of tokens we add enforces a longterm average rate of incoming bytes, yet
  860. we still permit short-term bursts above the allowed bandwidth. Currently
  861. bucket sizes are set to ten seconds worth of traffic.
  862. Further, we want to avoid starving any Tor streams. Entire circuits
  863. could starve if we read greedily from connections and one connection
  864. uses all the remaining bandwidth. We solve this by dividing the number
  865. of tokens in the bucket by the number of connections that want to read,
  866. and reading at most that number of bytes from each connection. We iterate
  867. this procedure until the number of tokens in the bucket is under some
  868. threshold (eg 10KB), at which point we greedily read from connections.
  869. Because the number of bytes going out of a node is roughly the same
  870. as the number of bytes that have come in, doing rate limiting only on
  871. incoming bytes should be sufficient.
  872. Further, inspired by Rennhard et al's design in \cite{anonnet}, the edges
  873. of the circuit can automatically distinguish interactive streams compared
  874. to bulk streams --- interactive streams supply cells only rarely. We can
  875. get good latency for these streams by giving them preferential service,
  876. while still getting good overall throughput to the bulk streams. Such
  877. preferential treatment can have impact on anonymity, but an adversary
  878. who can observe the stream can already learn this information through
  879. timing attacks.
  880. \SubSection{Congestion control}
  881. \label{subsec:congestion}
  882. Even with bandwidth rate limiting, we still need to worry about
  883. congestion, either accidental or intentional. If enough users choose
  884. the same OR-to-OR connection for their circuits, that connection
  885. will become saturated. For example, an adversary can make a `put'
  886. request through the onion routing network to a webserver he runs,
  887. and then refuse to read any of the bytes at the webserver end of the
  888. circuit. Without some congestion control mechanism, these bottlenecks
  889. can propagate back through the entire network.
  890. \subsubsection{Circuit-level}
  891. To control a circuit's bandwidth usage, each OR keeps track of two
  892. windows. The package window tracks how many relay data cells the OR is
  893. allowed to package (from outside streams) for transmission back to the OP,
  894. and the deliver window tracks how many relay data cells it is willing
  895. to deliver to streams outside the network. Each window is initialized
  896. (say, to 1000 data cells). When a data cell is packaged or delivered,
  897. the appropriate window is decremented. When an OR has received enough
  898. data cells (currently 100), it sends a relay sendme cell towards the OP,
  899. with stream ID zero. When an OR receives a relay sendme cell with stream
  900. ID zero, it increments its packaging window. Either of these cells
  901. increments the corresponding window by 100. If the packaging window
  902. reaches 0, the OR stops reading from TCP connections for all streams
  903. on the corresponding circuit, and sends no more relay data cells until
  904. receiving a relay sendme cell.
  905. The OP behaves identically, except that it must track a packaging window
  906. and a delivery window for every OR in the circuit. If a packaging window
  907. reaches 0, it stops reading from streams destined for that OR.
  908. \subsubsection{Stream-level}
  909. The stream-level congestion control mechanism is similar to the
  910. circuit-level mechanism above. ORs and OPs use relay sendme cells
  911. to implement end-to-end flow control for individual streams across
  912. circuits. Each stream begins with a package window (e.g. 500 cells),
  913. and increments the window by a fixed value (50) upon receiving a relay
  914. sendme cell. Rather than always returning a relay sendme cell as soon
  915. as enough cells have arrived, the stream-level congestion control also
  916. has to check whether data has been successfully flushed onto the TCP
  917. stream; it sends a relay sendme only when the number of bytes pending
  918. to be flushed is under some threshold (currently 10 cells worth).
  919. Currently, non-data relay cells do not affect the windows. Thus we
  920. avoid potential deadlock issues, e.g. because a stream can't send a
  921. relay sendme cell because its packaging window is empty.
  922. \subsubsection{Needs more research}
  923. We don't need to reimplement full TCP windows (with sequence numbers,
  924. the ability to drop cells when we're full and retransmit later, etc),
  925. because the TCP streams already guarantee in-order delivery of each
  926. cell. But we need to investigate further the effects of the current
  927. parameters on throughput and latency, while also keeping privacy in mind;
  928. see Section \ref{sec:maintaining-anonymity} for more discussion.
  929. \Section{Other design decisions}
  930. \SubSection{Resource management and DoS prevention}
  931. \label{subsec:dos}
  932. Describe DoS prevention. cookies before tls begins, rate limiting of
  933. create cells, link-to-link rate limiting, etc.
  934. Mention twins, what the do, what they can't.
  935. How we should do sequencing and acking like TCP so that we can better
  936. tolerate lost data cells.
  937. Mention that designers have to choose what you send across your
  938. circuit: wrapped IP packets, wrapped stream data, etc. [Disspell
  939. TCP-over-TCP misconception.]
  940. Mention that OR-to-OR connections should be highly reliable. If
  941. they aren't, everything can stall.
  942. \SubSection{Exit policies and abuse}
  943. \label{subsec:exitpolicies}
  944. Exit abuse is a serious barrier to wide-scale Tor deployment --- we
  945. must block or limit attacks and other abuse that users can do through
  946. the Tor network.
  947. Each onion router's \emph{exit policy} describes to which external
  948. addresses and ports the router will permit stream connections. On one end
  949. of the spectrum are \emph{open exit} nodes that will connect anywhere;
  950. on the other end are \emph{middleman} nodes that only relay traffic to
  951. other Tor nodes, and \emph{private exit} nodes that only connect locally
  952. or to addresses internal to that node's organization.
  953. This private exit
  954. node configuration is more secure for clients --- the adversary cannot
  955. see plaintext traffic leaving the network (e.g. to a webserver), so he
  956. is less sure of Alice's destination. More generally, nodes can require
  957. a variety of forms of traffic authentication \cite{onion-discex00}.
  958. Most onnion routers will function as \emph{limited exits} that permit
  959. connections to the world at large, but restrict access to certain abuse-prone
  960. addresses and services.
  961. Tor offers more reliability than the high-latency fire-and-forget
  962. anonymous email networks, because the sender opens a TCP stream
  963. with the remote mail server and receives an explicit confirmation of
  964. acceptance. But ironically, the private exit node model works poorly for
  965. email, when Tor nodes are run on volunteer machines that also do other
  966. things, because it's quite hard to configure mail transport agents so
  967. normal users can send mail normally, but the Tor process can only deliver
  968. mail locally. Further, most organizations have specific hosts that will
  969. deliver mail on behalf of certain IP ranges; Tor operators must be aware
  970. of these hosts and consider putting them in the Tor exit policy.
  971. The abuse issues on closed (e.g. military) networks are different
  972. from the abuse on open networks like the Internet. While these IP-based
  973. access controls are still commonplace on the Internet, on closed networks,
  974. nearly all participants will be honest, and end-to-end authentication
  975. can be assumed for anything important.
  976. Tor is harder than minion because tcp doesn't include an abuse
  977. address. you could reach inside the http stream and change the agent
  978. or something, but that's a specific case and probably won't help
  979. much anyway.
  980. And volunteer nodes don't resolve to anonymizer.mit.edu so it never
  981. even occurs to people that it wasn't you.
  982. Preventing abuse of open exit nodes is an unsolved problem. Princeton's
  983. CoDeeN project \cite{darkside} gives us a glimpse of what we're in for.
  984. % This is more speculative than a description of our design.
  985. but their solutions, which mainly involve rate limiting and blacklisting
  986. nodes which do bad things, don't translate directly to Tor. Rate limiting
  987. still works great, but Tor intentionally separates sender from recipient,
  988. so it's hard to know which sender was the one who did the bad thing,
  989. without just making the whole network wide open.
  990. even limiting most nodes to allow http, ssh, and aim to exit and reject
  991. all other stuff is sketchy, because plenty of abuse can happen over
  992. port 80. but it's a surprisingly good start, because it blocks most things,
  993. and because people are more used to the concept of port 80 abuse not
  994. coming from the machine's owner.
  995. we could also run intrusion detection system (IDS) modules at each tor
  996. node, to dynamically monitor traffic streams for attack signatures. it
  997. can even react when it sees a signature by closing the stream. but IDS's
  998. don't actually work most of the time, and besides, how do you write a
  999. signature for "is sending a mean mail"?
  1000. we should run a squid at each exit node, to provide comparable anonymity
  1001. to private exit nodes for cache hits, to speed everything up, and to
  1002. have a buffer for funny stuff coming out of port 80. we could similarly
  1003. have other exit proxies for other protocols, like mail, to check
  1004. delivered mail for being spam.
  1005. [XXX Um, I'm uncomfortable with this for several reasons.
  1006. It's not good for keeping honest nodes honest about discarding
  1007. state after it's no longer needed. Granted it keeps an external
  1008. observer from noticing how often sites are visited, but it also
  1009. allows fishing expeditions. ``We noticed you went to this prohibited
  1010. site an hour ago. Kindly turn over your caches to the authorities.''
  1011. I previously elsewhere suggested bulk transfer proxies to carve
  1012. up big things so that they could be downloaded in less noticeable
  1013. pieces over several normal looking connections. We could suggest
  1014. similarly one or a handful of squid nodes that might serve up
  1015. some of the more sensitive but common material, especially if
  1016. the relevant sites didn't want to or couldn't run their own OR.
  1017. This would be better than having everyone run a squid which would
  1018. just help identify after the fact the different history of that
  1019. node's activity. All this kind of speculation needs to move to
  1020. future work section I guess. -PS]
  1021. A mixture of open and restricted exit nodes will allow the most
  1022. flexibility for volunteers running servers. But while a large number
  1023. of middleman nodes is useful to provide a large and robust network,
  1024. a small number of exit nodes still simplifies traffic analysis because
  1025. there are fewer nodes the adversary needs to monitor, and also puts a
  1026. greater burden on the exit nodes.
  1027. The JAP cascade model is really nice because they only need one node to
  1028. take the heat per cascade. On the other hand, a hydra scheme could work
  1029. better (it's still hard to watch all the clients).
  1030. Discuss importance of public perception, and how abuse affects it.
  1031. ``Usability is a security parameter''. ``Public Perception is also a
  1032. security parameter.''
  1033. Discuss smear attacks.
  1034. \SubSection{Directory Servers}
  1035. \label{subsec:dirservers}
  1036. First-generation Onion Routing designs \cite{or-jsac98,freedom2-arch} did
  1037. % is or-jsac98 the right cite here? what's our stock OR cite? -RD
  1038. in-band network status updates: each router flooded a signed statement
  1039. to its neighbors, which propagated it onward. But anonymizing networks
  1040. have different security goals than typical link-state routing protocols.
  1041. For example, we worry more about delays (accidental or intentional)
  1042. that can cause different parts of the network to have different pictures
  1043. of link-state and topology. We also worry about attacks to deceive a
  1044. client about the router membership list, topology, or current network
  1045. state. Such \emph{partitioning attacks} on client knowledge help an
  1046. adversary with limited resources to efficiently deploy those resources
  1047. when attacking a target.
  1048. Instead, Tor uses a small group of redundant directory servers to
  1049. track network topology and node state such as current keys and exit
  1050. policies. The directory servers are normal onion routers, but there are
  1051. only a few of them and they are more trusted. They listen on a separate
  1052. port as an HTTP server, both so participants can fetch current network
  1053. state and router lists (a \emph{directory}), and so other onion routers
  1054. can upload their router descriptors.
  1055. [[mention that descriptors are signed with long-term keys; ORs publish
  1056. regularly to dirservers; policies for generating directories; key
  1057. rotation (link, onion, identity); Everybody already know directory
  1058. keys; how to approve new nodes (advogato, sybil, captcha (RTT));
  1059. policy for handling connections with unknown ORs; diff-based
  1060. retrieval; diff-based consensus; separate liveness from descriptor
  1061. list]]
  1062. Of course, a variety of attacks remain. An adversary who controls a
  1063. directory server can track certain clients by providing different
  1064. information --- perhaps by listing only nodes under its control
  1065. as working, or by informing only certain clients about a given
  1066. node. Moreover, an adversary without control of a directory server can
  1067. still exploit differences among client knowledge. If Eve knows that
  1068. node $M$ is listed on server $D_1$ but not on $D_2$, she can use this
  1069. knowledge to link traffic through $M$ to clients who have queried $D_1$.
  1070. Thus these directory servers must be synchronized and redundant. The
  1071. software is distributed with the signature public key of each directory
  1072. server, and directories must be signed by a threshold of these keys.
  1073. The directory servers in Tor are modeled after those in Mixminion
  1074. \cite{minion-design}, but our situation is easier. Firstly, we make the
  1075. simplifying assumption that all participants agree on who the directory
  1076. servers are. Secondly, Mixminion needs to predict node behavior ---
  1077. that is, build a reputation system for guessing future performance of
  1078. nodes based on past performance, and then figure out a way to build
  1079. a threshold consensus of these predictions. Tor just needs to get a
  1080. threshold consensus of the current state of the network.
  1081. The threshold consensus can be reached with standard Byzantine agreement
  1082. techniques \cite{castro-liskov}.
  1083. % Should I just stop the section here? Is the rest crap? -RD
  1084. But this library, while more efficient than previous Byzantine agreement
  1085. systems, is still complex and heavyweight for our purposes: we only need
  1086. to compute a single algorithm, and we do not require strict in-order
  1087. computation steps. Indeed, the complexity of Byzantine agreement protocols
  1088. threatens our security, because users cannot easily understand it and
  1089. thus have less trust in the directory servers. The Tor directory servers
  1090. build a consensus directory
  1091. through a simple four-round broadcast protocol. First, each server signs
  1092. and broadcasts its current opinion to the other directory servers; each
  1093. server then rebroadcasts all the signed opinions it has received. At this
  1094. point all directory servers check to see if anybody's cheating. If so,
  1095. directory service stops, the humans are notified, and that directory
  1096. server is permanently removed from the network. Assuming no cheating,
  1097. each directory server then computes a local algorithm on the set of
  1098. opinions, resulting in a uniform shared directory. Then the servers sign
  1099. this directory and broadcast it; and finally all servers rebroadcast
  1100. the directory and all the signatures.
  1101. The rebroadcast steps ensure that a directory server is heard by either
  1102. all of the other servers or none of them (some of the links between
  1103. directory servers may be down). Broadcasts are feasible because there
  1104. are so few directory servers (currently 3, but we expect to use as many
  1105. as 9 as the network scales). The actual local algorithm for computing
  1106. the shared directory is straightforward, and is described in the Tor
  1107. specification \cite{tor-spec}.
  1108. % we should, uh, add this to the spec. oh, and write it. -RD
  1109. Using directory servers rather than flooding approaches provides
  1110. simplicity and flexibility. For example, they don't complicate
  1111. the analysis when we start experimenting with non-clique network
  1112. topologies. And because the directories are signed, they can be cached at
  1113. all the other onion routers (or even elsewhere). Thus directory servers
  1114. are not a performance bottleneck when we have many users, and also they
  1115. won't aid traffic analysis by forcing clients to periodically announce
  1116. their existence to any central point.
  1117. % Mention Hydra as an example of non-clique topologies. -NM, from RD
  1118. % also find some place to integrate that dirservers have to actually
  1119. % lay test circuits and use them, otherwise routers could connect to
  1120. % the dirservers but discard all other traffic.
  1121. % in some sense they're like reputation servers in \cite{mix-acc} -RD
  1122. \Section{Rendezvous points: location privacy}
  1123. \label{sec:rendezvous}
  1124. Rendezvous points are a building block for \emph{location-hidden services}
  1125. (aka responder anonymity) in the Tor network. Location-hidden services
  1126. means Bob can offer a TCP service, such as a webserver, without revealing
  1127. the IP of that service. One motivation for location privacy is to provide
  1128. protection against DDoS attacks: attackers are forced to attack the
  1129. onion routing network as a whole rather than just Bob's IP.
  1130. We provide this censorship resistance for Bob by allowing him to
  1131. advertise several onion routers (his \emph{Introduction Points}) as his
  1132. public location. Alice, the client, chooses a node for her \emph{Meeting
  1133. Point}. She connects to one of Bob's introduction points, informs him
  1134. about her rendezvous point, and then waits for him to connect to the
  1135. rendezvous
  1136. point. This extra level of indirection means Bob's introduction points
  1137. don't open themselves up to abuse by serving files directly, eg if Bob
  1138. chooses a node in France to serve material distateful to the French,
  1139. %
  1140. % We need a more legitimate-sounding reason here.
  1141. %
  1142. or if Bob's service tends to get DDoS'ed by script kiddies.
  1143. The extra level of indirection also allows Bob to respond to some requests
  1144. and ignore others.
  1145. We provide the necessary glue so that Alice can view webpages from Bob's
  1146. location-hidden webserver with minimal invasive changes. Both Alice and
  1147. Bob must run local onion proxies.
  1148. The steps of a rendezvous:
  1149. \begin{tightlist}
  1150. \item Bob chooses some Introduction Points, and advertises them on a
  1151. Distributed Hash Table (DHT).
  1152. \item Bob establishes onion routing connections to each of his
  1153. Introduction Points, and waits.
  1154. \item Alice learns about Bob's service out of band (perhaps Bob told her,
  1155. or she found it on a website). She looks up the details of Bob's
  1156. service from the DHT.
  1157. \item Alice chooses and establishes a Rendezvous Point (RP) for this
  1158. transaction.
  1159. \item Alice goes to one of Bob's Introduction Points, and gives it a blob
  1160. (encrypted for Bob) which tells him about herself, the RP
  1161. she chose, and the first half of an ephemeral key handshake. The
  1162. Introduction Point sends the blob to Bob.
  1163. \item Bob chooses whether to ignore the blob, or to onion route to RP.
  1164. Let's assume the latter.
  1165. \item RP plugs together Alice and Bob. Note that RP can't recognize Alice,
  1166. Bob, or the data they transmit (they share a session key).
  1167. \item Alice sends a Begin cell along the circuit. It arrives at Bob's
  1168. onion proxy. Bob's onion proxy connects to Bob's webserver.
  1169. \item Data goes back and forth as usual.
  1170. \end{tightlist}
  1171. When establishing an introduction point, Bob provides the onion router
  1172. with a public ``introduction'' key. The hash of this public key
  1173. identifies a unique service, and (since Bob is required to sign his
  1174. messages) prevents anybody else from usurping Bob's introduction point
  1175. in the future. Bob uses the same public key when establishing the other
  1176. introduction points for that service.
  1177. The blob that Alice gives the introduction point includes a hash of Bob's
  1178. public key to identify the service, an optional initial authentication
  1179. token (the introduction point can do prescreening, eg to block replays),
  1180. and (encrypted to Bob's public key) the location of the rendezvous point,
  1181. a rendezvous cookie Bob should tell RP so he gets connected to
  1182. Alice, an optional authentication token so Bob can choose whether to respond,
  1183. and the first half of a DH key exchange. When Bob connects to RP
  1184. and gets connected to Alice's pipe, his first cell contains the
  1185. other half of the DH key exchange.
  1186. The authentication tokens can be used to provide selective access to users
  1187. proportional to how important it is that they main uninterrupted access
  1188. to the service. During normal situations, Bob's service might simply be
  1189. offered directly from mirrors; Bob also gives out authentication cookies
  1190. to special users. When those mirrors are knocked down by DDoS attacks,
  1191. those special users can switch to accessing Bob's service via the Tor
  1192. rendezvous system.
  1193. \subsection{Integration with user applications}
  1194. For each service Bob offers, he configures his local onion proxy to know
  1195. the local IP and port of the server, a strategy for authorizating Alices,
  1196. and a public key. We assume the existence of a robust decentralized
  1197. efficient lookup system which allows authenticated updates, eg
  1198. \cite{cfs:sosp01}. (Each onion router could run a node in this lookup
  1199. system; also note that as a stopgap measure, we can just run a simple
  1200. lookup system on the directory servers.) Bob publishes into the DHT
  1201. (indexed by the hash of the public key) the public key, an expiration
  1202. time (``not valid after''), and the current introduction points for that
  1203. service. Note that Bob's webserver is unmodified, and doesn't even know
  1204. that it's hidden behind the Tor network.
  1205. As far as Alice's experience goes, we require that her client interface
  1206. remain a SOCKS proxy, and we require that she shouldn't have to modify
  1207. her applications. Thus we encode all of the necessary information into
  1208. the hostname (more correctly, fully qualified domain name) that Alice
  1209. uses, eg when clicking on a url in her browser. Location-hidden services
  1210. use the special top level domain called `.onion': thus hostnames take the
  1211. form x.y.onion where x encodes the hash of PK, and y is the authentication
  1212. cookie. Alice's onion proxy examines hostnames and recognizes when they're
  1213. destined for a hidden server. If so, it decodes the PK and starts the
  1214. rendezvous as described in the table above.
  1215. \subsection{Previous rendezvous work}
  1216. Ian Goldberg developed a similar notion of rendezvous points for
  1217. low-latency anonymity systems \cite{ian-thesis}. His ``service tag''
  1218. is the same concept as our ``hash of service's public key''. We make it
  1219. a hash of the public key so it can be self-authenticating, and so the
  1220. client can recognize the same service with confidence later on. His
  1221. design differs from ours in the following ways though. Firstly, Ian
  1222. suggests that the client should manually hunt down a current location of
  1223. the service via Gnutella; whereas our use of the DHT makes lookup faster,
  1224. more robust, and transparent to the user. Secondly, in Tor the client
  1225. and server can share ephemeral DH keys, so at no point in the path is
  1226. the plaintext
  1227. exposed. Thirdly, our design is much more practical for deployment in a
  1228. volunteer network, in terms of getting volunteers to offer introduction
  1229. and rendezvous point services. The introduction points do not output any
  1230. bytes to the clients, and the rendezvous points don't know the client,
  1231. the server, or the stuff being transmitted. The indirection scheme
  1232. is also designed with authentication/authorization in mind -- if the
  1233. client doesn't include the right cookie with its request for service,
  1234. the server doesn't even acknowledge its existence.
  1235. \Section{Analysis}
  1236. \label{sec:analysis}
  1237. In this section, we discuss how well Tor meets our stated design goals
  1238. and its resistance to attacks.
  1239. Goals:
  1240. \begin{description}
  1241. \item [Basic Anonymity:] Because traffic is encrypted, changing in
  1242. appearance, and can flow from anywhere to anywhere within the
  1243. network, a simple observer that cannot see both the initiator
  1244. activity and the corresponding activity where the responder talks to
  1245. the network will not be able to link the initiator and responder.
  1246. Nor is it possible to directly correlate any two communication
  1247. sessions as coming from a single source without additional
  1248. information. Resistance to specific anonymity threats will be discussed
  1249. below.
  1250. \item[Deployability:]
  1251. \item[Usability:]
  1252. \item[Flexibility:]
  1253. \item[Conservative design:]
  1254. \end{description}
  1255. Basic
  1256. How well do we resist chosen adversary?
  1257. How well do we meet stated goals?
  1258. Mention jurisdictional arbitrage.
  1259. Pull attacks and defenses into analysis as a subsection
  1260. \Section{Maintaining anonymity in Tor}
  1261. \label{sec:maintaining-anonymity}
  1262. I probably should have noted that this means loops will be on at least
  1263. five hop routes, which should be rare given the distribution. I'm
  1264. realizing that this is reproducing some of the thought that led to a
  1265. default of five hops in the original onion routing design. There were
  1266. some different assumptions, which I won't spell out now. Note that
  1267. enclave level protections really change these assumptions. If most
  1268. circuits are just two hops, then just a single link observer will be
  1269. able to tell that two enclaves are communicating with high probability.
  1270. So, it would seem that enclaves should have a four node minimum circuit
  1271. to prevent trivial circuit insider identification of the whole circuit,
  1272. and three hop minimum for circuits from an enclave to some nonclave
  1273. responder. But then... we would have to make everyone obey these rules
  1274. or a node that through timing inferred it was on a four hop circuit
  1275. would know that it was probably carrying enclave to enclave traffic.
  1276. Which... if there were even a moderate number of bad nodes in the
  1277. network would make it advantageous to break the connection to conduct
  1278. a reformation intersection attack. Ahhh! I gotta stop thinking
  1279. about this and work on the paper some before the family wakes up.
  1280. On Sat, Oct 25, 2003 at 06:57:12AM -0400, Paul Syverson wrote:
  1281. > Which... if there were even a moderate number of bad nodes in the
  1282. > network would make it advantageous to break the connection to conduct > a reformation intersection attack. Ahhh! I gotta stop thinking > about this and work on the paper some before the family wakes up.
  1283. This is the sort of issue that should go in the 'maintaining anonymity
  1284. with tor' section towards the end. :)
  1285. Email from between roger and me to beginning of section above. Fix and move.
  1286. [Put as much of this as a part of open issues as is possible.]
  1287. [what's an anonymity set?]
  1288. packet counting attacks work great against initiators. need to do some
  1289. level of obfuscation for that. standard link padding for passive link
  1290. observers. long-range padding for people who own the first hop. are
  1291. we just screwed against people who insert timing signatures into your
  1292. traffic?
  1293. Even regardless of link padding from Alice to the cloud, there will be
  1294. times when Alice is simply not online. Link padding, at the edges or
  1295. inside the cloud, does not help for this.
  1296. how often should we pull down directories? how often send updated
  1297. server descs?
  1298. when we start up the client, should we build a circuit immediately,
  1299. or should the default be to build a circuit only on demand? should we
  1300. fetch a directory immediately?
  1301. would we benefit from greater synchronization, to blend with the other
  1302. users? would the reduced speed hurt us more?
  1303. does the "you can't see when i'm starting or ending a stream because
  1304. you can't tell what sort of relay cell it is" idea work, or is just
  1305. a distraction?
  1306. does running a server actually get you better protection, because traffic
  1307. coming from your node could plausibly have come from elsewhere? how
  1308. much mixing do you need before this is actually plausible, or is it
  1309. immediately beneficial because many adversary can't see your node?
  1310. do different exit policies at different exit nodes trash anonymity sets,
  1311. or not mess with them much?
  1312. do we get better protection against a realistic adversary by having as
  1313. many nodes as possible, so he probably can't see the whole network,
  1314. or by having a small number of nodes that mix traffic well? is a
  1315. cascade topology a more realistic way to get defenses against traffic
  1316. confirmation? does the hydra (many inputs, few outputs) topology work
  1317. better? are we going to get a hydra anyway because most nodes will be
  1318. middleman nodes?
  1319. using a circuit many times is good because it's less cpu work.
  1320. good because of predecessor attacks with path rebuilding.
  1321. bad because predecessor attacks can be more likely to link you with a
  1322. previous circuit since you're so verbose.
  1323. bad because each thing you do on that circuit is linked to the other
  1324. things you do on that circuit.
  1325. how often to rotate?
  1326. how to decide when to exit from middle?
  1327. when to truncate and re-extend versus when to start new circuit?
  1328. Because Tor runs over TCP, when one of the servers goes down it seems
  1329. that all the circuits (and thus streams) going over that server must
  1330. break. This reduces anonymity because everybody needs to reconnect
  1331. right then (does it? how much?) and because exit connections all break
  1332. at the same time, and it also reduces usability. It seems the problem
  1333. is even worse in a p2p environment, because so far such systems don't
  1334. really provide an incentive for nodes to stay connected when they're
  1335. done browsing, so we would expect a much higher churn rate than for
  1336. onion routing. Are there ways of allowing streams to survive the loss
  1337. of a node in the path?
  1338. discuss topologies. Cite George's non-freeroutes paper. Maybe this
  1339. graf goes elsewhere.
  1340. discuss attracting users; incentives; usability.
  1341. Choosing paths and path lengths.
  1342. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  1343. \Section{Attacks and Defenses}
  1344. \label{sec:attacks}
  1345. Below we summarize a variety of attacks and how well our design withstands
  1346. them.
  1347. \begin{enumerate}
  1348. \item \textbf{Passive attacks}
  1349. \begin{itemize}
  1350. \item \emph{Observing user behavior.}
  1351. \item \emph{Timing correlation.}
  1352. \item \emph{Size correlation.}
  1353. \item \emph{Option distinguishability.} User configuration options.
  1354. A: We standardize on how clients behave. cite econymics.
  1355. \item sub of the above on exit policy\\
  1356. Partitioning based on exit policy.
  1357. Run a rare exit server/something other people won't allow.
  1358. DOS three of the 4 who would allow a certain exit.
  1359. \item Content analysis. Not our main thing, but, Privoxy to
  1360. anonymization of data stream.
  1361. \end{itemize}
  1362. \item \textbf{Active attacks}
  1363. \begin{itemize}
  1364. \item \emph{Key compromise.} Talk about all three keys. 3 bullets
  1365. \item \emph{Iterated subpoena.} Legal roving adversary. Works bad against
  1366. this because of ephemeral keys. Criticize pets paper in section 2 for
  1367. failing to consider this when describing roving adversary.
  1368. \item \emph{Run recipient.} Be the Web server.
  1369. \item \emph{Run a hostile node.}
  1370. \item \emph{Compromise entire path.} Directory servers controlling admission
  1371. to network. But if you do compromise it, we're toast.
  1372. \item \emph{Selectively DoS OR.} Flood the pipe. We're toast. Rate limiting.
  1373. We can't stop flooding creates through all your neighbors. Router twins
  1374. is a useful fallback, makes you hit all the twins.
  1375. \item \emph{Introduce timing into messages.}
  1376. \item \emph{Tagging attacks.}
  1377. Integrity checking stops this.
  1378. Subcase of running a hostile node:
  1379. the exit node can change the content you're getting to try to
  1380. trick you. similarly, when it rejects you due to exit policy,
  1381. it could give you a bad IP that sends you somewhere else.
  1382. \end{itemize}
  1383. \item \emph{replaying traffic} Can't in Tor. NonSSL anonymizer.
  1384. \item Do bad things with the Tor network, so we are hated and
  1385. get shut down. Now the user you want to watch has to use anonymizer.
  1386. Exit policy's are a start.
  1387. \item Send spam through the network. Exit policy (no open relay) and
  1388. rate limiting. We won't send to more than 8 people at a time. See
  1389. section 5.1.
  1390. we rely on DNS being globally consistent. if people in africa resolve
  1391. IPs differently, then asking to extend a circuit to a certain IP can
  1392. give away your origin.
  1393. \item \textbf{Directory attacks}
  1394. \begin{itemize}
  1395. \item knock out a dirserver
  1396. \item knock out half the dirservers
  1397. \item trick user into using different software (with different dirserver
  1398. keys)
  1399. \item OR connects to the dirservers but nowhere else
  1400. \item foo
  1401. \end{itemize}
  1402. \item \textbf{Attacks against rendezvous points}
  1403. \begin{itemize}
  1404. \item foo
  1405. \end{itemize}
  1406. \end{enumerate}
  1407. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  1408. \Section{Future Directions and Open Problems}
  1409. \label{sec:conclusion}
  1410. % Mention that we need to do TCP over tor for reliability.
  1411. Tor brings together many innovations into
  1412. a unified deployable system. But there are still several attacks that
  1413. work quite well, as well as a number of sustainability and run-time
  1414. issues remaining to be ironed out. In particular:
  1415. \begin{itemize}
  1416. \item \emph{Scalability:} Since Tor's emphasis currently is on simplicity
  1417. of design and deployment, the current design won't easily handle more
  1418. than a few hundred servers, because of its clique topology. Restricted
  1419. route topologies \cite{danezis-pets03} promise comparable anonymity
  1420. with much better scaling properties, but we must solve problems like
  1421. how to randomly form the network without introducing net attacks.
  1422. % [cascades are a restricted route topology too. we must mention
  1423. % earlier why we're not satisfied with the cascade approach.]-RD
  1424. % [We do. At least
  1425. \item \emph{Cover traffic:} Currently we avoid cover traffic because
  1426. it introduces clear performance and bandwidth costs, but and its
  1427. security properties are not well understood. With more research
  1428. \cite{SS03,defensive-dropping}, the price/value ratio may change, both for
  1429. link-level cover traffic and also long-range cover traffic. In particular,
  1430. we expect restricted route topologies to reduce the cost of cover traffic
  1431. because there are fewer links to cover.
  1432. \item \emph{Better directory distribution:} Even with the threshold
  1433. directory agreement algorithm described in \ref{subsec:dirservers},
  1434. the directory servers are still trust bottlenecks. We must find more
  1435. decentralized yet practical ways to distribute up-to-date snapshots of
  1436. network status without introducing new attacks.
  1437. \item \emph{Implementing location-hidden servers:} While Section
  1438. \ref{sec:rendezvous} provides a design for rendezvous points and
  1439. location-hidden servers, this feature has not yet been implemented.
  1440. We will likely encounter additional issues, both in terms of usability
  1441. and anonymity, that must be resolved.
  1442. \item \emph{Wider-scale deployment:} The original goal of Tor was to
  1443. gain experience in deploying an anonymizing overlay network, and learn
  1444. from having actual users. We are now at the point where we can start
  1445. deploying a wider network. We will see what happens!
  1446. % ok, so that's hokey. fix it. -RD
  1447. \item \emph{Further specification review:} Foo.
  1448. \end{itemize}
  1449. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  1450. %\Section{Acknowledgments}
  1451. %% commented out for anonymous submission
  1452. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  1453. \bibliographystyle{latex8}
  1454. \bibliography{tor-design}
  1455. \end{document}
  1456. % Style guide:
  1457. % U.S. spelling
  1458. % avoid contractions (it's, can't, etc.)
  1459. % 'mix', 'mixes' (as noun)
  1460. % 'mix-net'
  1461. % 'mix', 'mixing' (as verb)
  1462. % 'middleman' [Not with a hyphen; the hyphen has been optional
  1463. % since Middle English.]
  1464. % 'nymserver'
  1465. % 'Cypherpunk', 'Cypherpunks', 'Cypherpunk remailer'
  1466. % 'Onion Routing design', 'onion router' [note capitalization]
  1467. % 'SOCKS'
  1468. %
  1469. %
  1470. % 'Substitute ``Damn'' every time you're inclined to write ``very;'' your
  1471. % editor will delete it and the writing will be just as it should be.'
  1472. % -- Mark Twain