Monday, December 4, 2017

NS3: What i learned

Installation of NS3


NS3 installation steps:


1) sudo apt-get update

2) sudo apt-get upgrade

3) sudo apt-get install gcc g++ python python-dev qt4-dev-tools libgtk-3-dev python-pygoocanvas python-pygraphviz wireshark gnuplot openjdk-7-jdk

4) sudo apt-get -y install vtun lxc bridge-utils uml-utilities

5) sudo apt-get -y install doxygen graphviz imagemagick texlive texlive-extra-utils texlive-latex-extra python-sphinx dia

6) sudo apt-get -y install wireshark

7) sudo apt-get -y install gnuplot plotdrop

8) cd
wget http://www.nsnam.org/release/ns-allinone-3.26.tar.bz2
tar xvjf ns-allinone-3.26.tar.bz2
cd ns-allinone-3.26

 ls
/* you should now see the following files
bake        constants.py     netanim-3.106    pybindgen-0.17.0.886         util.py
build.py    constants.pyc    ns-3.23         README                  util.py */

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

10) cd
mkdir ns3
cd ns3
hg clone http://code.nsnam.org/bake
cd bake

11) sudo apt-get -y install unrar-free autoconf cvs git unzip p7zip-full

12) export BAKE_HOME=`pwd`
export PATH=$PATH:$BAKE_HOME:$BAKE_HOME/build/bin
export PYTHONPATH=$PYTHONPATH:$BAKE_HOME:$BAKE_HOME/build/lib
./bake.py check

13) ./bake.py configure -e ns-3-dev

14) ./bake.py download -vvv

15) ./bake.py build -vvv

16) cd ns-allinone-3.26/ns-3.26
./waf --run scratch/scratch-simulator

17) cd source/ns-3-dev
./waf --run scratch/scratch-simulator

18) cp examples/tutorial/third.cc scratch/first.cc
./waf --run scratch/first


Structure of C++ program in NS3

  1. Include header files
  2. Add namespace
  3. Enable logging for different modules
  4. Create nodes
  5. Create network devices with MAC and PHY
  6. Attach network devices to node and set the interconnection
  7. Install protocol stack in node
  8. Set network address for interface
  9. Install application in nodes
  10. Run the Simulation
  11. Release resources at the end of the simulation


Log Level Information

  1. Type the following command just before creating nodes in first.cc     NS_LOG_INFO(“CREATING TOPOLOGY”);
  2. Type on the terminal
          export NS_LOG=FirstScriptExample=info
  3. Now if you run first.cc it displays CREATING TOPOLOGY along with the output.

  4. export NS_LOG=UdpEchoClientApplication=level-all
  5.  Run first.cc file
  6. Displays the log level information of UdpEchoClientApplication.
  7. export NS_LOG=*=level-all
  8. Run first.cc file
  9. Displays the log level information of all the application
  10. export NS_LOG=
  11. Clears the log level information. confirm the output by executing first.cc

Saturday, November 26, 2016

كتاب المسالك والممالك: “the book of pleasant journeys into faraway lands" from My Pen

In the January of year 2009, still new in Kingdom Saudi Arabia, far away from home, in absence of parents and wife's checks, traveling only means of getting rid of nostalgia and keeping my morale up, i met with a man viz. Mohammad Rasool Khan who had spent around 25 years in Kingdom, most of it in different geographically remote locations, as a keen learner should oblige i asked several questions about places to visit and how to get there. He on seeing my quest, told me about vast archaeological riches and special places to visit in Saudi Arabia, one of them was that there is point in saudi arabia, you can see three different countries and if count the soil beneath your foot 4. from that particular day, i was willing to see that point, but couldn't venture out of several reasons but kept my aspirations alive.

During the course of the time, i acquainted myself with long journeys and navigation techniques. Last week, Nov 2016 in our Mid Semester break, i decided to complete this chapter of my life as well and strived for a “pleasant journeys into faraway lands" although this title belongs to an eleventh‐century geography text by Abu Abdullah al‐Bakri. It was written around 1068 in Córdoba, al‐Andalus (present day Spain) but out of passion i have chosen it. ☺😊

Day 1: Beginning of  Journey
I with my staunch friend Dr Khurram Naim Shamsi with whom i share series of national and international journeys took up this opportunity also. I prayed Friday prayers in his locality and set out for our Unknown and uncertain journey with our families in our respective cars. Al though about 7 years back i have visited "Madain Swaleh: Dwellings of Qaum e Samood" but none of us were having any idea about northern region of Saudi Arabia, nevertheless we were excited to have new explorations, till Al Qassim it was our routine route for Madina Munawwarah, from Al Qassim we detoured towards Hail. before hail we passed through very big poultry farms of Al Watania and Al Yaum companies, i wished if my friend Dr Mushahid would be with us, we could  visit one of these. Till 8:30 PM we reached a point where from main highway we need to exit for Hail, which was around 60 KM. from this exit point. One of friend Dr Abrar sb has told me that we can find  cheap accommodations in 'Dwar As Shams Area', and it is easy to find as well, when you enter in hail there comes a big hospital on your right hand, after this hospital at first Signal turn right, go straight, on next signal turn left after may be 1 kilometer you will reach Dwar As Shams, a lot of mafrooshah to stay and restaurants to eat, we stayed at a lodge and slept early as there was long  unknown journey in the morning.

Day 2: First Milestone of journeys  into faraway lands

Just after Fajr (Dawn prayer) we started packing and set out early, first thing to see in our list was 'Burj Hail', it was near to place where we spent night, then we saw a small fort and an optional place Tomb of Hatim Tai which we omitted for certain reasons.
Burj Hail
Burj Hail





 Then we left Hail and moved towards Jubbah, our googling has showed that there are some caves in jubbah with thousand of years old engraving on mountainous walls

Towards Jubbah

 We exited from main highway for Jubbah town, as we were not having precise GPS coordinates for site, we have to rely upon residents of the town for our guide, after wasting our precious 1 hour, we were able to reach site but disappointed a lot after seeing a big lock on site entrance and warning signboard for trespassing.
What we expected



This is what we met with: Barbed fence and locked gate
Again we set for our next destination, Dumatul Jundal, we followed road to Al Jouf, this road was deserted, clam and from desert and ups and downs

crest and trough
Silence is only partner available
after continuing on this highway for about 3 hours, we exited for Sakaka, further continued on this road for about 25 kms and then found exit for "Dumatul Jandal". As we enter in Down Town, right from first round about will take you to Dumatul Jandal lake but we continued to second round about and right from here took us to Historic Al Marid Castle Compound, Masjid Umar bin Khattab is located in this compound just beside the castle.

I personally was very much exited and amazed to see the Masjid Minaret, and we have achieved first milestone of our journey.

Dumat al-Jundal (Arabic: دومة الجندل‎‎) is an ancient city of ruins located in North Western Saudi Arabia in the Al Jawf Province; it is located 37 km away from Sakakah. The name Dumat al-Jandal means literally "Dumah of the Stone", since this was the territory of Dumah, one of the twelve sons of Ismael. The city's ancient Akkadian name was Adummatu. (extracted from wikipedia)
From long rich history of Dawmatul-Jandal, this castle has a lions share, most notably, besieged by byzantine forces which this castle dwellers had thwarted and then after about 600 years by Hzrt Khalid bin Waleed raz. during the Wars of Apostasy, to defeat Judi and al kindi.

Most part of castle is preserved and open for visitors, upper storey of castle has door for castle tower which is also open and provide panoramic view of Daumatul Jundal, if you can dare to scale up...☺

Castle of Marid Compound, Minaret of Umar bin Khattab (raz.) Mosque
Ruins of fort walls




this compound is about 360 kms from Hail

GPS coordinates for compound are: Latitude: 29.811381 | Longitude: 39.867325

Masjid e Umar is one of the oldest mosque of islam and arabian peninsula. made up of stones. most prominent part of this mosque is it's Minaret, unique square shape base slanting walls, windows in between and stairs for Muezzins...unique in short

few kilometers from this site, is a natural lake surrounded by mountains, locally known as Buhayrah al Jundal

Panoramic view of Dumatul Jandal Lake
GPS Coordinates for lake site:
Latitude: 29.812207 | Longitude: 39.911528

After spending some time near lake we again set out for Tabuk, Sun has started declining and with more than 400 kms to travel on unknown path we were in hurry to cover as much as possible before sunset.

Olive orchards: we passed through a number of olive orchards, this was the first time i have seen blessed olive tree. i stopped near a orchard and rushed to it's fence to capture a glimpse into my mobile camera.

Olive Trees

Day 3: Fajr@Masjid e Tawbah

We slept early last night, I decided to offer morning prayer at Masjid e Tawbah (Mosque where Prophet PBUH stayed for 10 days during conquest of Tabuk), because at prayer times we can see mosque from inside as well. We reached to site easily. At first Khalifa Waleed bin Abdul Malik had made a mosque at this site then Khalifa Sulaiman the Magnificient, present structure was made by King Faisal bin Abdulaziz.



We have seen a small Castle near to mosque built by Khalifa Sulaiman the Magnificient for safety of Hajj pilgrims and there was a spring also near to the castle which has dried now.




One unique monument, although not so old, we have come across was Al Hejaz Railways Museum, which was actually railway station and locomotive workshop for Historical Al Hejaz Railways, connecting the Holy city of Al Madniah Al Munawwarah to Ottomon Capital, Istanbul. during the course of the time it has been converted into Railways Museum. The compound has one steam locomotive and a goods and passenger wagons and few rare snaps; specially the snap of feast held when first train arrived tabuk from istanbul.



Jabal al Lawz: Jabal e Tur

From tabuk we set out for the resort city of HAQL, it could be reched from tabuk by two ways, we adopted the one which passes through Jabal al Lawz or Mountain of Almond. although at the time of visit i just want to see it as a mountain which some times forms snow canopy in winters, later searches on google revealed that it is one of the strongest possible site of Jabal e Tur also, where Taurat was revealed on Prophet Musa PBUH. now i repent for not having insight.


To be continued...

Tuesday, November 8, 2016


Noorani Qaida: Ik Ibteda


To learn Arabic properly, Noorani Qaida is a must, it not only introduces alphabets and grammer rules required for proper comprehension of arabic but also focuses upon Phonetis and rules of pronounciation or Tajweed. Reciting quran with proper tajweed is necessary and we should recite quran with proper tajweed during Salah.


It became a Herculean Task for me to find a book store, where i can buy Noorani Qaida (The Elementary book to learn Arabic) for my youngest son.

It has given me a random thought, "may be many more parents like me would be facing same problem". it is readily available in India but for those living abroad or in remote locations, really its a tough job believe me really tough.

Keeping this in mind, i just scanned it and made it available online.

A humble request for DUA for those who have composed it so that our wards can learn Quran. 

*** Download From Here***

Tuesday, September 29, 2015

Farasan Islands: A dream realized

About 7 years ago, when my colleague Dr Mazhar & i was sharing room, one day i noticed a mobile recharge coupon from Mobily (Telecom operator)whose SIM mazhar bhai was using on floor. when i pick it up in my hands, i saw it was a 10 SAR recharge coupon, on the back of the card, there was a beautiful beach with caption "Farasan Islands". i made intention to visit this place immediately, it took around seven years for me to visit this marvelous place.

My visit is indebted to my friends Dr Hifzur Rehman, who arranged all tickets for us and for my Car, as there is no taxi facility in Farasan Island, visitors have to book his car also and extended his help & support when we reached there; Dr Suhail  who provided lodging in his home & Dr Bilal who took initiatives and provided moral support for this out of season visit.


I am also extremely thankful to my friends Dr Khurram Naim Shamsi and Dr Abdul Muqtadir who shared crest and trough of our long diverse journey, without their company I could never realize my dream.

Farasan Sea Fort
Our Ferry Ship

Old Heritage Village




Well for fort

Old Turkish Fort

Don't forget to take your car with you


Friday, February 25, 2011

Two wrong Lanes: Closed Encounters of the Lee Kind

After a long haul, it seems to me that it is some thing to share and save in Memoirs...
Although One of colleague has informed me about a conference, but i didn't paid any attention seeing title elearning.
It was only two days before when my neighbor alerted me about conference, next day when i saw list of speakers, very first name read Tim Berners Lee. Tim Berners Lee, creator of world wide web, man behind semantic web, is in riyadh and i am not going to listen him...such an ignorance..
With all extra zeal, i registered myself immediately OnLine.
Put full effort to arrange my classes with a bit of difficulty and bitterness, sought permission from Head of the Department, till night i was not pretty sure i would participate in the conference.
But after fajr salah my neighbors were ready to go and they convinced me also.
We strived very early, with four of my friends and me at my car for Hotel Faisaliyah, about 120 km from my home. we covered about 90-95 km distance with out any hurdle but when it came for taking turn for faisaliyah we were divided which way to go. Middle Lane was New Makkah Express Way and Right Lane was King Fahd Express Way; after consulting one of my friend and taking strong suggestion from our senior most fellow, i took King Fahd Express way. after covering few Kilometers, we found Express way was blocked for unknown reasons and cars were creeping. nothing could be changed now and we have to wait and watch only; i was cursing why not i opted another Express Way which was to me although a bit long but traffic free. it took our costly 2 hours to reach the place. after circulating premises several times finally i found a suitable parking for my car which took our another costly 20 minutes.
We rushed to the hotel and found several counter for registration and conference kit, in obvious hurry we queued in counter which was later discovered, meant for non-registered partcipants and all we were required to was just to scan our barcodes recieved in confirmation email at kiosks avialable there for online registered users.
after finishing all these formalities when i rushes to Grand hall, i saw T B Lee, leaving the dice, i rushed to him but at most closest i just cuaght a glance of noble scientist going towards hotel rooms...i was left still with extreme remorse, pondering why i took two wrong lanes.....

Wednesday, April 1, 2009

My Maiden Abroad Journey

I was never out of India before but when i got information from my consultant that my tickets for maiden abroad journey to riyadh have been confirmed to Dec 21, 2008...i was very excited...
at the night of dec 19, 2008 i boarded at Padmavat express for new delhi from where i have to start next and maiden phase of my journey .
I was accompanied by my younger brother-ASIF, father in law and my staunch friend IMRAN..
at new delhi as it approached to evening, because of tension and excitement i was very much disturbed and was even feeling pain in stomach.
many friends from aligarh and new delhi came to see off me..

when i departed from my fellows at entry point of Indira Gandhi International Airport, i felt some sort of confidence and strength in me. and felt as all burden has been removed from me.
after clearing customs and security checks, i went to waiting lounge and started checking my emails at my Mobile. many of my students and one of my best teachers, Dr. Pramod Kumar from IIITM Gwalior have wished me; i replied their mails sitting at lounge.
Then came a person who has seen me at interview venue and because of my unique attire identified me. it was only after conversation i came to know that he is also going to join there as faculty and his name is SHAWKAT.

after sitting for few hour i left my hand carry with shaukat and started visiting lounge, i have never seen such large collection of wines ever before as seen inside airport. in all these activities how whole night passed i could not guessed.

then came the boarding time, when i boarded in aircraft ( a AIRBUS 300) i found that i have window seat and further just above the wings. after some delay flight started moving. with few attempts i found seat belts easily and fasten it.
I could easily see the movements of ailerons on the wings, since i have taught Modeling and Simulation for two years specially simulation of autopilot i was seeing it at real time and was guessing what was going inside.
when plane took off it was a huge thrust i felt upon me, initially a bit scared but when i saw inside plane, got relaxed. after two hours of journey, we were howering over sanatcruz Mumbai, i could easily see the lights of City which never go for sleep.
Plane has taken two rounds of the city and was coming down when it took two sharp jolts, i was very much scared but everything was normal, it was nothing but an old Air India plane only.

we were taken to another building in a bus where a Boeing 747 Jumbo was waiting for us. before boarding to plane it was time for security check again. after security check i offered Fajr SALAH at airport, thanx to democratic government for this freedom.

Jumbo was really Jumbo in every aspect. from there it took 4.5 hours to riyadh. in between i saw how plane was penetrating clouds..........

when it started lowering altitiude, i again looked beyond the window and found red sand and dessert and some hounds of camels. it was now saudi arabia.....

plane landed and airport building was really very big....

at customs counter, i met with a very friendly custom officer after knowing that i am going to join King Saud University as lecturer, he behaved me very leniently....

although i have informed my dean about my arrival, but since could not get reply from him, i was a bit scared about.
but when i came out, i found an aged arabian shiekh with King Saud University placard, he took me with him to his ford car and dropped me at Hotel Dellmon Shrouq.
we were allotted double bed rooms and they were really very nice and splendid, after getting fresh i joined him again to University, it was very vast campus again full fledged with all healthy academic activities.
while returning from university, i purchased a SIM card and informed my mother and to my wife about my well being.
at evening i was very much disturbed and confused about azan timing and salah, it was only after isha that i came to know that MY WATCH IS STILL SHOWING ME INDIAN TIME while i am at Saudi Arabia, i corrected it.
i have taken dinner at a Turkish Restaurent and returned to Hotel, taken out my laptop, learned some common arabic sentences with traslate.google.com.
seeing my well furnished room and very comfy bed, i lie down pondering about what changes have taken place and when slept i still don't know...