Skip to the content.

Add logging support to Simulation Execution Manager (SEM)

This page summarizes the work done as part of Google Summer of Code 2021 with the ns-3 Network Simulator.

Student: Akshit Patel

Mentors: Davide Magrin, Mattia Lecci

Project Overview

Simulation Execution Manager (SEM) is a Python library to perform multiple ns-3 script executions, manage the results and collect them in processing-friendly data structures. SEM tries to hide as many of the tedious details about running a simulation campaign as possible, providing a clean interface that helps the user get all the way from the optimized compilation of ns-3 to plotting.

Initial status of SEM:

At the time of starting this project, SEM did not provide an API or support for enabling logging in ns-3 simulations. Apart from this, SEM also did not have any support for the visualization of ns-3 logs. Despite having no explicit support for logging, the users were still able to enable logging manually in their ns-3 scripts by using/redefining LogComponentEnable().

Project Goal:

The project aims to do the following:

The Project was divided into four phases:

Project Contributions

This section covers the work done during the GSoC Period in terms of contributed code/documentation/tests. For detailed design and implementation of each phase please refer to the Design Document.

Phase 1: Add logging support to SEM

Link to phase 1 PR:

After discussing with the mentors on a detailed flow for phase 1, we modified the existing SEM run_missing_simulations API to allow the users to enable logging. SEM would also keep a track of logging simulations in addition to non-logging simulations in its internal database. Towards the end of the first phase, we added an example to demonstrate the new changes to SEM, tests (in pytest framework) to validate the changes and python docstrings for the documentation.

Weekly progress for phase 1

Phase 2: Add APIs to read, parse, insert and filter logs

Link to phase 2 PR:

This phase focuses on creating APIs dedicated to parsing the log files passed in by the user. These APIs allow the user to filter log files based on 1) Time 2) Context 3) Function 4) Component. Also, the APIs created in this phase will be used by the backend of the dashboard created in the next phase. Towards the end of the second phase, we added an example to demonstrate the new changes to SEM, tests (in pytest framework) to validate the changes and python docstrings for the documentation.

Weekly progress for phase 2

Phase 3: Build an interactive dashboard

Link to phase 3 PR:

This phase focuses on creating an interactive dashboard for visualizing ns-3 log files. The front end of the dashboard is built using HTML, CSS, and JQuery. The dashboard has two main components 1) Graph 2) Table. Two Jquery based libraries have been used to create the dashboard: 1) chart.js (for graph) 2) Datatables (for table). For the backend, flask has been used. The backend also makes use of the APIs written in phase 2. For a complete overview of the features of the dashboard, refer here. At the time of writing this report, the phase 3 PR is yet to be merged (Last GSoC commit: here).

Weekly progress for phase 3

Final status of SEM

The final GSoC code is available here. Below are the user-visible features added to SEM during GSoC:

Future Work

Unfortunately, not all the goals mentioned in the project are accomplished. Adding support for enabling logging or accessing the dashboard is yet to be added to SEM-CLI. Other than this, all the tasks have been almost complete.

After discussion with the mentors, possible future work for SEM is as follows:

I will gladly help if any issues come up with the new code added.


I am very thankful to my family, mentors, and the ns-3 community who helped and supported me throughout GSoC. I am also thankful to Dr. Mohit P. Tahiliani for encouraging me to apply for the program. Though my project comes to an end, I will keep contributing to open source as well as SEM.