Installing NS3 with LENA (LTE Simulation) Module in Ubuntu 14

NOTE: 5G/ mmWave NS3 SIMULATOR IS AVAILABLE NOW. https://github.com/mmezzavilla/ns3-mmwave



Dear Friends,
      I am sharing my experience of installing LTE module LENA and NS3 in Ubuntu. I Hope this will help you. I have installed Ubuntu in VMPlayer with 1.7GB RAM assigned.
  • Install Ubuntu in VMPlayer
    • Download VMPlayer
      • https://my.vmware.com/web/vmware/free#desktop_end_user_computing/vmware_player/6_0
    • Download Ubuntu ISO
      • http://www.ubuntu.com/download/desktop
  • After installation U need to install prerequisite of NS3
    • This link contain all the commands for Ubuntu. But I am adding those commands here for your ease.
      http://www.nsnam.org/wiki/Installation#Ubuntu.2FDebian
NOTE: NS3 simulator requires some other programs (dependencies) to be installed already in your system. You can install those dependencies using these commands:

  sudo apt-get install gcc g++ python

  sudo apt-get install gcc g++ python python-dev
  sudo apt-get install mercurial
  sudo apt-get install bzr
  sudo apt-get install gdb valgrind 
  sudo apt-get install gsl-bin libgsl0-dev libgsl0ldbl
  sudo apt-get install flex bison libfl-dev
  sudo apt-get install g++-3.4 gcc-3.4
  sudo apt-get install tcpdump
  sudo apt-get install sqlite sqlite3 libsqlite3-dev
  sudo apt-get install libxml2 libxml2-dev
  sudo apt-get install libgtk2.0-0 libgtk2.0-dev
  sudo apt-get install vtun lxc
  sudo apt-get install uncrustify
  sudo apt-get install doxygen graphviz imagemagick
  sudo apt-get install texlive texlive-extra-utils texlive-latex-extra
  sudo apt-get install python-sphinx dia 
  sudo apt-get install python-pygraphviz python-kiwi python-pygoocanvas libgoocanvas-dev
  sudo apt-get install libboost-signals-dev libboost-filesystem-dev
  sudo apt-get install openmpi-bin openmpi-common openmpi-doc libopenmpi-dev
  sudo apt-get install gcc-multilib

Section 1:All in one install
 
This tutorial will guide you to install NS3 in your UBUNTU 14. I have installed Ubuntu 14 in VMplayer virtual environment.
To install NS3 use this:

1 cd
2 mkdir workspace
3 cd workspace
4 wget http://www.nsnam.org/releases/ns-allinone-3.21.tar.bz2

If above does not work try downloading latest tar from : http://www.nsnam.org/ns-3-21/ 
Download the latest ns3 stable release: https://www.nsnam.org/release/ns-allinone-3.24.1.tar.bz2 or from here: https://www.nsnam.org/ns-3-24/
after downloading cp the file to workspace folder

$ sudo cp /home/user/Downloads/ns3-allinone-3.21 ~/workspace/

above command will copy the file then use 
$ cd ~/workspace/

5 tar xjf ns-allinone-3.21.tar.bz2
this will create a workspace folder and in that folder will create ns-allinone folder.
Problem: Now if you are unable to download above ns3 tar file then download it manually using:
or
and copy the file in workspace using
cp /home/hassan/Downlaods/ns-allinone-3.21.tar.bz2  ~/workspace

after copy use step 5 (given above) to untar the files. After untar use this command to build.
Change the directory and go to ns3 folder.

./build.py 
./build.py --enable-examples --enable-tests

after build you will have some folder that you can see using ls command.

cd ns-3.21

so that you get in to ns3 directory then use waf to configure ns3


$ ./waf clean
$ ./waf configure --build-profile=debug --out=build/debug
$ ./waf configure --build-profile=optimized --out=build/optimized
$ ./waf configure --enable-examples –-enable-tests
$ ./waf build
(Note: If tests and examplse are still disabled use:)
cd ..
./build.py --enable-examples --enable-tests
Now if everything
goes well you can test your NS3 by:
./test.py -c core
and You should see 
92 of 92 tests
passed (92 passed, 0 failed, 0 crashed, 0 valgrind errors)
Now lets run one
script so that we can be sure of NS3.
./waf
./waf –run hello-simulator
Ta da .. Done . 
In case you have difficulties running hello-simulator code. Try configuring WAF again:

Configuration with Waf 

 ./waf -d optimized configure; ./waf 
 ./waf distclean ./waf configure    // (or use this > ./waf configure –enable-  examples –enable-tests)
 ./build.py --enable-examples --enable-tests  // we are enabling example and test by build
 ./waf configure --enable-examples --enable-tests // we are enabling example and test by waf
./waf build
  •  Now as You are good to go with ./waf to run scripts.
  • to run any script use
./waf --run first // to run file first.cc while your root folder should be ns3.17

Using Above method I have found that LTE is supported and installed already in NS3 . So no need to install separate module.
So Now lets run a simple LTE file with 1 enb and some devices.
You can refer this file documentation here and source code here.

Put lte_basic_example.cc in scratch folder.

./waf
./waf --run lte_basic_example

This will not generate any output on console but I have added some code to generate an xml file to read in NetAnim program. You will see a file in ns3 folder named as lte_animation_test.xml you can use netanim to read and simulate LTE basic scenario. To understand how to run netanim go here.

I HOPE THAT NOTHING IS MISSING, HAPPY CODING GUYS. "GOOD LUCK"                <WRITE COMMENT FOR ANY QUERY>

18 comments:

  1. hi..i cannot dpwnload the code source, would ya plz help me ?

    ReplyDelete
    Replies
    1. You mean NS3 allinone Package.
      You can download that from here.
      https://www.nsnam.org/ns-3-dev/download/

      Delete
  2. Hi, can you please re-upload the source code of the sample? The link doesn't work anymore, thanks.

    cit."So Now lets run a simple LTE file with 1 enb and some devices.
    You can refer this file documentation here and source code here."

    ReplyDelete
    Replies
    1. Please Refer This file: https://www.dropbox.com/s/os6r9cfc05ysf4b/lte_basic_example.cc?dl=0

      Delete
  3. Thanks for the post, saved me quite a bit of time!

    ReplyDelete
    Replies
    1. hello farooq

      is the file still available? the drop box link does not work

      regards
      kashif

      Delete
    2. Hello Kashif,
      The Link Is Still Active. Please Refer This:

      https://www.dropbox.com/s/os6r9cfc05ysf4b/lte_basic_example.cc?dl=0

      Delete
    3. Can you please give the link again. File is not available on this.

      Delete
  4. Farooque, what is you good email address to contact you ?
    Thanks,
    Azar
    azar@techtrained.com

    ReplyDelete
  5. i have installed netanim 3.105,but its not working properly .i felt like its incomplete solve examples

    ReplyDelete
    Replies
    1. Can You Explain The Problem Properly??
      What Is The Error or Issue?

      Delete
  6. Hello farooque, myself Gitimayee Sahu working on optimization of femto cell; i have tried to simulate dual stripe model and FFR model using NS3. But didn't get the animation. kindly help.

    please share your mail id, giti.sahoo@gmail.com

    ReplyDelete
  7. This comment has been removed by the author.

    ReplyDelete
  8. Sir, I want to generate dataset(containing features like throughput,SINR,Transmission power,CQI)from lte simulation.How can I generate dataset. I have used flow monitor. But didnt get any data.Please help sir

    ReplyDelete
  9. Sir, i want to generate traffic between two UEs rather than UL and DL. Can u help me in this regard..any help will be appreciated

    ReplyDelete

Connecting Arduino Uno with ThingSpeak using ESP 8266 Wi-Fi Module

Connecting Arduino Uno with ThingSpeak using ESP 8266 Wi-Fi Module We will connect ARDUINO with ThingSpeak using TCP Connection and HT...