{"id":48684548,"url":"https://github.com/comnetshh/sgcomm2021-publication-code-release","last_synced_at":"2026-04-11T03:55:38.756Z","repository":{"id":122873755,"uuid":"402388458","full_name":"ComNetsHH/SGComm2021-publication-code-release","owner":"ComNetsHH","description":"Open source code release to replicate results of the conference paper. ","archived":false,"fork":false,"pushed_at":"2021-10-29T09:04:32.000Z","size":260,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2026-04-11T03:55:33.314Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://www.tuhh.de/et6/","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ComNetsHH.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2021-09-02T11:03:10.000Z","updated_at":"2021-10-29T09:04:36.000Z","dependencies_parsed_at":null,"dependency_job_id":"996fe2d9-dcac-4c88-907b-1c719fac1bc4","html_url":"https://github.com/ComNetsHH/SGComm2021-publication-code-release","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/ComNetsHH/SGComm2021-publication-code-release","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ComNetsHH%2FSGComm2021-publication-code-release","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ComNetsHH%2FSGComm2021-publication-code-release/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ComNetsHH%2FSGComm2021-publication-code-release/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ComNetsHH%2FSGComm2021-publication-code-release/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ComNetsHH","download_url":"https://codeload.github.com/ComNetsHH/SGComm2021-publication-code-release/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ComNetsHH%2FSGComm2021-publication-code-release/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31668050,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-10T17:19:37.612Z","status":"online","status_checked_at":"2026-04-11T02:00:05.776Z","response_time":54,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-04-11T03:55:37.647Z","updated_at":"2026-04-11T03:55:38.683Z","avatar_url":"https://github.com/ComNetsHH.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![DOI](https://zenodo.org/badge/402388458.svg)](https://zenodo.org/badge/latestdoi/402388458)\n\n---\n\nAny references to this code, protocol, or results shall be realized by citing the original paper from IEEE Xplore.\n\n## **Preface**\nThis is the complementary code repository for the scientific publication 'Minimizing Age of Information for Distributed Control in Smart Grids' by Fisser, Leonard and Timm-Giel, Andreas published at the IEEE International Conference on Communications, Control, and Computing Technologies for Smart Grids 2021 held in Aachen, Germany.\n\nThe provided codebase includes every necessary code to reproduce the results presented in the paper.\nWhile all presented code is made available for public use under GNU GPLv2.0, portions of the code use external software libraries.\nExternal code which is embedded in this repository is compatible with the selected licensing.\nAdditional dependencies may have to be acquired to fully use the provided toolchain (for example a working NS-3 installation as well as Gurobi).\nThe authors are aware that these dependencies do not completely fulfill the requirements for open-source code publications, but the trade-off has been made to achieve significant performance gains.\nOptional replacements for proprietary libraries (such as Gurobi) are included where applicable.  \n\nAs the complete toolchain is quite large and covers different programming language, possible reuse of published code will be difficult.\nHowever, in the hope that at least parts of the toolchain can be reused by other researchers, the code is structured into four parts.\nEach part can theoretically be used on its own and may only partially depend on the previous steps.\n\nThe code is provided as is and does not claim to be part of any workshop or demo.\nSupport is not guaranteed, but feel free to contact the corresponding author with any question regarding the code or protocol.\n\n## **Toolchain Overview**\n### **01_Pre-Processing**\nIn the first part, topology generation, MCDS calculation and simulation-data generation are conducted.\nThe output of the first pre-processing script is a set of separated LVDGs.\nThe whole pre-processing setup is further divided into 3 sub-tasks accessible by the main scripts.\nIn general, no changes have to be made to any files except the main scripts. \n- **a_osm_processing**  \nIn this script, an OpenStreetMap data export is used to create a configurable amount of Low Voltage Distribution Grids (LVDGs) using the methodology presented in the paper.\nBesides path configurations, the following parameters have to be specified:\n  - street_fix_distance: The maximum distance between two street anchor points for them to be considered connected (default: 0.001km).\n  - mean_num_loads: The average number of households connected to a MV/LV substation (default: 101 urban, 87 sub-urban, 51 rural).   \n  - Furthermore, the optimization options for the k-medoid clustering method have to be specified.  \n\n- **b1_mcds_processing / b2_mcds_processing**  \nThe Minimum Connceted Dominating Set (MCDS) formulation is split into two steps due to unfavorable computational performance.\nIn b1_mcds_processing, the optimization problem is formulated as a Linear Program, whereas b2_mcds_processing solves the problem.\nThis split was introduced to allow a restart of MATLAB between both calculation steps, allowing for a re-allocation of RAM.\nBesides path configurations, the following parameters have to be specified:\n  - use_lp: Either use the Gurobi LP MCDS solver, or use a poorly performing exhaustive search algorithm.\n  - start_communiation_range: The minimum node communication range used in creating the logical communication graph.\n  - communication_range_increments: As we need a fully connected graph for the flooding algorithm presented in this paper, the communication range is incremented until each node is connected.\n\n- **c_conc_seq_flooding_processing**  \nIn the last pre-processing step, all required node-control information for the full network simulation are generated and exported to separate folders.\nIt has to be noted, that this step generates a high number of small files.\nBesides path configurations, no parameters have to be specified.\n\n### **02_Simulator**\nThe files provided in the second step include the actual implementation of the flooding protocol and simulation setup scripts.\nAs the source code for NS-3 is [publicly available](https://www.nsnam.org/), only a software patch to be copied into the simulators main directory is included in this repository.\nThe publication was based on the modified NS-3 codebase available [here](https://github.com/usnistgov/psc-ns3/tree/v3.0.1).\nThe patch includes the required application files, simulation setup files and batch run scripts.\nFor the actual execution of the simulations please refer to the scripts:\n- run_sg_flooding_matrix\n- run_sg_flooding_low\n- run_sg_flooding_high\n- run_sg_flooding_large_low\n- run_sg_flooding_large_high\nEach of these files corresponds to one evaluation conducted in the published paper.\n\nIt has to be noted that both simulation scripts include an option to switch between 802.11 and LTE-D2D communication protocols.\nHowever, as only the CMSA-CA based technology was investigated in depth for the publication, no guarantees on the LTE-D2D implementation are given.\nIt is just left in the code, as it was present during the simulation campaign for the paper and in the hope that it might be of interest for other researchers.\n\n### **03_Result-Processing**\nAs the trace output of the simulation is quite convoluted and does not provide all important KPIs directly, a result processing step has to be executed.\nTheoretically, no configuration of this code should be necessary, and it is only provided to explicitly show how each metric was calculated.\nThe processing script should be ideally executed directly after the simulation finishes.\nFor doing this please, refer to the command   \n`matlab20b -nodisplay -nosplash -nodesktop -r \"cd ../../03_Result-Processing; addpath(genpath(pwd));d_result_processing(\\\"$outputDir\\\",\\\"$outputDirProcessed\\\",\\\"$experimentName\\\",$doCalcPeak); exit;\" | tail -n +11 \u003e $saveName/processingLog.txt \u0026\n`  \nin the `run_sg_flooding_*` scripts.\n\n### **04_Plots**\nThe plotting suite uses the post-processed results from step 3 and includes all plots presented in the paper.\nTo allow for a more interactive plotting experience, a MATLAB live script `e_plotter.mlx` is provided.\n\n### **05_Sim-Data**\nAs some toolchain steps either take a long time to compute (matrix simulations - +2 Weeks on a moderately equipped server) or use licensed software, output files are provided.\nThese files are identical to the ones used for plotting the results of the paper and should enable everyone to simply execute each toolchain step individually.\nPlease refer to the actual toolchain steps for naming conventions, as some path adjustments might be necessary to access this sim-data directory.\n\n## **Installation**\nPlease install and make sure the following dependencies are available:\n  - [PSC-NS3 V3.0.1](https://github.com/usnistgov/psc-ns3/tree/v3.0.1)\n  - [MATLAB20b](https://de.mathworks.com/products/matlab.html)\n  - [Gurobi for MATLAB](https://www.gurobi.com/documentation/9.1/quickstart_mac/matlab_setting_up_grb_for_.html)\n  - NS-3 Patch (this code)\nA working simulation can be achieved without MATLAB and Gurobi by using the supplied pre-processing files found in 05_Sim-Data.\n\nSimulations should be started by using any of the `run_sg_flooding_*` bash scripts located in the ns3-patch folder.\nThese bash files automatically start the evaluations conducted in the paper and are configured by some static variables at the start of each script.\n\nIn any case, please make sure you set up each script with correct options and path variables. If scripts fail, it is most likely because of misconfigured paths or missing input data.\n\n## **Protocol Overview**\nThe flooding protocol evaluated in the corresponding paper is based of the commonly known `Sequential Flooding` Protocol.\nIt is extended by using a Minimum Connected Dominating Set of nodes as Virtual Backbone Network.\nFurthermore, the sequential nature can be softened by increasing the number of simultaneously occurring flooding processes.\nFor some mode details please consult the following Message Sequence Chart, Header Map, the paper, or the implementation itself.\n\n#### **Minimum Connected Dominating Set**\nAs described MCDSs are used as Virtual Backbone Networks for disseminating the data chunks efficiently through the network.\nA simple semantic view of such a backbone network is given in the following figure.    \n\n![MCDS](00_Materials/MCDS-MCDS.png)  \n**Fig. 1 : Simple Minimum Connected Dominating Set** \n\n#### **Protocol Header Map**\nIn the following figure the header fields used by the PSAA flooding protocol are given.\nDepending on the field size (unit8 vs uint32), a short of long version of the header can be used.\n\n![Header Map](00_Materials/headerMap.png)  \n**Fig. 2 : Protocol Header Map** \n\nA short description of each field's purpose is given:\n- TYPE: The control/data format of the corresponding transmission.\n- SRC ID: The unique node ID from which the transmission originated.\n- B ID: Blocked-ID, a node ID to which this transmission shall not be forwarded (breaks 2-hop network cycles).\n- DATA ID: The unique node ID from which the data chunk originated.\n- SEQ: The sequence number of the data chunk.\n- NIS: The node ID which is the next in the stream of nodes corresponding to this data chunk.\n- INFO: Multi-purpose field, mainly used to indicate nodes covered by aggregated ACKs.\n- NUM-DEST: The number of multicast destinations.\n- DEST *: The unique node ID of each destination.\n\n#### **Message Sequence Chart**\nThis MSC depicts a typical dissemination process of data chunk (1,1) representing the data chunk originating from node 1 and with a sequence number of 1.\nThe 6 node network previously depicted in the MCDS section is re-used.\nAfter successful delivery of the `NewData` transmission to the parent of node 1, the data is broadcasted to all children of the backbone node 3, as well as forwarded to the next backbone node 5.\nAfter the data chunk is delivered to all nodes, and the parent node of the node which is next in stream (the parent of node 2 (next in stream) is node 3) received all aggregated ACK's, the dissemination of packet (2,1) starts.\nIt should be highlighted that a retransmission occurs as the ACK from node 2 is not successfully received by node 3.\nIn the subsequent retransmission, the already ACK'ed node 4 is removed from the destination field array. \n\n![Message Sequence Chart](00_Materials/MSC.png)  \n**Fig. 3 : Exemplary Message Sequence Chart** \n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcomnetshh%2Fsgcomm2021-publication-code-release","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcomnetshh%2Fsgcomm2021-publication-code-release","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcomnetshh%2Fsgcomm2021-publication-code-release/lists"}