Skip to content

Latest commit

 

History

History
103 lines (79 loc) · 5.63 KB

README.md

File metadata and controls

103 lines (79 loc) · 5.63 KB

MPTCP Analysis Scripts

This repository contains scripts to analyze and create graphs from PCAP files generated by the traffic between N Multipath TCP capable smartphones and one Multipath TCP capable proxy (or server).

Requirements

If you want to use the main scripts, make sure you have installed Python >=2.6 (not Python 3) and the following dependencies:

If you also use our MultipathControl collect server, you might be interested in the -D option of analyze.py that requires PyMongo.

The analysis scripts requires the creation of a new file, config.py. The content of this file must be the following:

# IP address of the proxy/server (either str or a list of str)
IP_PROXY = ['1.2.3.4', '2001:db8::1']
# Prefix of the IP addres of the proxy/server (either str or a list of str)
PREFIX_IP_PROXY = ['1.2.', '2001:db8']
# Prefix of IPs belonging to WiFi access points
PREFIX_IP_WIFI = '192.168.'
# The password of SOCKS sessions
PASSWORD = 'My awesome password'

To have all functionalities, you also need to get

Produce stats files

The main scripts are analyze.py, mptcp.py, tcp.py and common.py. The three first ones are used to produce the statistic files useful to produce further graphs, whereas the last one contains various functions that can be used at different places.

If you want to produce results from traces generated by the automated test framework, you can launch

./analyze.py -i input_file_or_folder -j number_of_threads

This will produce several folders, containing among others the graphs generated by mptcptrace and tcptrace (graphs* folder) and the statistic files that can be reused by other scripts (stats* folder).

The default behavior is not suitable for very large traces (for time and/or memory usage). To analyze such traces, if those are known to contain only Multipath TCP traces, one can run

./analyze.py -i input_file_or_folder -p '' -M

This produces less outputs than the previous command, though you still obtain the most important ones.

You can also match flows with the smartphone interface. Either you control one WiFi access point, and the definition of PREFIX_IP_WIFI is sufficient, or you have a database of this matching thanks to the MultipathControl application and our REST server. In that case, you can use the -D option, but you may need to modify the analyze.py script.

To have more detailed information on how to use it, you can show the help by typing

./analyze -h

Generation of results and graphs

Once those statistic files are produced, you can agglomerate the different statistics obtained (by default in the stats folder). A lot of example are provided in scripts_graph, for instance in example_graph.py, difference_rtt_sfs.py, plot_acksize.py or global_stats.py. Notice that those scripts are put in this directory for cleaning purpose, but they act as they were at the root directory. In practice, running global_stats.py in scripts_graph with the stats files in the stats directory at the root is done with

# Starting at the root directory
cd scripts_graph
./global_stats.py -s stats -S sums

(and not with -s ../stats, see the import lines in the graph files).

To produce your own summary script, you may be interested in the MPTCPConnection and TCPConnection objects (defined respectively in mptcp.py and tcp.py). Notice that common_graph.py provide useful functions for graph purposes.

Details about the stats generated

Statistics about analyzed traces are contained in a stats folder, by default stats_any. Each file contains a dictionary of objects representing the connections, that can be read using pickle.load(file). Depending of the protocol indicated on the file, those objects are either TCPConnections or MPTCPConnections. Both of them inherit from BasicConnection, defined in common.py. Information related to connections is stored in the attr attribute, containing a dictionary.

The main difference between TCPConnection and MPTCPConnection is related to the number of (sub)flows they contain. TCPConnection only has one flow, in the flow attribute, whereas MPTPCConnection can have more than one, in the dictionary flows. In both cases, flows inherit from (or are) BasicFlow, which has the attr dictionary containing all information related to the flow.

Keys of attr dictionaries are defined in common.py.

License

All the code in this repository is licensed under GPLv3 and is part of our Master Thesis Multipath TCP with Real Smartphone Applications. The contributor are Quentin De Coninck and Matthieu Baerts.