Skip to content

This repository has the code for lightweight link simulation in ns-3 using theoretical model of channels

Notifications You must be signed in to change notification settings

tlmat-unican/Lightweight-ns-3-link-simulation

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

81 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Lightweight modeling of dynamic channels: application to NTN scenarios

This repository contains the implementation over ns-3 of thoretical wireless link models based on Markov Chains. This modeling is intended to carry out performance evalaution of upper layers (e.g. transport) over dynamic channels without the complexity of detailed implementation of wireless technologies.

Dependencies

It has been tested in Ubuntu 22.04.1 LTS (jammy). It has the following dependencies:

  • Dependencies of ns-3
apt install g++ python3 cmake ninja-build git
  • python3 and pip3 to automatize the evaluation
apt install python3
apt install python3-pip
  • Jupyter optional to generate plots.

Project Structure

  • The folder ns-allinone-3.35 contains a copy of ns-3. The scratch folder contains a generic scenario (p2p_scenarioOnBuild.cc) to generate evaluation topologies. A second scenario p2p_scenarioReusable_taps.cc) has been defined to use the link models with real applications using ns-3 TAP.

  • The scripts folder contains scripts needed to run different topologies. It also contains a Jupyter notebook to represent the outcomes.

Building ns-3

Configure and compile ns-3, we disable not used functionalities

cd ns-allinone-3.35/ns-3.35
./waf configure --disable-werror --disable-python --disable-tests --disable-examples --build-profile=optimized
./waf

Scenarios

Below are the scripts that have been used to prepare the results of the paper. The scripts automatically generate the folder tree where the results are stored, and by keeping this structure, a representation of the results can be obtained like in the paper. All results will be generated under the folder ./scripts/RESULTS

In addition, the files used for the simulation of each of the scenarios using Python3 are described below, all of them are collected in scripts. In all cases the evaluation embraces a pair ns-3 client and server sending a 300 MB datafile with a rate of 40 Mbpos, that equals the average capacity of the first link from the sender (access link).

In all cases, the execution of a scenario generates the following logs:

  • Congestion window: logCWND.log [time (seconds) | size (B)]
  • Received traffic: RXFile.log [pkt number | time (seconds) | pkt size (B)]
  • Transmission traffic: TXFile.log [pkt number | time (seconds) | pkt size(B)]
  • Access buffer occupancy: logBuffer.log [time (seconds) | size buffer (B)]
  • ChannelVar.log: [time (seconds)| State] where State = {LoS=1,Ms=2,Ds=3}

Synthetic LMS link (figure 3)

This script deploys a Land-Mobile-System (LMS) link modeled as a 3-state Markov Chain with constant stay times of 5 seconds. It runs the scenario once.

cd scripts
python3 sim_ns3_lms_toy.py

Realistic LMS link (figure 4)

This script deploys a Land-Mobile-System (LMS) link modeles as a 3-state Markov Chain with exponentially distributed stay times. It runs the scenario once.

cd scripts
python3 sim_ns3_lms.py 

End-to-end with disconnections traffic: LMS - ISL(disconnections)-LMS (figure 5)

This script deploys three links, UP/DOWN LMS links and an inter-satellite-link (ISL) connecting them, with disconnections. The script sweeps the average disconnection time from 0 to 3 seconds with step 0.2 seconds. For each value it runs Nsim independent executions. By default NSim is set to 5, increase it to obtain statistically significant results.

cd scripts
python3 sim_ns3_lms.py 

End-to-end with background traffic: LMS - ISL(background traffic)-LMS (figure 6)

This script deploys three links, UP/DOWN LMS links and an inter-satellite-link (ISL) connecting them, with background traffic. The script sweeps the background traffic from 5 to 30 Mbps with step 1 Mbps. For each value it runs Nsim independent executions. By default NSim is set to 5, increase it to obtain statistically significant results.

cd scripts
python3 sim_ns3_lms.py 

Applications with ns-3 TAP

The scenario p2p_scenarioReusable_taps.cc is created to use real applications with the lightweight channel models. This script runs the scenario using ns-3 TAP to use real applications instead of ns-3 client/server. The script uses the commands tunctl and ip. Install them as follows

apt install uml-utilities
apt install iproute2

Plots generation with Jupyter NoteBook

Analysis.ipynb contains code snippets to reproduce the results shown in the paper. Figures generated by Analysis.ipynb are saved in figures folder.

Disclaimer: figures in manuscrip are generated with Tikz, points in temporal plots are reduced for better visibility and boxplots are generated with 100 executions.

Contact

About

This repository has the code for lightweight link simulation in ns-3 using theoretical model of channels

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •