| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988 | \documentclass[twocolumn]{article}\usepackage{usenix}%\documentclass[times,10pt,twocolumn]{article}%\usepackage{latex8}%\usepackage{times}\usepackage{url}\usepackage{graphics}\usepackage{amsmath}\usepackage{epsfig}\pagestyle{empty}\renewcommand\url{\begingroup \def\UrlLeft{<}\def\UrlRight{>}\urlstyle{tt}\Url}\newcommand\emailaddr{\begingroup \def\UrlLeft{<}\def\UrlRight{>}\urlstyle{tt}\Url}\newcommand{\workingnote}[1]{}        % The version that hides the note.%\newcommand{\workingnote}[1]{(**#1)}   % The version that makes the note visible.% If an URL ends up with '%'s in it, that's because the line *in the .bib/.tex% file* is too long, so break it there (it doesn't matter if the next line is% indented with spaces). -DH%\newif\ifpdf%\ifx\pdfoutput\undefined%   \pdffalse%\else%   \pdfoutput=1%   \pdftrue%\fi\newenvironment{tightlist}{\begin{list}{$\bullet$}{  \setlength{\itemsep}{0mm}    \setlength{\parsep}{0mm}    %  \setlength{\labelsep}{0mm}    %  \setlength{\labelwidth}{0mm}    %  \setlength{\topsep}{0mm}    }}{\end{list}}% Cut down on whitespace above and below figures displayed at head/foot of% page.\setlength{\textfloatsep}{3mm}% Cut down on whitespace above and below figures displayed in middle of page\setlength{\intextsep}{3mm}\begin{document}%% Use dvipdfm instead. --DH%\ifpdf%  \pdfcompresslevel=9%  \pdfpagewidth=\the\paperwidth%  \pdfpageheight=\the\paperheight%\fi\title{Tor: The Second-Generation Onion Router} %\\DRAFT VERSION}% Putting the 'Private' back in 'Virtual Private Network'\author{Roger Dingledine \\ The Free Haven Project \\ arma@freehaven.net \andNick Mathewson \\ The Free Haven Project \\ nickm@freehaven.net \andPaul Syverson \\ Naval Research Lab \\ syverson@itd.nrl.navy.mil}\maketitle\thispagestyle{empty}\begin{abstract}We present Tor, a circuit-based low-latency anonymous communicationservice. This second-generation Onion Routing system addresses limitationsin the original design by adding perfect forward secrecy, congestioncontrol, directory servers, integrity checking, configurable exit policies,and a practical design for location-hidden services via rendezvouspoints. Tor works on the real-worldInternet, requires no special privileges or kernel modifications, requireslittle synchronization or coordination between nodes, and provides areasonable tradeoff between anonymity, usability, and efficiency.We briefly describe our experiences with an international network ofmore than 30 nodes. % that has been running for several months.We close with a list of open problems in anonymous communication.\end{abstract}%\begin{center}%\textbf{Keywords:} anonymity, peer-to-peer, remailer, nymserver, reply block%\end{center}%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\section{Overview}\label{sec:intro}Onion Routing is a distributed overlay network designed to anonymizeTCP-based applications like web browsing, secure shell,and instant messaging. Clients choose a path through the network andbuild a \emph{circuit}, in which each node (or ``onion router'' or ``OR'')in the path knows its predecessor and successor, but no other nodes inthe circuit.  Traffic flows down the circuit in fixed-size\emph{cells}, which are unwrapped by a symmetric key at each node(like the layers of an onion) and relayed downstream. TheOnion Routing project published several design and analysispapers \cite{or-ih96,or-jsac98,or-discex00,or-pet00}. While a wide area OnionRouting network was deployed briefly, the only long-runningpublic implementation was a fragileproof-of-concept that ran on a single machine. Even this simple deploymentprocessed connections from over sixty thousand distinct IP addresses fromall over the world at a rate of about fifty thousand per day.But many critical design and deployment issues were neverresolved, and the design has not been updated in years. Herewe describe Tor, a protocol for asynchronous, loosely federated onionrouters that provides the following improvements over the old OnionRouting design:\textbf{Perfect forward secrecy:} In the original Onion Routing design,a single hostile node could record traffic andlater compromise successive nodes in the circuit and force themto decrypt it. Rather than using a single multiply encrypted datastructure (an \emph{onion}) to lay each circuit,Tor now uses an incremental or \emph{telescoping} path-building design,where the initiator negotiates session keys with each successive hop inthe circuit.  Once these keys are deleted, subsequently compromised nodescannot decrypt old traffic.  As a side benefit, onion replay detectionis no longer necessary, and the process of building circuits is morereliable, since the initiator knows when a hop fails and can then tryextending to a new node.\textbf{Separation of ``protocol cleaning'' from anonymity:}Onion Routing originally required a separate ``applicationproxy'' for each supported application protocol---most of which werenever written, so many applications were never supported.  Tor uses thestandard and near-ubiquitous SOCKS~\cite{socks4} proxy interface, allowingus to support most TCP-based programs without modification.  Tor nowrelies on the filtering features of privacy-enhancingapplication-level proxies such as Privoxy~\cite{privoxy}, without tryingto duplicate those features itself.\textbf{No mixing, padding, or traffic shaping (yet):} OnionRouting originally called for batching and reordering cells as they arrived,assumed padding between ORs, and inlater designs added padding between onion proxies (users) andORs~\cite{or-ih96,or-jsac98}.  Tradeoffs between padding protectionand cost were discussed, and \emph{traffic shaping} algorithms weretheorized~\cite{or-pet00} to provide good security without expensivepadding, but no concrete padding scheme was suggested.Recent research~\cite{econymics}and deployment experience~\cite{freedom21-security} suggest that thislevel of resource use is not practical or economical; and even fulllink padding is still vulnerable~\cite{defensive-dropping}. Thus,until we have a proven and convenient design for traffic shaping orlow-latency mixing that improves anonymity against a realisticadversary, we leave these strategies out.\textbf{Many TCP streams can share one circuit:} Onion Routing originallybuilt a separate circuit for eachapplication-level request, but this requiredmultiple public key operations for every request, and also presenteda threat to anonymity from building so many circuits; seeSection~\ref{sec:maintaining-anonymity}.  Tor multiplexes multiple TCPstreams along each circuit to improve efficiency and anonymity.\textbf{Leaky-pipe circuit topology:} Through in-band signalingwithin the circuit, Tor initiators can direct traffic to nodes partwaydown the circuit. This novel approachallows traffic to exit the circuit from the middle---possiblyfrustrating traffic shape and volume attacks based on observing the endof the circuit. (It also allows for long-range padding iffuture research shows this to be worthwhile.)\textbf{Congestion control:} Earlier anonymity designs do notaddress traffic bottlenecks. Unfortunately, typical approaches toload balancing and flow control in overlay networks involve inter-nodecontrol communication and global views of traffic. Tor's decentralizedcongestion control uses end-to-end acks to maintain anonymitywhile allowing nodes at the edges of the network to detect congestionor flooding and send less data until the congestion subsides.\textbf{Directory servers:} The earlier Onion Routing designplanned to flood state information through the network---an approachthat can be unreliable and complex. % open to partitioning attacks.Tor takes a simplified view toward distributing thisinformation. Certain more trusted nodes act as \emph{directoryservers}: they provide signed directories describing knownrouters and their current state. Users periodically download themvia HTTP.\textbf{Variable exit policies:} Tor provides a consistent mechanismfor each node to advertise a policy describing the hostsand ports to which it will connect. These exit policies are criticalin a volunteer-based distributed infrastructure, because each operatoris comfortable with allowing different types of traffic to exitfrom his node.\textbf{End-to-end integrity checking:} The original Onion Routingdesign did no integrity checking on data. Any node on thecircuit could change the contents of data cells as they passed by---forexample, to alter a connection request so it would connectto a different webserver, or to `tag' encrypted traffic and look forcorresponding corrupted traffic at the network edges~\cite{minion-design}.Tor hampers these attacks by verifying data integrity before it leavesthe network.%\textbf{Improved robustness to failed nodes:} A failed node%in the old design meant that circuit building failed, but thanks to%Tor's step-by-step circuit building, users notice failed nodes%while building circuits and route around them. Additionally, liveness%information from directories allows users to avoid unreliable nodes in%the first place.%% Can't really claim this, now that we've found so many variants of%% attack on partial-circuit-building. -RD\textbf{Rendezvous points and hidden services:}Tor provides an integrated mechanism for responder anonymity vialocation-protected servers.  Previous Onion Routing designs includedlong-lived ``reply onions'' that could be used to build circuitsto a hidden server, but these reply onions did not provide forwardsecurity, and became useless if any node in the path went downor rotated its keys.  In Tor, clients negotiate {\it rendezvous points}to connect with hidden servers; reply onions are no longer required.Unlike Freedom~\cite{freedom2-arch}, Tor does not require OS kernelpatches or network stack support.  This prevents us from anonymizingnon-TCP protocols, but has greatly helped our portability anddeployability.%Unlike Freedom~\cite{freedom2-arch}, Tor only anonymizes%TCP-based protocols---not requiring patches (or built-in support) in an%operating system's network stack has been valuable to Tor's%portability and deployability.We have implemented all of the above features, including rendezvouspoints. Our source code isavailable under a free license, and Tor%, as far as we know, is unencumbered by patents.is not covered by the patent that affected distribution and use ofearlier versions of Onion Routing.We have deployed a wide-area alpha networkto test the design, to get more experience with usabilityand users, and to provide a research platform for experimentation.As of this writing, the network stands at 32 nodes %in thirteen%distinct administrative domainsspread over two continents.We review previous work in Section~\ref{sec:related-work}, describeour goals and assumptions in Section~\ref{sec:assumptions},and then address the above list of improvements inSections~\ref{sec:design},~\ref{sec:rendezvous}, and~\ref{sec:other-design}.We summarizein Section~\ref{sec:attacks} how our design stands up toknown attacks, and talk about our early deployment experiences inSection~\ref{sec:in-the-wild}. We conclude with a list of open problems inSection~\ref{sec:maintaining-anonymity} and future work for the OnionRouting project in Section~\ref{sec:conclusion}.%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\section{Related work}\label{sec:related-work}Modern anonymity systems date to Chaum's {\bf Mix-Net}design~\cite{chaum-mix}. Chaumproposed hiding the correspondence between sender and recipient bywrapping messages in layers of public-key cryptography, and relaying themthrough a path composed of ``mixes.''  Each mix in turndecrypts, delays, and re-orders messages before relaying themonward.%toward their destinations.Subsequent relay-based anonymity designs have diverged in twomain directions. Systems like {\bf Babel}~\cite{babel},{\bf Mixmaster}~\cite{mixmaster-spec},and {\bf Mixminion}~\cite{minion-design} have triedto maximize anonymity at the cost of introducing comparatively large andvariable latencies. Because of this decision, these \emph{high-latency}networks resist strong global adversaries,but introduce too much lag for interactive tasks like web browsing,Internet chat, or SSH connections.Tor belongs to the second category: \emph{low-latency} designs thattry to anonymize interactive network traffic. These systems handlea variety of bidirectional protocols. They also provide more convenientmail delivery than the high-latency anonymous emailnetworks, because the remote mail server provides explicit and timelydelivery confirmation. But because these designs typicallyinvolve many packets that must be delivered quickly, it isdifficult for them to prevent an attacker who can eavesdrop both ends of thecommunication from correlating the timing and volumeof traffic entering the anonymity network with traffic leaving it~\cite{SS03}.Theseprotocols are similarly vulnerable to an active adversary who introducestiming patterns into traffic entering the network and looksfor correlated patterns among exiting traffic.Although some work has been done to frustrate these attacks, most designsprotect primarily against traffic analysis rather than trafficconfirmation (see Section~\ref{subsec:threat-model}).The simplest low-latency designs are single-hop proxies such as the{\bf Anonymizer}~\cite{anonymizer}: a single trusted server strips thedata's origin before relaying it.  These designs are easy toanalyze, but users must trust the anonymizing proxy.Concentrating the traffic to this single point increases the anonymity set(the people a given user is hiding among), but it is vulnerable if theadversary can observe all traffic entering and leaving the proxy.More complex are distributed-trust, circuit-based anonymizing systems.In these designs, a user establishes one or more medium-term bidirectionalend-to-end circuits, and tunnels data in fixed-size cells.Establishing circuits is computationally expensive and typicallyrequires public-keycryptography, whereas relaying cells is comparatively inexpensive andtypically requires only symmetric encryption.Because a circuit crosses several servers, and each server only knowsthe adjacent servers in the circuit, no single server can link auser to her communication partners.The {\bf Java Anon Proxy} (also known as JAP or Web MIXes) uses fixed sharedroutes known as \emph{cascades}.  As with a single-hop proxy, thisapproach aggregates users into larger anonymity sets, but again anattacker only needs to observe both ends of the cascade to bridge allthe system's traffic.  The Java Anon Proxy's designcalls for padding between end users and the head of thecascade~\cite{web-mix}. However, it is not demonstrated whether the currentimplementation's padding policy improves anonymity.{\bf PipeNet}~\cite{back01, pipenet}, another low-latency design proposedaround the same time as Onion Routing, gavestronger anonymity but allowed a single user to shutdown the network by not sending. Systems like {\bf ISDNmixes}~\cite{isdn-mixes} were designed for other environments withdifferent assumptions.%XXX please can we fix this sentence to something less demeaningIn P2P designs like {\bf Tarzan}~\cite{tarzan:ccs02} and{\bf MorphMix}~\cite{morphmix:fc04}, all participants both generatetraffic and relay traffic for others. These systems aim to concealwhether a given peer originated a requestor just relayed it from another peer. While Tarzan and MorphMix uselayered encryption as above, {\bf Crowds}~\cite{crowds-tissec} simply assumesan adversary who cannot observe the initiator: it uses no public-keyencryption, so any node on a circuit can read users' traffic.{\bf Hordes}~\cite{hordes-jcs} is based on Crowds but also uses multicastresponses to hide the initiator. {\bf Herbivore}~\cite{herbivore} and$\mbox{\bf P}^{\mathbf 5}$~\cite{p5} go even further, requiring broadcast.These systems are designed primarily for communication among peers,although Herbivore users can make external connections byrequesting a peer to serve as a proxy.Systems like {\bf Freedom} and the original Onion Routing build circuitsall at once, using a layered ``onion'' of public-key encrypted messages,each layer of which provides session keys and the address of thenext server in the circuit. Tor as described herein, Tarzan, MorphMix,{\bf Cebolla}~\cite{cebolla}, and Rennhard's {\bf Anonymity Network}~\cite{anonnet}build circuitsin stages, extending them one hop at a time.Section~\ref{subsubsec:constructing-a-circuit} describes how thisapproach enables perfect forward secrecy.Circuit-based designs must choose which protocol layerto anonymize. They may intercept IP packets directly, andrelay them whole (stripping the source address) along thecircuit~\cite{freedom2-arch,tarzan:ccs02}.  LikeTor, they may accept TCP streams and relay the data in those streams,ignoring the breakdown of that data into TCPsegments~\cite{morphmix:fc04,anonnet}. Finally, like Crowds, they may acceptapplication-level protocols such as HTTP and relay the applicationrequests themselves.Making this protocol-layer decision requires a compromise between flexibilityand anonymity.  For example, a system that understands HTTPcan stripidentifying information from requests, can take advantage of cachingto limit the number of requests that leave the network, and can batchor encode requests to minimize the number of connections.On the other hand, an IP-level anonymizer can handle nearly any protocol,even ones unforeseen by its designers (though these systems requirekernel-level modifications to some operating systems, and so are morecomplex and less portable). TCP-level anonymity networks like Tor presenta middle approach: they are application neutral (so long as theapplication supports, or can be tunneled across, TCP), but by treatingapplication connections as data streams rather than raw TCP packets,they avoid the inefficiencies of tunneling TCP overTCP.Distributed-trust anonymizing systems need to prevent attackers fromadding too many servers and thus compromising user paths.Tor relies on a small set of well-known directory servers, run byindependent parties, to decide which nodes canjoin. Tarzan and MorphMix allow unknown users to run servers, and usea limited resource (like IP addresses) to prevent an attacker fromcontrolling too much of the network.  Crowds suggests requiringwritten, notarized requests from potential crowd members.Anonymous communication is essential for censorship-resistantsystems like Eternity~\cite{eternity}, Free~Haven~\cite{freehaven-berk},Publius~\cite{publius}, and Tangler~\cite{tangler}. Tor's rendezvouspoints enable connections between mutually anonymous entities; theyare a building block for location-hidden servers, which are needed byEternity and Free~Haven.% didn't include rewebbers. No clear place to put them, so I'll leave% them out for now. -RD\section{Design goals and assumptions}\label{sec:assumptions}\noindent{\large\bf Goals}\\Like other low-latency anonymity designs, Tor seeks to frustrateattackers from linking communication partners, or from linkingmultiple communications to or from a single user.  Within thismain goal, however, several considerations have directedTor's evolution.\textbf{Deployability:} The design must be deployed and used in thereal world.  Thus itmust not be expensive to run (for example, by requiring more bandwidththan volunteers are willing to provide); must not place a heavyliability burden on operators (for example, by allowing attackers toimplicate onion routers in illegal activities); and must not bedifficult or expensive to implement (for example, by requiring kernelpatches, or separate proxies for every protocol).  We also cannotrequire non-anonymous parties (such as websites)to run our software.  (Our rendezvous point design does not meetthis goal for non-anonymous users talking to hidden servers,however; see Section~\ref{sec:rendezvous}.)\textbf{Usability:} A hard-to-use system has fewer users---and becauseanonymity systems hide users among users, a system with fewer usersprovides less anonymity.  Usability is thus not only a convenience:it is a security requirement~\cite{econymics,back01}. Tor shouldtherefore notrequire modifying familiar applications; should not introduce prohibitivedelays;and should require as few configuration decisionsas possible.  Finally, Tor should be easily implementable on all commonplatforms; we cannot require users to change their operating systemto be anonymous.  (Tor currently runs on Win32, Linux,Solaris, BSD-style Unix, MacOS X, and probably others.)\textbf{Flexibility:} The protocol must be flexible and well-specified,so Tor can serve as a test-bed for future research.Many of the open problems in low-latency anonymitynetworks, such as generating dummy traffic or preventing Sybilattacks~\cite{sybil}, may be solvable independently from the issuessolved byTor. Hopefully future systems will not need to reinvent Tor's design.%(But note that while a flexible design benefits researchers,%there is a danger that differing choices of extensions will make users%distinguishable. Experiments should be run on a separate network.)\textbf{Simple design:} The protocol's design and securityparameters must be well-understood. Additional features impose implementationand complexity costs; adding unproven techniques to the design threatensdeployability, readability, and ease of security analysis. Tor aims todeploy a simple and stable system that integrates the best acceptedapproaches to protecting anonymity.\\\noindent{\large\bf Non-goals}\label{subsec:non-goals}\\In favoring simple, deployable designs, we have explicitly deferredseveral possible goals, either because they are solved elsewhere, or becausethey are not yet solved.\textbf{Not peer-to-peer:} Tarzan and MorphMix aim to scale to completelydecentralized peer-to-peer environments with thousands of short-livedservers, many of which may be controlled by an adversary.  This approachis appealing, but still has many openproblems~\cite{tarzan:ccs02,morphmix:fc04}.\textbf{Not secure against end-to-end attacks:} Tor does not claimto completely solve end-to-end timing or intersectionattacks. Some approaches, such as having users run their own onion routers,may help;see Section~\ref{sec:maintaining-anonymity} for more discussion.\textbf{No protocol normalization:} Tor does not provide \emph{protocolnormalization} like Privoxy or the Anonymizer. If senders want anonymity fromresponders while using complex and variableprotocols like HTTP, Tor must be layered with a filtering proxy suchas Privoxy to hide differences between clients, and expunge protocolfeatures that leak identity.Note that by this separation Tor can also provide services thatare anonymous to the network yet authenticated to the responder, likeSSH. Similarly, Tor does not integratetunneling for non-stream-based protocols like UDP; this must beprovided by an external service if appropriate.\textbf{Not steganographic:} Tor does not try to conceal who is connectedto the network.\subsection{Threat Model}\label{subsec:threat-model}A global passive adversary is the most commonly assumed threat whenanalyzing theoretical anonymity designs. But like all practicallow-latency systems, Tor does not protect against such a strongadversary. Instead, we assume an adversary who can observe some fractionof network traffic; who can generate, modify, delete, or delaytraffic;  who can operate onion routers of his own; and who cancompromise some fraction of the onion routers.In low-latency anonymity systems that use layered encryption, theadversary's typical goal is to observe both the initiator and theresponder. By observing both ends, passive attackers can confirm asuspicion that Alice istalking to Bob if the timing and volume patterns of the traffic on theconnection are distinct enough; active attackers can induce timingsignatures on the traffic to force distinct patterns. Ratherthan focusing on these \emph{traffic confirmation} attacks,we aim to prevent \emph{trafficanalysis} attacks, where the adversary uses traffic patterns to learnwhich points in the network he should attack.Our adversary might try to link an initiator Alice with hercommunication partners, or try to build a profile of Alice'sbehavior. He might mount passive attacks by observing the network edgesand correlating traffic entering and leaving the network---byrelationships in packet timing, volume, or externally visibleuser-selectedoptions. The adversary can also mount active attacks by compromisingrouters or keys; by replaying traffic; by selectively denying serviceto trustworthy routers to move users tocompromised routers, or denying service to users to see if trafficelsewhere in thenetwork stops; or by introducing patterns into traffic that can later bedetected. The adversary might subvert the directory servers to give usersdiffering views of network state. Additionally, he can try to decreasethe network's reliability by attacking nodes or by performing antisocialactivities from reliable nodes and trying to get them taken down---makingthe network unreliable flushes users to other less anonymoussystems, where they may be easier to attack. We summarizein Section~\ref{sec:attacks} how well the Tor design defends againsteach of these attacks.%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\section{The Tor Design}\label{sec:design}The Tor network is an overlay network; each onion router (OR)runs as a normaluser-level process without any special privileges.Each onion router maintains a TLS~\cite{TLS}connection to every other onion router.%(We discuss alternatives to this clique-topology assumption in%Section~\ref{sec:maintaining-anonymity}.)% A subset of the ORs also act as%directory servers, tracking which routers are in the network;%see Section~\ref{subsec:dirservers} for directory server details.Each userruns local software called an onion proxy (OP) to fetch directories,establish circuits across the network,and handle connections from user applications.  These onion proxies acceptTCP streams and multiplex them across the circuits. The onionrouter on the other sideof the circuit connects to the requested destinationsand relays data.Each onion router maintains a long-term identity key and a short-termonion key. The identitykey is used to sign TLS certificates, to sign the OR's \emph{routerdescriptor} (a summary of its keys, address, bandwidth, exit policy,and so on), and (by directory servers) to sign directories. %Changing%the identity key of a router is considered equivalent to creating a%new router. The onion key is used to decrypt requestsfrom users to set up a circuit and negotiate ephemeral keys. The TLS protocol also establishes a short-term link key when communicatingbetween ORs. Short-term keys are rotated periodically andindependently, to limit the impact of key compromise.Section~\ref{subsec:cells} presents the fixed-size\emph{cells} that are the unit of communication in Tor. We describein Section~\ref{subsec:circuits} how circuits arebuilt, extended, truncated, and destroyed. Section~\ref{subsec:tcp}describes how TCP streams are routed through the network.  We addressintegrity checking in Section~\ref{subsec:integrity-checking},and resource limiting in Section~\ref{subsec:rate-limit}.Finally,Section~\ref{subsec:congestion} talks about congestion control andfairness issues.\subsection{Cells}\label{subsec:cells}Onion routers communicate with one another, and with users' OPs, viaTLS connections with ephemeral keys.  Using TLS conceals the data onthe connection with perfect forward secrecy, and prevents an attackerfrom modifying data on the wire or impersonating an OR.Traffic passes along these connections in fixed-size cells.  Each cellis 512 bytes, %(but see Section~\ref{sec:conclusion} for a discussion of%allowing large cells and small cells on the same network),and consists of a header and a payload. The header includes a circuitidentifier (circID) that specifies which circuit the cell refers to(many circuits can be multiplexed over the single TLS connection), anda command to describe what to do with the cell's payload.  (Circuitidentifiers are connection-specific: each circuit has a differentcircID on each OP/OR or OR/OR connection it traverses.)Based on their command, cells are either \emph{control} cells, which arealways interpreted by the node that receives them, or \emph{relay} cells,which carry end-to-end stream data.   The control cell commands are:\emph{padding} (currently used for keepalive, but also usable for linkpadding); \emph{create} or \emph{created} (used to set up a new circuit);and \emph{destroy} (to tear down a circuit).Relay cells have an additional header (the relay header) at the frontof the payload, containing a streamID (stream identifier: many streams canbe multiplexed over a circuit); an end-to-end checksum for integritychecking; the length of the relay payload; and a relay command.The entire contents of the relay header and the relay cell payloadare encrypted or decrypted together as the relay cell moves along thecircuit, using the 128-bit AES cipher in counter mode to generate acipher stream.  The relay commands are: \emph{relaydata} (for data flowing down the stream), \emph{relay begin} (to open astream), \emph{relay end} (to close a stream cleanly), \emph{relayteardown} (to close a broken stream), \emph{relay connected}(to notify the OP that a relay begin has succeeded), \emph{relayextend} and \emph{relay extended} (to extend the circuit by a hop,and to acknowledge), \emph{relay truncate} and \emph{relay truncated}(to tear down only part of the circuit, and to acknowledge), \emph{relaysendme} (used for congestion control), and \emph{relay drop} (used toimplement long-range dummies).We give a visual overview of cell structure plus the details of relaycell structure, and then describe each of these cell types and commandsin more detail below.%\begin{figure}[h]%\unitlength=1cm%\centering%\begin{picture}(8.0,1.5)%\put(4,.5){\makebox(0,0)[c]{\epsfig{file=cell-struct,width=7cm}}}%\end{picture}%\end{figure}\begin{figure}[h]\centering\mbox{\epsfig{figure=cell-struct,width=7cm}}\end{figure}\subsection{Circuits and streams}\label{subsec:circuits}Onion Routing originally built one circuit for eachTCP stream.  Because building a circuit can take several tenths of asecond (due to public-key cryptography and network latency),this design imposed high costs on applications like web browsing thatopen many TCP streams.In Tor, each circuit can be shared by many TCP streams.  To avoiddelays, users construct circuits preemptively.  To limit linkabilityamong their streams, users' OPs build a new circuitperiodically if the previous ones have been used,and expire old used circuits that no longer have any open streams.OPs consider rotating to a new circuit once a minute: thuseven heavy users spend negligible timebuilding circuits, but a limited number of requests can be linkedto each other through a given exit node. Also, because circuits are builtin the background, OPs can recover from failed circuit creationwithout harming user experience.\\\begin{figure}[h]\centering\mbox{\epsfig{figure=interaction,width=8.75cm}}\caption{Alice builds a two-hop circuit and begins fetching a web page.}\label{fig:interaction}\end{figure}\noindent{\large\bf Constructing a circuit}\label{subsubsec:constructing-a-circuit}\\%\subsubsection{Constructing a circuit}A user's OP constructs circuits incrementally, negotiating asymmetric key with each OR on the circuit, one hop at a time. To begincreating a new circuit, the OP (call her Alice) sends a\emph{create} cell to the first node in her chosen path (call him Bob).(She chooses a newcircID $C_{AB}$ not currently used on the connection from her to Bob.)The \emph{create} cell'spayload contains the first half of the Diffie-Hellman handshake($g^x$), encrypted to the onion key of Bob. Bobresponds with a \emph{created} cell containing $g^y$along with a hash of the negotiated key $K=g^{xy}$.Once the circuit has been established, Alice and Bob can send oneanother relay cells encrypted with the negotiatedkey.\footnote{Actually, the negotiated key is used to derive two  symmetric keys: one for each direction.}  More detail is given inthe next section.To extend the circuit further, Alice sends a \emph{relay extend} cellto Bob, specifying the address of the next OR (call her Carol), andan encrypted $g^{x_2}$ for her.  Bob copies the half-handshake into a\emph{create} cell, and passes it to Carol to extend the circuit.(Bob chooses a new circID $C_{BC}$ not currently used on the connectionbetween him and Carol.  Alice never needs to know this circID; only Bobassociates $C_{AB}$ on his connection with Alice to $C_{BC}$ onhis connection with Carol.)When Carol responds with a \emph{created} cell, Bob wraps the payloadinto a \emph{relay extended} cell and passes it back to Alice.  Nowthe circuit is extended to Carol, and Alice and Carol share a common key$K_2 = g^{x_2 y_2}$.To extend the circuit to a third node or beyond, Aliceproceeds as above, always telling the last node in the circuit toextend one hop further.This circuit-level handshake protocol achieves unilateral entityauthentication (Alice knows she's handshaking with the OR, butthe OR doesn't care who is opening the circuit---Alice uses no public keyand remains anonymous) and unilateral key authentication(Alice and the OR agree on a key, and Alice knows only the OR learnsit). It also achieves forwardsecrecy and key freshness. More formally, the protocol is as follows(where $E_{PK_{Bob}}(\cdot)$ is encryption with Bob's public key,$H$ is a secure hash function, and $|$ is concatenation):\begin{equation*}\begin{aligned}\mathrm{Alice} \rightarrow \mathrm{Bob}&: E_{PK_{Bob}}(g^x) \\\mathrm{Bob} \rightarrow \mathrm{Alice}&: g^y, H(K | \mathrm{``handshake"}) \\\end{aligned}\end{equation*}\noindent In the second step, Bob proves that it was he who received $g^x$,and who chose $y$. We use PK encryption in the first step(rather than, say, using the first two steps of STS, which has asignature in the second step) because a single cell is too small tohold both a public key and a signature. Preliminary analysis with theNRL protocol analyzer~\cite{meadows96} shows this protocol to besecure (including perfect forward secrecy) under thetraditional Dolev-Yao model.\\\noindent{\large\bf Relay cells}\\%\subsubsection{Relay cells}%Once Alice has established the circuit (so she shares keys with eachOR on the circuit), she can send relay cells.%Recall that every relay cell has a streamID that indicates to which%stream the cell belongs.  %This streamID allows a relay cell to be%addressed to any OR on the circuit.  Upon receiving a relaycell, an OR looks up the corresponding circuit, and decrypts the relayheader and payload with the session key for that circuit.If the cell is headed away from Alice the OR then checks whether thedecrypted cell has a valid digest (as an optimization, the firsttwo bytes of the integrity check are zero, so in most cases we can avoidcomputing the hash).%is recognized---either because it%corresponds to an open stream at this OR for the given circuit, or because%it is the control streamID (zero).If valid, it accepts the relay cell and processes it as describedbelow.  Otherwise,the OR looks up the circID and OR for thenext step in the circuit, replaces the circID as appropriate, andsends the decrypted relay cell to the next OR.  (If the OR at the endof the circuit receives an unrecognized relay cell, an error hasoccurred, and the circuit is torn down.)OPs treat incoming relay cells similarly: they iteratively unwrap therelay header and payload with the session keys shared with eachOR on the circuit, from the closest to farthest.If at any stage the digest is valid, the cell must haveoriginated at the OR whose encryption has just been removed.To construct a relay cell addressed to a given OR, Alice assigns thedigest, and then iterativelyencrypts the cell payload (that is, the relay header and payload) withthe symmetric key of each hop up to that OR.  Because the digest isencrypted to a different value at each step, only at the targeted ORwill it have a meaningful value.\footnote{  % Should we just say that 2^56 is itself negligible?  % Assuming 4-hop circuits with 10 streams per hop, there are 33  % possible bad streamIDs before the last circuit.  This still  % gives an error only once every 2 million terabytes (approx).With 48 bits of digest per cell, the probability of an accidentalcollision is far lower than the chance of hardware failure.}This \emph{leaky pipe} circuit topologyallows Alice's streams to exit at different ORs on a single circuit.Alice may choose different exit points because of their exit policies,or to keep the ORs from knowing that two streamsoriginate from the same person.When an OR later replies to Alice with a relay cell, itencrypts the cell's relay header and payload with the single key itshares with Alice, and sends the cell back toward Alice along thecircuit.  Subsequent ORs add further layers of encryption as theyrelay the cell back to Alice.To tear down a circuit, Alice sends a \emph{destroy} controlcell. Each OR in the circuit receives the \emph{destroy} cell, closesall streams on that circuit, and passes a new \emph{destroy} cellforward. But just as circuits are built incrementally, they can alsobe torn down incrementally: Alice can send a \emph{relaytruncate} cell to a single OR on a circuit. That OR then sends a\emph{destroy} cell forward, and acknowledges with a\emph{relay truncated} cell. Alice can then extend the circuit todifferent nodes, without signaling to the intermediate nodes (ora limited observer) that she has changed her circuit.Similarly, if a node on the circuit goes down, the adjacentnode can send a \emph{relay truncated} cell back to Alice.  Thus the``break a node and see which circuits go down''attack~\cite{freedom21-security} is weakened.\subsection{Opening and closing streams}\label{subsec:tcp}When Alice's application wants a TCP connection to a givenaddress and port, it asks the OP (via SOCKS) to make theconnection. The OP chooses the newest open circuit (or creates one ifneeded), and chooses a suitable OR on that circuit to be theexit node (usually the last node, but maybe others due to exit policyconflicts; see Section~\ref{subsec:exitpolicies}.) The OP then opensthe stream by sending a \emph{relay begin} cell to the exit node,using a new random streamID. Once theexit node connects to the remote host, it respondswith a \emph{relay connected} cell.  Upon receipt, the OP sends aSOCKS reply to notify the application of its success. The OPnow accepts data from the application's TCP stream, packaging it into\emph{relay data} cells and sending those cells along the circuit tothe chosen OR.There's a catch to using SOCKS, however---some applications pass thealphanumeric hostname to the Tor client, while others resolve it intoan IP address first and then pass the IP address to the Tor client. Ifthe application does DNS resolution first, Alice thereby reveals herdestination to the remote DNS server, rather than sending the hostnamethrough the Tor network to be resolved at the far end. Common applicationslike Mozilla and SSH have this flaw.With Mozilla, the flaw is easy to address: the filtering HTTPproxy called Privoxy gives a hostname to the Tor client, so Alice'scomputer never does DNS resolution.But a portable general solution, such as is needed forSSH, isan open problem. Modifying or replacing the local nameservercan be invasive, brittle, and unportable. Forcing the resolverlibrary to prefer TCP rather than UDP is hard, and also hasportability problems. Dynamically intercepting system calls to theresolver library seems a promising direction. We could also providea tool similar to \emph{dig} to perform a private lookup through theTor network. Currently, we encourage the use of privacy-aware proxieslike Privoxy wherever possible.Closing a Tor stream is analogous to closing a TCP stream: it uses atwo-step handshake for normal operation, or a one-step handshake forerrors. If the stream closes abnormally, the adjacent node simply sends a\emph{relay teardown} cell. If the stream closes normally, the node sendsa \emph{relay end} cell down the circuit, and the other side responds withits own \emph{relay end} cell. Becauseall relay cells use layered encryption, only the destination OR knowsthat a given relay cell is a request to close a stream.  This two-stephandshake allows Tor to support TCP-based applications that use half-closedconnections.% such as broken HTTP clients that close their side of the%stream after writing but are still willing to read.\subsection{Integrity checking on streams}\label{subsec:integrity-checking}Because the old Onion Routing design used a stream cipher without integritychecking, traffic wasvulnerable to a malleability attack: though the attacker could notdecrypt cells, any changes to encrypted datawould create corresponding changes to the data leaving the network.This weakness allowed an adversary who could guess the encrypted contentto change a padding cell to a destroycell; change the destination address in a \emph{relay begin} cell to theadversary's webserver; or change an FTP command from{\tt dir} to {\tt rm~*}. (Even an externaladversary could do this, because the link encryption similarly used astream cipher.)Because Tor uses TLS on its links, external adversaries cannot modifydata. Addressing the insider malleability attack, however, ismore complex.We could do integrity checking of the relay cells at each hop, eitherby including hashes or by using an authenticating cipher mode likeEAX~\cite{eax}, but there are some problems. First, these approachesimpose a message-expansion overhead at each hop, and so we would have toeither leak the path length or waste bytes by padding to a maximumpath length. Second, these solutions can only verify traffic comingfrom Alice: ORs would not be able to produce suitable hashes forthe intermediate hops, since the ORs on a circuit do not know theother ORs' session keys. Third, we have already accepted that our designis vulnerable to end-to-end timing attacks; so tagging attacks performedwithin the circuit provide no additional information to the attacker.Thus, we check integrity only at the edges of each stream. (Remember thatin our leaky-pipe circuit topology, a stream's edge could be any hopin the circuit.) When Alicenegotiates a key with a new hop, they each initialize a SHA-1digest with a derivative of that key,thus beginning with randomness that only the two of them know.Then they each incrementally add to the SHA-1 digest the contents ofall relay cells they create, and include with each relay cell thefirst four bytes of the current digest.  Each also keeps a SHA-1digest of data received, to verify that the received hashes are correct.To be sure of removing or modifying a cell, the attacker must be ableto deduce the current digest state (which depends on alltraffic between Alice and Bob, starting with their negotiated key).Attacks on SHA-1 where the adversary can incrementally add to a hashto produce a new valid hash don't work, because all hashes areend-to-end encrypted across the circuit.  The computational overheadof computing the digests is minimal compared to doing the AESencryption performed at each hop of the circuit. We use only fourbytes per cell to minimize overhead; the chance that an adversary willcorrectly guess a valid hash%, plus the payload the current cell,isacceptably low, given that the OP or OR tear down the circuit if theyreceive a bad hash.\subsection{Rate limiting and fairness}\label{subsec:rate-limit}Volunteers are more willing to run services that can limittheir bandwidth usage. To accommodate them, Tor servers use atoken bucket approach~\cite{tannenbaum96} toenforce a long-term average rate of incoming bytes, while stillpermitting short-term bursts above the allowed bandwidth.% Current bucket sizes are set to ten seconds' worth of traffic.%Further, we want to avoid starving any Tor streams. Entire circuits%could starve if we read greedily from connections and one connection%uses all the remaining bandwidth. We solve this by dividing the number%of tokens in the bucket by the number of connections that want to read,%and reading at most that number of bytes from each connection. We iterate%this procedure until the number of tokens in the bucket is under some%threshold (currently 10KB), at which point we greedily read from connections.Because the Tor protocol outputs about the same number of bytes as ittakes in, it is sufficient in practice to limit only incoming bytes.With TCP streams, however, the correspondence is not one-to-one:relaying a single incoming byte can require an entire 512-byte cell.(We can't just wait for more bytes, because the local application maybe awaiting a reply.) Therefore, we treat this case as if the entirecell size had been read, regardless of the cell's fullness.Further, inspired by Rennhard et al's design in~\cite{anonnet}, acircuit's edges can heuristically distinguish interactive streams from bulkstreams by comparing the frequency with which they supply cells.  We canprovide good latency for interactive streams by giving them preferentialservice, while still giving good overall throughput to the bulkstreams. Such preferential treatment presents a possible end-to-endattack, but an adversary observing bothends of the stream can already learn this information through timingattacks.\subsection{Congestion control}\label{subsec:congestion}Even with bandwidth rate limiting, we still need to worry aboutcongestion, either accidental or intentional. If enough users choose thesame OR-to-OR connection for their circuits, that connection can becomesaturated. For example, an attacker could send a large filethrough the Tor network to a webserver he runs, and thenrefuse to read any of the bytes at the webserver end of thecircuit. Without some congestion control mechanism, these bottleneckscan propagate back through the entire network. We don't need toreimplement full TCP windows (with sequence numbers,the ability to drop cells when we're full and retransmit later, and soon),because TCP already guarantees in-order delivery of eachcell.%But we need to investigate further the effects of the current%parameters on throughput and latency, while also keeping privacy in mind;%see Section~\ref{sec:maintaining-anonymity} for more discussion.We describe our response below.\textbf{Circuit-level throttling:}To control a circuit's bandwidth usage, each OR keeps track of twowindows. The \emph{packaging window} tracks how many relay data cells the OR isallowed to package (from incoming TCP streams) for transmission back to the OP,and the \emph{delivery window} tracks how many relay data cells it is willingto deliver to TCP streams outside the network. Each window is initialized(say, to 1000 data cells). When a data cell is packaged or delivered,the appropriate window is decremented. When an OR has received enoughdata cells (currently 100), it sends a \emph{relay sendme} cell towards the OP,with streamID zero. When an OR receives a \emph{relay sendme} cell withstreamID zero, it increments its packaging window. Either of these cellsincrements the corresponding window by 100. If the packaging windowreaches 0, the OR stops reading from TCP connections for all streamson the corresponding circuit, and sends no more relay data cells untilreceiving a \emph{relay sendme} cell.The OP behaves identically, except that it must track a packaging windowand a delivery window for every OR in the circuit. If a packaging windowreaches 0, it stops reading from streams destined for that OR.\textbf{Stream-level throttling}:The stream-level congestion control mechanism is similar to thecircuit-level mechanism. ORs and OPs use \emph{relay sendme} cellsto implement end-to-end flow control for individual streams acrosscircuits. Each stream begins with a packaging window (currently 500 cells),and increments the window by a fixed value (50) upon receiving a \emph{relaysendme} cell. Rather than always returning a \emph{relay sendme} cell as soonas enough cells have arrived, the stream-level congestion control alsohas to check whether data has been successfully flushed onto the TCPstream; it sends the \emph{relay sendme} cell only when the number of bytes pendingto be flushed is under some threshold (currently 10 cells' worth).%% Maybe omit this next paragraph. -NM%Currently, non-data relay cells do not affect the windows. Thus we%avoid potential deadlock issues, for example, arising because a stream%can't send a \emph{relay sendme} cell when its packaging window is empty.These arbitrarily chosen parameters seem to give tolerable throughputand delay; see Section~\ref{sec:in-the-wild}.\section{Rendezvous Points and hidden services}\label{sec:rendezvous}Rendezvous points are a building block for \emph{location-hiddenservices} (also known as \emph{responder anonymity}) in the Tornetwork.  Location-hidden services allow Bob to offer a TCPservice, such as a webserver, without revealing his IP address.This type of anonymity protects against distributed DoS attacks:attackers are forced to attack the onion routing networkbecause they do not know Bob's IP address.Our design for location-hidden servers has the following goals.\textbf{Access-control:} Bob needs a way to filter incoming requests,so an attacker cannot flood Bob simply by making many connections to him.\textbf{Robustness:} Bob should be able to maintain a long-term pseudonymousidentity even in the presence of router failure. Bob's service mustnot be tied to a single OR, and Bob must be able to migrate his serviceacross ORs. \textbf{Smear-resistance:}A social attackershould not be able to ``frame'' a rendezvous router byoffering an illegal or disreputable location-hidden service andmaking observers believe the router created that service.\textbf{Application-transparency:} Although we require usersto run special software to access location-hidden servers, we must notrequire them to modify their applications.We provide location-hiding for Bob by allowing him to advertiseseveral onion routers (his \emph{introduction points}) as contactpoints. He may do this on any robust efficientkey-value lookup system with authenticated updates, such as adistributed hash table (DHT) like CFS~\cite{cfs:sosp01}.\footnote{Rather than rely on an external infrastructure, the Onion Routing networkcan run the lookup service itself.  Our current implementation provides asimple lookup system on thedirectory servers.} Alice, the client, chooses an OR as her\emph{rendezvous point}. She connects to one of Bob's introductionpoints, informs him of her rendezvous point, and then waits for himto connect to the rendezvous point. This extra level of indirectionhelps Bob's introduction points avoid problems associated with servingunpopular files directly (for example, if Bob servesmaterial that the introduction point's community finds objectionable,or if Bob's service tends to get attacked by network vandals).The extra level of indirection also allows Bob to respond to some requestsand ignore others.\subsection{Rendezvous points in Tor}The following steps are%We give an overview of the steps of a rendezvous. These areperformed on behalf of Alice and Bob by their local OPs;application integration is described more fully below.\begin{tightlist}\item Bob generates a long-term public key pair to identify his service.\item Bob chooses some introduction points, and advertises them on      the lookup service, signing the advertisement with his public key.  He      can add more later.\item Bob builds a circuit to each of his introduction points, and tells      them to wait for requests.\item Alice learns about Bob's service out of band (perhaps Bob told her,      or she found it on a website).  She retrieves the details of Bob's      service from the lookup service.  If Alice wants to access Bob's      service anonymously, she must connect to the lookup service via Tor.\item Alice chooses an OR as the rendezvous point (RP) for her connection to      Bob's service. She builds a circuit to the RP, and gives it a      randomly chosen ``rendezvous cookie'' to recognize Bob.\item Alice opens an anonymous stream to one of Bob's introduction      points, and gives it a message (encrypted with Bob's public key)      telling it about herself,      her RP and rendezvous cookie, and the      start of a DH      handshake. The introduction point sends the message to Bob.\item If Bob wants to talk to Alice, he builds a circuit to Alice's      RP and sends the rendezvous cookie, the second half of the DH      handshake, and a hash of the session      key they now share. By the same argument as in      Section~\ref{subsubsec:constructing-a-circuit}, Alice knows she      shares the key only with Bob.\item The RP connects Alice's circuit to Bob's. Note that RP can't      recognize Alice, Bob, or the data they transmit.\item Alice sends a \emph{relay begin} cell along the circuit. It      arrives at Bob's OP, which connects to Bob's      webserver.\item An anonymous stream has been established, and Alice and Bob      communicate as normal.\end{tightlist}When establishing an introduction point, Bob provides the onion routerwith the public key identifying his service.  Bob signs hismessages, so others cannot usurp his introduction pointin the future. He uses the same public key to establish the otherintroduction points for his service, and periodically refreshes hisentry in the lookup service.The message that Alice givesthe introduction point includes a hash of Bob's public key % to identify%the service, along withand an optional initial authorization token (theintroduction point can do prescreening, for example to block replays). Hermessage to Bob may include an end-to-end authorization token so Bobcan choose whether to respond.The authorization tokens can be used to provide selective access:important users can get uninterrupted access.%important users get tokens to ensure uninterrupted access. %to the%service.During normal situations, Bob's service might simply be offereddirectly from mirrors, while Bob gives out tokens to high-priority users. Ifthe mirrors are knocked down,%by distributed DoS attacks or even%physical attack,those users can switch to accessing Bob's service viathe Tor rendezvous system.Bob's introduction points are themselves subject to DoS---he mustopen many introduction points or risk such an attack.He can provide selected users with a current list or future schedule ofunadvertised introduction points;this is most practicalif there is a stable and large group of introduction pointsavailable. Bob could also give secret public keysfor consulting the lookup service. All of these approacheslimit exposure even whensome selected users collude in the DoS\@.\subsection{Integration with user applications}Bob configures his onion proxy to know the local IP address and port of hisservice, a strategy for authorizing clients, and his public key. The onionproxy anonymously publishes a signed statement of Bob'spublic key, an expiration time, andthe current introduction points for his service onto the lookup service,indexedby the hash of his public key.  Bob's webserver is unmodified,and doesn't even know that it's hidden behind the Tor network.Alice's applications also work unchanged---her client interfaceremains a SOCKS proxy.  We encode all of the necessary informationinto the fully qualified domain name (FQDN) Alice uses when establishing herconnection. Location-hidden services use a virtual top level domaincalled {\tt .onion}: thus hostnames take the form {\tt x.y.onion} where{\tt x} is the authorization cookie and {\tt y} encodes the hash ofthe public key. Alice's onion proxyexamines addresses; if they're destined for a hidden server, it decodesthe key and starts the rendezvous as described above.\subsection{Previous rendezvous work}%XXXX Should this get integrated into the earlier related work section? -NMRendezvous points in low-latency anonymity systems were firstdescribed for use in ISDN telephony~\cite{jerichow-jsac98,isdn-mixes}.Later low-latency designs used rendezvous points for hiding locationof mobile phones and low-power locationtrackers~\cite{federrath-ih96,reed-protocols97}.  Rendezvous foranonymizing low-latencyInternet connections was suggested in early Onion Routingwork~\cite{or-ih96}, but the first published design was by IanGoldberg~\cite{ian-thesis}. His design differs fromours in three ways. First, Goldberg suggests that Alice should manuallyhunt down a current location of the service via Gnutella; our approachmakes lookup transparent to the user, as well as faster and more robust.Second, in Tor the client and server negotiate session keyswith Diffie-Hellman, so plaintext is not exposed even at the rendezvouspoint. Third,our design minimizes the exposure from running theservice, to encourage volunteers to offer introduction and rendezvousservices. Tor's introduction points do not output any bytes to theclients; the rendezvous points don't know the client or the server,and can't read the data being transmitted. The indirection scheme isalso designed to include authentication/authorization---if Alice doesn'tinclude the right cookie with her request for service, Bob need not evenacknowledge his existence.\section{Other design decisions}\label{sec:other-design}\subsection{Denial of service}\label{subsec:dos}Providing Tor as a public service creates many opportunities fordenial-of-service attacks against the network.  Whileflow control and rate limiting (discussed inSection~\ref{subsec:congestion}) prevent users from consuming morebandwidth than routers are willing to provide, opportunities remain forusers toconsume more network resources than their fair share, or to render thenetwork unusable for others.First of all, there are several CPU-consuming denial-of-serviceattacks wherein an attacker can force an OR to perform expensivecryptographic operations.  For example, an attacker can %\emph{create} cell full of junk bytes can force an OR to perform an RSA%decrypt.%Similarly, an attacker canfake the start of a TLS handshake, forcing the OR to carry out its(comparatively expensive) half of the handshake at no real computationalcost to the attacker.We have not yet implemented any defenses for these attacks, but severalapproaches are possible. First, ORs canrequire clients to solve a puzzle~\cite{puzzles-tls} while beginning newTLS handshakes or accepting \emph{create} cells.  So long as thesetokens are easy to verify and computationally expensive to produce, thisapproach limits the attack multiplier.  Additionally, ORs can limitthe rate at which they accept \emph{create} cells and TLS connections,so thatthe computational work of processing them does not drown out thesymmetric cryptography operations that keep cellsflowing.  This rate limiting could, however, allow an attackerto slow down other users when they build new circuits.% What about link-to-link rate limiting?Adversaries can also attack the Tor network's hosts and networklinks. Disrupting a single circuit or link breaks all streams passingalong that part of the circuit. Users similarly lose servicewhen a router crashes or its operator restarts it. The currentTor design treats such attacks as intermittent network failures, anddepends on users and applications to respond or recover as appropriate. Afuture design could use an end-to-end TCP-like acknowledgment protocol,so no streams are lost unless the entry or exit point isdisrupted. This solution would require more buffering at the networkedges, however, and the performance and anonymity implications from thisextra complexity still require investigation.\subsection{Exit policies and abuse}\label{subsec:exitpolicies}% originally, we planned to put the "users only know the hostname,% not the IP, but exit policies are by IP" problem here too. Not% worth putting in the submission, but worth thinking about putting% in sometime somehow. -RDExit abuse is a serious barrier to wide-scale Tor deployment. Anonymitypresents would-be vandals and abusers with an opportunity to hidethe origins of their activities. Attackers can harm the Tor network byimplicating exit servers for their abuse. Also, applications that commonlyuse IP-based authentication (such as institutional mail or webservers)can be fooled by the fact that anonymous connections appear to originateat the exit OR.We stress that Tor does not enable any new class of abuse. Spammersand other attackers already have access to thousands of misconfiguredsystems worldwide, and the Tor network is far from the easiest wayto launch attacks.%Indeed, because of its limited%anonymity, Tor is probably not a good way to commit crimes.But because theonion routers can be mistaken for the originators of the abuse,and the volunteers who run them may not want to deal with the hassle ofexplaining anonymity networks to irate administrators, we must block or limitabuse through the Tor network.To mitigate abuse issues, each onion router's \emph{exit policy}describes to which external addresses and ports the router willconnect. On one end of the spectrum are \emph{open exit}nodes that will connect anywhere. On the other end are \emph{middleman}nodes that only relay traffic to other Tor nodes, and \emph{private exit}nodes that only connect to a local host or network.  A privateexit can allow a client to connect to a given host ornetwork more securely---an external adversary cannot eavesdrop trafficbetween the private exit and the final destination, and so is less sure ofAlice's destination and activities. Most onion routers in the currentnetwork function as\emph{restricted exits} that permit connections to the world at large,but prevent access to certain abuse-prone addresses and services suchas SMTP.The OR might also be able to authenticate clients toprevent exit abuse without harming anonymity~\cite{or-discex00}.%The abuse issues on closed (e.g. military) networks are different%from the abuse on open networks like the Internet. While these IP-based%access controls are still commonplace on the Internet, on closed networks,%nearly all participants will be honest, and end-to-end authentication%can be assumed for important traffic.Many administrators use port restrictions to support only alimited set of services, such as HTTP, SSH, or AIM.This is not a complete solution, of course, since abuse opportunities for theseprotocols are still well known.We have not yet encountered any abuse in the deployed network, but ifwe do we should consider using proxies to clean traffic for certainprotocols as it leaves the network.  For example, much abusive HTTPbehavior (such as exploiting buffer overflows or well-known scriptvulnerabilities) can be detected in a straightforward manner.Similarly, one could run automatic spam filtering software (such asSpamAssassin) on email exiting the OR network.ORs may also rewrite exiting traffic to appendheaders or other information indicating that the traffic has passedthrough an anonymity service.  This approach is commonly usedby email-only anonymity systems.  ORs can alsorun on servers with hostnames like {\tt anonymous} to furtheralert abuse targets to the nature of the anonymous traffic.A mixture of open and restricted exit nodes allows the mostflexibility for volunteers running servers. But while having manymiddleman nodes provides a large and robust network,having only a few exit nodes reduces the number of pointsan adversary needs to monitor for traffic analysis, and places agreater burden on the exit nodes.  This tension can be seen in theJava Anon Proxycascade model, wherein only one node in each cascade needs to handleabuse complaints---but an adversary only needs to observe the entryand exit of a cascade to perform traffic analysis on all thatcascade's users. The hydra model (many entries, few exits) presents adifferent compromise: only a few exit nodes are needed, but anadversary needs to work harder to watch all the clients; seeSection~\ref{sec:conclusion}.Finally, we note that exit abuse must not be dismissed as a peripheralissue: when a system's public image suffers, it can reduce the numberand diversity of that system's users, and thereby reduce the anonymityof the system itself.  Like usability, public perception is asecurity parameter.  Sadly, preventing abuse of open exit nodes is anunsolved problem, and will probably remain an arms race for theforeseeable future.  The abuse problems faced by Princeton's CoDeeNproject~\cite{darkside} give us a glimpse of likely issues.\subsection{Directory Servers}\label{subsec:dirservers}First-generation Onion Routing designs~\cite{freedom2-arch,or-jsac98} usedin-band network status updates: each router flooded a signed statementto its neighbors, which propagated it onward. But anonymizing networkshave different security goals than typical link-state routing protocols.For example, delays (accidental or intentional)that can cause different parts of the network to have different viewsof link-state and topology are not only inconvenient: they giveattackers an opportunity to exploit differences in client knowledge.We also worry about attacks to deceive aclient about the router membership list, topology, or current networkstate. Such \emph{partitioning attacks} on client knowledge help anadversary to efficiently deploy resourcesagainst a target~\cite{minion-design}.Tor uses a small group of redundant, well-known onion routers totrack changes in network topology and node state, including keys andexit policies.  Each such \emph{directory server} acts as an HTTPserver, so clients can fetch current network stateand router lists, and so other ORs can uploadstate information.  Onion routers periodically publish signedstatements of their state to each directory server. The directory serverscombine this information with their own views of network liveness,and generate a signed description (a \emph{directory}) of the entirenetwork state. Client software ispre-loaded with a list of the directory servers and their keys,to bootstrap each client's view of the network.% XXX this means that clients will be forced to upgrade as the% XXX dirservers change or get compromised. argue that this is ok.When a directory server receives a signed statement for an OR, itchecks whether the OR's identity key is recognized. Directoryservers do not advertise unrecognized ORs---if they did,an adversary could take over the network by creating manyservers~\cite{sybil}. Instead, new nodes must be approved by thedirectoryserver administrator before they are included. Mechanisms for automatednode approval are an area of active research, and are discussed morein Section~\ref{sec:maintaining-anonymity}.Of course, a variety of attacks remain. An adversary who controlsa directory server can track clients by providing them differentinformation---perhaps by listing only nodes under its control, or byinforming only certain clients about a given node. Even an externaladversary can exploit differences in client knowledge: clients who usea node listed on one directory server but not the others are vulnerable.Thus these directory servers must be synchronized and redundant, sothat they can agree on a common directory.  Clients should only trustthis directory if it is signed by a threshold of the directoryservers.The directory servers in Tor are modeled after those inMixminion~\cite{minion-design}, but our situation is easier. First,we make thesimplifying assumption that all participants agree on the set ofdirectory servers. Second, while Mixminion needs to predict nodebehavior, Tor only needs a threshold consensus of the currentstate of the network. Third, we assume that we can fall back to thehuman administrators to discover and resolve problems when a consensusdirectory cannot be reached. Since there are relatively few directoryservers (currently 3, but we expect as many as 9 as the network scales),we can afford operations like broadcast to simplify the consensus-buildingprotocol.To avoid attacks where a router connects to all the directory serversbut refuses to relay traffic from other routers, the directory serversmust also build circuits and use them to anonymously test routerreliability~\cite{mix-acc}. Unfortunately, this defense is not yetdesigned orimplemented.Using directory servers is simpler and more flexible than flooding.Flooding is expensive, and complicates the analysis when westart experimenting with non-clique network topologies. Signeddirectories can be cached by otheronion routers,so directory servers are not a performancebottleneck when we have many users, and do not aid traffic analysis byforcing clients to announce their existence to anycentral point.\section{Attacks and Defenses}\label{sec:attacks}Below we summarize a variety of attacks, and discuss how well ourdesign withstands them.\\\noindent{\large\bf Passive attacks}\\\emph{Observing user traffic patterns.} Observing a user's connectionwill not reveal her destination or data, but it willreveal traffic patterns (both sent and received). Profiling via userconnection patterns requires further processing, because multipleapplication streams may be operating simultaneously or in series overa single circuit.\emph{Observing user content.} While content at the user end is encrypted,connections to responders may not be (indeed, the responding websiteitself may be hostile). While filtering content is not a primary goalof Onion Routing, Tor can directly use Privoxy and relatedfiltering services to anonymize application data streams.\emph{Option distinguishability.} We allow clients to chooseconfiguration options. For example, clients concerned about requestlinkability should rotate circuits more often than those concernedabout traceability. Allowing choice may attract users with different %There is economic incentive to attract users by%allowing this choice; needs; but clients who arein the minority may lose more anonymity by appearing distinct than theygain by optimizing their behavior~\cite{econymics}.\emph{End-to-end timing correlation.}  Tor only minimally hidessuch correlations. An attacker watching patterns oftraffic at the initiator and the responder will beable to confirm the correspondence with high probability. Thegreatest protection currently available against such confirmation is to hidethe connection between the onion proxy and the first Tor node,by running the OP on the Tor node or behind a firewall. This approachrequires an observer to separate traffic originating at the onionrouter from traffic passing through it: a global observer can do this,but it might be beyond a limited observer's capabilities.\emph{End-to-end size correlation.} Simple packet countingwill also be effective in confirmingendpoints of a stream. However, even without padding, we may have somelimited protection: the leaky pipe topology means different numbersof packets may enter one end of a circuit than exit at the other.\emph{Website fingerprinting.} All the effective passiveattacks above are traffic confirmation attacks,which puts them outside our design goals. There is alsoa passive traffic analysis attack that is potentially effective.Rather than searching exit connections for timing and volumecorrelations, the adversary may build up a database of``fingerprints'' containing file sizes and access patterns fortargeted websites. He can later confirm a user's connection to a givensite simply by consulting the database. This attack hasbeen shown to be effective against SafeWeb~\cite{hintz-pet02}.It may be less effective against Tor, sincestreams are multiplexed within the same circuit, andfingerprinting will be limited tothe granularity of cells (currently 512 bytes). Additionaldefenses could includelarger cell sizes, padding schemes to group websitesinto large sets, and linkpadding or long-range dummies.\footnote{Note that this fingerprintingattack should not be confused with the much more complicated latencyattacks of~\cite{back01}, which require a fingerprint of the latenciesof all circuits through the network, combined with those from thenetwork edges to the target user and the responder website.}\\\noindent{\large\bf Active attacks}\\\emph{Compromise keys.} An attacker who learns the TLS session key cansee control cells and encrypted relay cells on every circuit on thatconnection; learning a circuitsession key lets him unwrap one layer of the encryption. An attackerwho learns an OR's TLS private key can impersonate that OR for the TLSkey's lifetime, but he mustalso learn the onion key to decrypt \emph{create} cells (and because ofperfect forward secrecy, he cannot hijack already established circuitswithout also compromising their session keys). Periodic key rotationlimits the window of opportunity for these attacks. On the other hand,an attacker who learns a node's identity key can replace that nodeindefinitely by sending new forged descriptors to the directory servers.\emph{Iterated compromise.} A roving adversary who cancompromise ORs (by system intrusion, legal coercion, or extralegalcoercion) could march down the circuit compromising thenodes until he reaches the end.  Unless the adversary can completethis attack within the lifetime of the circuit, however, the ORswill have discarded the necessary information before the attack canbe completed.  (Thanks to the perfect forward secrecy of sessionkeys, the attacker cannot force nodes to decrypt recordedtraffic once the circuits have been closed.)  Additionally, buildingcircuits that cross jurisdictions can make legal coercionharder---this phenomenon is commonly called ``jurisdictionalarbitrage.'' The Java Anon Proxy project recently experienced theneed for this approach, whena German court forced them to add a backdoor totheir nodes~\cite{jap-backdoor}.\emph{Run a recipient.} An adversary running a webservertrivially learns the timing patterns of users connecting to it, andcan introduce arbitrary patterns in its responses.End-to-end attacks become easier: if the adversary can induceusers to connect to his webserver (perhaps by advertisingcontent targeted to those users), he now holds one end of theirconnection.  There is also a danger that applicationprotocols and associated programs can be induced to reveal informationabout the initiator. Tor depends on Privoxy and similar protocol cleanersto solve this latter problem.\emph{Run an onion proxy.} It is expected that end users willnearly always run their own local onion proxy. However, in somesettings, it may be necessary for the proxy to runremotely---typically, in institutions that wantto monitor the activity of those connecting to the proxy.Compromising an onion proxy compromises all future connectionsthrough it.\emph{DoS non-observed nodes.} An observer who can only watch someof the Tor network can increase the value of this trafficby attacking non-observed nodes to shut them down, reducetheir reliability, or persuade users that they are not trustworthy.The best defense here is robustness.\emph{Run a hostile OR.}  In addition to being a local observer,an isolated hostile node can create circuits through itself, or altertraffic patterns to affect traffic at other nodes. Nonetheless, a hostilenode must be immediately adjacent to both endpoints to compromise theanonymity of a circuit. If an adversary canrun multiple ORs, and can persuade the directory serversthat those ORs are trustworthy and independent, then occasionallysome user will choose one of those ORs for the start and anotheras the end of a circuit. If an adversarycontrols $m>1$ of $N$ nodes, he can correlate at most$\left(\frac{m}{N}\right)^2$ of the traffic---although anadversarycould still attract a disproportionately large amount of trafficby running an OR with a permissive exit policy, or bydegrading the reliability of other routers.\emph{Introduce timing into messages.} This is simply a strongerversion of passive timing attacks already discussed earlier.\emph{Tagging attacks.} A hostile node could ``tag'' acell by altering it. If thestream were, for example, an unencrypted request to a Web site,the garbled content coming out at the appropriate time would confirmthe association. However, integrity checks on cells preventthis attack.\emph{Replace contents of unauthenticated protocols.}  Whenrelaying an unauthenticated protocol like HTTP, a hostile exit nodecan impersonate the target server. Clientsshould prefer protocols with end-to-end authentication.\emph{Replay attacks.} Some anonymity protocols are vulnerableto replay attacks.  Tor is not; replaying one side of a handshakewill result in a different negotiated session key, and so the restof the recorded session can't be used.\emph{Smear attacks.} An attacker could use the Tor network forsocially disapproved acts, to bring thenetwork into disrepute and get its operators to shut it down.Exit policies reduce the possibilities for abuse, butultimately the network requires volunteers who can toleratesome political heat.\emph{Distribute hostile code.} An attacker could trick usersinto running subverted Tor software that did not, in fact, anonymizetheir connections---or worse, could trick ORs into running weakenedsoftware that provided users with less anonymity.  We address thisproblem (but do not solve it completely) by signing all Tor releaseswith an official public key, and including an entry in the directorythat lists which versions are currently believed to be secure.  Toprevent an attacker from subverting the official release itself(through threats, bribery, or insider attacks), we provide allreleases in source code form, encourage source audits, andfrequently warn our users never to trust any software (even fromus) that comes without source.\\\noindent{\large\bf Directory attacks}\\\emph{Destroy directory servers.}  If a few directoryservers disappear, the others still decide on a validdirectory.  So long as any directory servers remain in operation,they will still broadcast their views of the network and generate aconsensus directory.  (If more than half are destroyed, thisdirectory will not, however, have enough signatures for clients touse it automatically; human intervention will be necessary forclients to decide whether to trust the resulting directory.)\emph{Subvert a directory server.}  By taking over a directory server,an attacker can partially influence the final directory.  Since ORsare included or excluded by majority vote, the corrupt directory canat worst cast a tie-breaking vote to decide whether to includemarginal ORs.  It remains to be seen how often such marginal casesoccur in practice.\emph{Subvert a majority of directory servers.} An adversary who controlsmore than half the directory servers can include as many compromisedORs in the final directory as he wishes. We must ensure that directoryserver operators are independent and attack-resistant.\emph{Encourage directory server dissent.}  The directoryagreement protocol assumes that directory server operators agree onthe set of directory servers.  An adversary who can persuade someof the directory server operators to distrust one another couldsplit the quorum into mutually hostile camps, thus partitioningusers based on which directory they use.  Tor does not addressthis attack.\emph{Trick the directory servers into listing a hostile OR.}Our threat model explicitly assumes directory server operators willbe able to filter out most hostile ORs.% If this is not true, an% attacker can flood the directory with compromised servers.\emph{Convince the directories that a malfunctioning OR isworking.}  In the current Tor implementation, directory serversassume that an OR is running correctly if they can start a TLSconnection to it.  A hostile OR could easily subvert this test byaccepting TLS connections from ORs but ignoring all cells. Directoryservers must actively test ORs by building circuits and streams asappropriate.  The tradeoffs of a similar approach are discussedin~\cite{mix-acc}.\\\noindent{\large\bf Attacks against rendezvous points}\\\emph{Make many introduction requests.}  An attacker couldtry to deny Bob service by flooding his introduction points withrequests.  Because the introduction points can block requests thatlack authorization tokens, however, Bob can restrict the volume ofrequests he receives, or require a certain amount of computation forevery request he receives.\emph{Attack an introduction point.} An attacker coulddisrupt a location-hidden service by disabling its introductionpoints.  But because a service's identity is attached to its publickey, the service can simply re-advertiseitself at a different introduction point. Advertisements can also bedone secretly so that only high-priority clients know the address ofBob's introduction points or so that different clients know of differentintroduction points. This forces the attacker to disable all possibleintroduction points.\emph{Compromise an introduction point.} An attacker who controlsBob's introduction point can flood Bob withintroduction requests, or prevent valid introduction requests fromreaching him. Bob can notice a flood, and close the circuit.  To noticeblocking of valid requests, however, he should periodically test theintroduction point by sending rendezvous requests and makingsure he receives them.\emph{Compromise a rendezvous point.}  A rendezvouspoint is no more sensitive than any other OR ona circuit, since all data passing through the rendezvous is encryptedwith a session key shared by Alice and Bob.\section{Early experiences: Tor in the Wild}\label{sec:in-the-wild}As of mid-May 2004, the Tor network consists of 32 nodes(24 in the US, 8 in Europe), and more are joining each week as the codematures. (For comparison, the current remailer networkhas about 40 nodes.) % We haven't asked PlanetLab to provide%Tor nodes, since their AUP wouldn't allow exit nodes (see%also~\cite{darkside}) and because we aim to build a long-term community of%node operators and developers.}Each node has at least a 768Kb/768Kb connection, andmany have 10Mb. The number of users varies (and of course, it's hard totell for sure), but we sometimes have several hundred users---administrators atseveral companies have begun sending their entire departments' webtraffic through Tor, to block other divisions oftheir company from reading their traffic. Tor users have reported usingthe network for web browsing, FTP, IRC, AIM, Kazaa, SSH, andrecipient-anonymous email via rendezvous points. One user has anonymouslyset up a Wiki as a hidden service, where other users anonymously publishthe addresses of their hidden services.Each Tor node currently processes roughly 800,000 relaycells (a bit under half a gigabyte) per week. On average, about 80\%of each 498-byte payload is full for cells going back to the client,whereas about 40\% is full for cells coming from the client. (The differencearises because most of the network's traffic is web browsing.) Interactivetraffic like SSH brings down the average a lot---once we have moreexperience, and assuming we can resolve the anonymity issues, we maypartition traffic into two relay cell sizes: one to handlebulk traffic and one for interactive traffic.Based in part on our restrictive default exit policy (wereject SMTP requests) and our low profile, we have had no abuseissues since the network was deployed in October2003. Our slow growth rate gives us time to add features,resolve bugs, and get a feel for what users actually want from ananonymity system.  Even though having more users would bolster ouranonymity sets, we are not eager to attract the Kazaa or warezcommunities---we feel that we must build a reputation for privacy, humanrights, research, and other socially laudable activities.As for performance, profiling shows that Tor spends almostall its CPU time in AES, which is fast.  Current latency is attributableto two factors. First, network latency is critical: we areintentionally bouncing traffic around the world several times. Second,our end-to-end congestion control algorithm focuses on protectingvolunteer servers from accidental DoS rather than on optimizingperformance. % Right now the first $500 \times 500\mbox{B}=250\mbox{KB}$%of the stream arrives%quickly, and after that throughput depends on the rate that \emph{relay%sendme} acknowledgments arrive.To quantify these effects, we did some informal tests using a network of 4nodes on the same machine (a heavily loaded 1GHz Athlon). We downloaded a 60megabyte file from {\tt debian.org} every 30 minutes for 54 hours (108 samplepoints). It arrived in about 300 seconds on average, compared to 210s for adirect download. We ran a similar test on the production Tor network,fetching the front page of {\tt cnn.com} (55 kilobytes):% every 20 seconds for 8952 data pointswhile a directdownload consistently took about 0.3s, the performance through Tor varied.Some downloads were as fast as 0.4s, with a median at 2.8s, and90\% finishing within 5.3s.  It seems that as the network expands, the chanceof building a slow circuit (one that includes a slow or heavily loaded nodeor link) is increasing.  On the other hand, as our users remain satisfiedwith this increased latency, we can address our performance incrementally as weproceed with development. %\footnote{For example, we have just begun pushing%a pipelining patch to the production network that seems to decrease%latency for medium-to-large files; we will present revised benchmarks%as they become available.}%With the current network's topology and load, users can typically get 1-2%megabits sustained transfer rate, which is good enough for now.%Indeed, the Tor%design aims foremost to provide a security research platform; performance%only needs to be sufficient to retain users~\cite{econymics,back01}.%We can tweak the congestion control%parameters to provide faster throughput at the cost of%larger buffers at each node; adding the heuristics mentioned in%Section~\ref{subsec:rate-limit} to favor low-volume%streams may also help. More research remains to find the%right balance.% We should say _HOW MUCH_ latency there is in these cases. -NM%performs badly on lossy networks. may need airhook or something else as%transport alternative?Although Tor's clique topology and full-visibility directories presentscaling problems, we still expect the network to support a few hundrednodes and maybe 10,000 users before we're forced to becomemore distributed. With luck, the experience we gain running the currenttopology will help us choose among alternatives when the time comes.\section{Open Questions in Low-latency Anonymity}\label{sec:maintaining-anonymity}In addition to the non-goals inSection~\ref{subsec:non-goals}, many questions must be solvedbefore we can be confident of Tor's security.Many of these open issues are questions of balance. For example,how often should users rotate to fresh circuits? Frequent rotationis inefficient, expensive, and may lead to intersection attacks andpredecessor attacks~\cite{wright03}, but infrequent rotation makes theuser's traffic linkable. Besides opening fresh circuits, clients canalso exit from the middle of the circuit,or truncate and re-extend the circuit. More analysis isneeded to determine the proper tradeoff.%% Duplicated by 'Better directory distribution' in section 9.%%A similar question surrounds timing of directory operations: how often%should directories be updated?  Clients that update infrequently receive%an inaccurate picture of the network, but frequent updates can overload%the directory servers. More generally, we must find more%decentralized yet practical ways to distribute up-to-date snapshots of%network status without introducing new attacks.How should we choose path lengths? If Alice always uses two hops,then both ORs can be certain that by colluding they will learn aboutAlice and Bob. In our current approach, Alice always chooses at leastthree nodes unrelated to herself and her destination.%% This point is subtle, but not IMO necessary.  Anybody who thinks%% about it will see that it's implied by the above sentence; anybody%% who doesn't think about it is safe in his ignorance.%%Thus normally she chooses%three nodes, but if she is running an OR and her destination is on an OR,%she uses five.Should Alice choose a random path length (e.g.~from a geometricdistribution) to foil an attacker whouses timing to learn that he is the fifth hop and thus concludes thatboth Alice and the responder are running ORs?Throughout this paper, we have assumed that end-to-end trafficconfirmation will immediately and automatically defeat a low-latencyanonymity system. Even high-latency anonymity systems can bevulnerable to end-to-end traffic confirmation, if the traffic volumesare high enough, and if users' habits are sufficientlydistinct~\cite{statistical-disclosure,limits-open}. Can anything bedone tomake low-latency systems resist these attacks as well as high-latencysystems? Tor already makes some effort to conceal the starts and ends ofstreams by wrapping long-range control commands in identical-lookingrelay cells. Link padding could frustrate passive observers who countpackets; long-range padding could work against observers who own thefirst hop in a circuit. But more research remains to find an efficientand practical approach. Volunteers prefer not to run constant-bandwidthpadding; but no convincing traffic shaping approach has beenspecified. Recent work on long-range padding~\cite{defensive-dropping}shows promise. One could also try to reduce correlation in packet timingby batching and re-ordering packets, but it is unclear whether this couldimprove anonymity without introducing so much latency as to render thenetwork unusable.A cascade topology may better defend against traffic confirmation byaggregating users, and making padding andmixing more affordable.  Does the hydra topology (many input nodes,few output nodes) work better against some adversaries? Are we goingto get a hydra anyway because most nodes will be middleman nodes?Common wisdom suggests that Alice should run her own OR for bestanonymity, because traffic coming from her node could plausibly havecome from elsewhere. How much mixing does this approach need?  Is itimmediately beneficial because of real-world adversaries that can'tobserve Alice's router, but can run routers of their own?To scale to many users, and to prevent an attacker from observing thewhole network, it may be necessaryto support far more servers than Tor currently anticipates.This introduces several issues.  First, if approval by a central setof directory servers is no longer feasible, what mechanism should be usedto prevent adversaries from signing up many colluding servers? Second,if clients can no longer have a complete picture of the network,how can they perform discovery while preventing attackers frommanipulating or exploiting gaps in their knowledge?  Third, if thereare too many servers for every server to constantly communicate withevery other, which non-clique topology should the network use?(Restricted-route topologies promise comparable anonymity with betterscalability~\cite{danezis-pets03}, but whatever topology we choose, weneed some way to keep attackers from manipulating their position withinit~\cite{casc-rep}.) Fourth, if no central authority is trackingserver reliability, how do we stop unreliable servers from makingthe network unusable?  Fifth, do clients receive so much anonymityfrom running their own ORs that we should expect them all to doso~\cite{econymics}, or do we need another incentive structure tomotivate them?  Tarzan and MorphMix present possible solutions.% advogato, captchaWhen a Tor node goes down, all its circuits (and thus streams) must break.Will users abandon the system because of this brittleness? How welldoes the method in Section~\ref{subsec:dos} allow streams to survivenode failure? If affected users rebuild circuits immediately, how muchanonymity is lost? It seems the problem is even worse in a peer-to-peerenvironment---such systems don't yet provide an incentive for peers tostay connected when they're done retrieving content, so we would expecta higher churn rate.%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\section{Future Directions}\label{sec:conclusion}Tor brings together many innovations into a unified deployable system. Thenext immediate steps include:\emph{Scalability:} Tor's emphasis on deployability and design simplicityhas led us to adopt a clique topology, semi-centralizeddirectories, and a full-network-visibility model for clientknowledge. These properties will not scale past a few hundred servers.Section~\ref{sec:maintaining-anonymity} describes some promisingapproaches, but more deployment experience will be helpful in learningthe relative importance of these bottlenecks.\emph{Bandwidth classes:} This paper assumes that all ORs havegood bandwidth and latency. We should instead adopt the MorphMix model,where nodes advertise their bandwidth level (DSL, T1, T3), andAlice avoids bottlenecks by choosing nodes that match orexceed her bandwidth. In this way DSL users can usefully join the Tornetwork.\emph{Incentives:} Volunteers who run nodes are rewarded with publicityand possibly better anonymity~\cite{econymics}. More nodes means increasedscalability, and more users can mean more anonymity. We need to continueexamining the incentive structures for participating in Tor. Further,we need to explore more approaches to limiting abuse, and understandwhy most people don't bother using privacy systems.\emph{Cover traffic:} Currently Tor omits cover traffic---its costsin performance and bandwidth are clear but its security benefits arenot well understood. We must pursue more research on link-level covertraffic and long-range cover traffic to determine whether some simple paddingmethod offers provable protection against our chosen adversary.%%\emph{Offer two relay cell sizes:} Traffic on the Internet tends to be%%large for bulk transfers and small for interactive traffic. One cell%%size cannot be optimal for both types of traffic.% This should go in the spec and todo, but not the paper yet. -RD\emph{Caching at exit nodes:} Perhaps each exit node should run acaching web proxy~\cite{shsm03}, to improve anonymity for cached pages(Alice's request neverleaves the Tor network), to improve speed, and to reduce bandwidth cost.On the other hand, forward security is weakened because cachesconstitute a record of retrieved files.  We must find the rightbalance between usability and security.\emph{Better directory distribution:}Clients currently download a description ofthe entire network every 15 minutes. As the state grows largerand clients more numerous, we may need a solution in whichclients receive incremental updates to directory state.More generally, we must find morescalable yet practical ways to distribute up-to-date snapshots ofnetwork status without introducing new attacks.\emph{Further specification review:} Our publicbyte-level specification~\cite{tor-spec} needsexternal review.  We hope that as Toris deployed, more people will examine itsspecification.\emph{Multisystem interoperability:} We are currently working with thedesigner of MorphMix to unify the specification and implementation ofthe common elements of our two systems. So far, this seemsto be relatively straightforward.  Interoperability will allow testingand direct comparison of the two designs for trust and scalability.\emph{Wider-scale deployment:} The original goal of Tor was togain experience in deploying an anonymizing overlay network, andlearn from having actual users.  We are now at a point in designand development where we can start deploying a wider network.  Oncewe have many actual users, we will doubtlessly be betterable to evaluate some of our design decisions, including ourrobustness/latency tradeoffs, our performance tradeoffs (includingcell size), our abuse-prevention mechanisms, andour overall usability.%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% commented out for anonymous submission\section*{Acknowledgments} We thank Peter Palfrader, Geoff Goodell, Adam Shostack, Joseph Sokol-Margolis,   John Bashinski, and Zack Brown   for editing and comments; Matej Pfajfar, Andrei Serjantov, Marc Rennhard for design discussions; Bram Cohen for congestion control discussions; Adam Back for suggesting telescoping circuits; and Cathy Meadows for formal analysis of the \emph{extend} protocol. This work has been supported by ONR and DARPA.%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\bibliographystyle{latex8}\bibliography{tor-design}\end{document}% Style guide:%     U.S. spelling%     avoid contractions (it's, can't, etc.)%     prefer ``for example'' or ``such as'' to e.g.%     prefer ``that is'' to i.e.%     'mix', 'mixes' (as noun)%     'mix-net'%     'mix', 'mixing' (as verb)%     'middleman'  [Not with a hyphen; the hyphen has been optional%         since Middle English.]%     'nymserver'%     'Cypherpunk', 'Cypherpunks', 'Cypherpunk remailer'%     'Onion Routing design', 'onion router' [note capitalization]%     'SOCKS'%     Try not to use \cite as a noun.%     'Authorizating' sounds great, but it isn't a word.%     'First, second, third', not 'Firstly, secondly, thirdly'.%     'circuit', not 'channel'%     Typography: no space on either side of an em dash---ever.%     Hyphens are for multi-part words; en dashs imply movement or%        opposition (The Alice--Bob connection); and em dashes are%        for punctuation---like that.%     A relay cell; a control cell; a \emph{create} cell; a%     \emph{relay truncated} cell.  Never ``a \emph{relay truncated}.''%%     'Substitute ``Damn'' every time you're inclined to write ``very;'' your%     editor will delete it and the writing will be just as it should be.'%     -- Mark Twain
 |