Repository dedicated to the Wireless Networks course took at the Federal University of Paraíba. On this class, we created experiments using ns-3. The project's structure is based on Alejandro Gomez's Network Simulator. The experiments are implemented in the scenarios directory, where each scenario has it's own docker-compose file to setup the necessary containers and volumes. The simulations can be run using scripts that sets up th required linux networking interfaceson host and connects them to the running containers and simulation.
-
Linux or MacOS
⚠️ Warning: This installation was only tested onLinux
(but should work fine forMacOS
as well). -
docker
- https://docs.docker.com/get-docker/ -
docker compose
- https://docs.docker.com/compose/install/ -
git
installed by your distribution Linux or macOS (e.g.HomeBrew
)
-
Install
docker
and verify installation. Should be possible to run thehello-world
image:foor@bar# sudo docker run hello-world Hello from Docker! This message shows that your installation appears to be working correctly. To generate this message, Docker took the following steps: 1. The Docker client contacted the Docker daemon. 2. The Docker daemon pulled the "hello-world" image from the Docker Hub. (amd64) 3. The Docker daemon created a new container from that image which runs the executable that produces the output you are currently reading. 4. The Docker daemon streamed that output to the Docker client, which sent it to your terminal. To try something more ambitious, you can run an Ubuntu container with: $ docker run -it ubuntu bash Share images, automate workflows, and more with a free Docker ID: https://hub.docker.com/ For more examples and ideas, visit: https://docs.docker.com/get-started/
-
Clone the repo. Example using SSH:
foo@bar# git clone git@github.com:jpvt/wireless-networks.git
-
Prepare the
hello_world.sh
script to run:foo@bar# chmod a+x scripts/hello_world.sh
-
Run the
hello_world.sh
script:⚠️ Warning: On the first run this should take about ~22 minutes on a 300Mbps connection.foo@bar# ./scripts/hello_world.sh ns3 | -- Configuring done ns3 | -- Generating done ns3 | -- Build files have been written to: /usr/local/ns-allinone-3.37/ns-3.37/cmake-cache ns3 | Scanning dependencies of target scratch_hello ns3 | [ 0%] Building CXX object scratch/CMakeFiles/scratch_hello.dir/hello.cc.o ns3 | [ 0%] Linking CXX executable ../../build/scratch/ns3.37-hello-default ns3 | At time +2s client sent 1024 bytes to 10.1.1.2 port 9 ns3 | At time +2.00369s server received 1024 bytes from 10.1.1.1 port 49153 ns3 | At time +2.00369s server sent 1024 bytes to 10.1.1.1 port 49153 ns3 | At time +2.00737s client received 1024 bytes from 10.1.1.2 port 9 ns3 exited with code 0 Done
This is a test scenario to check if your setup is working properly. There is not much to it. Files in this scenario:
- script:
hello_world.sh
- docker compose:
scenarios/hello-world.yaml
- src file:
hello.cc
- image:
ns3.Dockerfile
In this scenario, a smart hospital is equipped with an Internet of Things (IoT) network to continuously monitor patients' vital parameters and respond to events in real-time to improve patient care quality.
Note: the intervals of vital parameters may change accordingly to the patient data.
-
Sensor Nodes: These nodes are associated with patients and are responsible for continuously monitoring patients' vital parameters, such as heart rate, blood pressure, body temperature, respiratory rate, and blood oxygen levels.
-
Server Node: This node receives readings from the sensor nodes. It has predefined rules to identify normal and abnormal readings. When an abnormal reading is detected, the server node identifies this as an event.
-
Actuator Nodes: These nodes are associated with various actions that may be required in response to an event. For example, there might be an actuator node associated with a robot that delivers medications to patients.
-
Intermediate Nodes: These nodes facilitate communication between the sensor nodes, the server node, and the actuator nodes.
The server node stores and processes the patients' vital parameters, which are continuously monitored by the sensor nodes. This includes patients' heart rate, blood pressure, body temperature, respiratory rate, and blood oxygen levels.
- script:
hospital.sh
- docker compose:
scenarios/hospital.yaml
- src file:
hospital.cc
- logs:
data/hospital_logs.txt
- server data:
data/patients_data.csv
- test input:
data/sensor_readings.csv
- image:
ns3.Dockerfile
-
Prepare the
hospital.sh
script to run:foo@bar# chmod a+x scripts/hospital.sh
-
Run the
hospital.sh
script:⚠️ Warning: If this is the first time that you're building the image, this should take about ~22 minutes on a 300Mbps connection.foo@bar# ./scripts/hospital.sh