A few days ago, researchers from the University of Waterloo and the U.S. Naval Research Laboratory presented the results of the development of a Tor network simulator that is comparable in number of nodes and users to the main Tor network and allows experiments that approach real conditions.
The toolkit and network modeling methodology developed during the experiment made it possible to simulate the operation of a network of 6489 Tor nodes on a computer with 4 TB of RAM, to which 792 virtual users are simultaneously connected.
It should be noted that this is the first large-scale simulation of the Tor network, whose number of nodes corresponds to the real network (the operational Tor network has around 6 nodes and 2 million connected users).
A complete simulation of the Tor network is of interest in terms of identifying bottlenecks, modeling attack behavior, testing new optimization techniques under real-life conditions, and proof of security-related concepts.
With a comprehensive simulator , Tor developers can move away from the practice of conducting experiments on the main network or individual working nodes, which creates additional risks of violating user privacy and doesn't eliminate the possibility of failures. For example, in the coming months, Tor is expected to introduce support for a new congestion control protocol, and the simulation will allow them to fully study its operation before deploying it on a real network.
In addition to eliminating the impact of experiments on the confidentiality and reliability of the main Tor network, the presence of separate test networks will make it possible to quickly test and debug new code during development, implement changes immediately for all nodes and users without waiting for the completion of lengthy intermediate implementations, and create and run prototypes more quickly with the implementation of new ideas.
Work is being done to improve the toolkit which, according to the developers, will reduce resource consumption by 10 times and will allow the operation of networks that exceed the real network to be simulated on the same computer, which may be necessary to identify possible problems. with Tor scaling. In the course of the work, several new network modeling methods have also been created that make it possible to predict the change in network state over time and use background traffic generators to simulate user activity.
The researchers also studied the relationship between the size of the simulated network and the reliability of projecting the experimental results onto the real network. During Tor's development, changes and optimizations are first tested on small test networks, which contain significantly fewer nodes and users than a real network.
It was found that the statistical errors of the forecasts obtained during small simulations can be compensated for by repeated repetition of independent experiments with different initial data sets, whereas the larger the simulated network, the fewer retests are required to obtain statistically significant conclusions.
To model and simulate the Tor network, researchers are developing several open source projects distributed under the BSD license:
- Shadow: a universal network simulator that allows you to run real network application code to recreate the operation of distributed systems with thousands of network processes. To simulate systems based on real unmodified applications.
- Tornettools: a set of tools for generating realistic models of the Tor network that can be run in the Shadow environment, as well as for running and customizing the simulation process, accumulating and visualizing the results. Metrics that reflect the performance of the actual Tor network can be used as templates for network generation.
- TGen: generator of traffic flows based on the parameters established by the user (size, delays, number of flows, etc.). Traffic shaping schemes can be established based on special scenarios in the GraphML format and using probabilistic Markov models for the distribution of TCP streams and packets.
- OnionTrace: a set of tools for monitoring performance and events in a simulated Tor network, as well as for recording and replaying information about the formation of chains of Tor nodes and linking traffic flows to them.
Finally, if you are interested in learning more, you can find the details at the following link.