Monthly Archives: December 2012

Install windoWs application in LINUX.

  • RUN all application of windows based in UBUNTU.

************************* COMMAND BASED INSTALLATION PROCESS *************************************

  • Rule 1:   you should have inter net  connection FOR installing WINE software
  • Rule 2:  To get started, press Ctrl – Alt – T on your keyboard to open Terminal. When it opens, run the commands below to add Wine PPA.
  • Rule 3: type this command  on the terminal sudo add-apt-repository ppa:ubuntu-wine/ppa u must have inter net connection during the installation or u are connecteD.
  • Finally, run the commands below to update your system and install Wine 1.5.4
  • sudo apt-get update && sudo apt-get install wine1.5

*********************** MANUALLY DOWNLOAD AND INSTALL *******************************************

  • You can install manually after downloading the file from here


  • NOW press windows button of your keyboard and search “WINE”.

then Enjoy  🙂

thanks 🙂

Run shell (LINUX) program in W7



now you can run shell script linux program in windows7 through Cygwin tools just download it and install from here

if you have any problem during the installation or anything regarding this  then please leave a comment here or if you did very well then ……….  LIKE this or RATE this 🙂

🙂 thank you

Run c/C++ propgram in Ubuntu




Install C and C++ Compilers in Ubuntu

  • sudo aptitude install build-essential   /**** This will install all the required packages for C and C++ compilers ***/

Firstly compile the code using the following command

  • cc -c first.c

then create an executable using the following command

  • cc -o first first.c

Now run this executable using the following command

  • ./first


Compiling your first C++ program

If you want to run c++ program follow this procedure

g++ is the compiler that you must use.

you should use a .cpp file extension rather than a .c one

You need to create a file

  • sudo gedit “any filename”.cpp


Run your C++ Program using the following command

  • g++ first.cpp -o test
  • ./test



DSDV Algorithm (implementation of 3 nodes)


# this is the TCL script

set val(chan)           Channel/WirelessChannel    ;# channel type
set val(prop)           Propagation/TwoRayGround   ;# radio-propagation model
set val(netif)          Phy/WirelessPhy            ;# network interface type
set val(mac)            Mac/802_11                 ;# MAC type
set val(ifq)            Queue/DropTail/PriQueue    ;# interface queue type
set val(ll)             LL                         ;# link layer type
set val(ant)            Antenna/OmniAntenna        ;# antenna model
set val(ifqlen)         50                         ;# max packet in ifq
set val(nn)             3                         ;# number of mobilenodes
set val(rp)             DSDV                       ;# routing protocol
set val(x)              500                  ;# X dimension of topography
set val(y)              400                  ;# Y dimension of topography
set val(stop)           150               ;# time of simulation end

#Creating trace file and nam file
set ns          [new Simulator]
set tracefd       [open w]
set windowVsTime2 [open w]
set namtrace      [open dsdv.nam w]

$ns trace-all $tracefd
$ns namtrace-all-wireless $namtrace $val(x) $val(y)

# set up topography object
set topo       [new Topography]

$topo load_flatgrid $val(x) $val(y)

create-god $val(nn)

# configure the nodes
$ns node-config -adhocRouting $val(rp) \
-llType $val(ll) \
-macType $val(mac) \
-ifqType $val(ifq) \
-ifqLen $val(ifqlen) \
-antType $val(ant) \
-propType $val(prop) \
-phyType $val(netif) \
-channelType $val(chan) \
-topoInstance $topo \
-agentTrace ON \
-routerTrace ON \
-macTrace OFF \
-movementTrace ON

for {set i 0} {$i < $val(nn) } { incr i } {
set node_($i) [$ns node]

#set node_(0) [$ns node]
#set node_(1) [$ns node]
#set node_(2) [$ns node]

# Defining heades..
$ns at 0.0 “$node_(2) label CH”
$ns at 0.0 “$node_(1) label Source”
$ns at 0.0 “$node_(0) label Destination”

# Provide initial location of mobilenodes
$node_(0) set X_ 5.0
$node_(0) set Y_ 5.0
$node_(0) set Z_ 0.0

$node_(1) set X_ 490.0
$node_(1) set Y_ 285.0
$node_(1) set Z_ 0.0

$node_(2) set X_ 150.0
$node_(2) set Y_ 240.0
$node_(2) set Z_ 0.0

# Generation of movements
$ns at 10.0 “$node_(0) setdest 250.0 250.0 3.0”
$ns at 15.0 “$node_(1) setdest 45.0 285.0 5.0”
$ns at 110.0 “$node_(0) setdest 480.0 300.0 5.0”

$ns at 0.0 “$node_(2) add-mark N2 green circle”
$ns at 85.0 “$node_(0) add-mark N0 green circle”
$ns at 85.0 “$node_(1) add-mark N1 green circle”

# Set a TCP connection between node_(0) and node_(1)
set tcp [new Agent/TCP/Newreno]
$tcp set class_ 2
set sink [new Agent/TCPSink]
$ns attach-agent $node_(0) $tcp
$ns attach-agent $node_(1) $sink
$ns connect $tcp $sink
set ftp [new Application/FTP]
$ftp attach-agent $tcp
$ns at 10.0 “$ftp start”

$ns at 90.0 “$node_(2) add-mark N3 yellow circle”
$ns at 104.0 “$node_(1) add-mark N2 yellow red”
$ns at 125.0 “$node_(0) add-mark N4 red circle”
# Printing the window size

proc plotWindow {tcpSource file} {
global ns
set time 0.01
set now [$ns now]
set cwnd [$tcpSource set cwnd_]
puts $file “$now $cwnd”
$ns at [expr $now+$time] “plotWindow $tcpSource $file” }
$ns at 10.1 “plotWindow $tcp $windowVsTime2”

# Define node initial position in nam
for {set i 0} {$i < $val(nn)} { incr i } {

# 30 defines the node size for nam
$ns initial_node_pos $node_($i) 30

# Telling nodes when the simulation ends
for {set i 0} {$i < $val(nn) } { incr i } {
$ns at $val(stop) “$node_($i) reset”;

# ending nam and the simulation
$ns at $val(stop) “$ns nam-end-wireless $val(stop)”
$ns at $val(stop) “stop”
$ns at 150.01 “puts \”end simulation\” ; $ns halt”

proc stop {} {
global ns tracefd namtrace
$ns flush-trace
close $tracefd
close $namtrace
exec nam dsdv.nam &
#exec xgraph -geometry 800×400 &
exit 0

$ns run

  • To run this script “$ns dsdv.tcl

Screenshot from 2012-12-02 222153

  • Sending the Packets one Node to another node..


NS2 (NS-2.35) Installation in Ubuntu


This post will help you in installing Network Simulator 2 version NS2.35 in Ubuntu 11.10
• Install Ubuntu

  • Unzip or untar it to any folder (recommended is /home/loginname) using the following commands one by one
  • sudo apt-get update
  • sudo apt-get build-essential autoconf automake libxmu-dev
  • tar zxvf ns-allinone-2.35.tar.gz (simply you may extract manually )
  • cd ns-allinone-2.35
  • ./install
  • after that go through ubuntu’s software center and search “NS2 ” you will get “Discrete event simulator targeted at networking research ns2”  and once again install it.