Open Source Tor Protocol Book Ships with Twenty Hands-On Labs
A free, GPL-3.0-licensed technical book on the Tor protocol, written in Italian, traces Tor from the bytes exchanged between two relays up to design trade-offs, real attacks and open problems, accompanied by twenty labs that rebuild and test each mechanism on a private Tor network. The author discloses that AI tools contributed substantially to expanding and organizing the material and drafting figures, code and labs, and that the work has not undergone independent expert review.
Related Entities
Full Report
Contents5 sections
Onion Routing Anatomy
Anatomia di Tor — The Tor Protocol, Byte by Byte
Book · Laboratories · Documentation · Contribute
English
A free, open-source technical book about the Tor protocol, written in Italian: how Tor works from the bytes two relays exchange up to design choices, real attacks and open problems — with twenty laboratories that rebuild and test each mechanism on a private Tor network.
Origin, method, and an invitation to contribute. This book builds on study documents I produced over several years, beginning with my bachelor's thesis. Under my editorial direction, AI tools made substantial contributions to expanding and organizing that material into the present technical narrative, as well as drafting figures, exercises, code, and laboratories. Despite technical checks, the book has not undergone independent expert review; mistakes may remain. Readers are invited to report them and submit corrections. I provide the work free of charge through the project's official channels under the GPL-3.0-or-later: "diffusione dei saperi senza fondare poteri" — spreading knowledge without establishing power. The license allows reuse and redistribution, including commercial redistribution, on its terms. See AI disclosure for the precise roles and limitations.
This is an open project: readers can report errors, improve explanations and contribute technical corrections or translations. → Help improve this book
31 chapters · 20 reproducible laboratories · 176 exercises with solutions · 39 figures
Download
Italian original — first edition
| Format | File |
|---|---|
| Read on screen · A4 PDF · 298 pages | Open A4 PDF |
| E-reader · EPUB 3 | Open EPUB |
| Print a personal copy · 7×10 in PDF · 342 pages | Open print PDF |
| Cover | View cover |
The Italian edition is free to read, download and share under the conditions of the GPL-3.0-or-later.
Official release: v1.0.0-it (seven files, SHA-256 checksums).
Zenodo (Italian edition): DOI 10.5281/zenodo.24207180.
Download the translated editions (version 1.0.0)
What the book contains
- Part I — History and foundations: anonymity and metadata, mix networks and remailers, from the NRL's onion routing to the Tor Project, Tor's threat model.
- Part II — The protocol at a low level: cryptography for Tor, network architecture, channels and the link protocol, cells, circuit creation (CREATE_FAST, ntor, ntor-v3), layered relay encryption and CGO, streams, SENDME and congestion control, the directory system, path selection and guards, onion services v3, DoS defences, censorship, bridges and pluggable transports.
- Part III — Tor in practice: torrc, the control port and Stem, a private Tor network, traffic analysis with Wireshark, onion services, relays and bridges, Tor Browser, Tails and Whonix, Tor Metrics and OONI, legal and ethical aspects in Italy and the EU.
- Part IV — Attacks and defences: traffic correlation, fingerprinting and Sybil attacks, real cases, operational mistakes — with an analytical, defensive approach.
- Part V — Research and future: academic research on Tor, Arti (Tor in Rust), open problems and proposals.
31 chapters, 4 appendices, 176 graded exercises with solutions, 39 original figures. Reference versions: tor 0.4.9.13, Arti 2.6.0.
These are fixed reference versions for study and laboratory reproducibility, not the versions recommended for use on the public Tor network. For real deployments, install releases that include current security updates.
Inside the book
These are actual pages from the Italian A4 PDF, not promotional mockups. The page numbers refer to the PDF file, not the printed pagination.
| Cells and wire format · PDF page 63 | Telescopic circuit construction · PDF page 78 |
|---|---|
![]() | ![]() |
| Onion service rendezvous · PDF page 131 | Private Tor network · PDF page 170 |
![]() | ![]() |
Open the complete A4 PDF · Provenance and SHA-256
Laboratories and reproducibility
Twenty laboratories build torlab, a small educational Tor client in Python, and run it against
a private Tor network (tor and Chutney built from source in Docker, every listener on
127.0.0.1). On 28 October 2026 the Italian laboratories were rerun live: 53/53 checks, plus
14/14 for the obfs4 bridge laboratory (validation summaries).
make -C labs/it test # offline tests (Python ≥ 3.11, pip install -r requirements.txt)
make -C labs/it immagine # Docker image with tor and Chutney
make -C labs/it avvia # start the private network
make verifica-lab # rerun every laboratory and check its resultsExperiments run only on the private network, never against public relays or real users. Guides:
labs/it/wiki/. Building the book needs only Docker and make:
make book-pdf, make book-epub, make book (details).
(注:更多技术实现细节与完整 API 文档请查阅原项目 README)



