Skip to content
AbelKidaneHailePublic

About

Simulation code for simulating the batman protocol in ns3 (not for deployment)

Resources

Stars

1 star

Watchers

0 watching

Forks

Latest commit

 

History

28 Commits

Folders and files

Repository files navigation

B.A.T.M.A.N

Better Approach to Mobile Ad-hoc Networking (non-official)

Static Badge

Simple simulation code for simulating the Batman routing protocol in ns-3. (N.B. This repo contains a "from-scratch" Batman protocol implementation, and is not recommended for any use. Please use the official release instead.)

Prerequisite

Install Docker in your PC by following the installation instructions from Docker. For Windows, install the Docker Desktop Application. For Ubuntu, install it using the following commands.

sudo apt update
sudo apt install docker.io

# to verify installation just type
docker

To avoid usign sudo everytime you use docker, create a group and add the user to it:-

sudo groupadd docker
sudo usermod -aG docker $USER
# verify using 
docker run hello-world

How to use

Clone this repo and pull the image for the project from Docker Hub.

git clone https://github.com/AbelKidaneHaile/batman.git 
docker pull abelkidane/ns3-dce 
cd batman

Then, start the container by using docker compose.

docker compose run ns3dce

OR alternatively (this removes warnings that docker compose has leftover from older runs)
docker compose run --rm --remove-orphans ns3dce

Now, we are ready to run ns3 terminal commands using waf. Always make sure to configure at least once. Building might take a bit of time.

./waf configure --enable-examples --enable-tests
./waf build

Finally, we can run the simulation

./waf --run "batman-simulation --nNodes=5 --duration=12"

The simulation automatically creates the trace, pcap, and routing output directories under src/batman. Paths are relative to the current working directory (normally the ns-3 root when running waf). To save all outputs elsewhere, including batman-animation.xml, set --outputDir:

./waf --run "batman-simulation --nNodes=4 --duration=12 --outputDir=/tmp/batman-results"

After completing the simulation, an xml file will be generated (batman-animation.xml). This file can be used in netanim to show the transfer of the packets across nodes. Open netanim and select the xml file to view the packet traffic in the simulation.

About

Simulation code for simulating the batman protocol in ns3 (not for deployment)

Resources

Stars

1 star

Watchers

0 watching

Forks

Contributors

Languages