GithubHelp home page GithubHelp logo

splitting_simulator's Introduction

Simulator of Traffic Splitting for Tor

Simulator to apply splitting strategies as defense for WFP attacks. It simulates the effects of sending packets over different routes characterized by their latency. Simulator used in the paper https://dl.acm.org/doi/10.1145/3372297.3423351. Please refer to the paper for more information regarding the available splitting strategies

Requirements

File with multi-path circuit latencies. Look at the circuits_latencies_new.txt for knowing how latencies are related to multiple circuits.

Dataset in the wang-format. I.e. a folder containing one file per instance, in which timestamps and directions are described per packet. It can also contain a third column of packet size.

Instances should be named in wang-format as for example 0-0.cell is first instance of the page labeled as 0 and 23-5.cell is the 6th instance of page of label 23

Usage

For getting all options and modes, run:

python simulator.py -h 

Examples

For simulating a weighted random (WR) and BWR scheduler for three paths with the dataset located in dataset/ and putting the output traces on outfolder/ (must be created before)

##For WR m=3
python simulator.py -p dataset/ -m 3 -o outfolder -s weighted_random -i circuits_latencies_new.txt

##For BWR m=5
python simulator.py -p dataset/ -m 5 -o outfolder -s batched_weighted_random -r 50,70 -a 1,1,1,1,1

Notes

Instance files must have the extension .cell. The simulator will produce on the oufolder m (number of paths) files with extension _split_i.cell (for the i-th path), and a file with the extension _join_.cell for the merged trace but after the multi-path effect

splitting_simulator's People

Contributors

wladimirdelacadena avatar amitseva avatar

Stargazers

 avatar Jexer Ji avatar James Holland avatar journey_park avatar Jean-Pierre Smith avatar Changyue Li avatar  avatar itsallpretend avatar Woody avatar  avatar

Watchers

James Cloos avatar  avatar Jens Hiller avatar

splitting_simulator's Issues

Wrong parameters of BWR in README examples

According to getWeights() in file multipath.py, number of alpha values must be equal to the number of circuits i.e m

def getWeights(n,alphas):
	aph = alphas.split(',')
	if (len(aph) != n):
		return -1
	vec_alphas = np.array(aph,dtype= np.float)
	w = np.random.dirichlet(vec_alphas,size=1)[0]
	return w

However, the example uses m=5 but sets option -a parameters to 1,1, resulting in the following error:

user>> python simulator.py -p /share/s4an/datasets/bigenough/undefended/monitored/standard/ -m 5 -o data/bwr_5m_bestd/ -s batched_weighted_random -r 50,70 -a 1,1

Simulating BWR multi-path scheme...
Traceback (most recent call last):
  File "simulator.py", line 503, in <module>
    sim_bwr(paths_, latencies_,traces_,outfolder_,range_, alpha_)
  File "simulator.py", line 206, in sim_bwr
    last_client_route =  np.random.choice(np.arange(0,n),p = w_out)
  File "mtrand.pyx", line 911, in numpy.random.mtrand.RandomState.choice
TypeError: object of type 'int' has no len()

Resolved the error by using 1,1,1,1,1 instead.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.