NetAnim for NS3, Graphical simulation animation and statistics for NS3 simulation

Dear Fellow,
         This tutorial is to help you configure and run NetAnim with NS3. I hope you have already installed NS3 in ubuntu. If not refer my previous post for NS3 installation.
To configure go in netanim directory. This directory you can find in NS3 folder.

Prerequisites

  1. mercurial
  2. QT4 development packages (recommended version 4.7)

Debian/Ubuntu Linux distribution:

  1. apt-get install mercurial
  2. apt-get install qt4-dev-tools


root@hassan-virtual-machine:~/workspace/ns-allinone-3.21/netanim-3.105#

after that use these commands:

make clean
qmake NetAnim.pro (For MAC Users: qmake -spec macx-g++ NetAnim.pro)
make

after these commands netanim will be configure. NetAnim can be used to read *.xml files generated by your code. Lets assume we are using /example/tutorial/third.cc file. add following lines of code in this file. (its better to copy this file first in scratch folder)

For adding ns3 to your program, do the following
1. Add the header file

#include "ns3/netanim-module.h"

2. Add the following statement before Simulation::Run()

AnimationInterface anim ("animation.xml"); 
anim.SetMobilityPollInterval(Seconds(0.25));
anim.EnablePacketMetadata(true);



References: http://www.nsnam.org/wiki/NetAnim

by using these lines a new file will be created named as animation.xml
now go in

root@hassan-virtual-machine:~/workspace/ns-allinone-3.21/# 

and type

root@hassan-virtual-machine:~/workspace/ns-allinone-3.21/# ./netanim-3.105/NetAnim

This will open graphical interface of NetAnim, use open file and open animation.xml
By play button you can easily play the simulation.

Note: There is different interface that you can encounter. Using above method you will get full interface.
In above picture you can see 3 tabs.
But if you open netanim from dashboard you will get minimal view.
. (This is due to root permissions :) )


Thats all for now.
GOOD LUCK.. 

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>

Permissions in android and intrusion in the privacy of a person's personal life, Facebook messenger's permissions

(Solved) Intrusion of the android apps specially Facebook messenger on Personal information <No  Purchase>:


Hi Friends, 

       I read and saw some news about the privacy issues with facebook and its application on android phone like :

http://www.youtube.com/watch?v=FzGMcJ_DMLo
http://www.onthemedia.org/story/why-facebook-wants-access-your-phones-microphone-all-times/
http://mashable.com/2014/08/11/stop-freaking-out-about-facebook-messenger-app-permissions/

and other articles and videos.
So gave my self a thought that why the hell do Facebook need permission which are not related to the operation of the application like reading/sending my sms/contact/calls, storage, recording features and much more.


On the other hand I want to use Facebook and its messenger. Now how to get around this problem so I searched a bit and got a workaround.
In short (for geek/nerd kind of guys) what I did (Galaxy S3) is :

Updated: I put a comparison of permission on android apps (Facebook, Facebook messenger, Skype, Viber) that I use normally. and also I used above procedure to remove some permissions. details are here:
https://app.box.com/s/c0g6u5xx34s31vktdlr3

Detailed information about the process from start:

  • Root your device
  • Install Xposed framework
    • http://repo.xposed.info/module/de.robv.android.xposed.installer
    • First you need to install framework, copy apk in your device and then use it. Make sure your unknown sources is checked in setting. If you dont know unknown sources setting, this might help
    • http://goo.gl/G59aDa
    • After installation it might ask you to grant supersu permission to XposedFramework, grant it
  • Install AppSetting framework from xposed repository 

Select Xposed Installer
Selects Modules

Enable App Settings and Reboot


  • Using Appsetting go in facebook or any other and revoke the permissions you don't want any application to have, like removing camera,sms access from Facebook or any other applications.
Open AppSetting
Select Facebook or any app to revoke permissions

1. switch on settings
2. select permissions

1. switch on permissions
2. touch permission you want to remove and press OK
after Ok you will be redirected to above screen press save button and click ok, relaunch application and you are good to go.



  • Thats it .. Use application and be secure :) 
  • Using above process you can check application that are accessing more than they require for their operation.
  • if after revoking permissions your application crashes try revoking 1 permission at a time and relaunching application.





Good Luck Guyz.
Note: If you have any question feel free to ask or share your experiences.

Android S Planner Sync with Outlook Calendar and Google Calendar, Backward Sync Too .

Dear Friends,
          When I bought Samsung S3 I wanted an application that can remind me about my important appointments I tried many but I found S Planner available already in Phone really help. Then it came to me that I should sync my calendar to Outlook or Google so I can see and set my appointment using computer and get more ease of use.
I searched and after many searches I did it.
I want to share that experience with You so you can do it easily.

Sync with Outlook:

Requirement:
  1. Android Phone with S Planner
  2. Outlook account with calendar set up.
procedure is in snap shots:

1
 2
 3
 4
 After adding accounts from Outlook, go back to pic 3 and mark the check box with your account information.
Now while using outlook calendar you can see in your S Planner the events you added in Outlook calendar but not the events that are saved in S Planner ..
( I Also wanted backward sync )So To Sync this kind of system you have to add events on your phone using your outlook account name in SPlanner, refer the snap shot.
And your new event/task will be updated on your Outlook calendar.


Google Calendar:

For Google calendar the steps are same but with Google calendar instead of Outlook calendar. I hope I helped someone..

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...