This project is a network traffic generator
that uses iperf3
to execute commands and analyze the throughput data. It includes a script to run iperf3 commands, a script for throughput analysis, and an HTML template for generating a throughput report.
- Python 3.x
- iperf3 (installed and accessible from the command line)
- Dependencies: pandas, matplotlib, and Jinja2 (can be installed using pip)
-
Clone the repository or download the code files into a directory.
-
Make sure iperf3 is present in the same directory as the other files.
-
Make sure log_files folder is present in the same directory
-
Install the Python dependencies by running the following command:
pip install pandas matplotlib jinja2
-
Open a terminal or command prompt and navigate to the project directory.
-
Execute the network traffic generator script by running the following command:
python netgen.py <iperf3 command>
.
- Replace
<iperf3 command>
with the desired iperf3 command and its arguments. - For example:
python netgen.py -c <server_ip> -t 10
. - This will run the iperf3 command specified and save the output in the
log_files/log.txt
file.
- Run the throughput analysis script by executing the following command :
python throughput_analysis.py
.
- This script will read the log file, analyze the throughput data, generate graphs, calculate statistical measures, and generate an HTML report.
- After executing the throughput analysis script, a file named
throughput_report.html
will be generated, containing the final throughput report.
netgen.py
: The main script for running iperf3 commands and generating network traffic.throughput_analysis.py
: Script for parsing iperf3 log files, generating throughput graphs, calculating statistical measures, and generating a throughput report.throughput_report_template.html
: HTML template used for generating the final throughput report.- Please refer the below attached structure of the NETGEN before running it.
- You can modify the iperf3 command and arguments in the
netgen.py
script to suit your specific network testing requirements. - The
throughput_analysis.py
script can be customized to change the graph generation, statistical calculations, or report format as needed. - Feel free to modify the
throughput_report_template.html
file to adjust the appearance or content of the generated throughput report.