Modifying transmission range values in ns-2

Tuesday, October 5, 2010 2:15 AM Posted by naz
Labels: ,

3

In my final year project, I have to vary the transmission range value in order to study the protocol behaviour using simulation with NS-2.

This can be done using a separate C program that is provided at ~ns/indep-utils/propagation/threshold.cc to compute the receiving threshold. It can be used for all the propagation models as discussed in ns-manual 18.4.


In some applications, a user may want to specify the communication range of wireless nodes. This can be done by set an appropriate value of the receiving threshold in the network interface, 
  • Phy/WirelessPhy set RXThresh_ \


Compile threshold.cc using this command:
  • g++ threshold.cc -o threshold

Assume you have compiled it and get the excutable named as threshold. You can use it to compute the threshold as follows:
  • threshold -m \ [other-options] distance
    • where propagation-model is either FreeSpaceTwoRayGround or Shadowing, and the distance is the communication range in meter.
    • [other-options] are used to specify parameters other than their default values. For the shadowing model there is a necessary parameter, -r receive-rate, which specifies the rate of correct reception at thedistance.
    • Because the communication range in the shadowing model is not an ideal circle, an inverse Q-function [29] is used to calculate the receiving threshold. For example, if you want 95% of packets can be correctly received at the distance of 50m, you can compute the threshold by
  • threshold -m Shadowing -r 0.95 50
    • Other available values of [other-options] are shown below
    • -pl \ -std \ -Pt \ -fr \ -Gt \ -Gr \ -L \ -ht \ -hr \ -d0 \
Include new value in TCL file, example:

RPM failed: error: can’t create transaction lock on /var/lib/rpm/__db.000

Wednesday, September 15, 2010 2:06 AM Posted by naz

0

  • Solution 1: 
    • Always be su (root) when you install rpm.
  • Solution 2:   
    • rm -f /var/lib/rpm/__db.0*
    • rpm --rebuildd
    • The first command clears out any of the files that will lock an RPM from running
    • The second command rebuilds the RPM database.

Change Gnuplot Background color

1:59 AM Posted by naz
Labels:

0

gnuplot -background white

options :

gnuplot*background:  white
      gnuplot*textColor:   black
      gnuplot*borderColor: black
      gnuplot*axisColor:   black
      gnuplot*line1Color:  red
      gnuplot*line2Color:  green
      gnuplot*line3Color:  blue
      gnuplot*line4Color:  magenta
      gnuplot*line5Color:  cyan
      gnuplot*line6Color:  sienna
      gnuplot*line7Color:  orange
      gnuplot*line8Color:  coral

How to generate graph in wireless scenario

1:58 AM Posted by naz
Labels: ,

0

Question: I wanted to know the procedure to get Xgraph or Gnuplot from trace file.
Answer (by Mubashir Husain Rehmani, Paris, France):

As far as gnuplot is concerned, its very easy and there is no need of any
language to learn it. what you have to do is:
1. Install gnuplot in your linux (ubuntu) distribution.
2. Once you are in the directory of gnuplot, just write gnuplot at the command prompt
3. Then once you are in gnuplot command prompt then write load "Graph.p"
4. and see the graph.
====================
Code for file Graph.p
====================
set title "Relationship between Two functions"
set xlabel "First function"
set ylabel "Second function"

set xrange [0.0:100]
set yrange [0.00:10]

set grid
set boxwidth 15

plot "Graph.tr"  using 1:2 with lines lt 1 lw 2 title ''; replot

set term post eps enhan color
set out "Graph.eps"; replot
=====================
Data present in Graph.tr
=====================
0    0
10    3.16
20    4.47
30    5.48
40    6.32
50    7.07
60    7.75
70    8.37
80    8.94
90    9.49
100    10

Source

Lyx: Include TOC in TOC

1:49 AM Posted by naz
Labels:

0

If you need to include "Table of Contents" to be listed in the Table of Contents section, use the following the in the preamble.

use tocbibind package
\usepackage {tocbibind}

Linux Basics: Understanding software Installation

1:16 AM Posted by naz
Labels:

0

This tutorial is aimed at those who have just started using Linux. Generally when users from the Windows background enter the Linux scene,they are totally stumped by the software installation method. They were used to the luxury of double clicking on a single file and getting their software installed. But now they have to type cryptic commands to do the same.

Though the installation instructions tell them what to do, they have no idea what those steps actually do. This article shall explain the basics of software installation. After reading this article you would feel more at home when installing your next software.

Generally beginners tend to search desperately for RPMs since installing RPMs is a real simple task. But this article doesn't talk about RPMs. It deals with the softwares that you generally get in the zipped formats as tarballs.


Details :
Generally you would get Linux software in the tarball format (.tgz) This file has to be uncompressed into any directory using tar command. In case you download a new tarball by the name game.tgz, then you would have to type the following command

$ tar xfvz game.tgz
This would create a directory within the current directory and unzip all the files within that new directory. Once this is complete the installation instructions ask you to execute the 3 (now famous) commands : configure, make & make install. Most of the users do this and successfully install their softwares. But most of the newbies have no idea what this really does. The rest of the article shall explain the meaning of these 3 commands

Each software comes with a few files which are solely for the purpose of installation sake. One of them is the configure script. The user has to run the following command at the prompt

$ ./configure
The above command makes the shell run the script named ' configure ' which exists in the current directory. The configure script basically consists of many lines which are used to check some details about the machine on which the software is going to be installed. This script checks for lots of dependencies on your system. For the particular software to work properly, it may be requiring a lot of things to be existing on your machine already. When you run the configure script you would see a lot of output on the screen , each being some sort of question and a respective yes/no as the reply. If any of the major requirements are missing on your system, the configure script would exit and you cannot proceed with the installation, until you get those required things.

The main job of the configure script is to create a ' Makefile ' . This is a very important file for the installation process. Depending on the results of the tests (checks) that the configure script performed it would write down the various steps that need to be taken (while compiling the software) in the file named Makefile.

If you get no errors and the configure script runs successfully (if there is any error the last few lines of the output would glaringly be stating the error) then you can proceed with the next command which is

$ make
make ' is actually a utility which exists on almost all Unix systems. For make utility to work it requires a file named Makefile in the same directory in which you run make. As we have seen the configure script's main job was to create a file named Makefile to be used with make utility. (Sometimes the Makefile is named as makefile also)

make would use the directions present in the Makefile and proceed with the installation. The Makefile indicates the sequence, that Linux must follow to build various components / sub-programs of your software. The sequence depends on the way the software is designed as well as many other factors.

The Makefile actually has a lot of labels (sort of names for different sections). Hence depending on what needs to be done the control would be passed to the different sections within the Makefile Or it is possible that at the end of one of the section there is a command to go to some next section.

Basically the make utility compiles all your program code and creates the executables. For particular section of the program to complete might require some other part of the code already ready, this is what the Makefile does. It sets the sequence for the events so that your program does not complain about missing dependencies.

One of the labels present in the Makefile happens to be named ' install ' .

If make ran successfully then you are almost done with the installation. Only the last step remains which is
$ make install
As indicated before make uses the file named Makefile in the same directory. When you run make without any parameters, the instruction in the Makefile begin executing from the start and as per the rules defined within the Makefile (particular sections of the code may execute after one another..thats why labels are used..to jump from one section to another). But when you run make with install as the parameter, the make utility searches for a label named install within the Makefile, and executes only that section of the Makefile.
The install section happens to be only a part where the executables and other required files created during the last step (i.e. make) are copied into the required final directories on your machine. E.g. the executable that the user runs may be copied to the /usr/local/bin so that all users are able to run the software. Similarly all the other files are also copied to the standard directories in Linux. Remember that when you ran make, all the executables were created in the temporary directory where you had unzipped your original tarball. So when you run make install, these executables are copied to the final directories.
Thats it !! Now the installation process must be clear to you. You surely will feel more at home when you begin your next software installation.


Source

Installing VirtualBox Guest Addition on Centos

Tuesday, July 6, 2010 1:04 AM Posted by naz
Labels: ,

0

Log in as root and type in terminal:

  • yum install gcc -y
  • yum install kernel sources -y
  • yum install kernel-devel -y
Restart the system.
Mount the VboxGuestAdditions.iso.
Move to the following directory:

  • cd /media/VBOXADDTIONS_2.2.4_47978
As root execute:
  • sh ./VBoxLinuxAddtions-x86.run
Restart the system. Done.

as being mentioned here.