wirelessmeshnetwork

Just another WordPress.com site

Archive for March 2011

DSDV simulation on NS

with 3 comments

I have simulated AODV and DSDV on NS2. Otcl code is given below:
I have written another code which are almost similar codes and its not working please check it and tell me the problem.
AODV simulation is same you just have to change the routing protocol from DSDV to AODV

DSDV

DSDV2(Having Problem)

Img1
Img2
Img3
Img4
Img5
Img6
Img7
Img8
Img9
Img10

Written by umairabid

March 18, 2011 at 9:44 PM

Posted in project activities

NS2 tutorial for beginners

leave a comment »

Written by umairabid

March 11, 2011 at 8:48 PM

Posted in project activities

NS2 Handbook

leave a comment »

Written by umairabid

March 10, 2011 at 12:27 PM

Posted in project activities

Simuation on NS2

leave a comment »

Written by umairabid

March 9, 2011 at 8:28 PM

Posted in project activities

simulation example

leave a comment »

follow the link to create a simulation for practice

http://perform.wpi.edu/NS/simple_ns.html

NS simulation script  explains what each line does. Example  is an OTcl script that creates the simple network configuration and runs the simulation scenario in Figure . To run this simulation, download “ns-simple.tcl” and type “ns ns-simple.tcl” at your shell prompt.

Written by umairahmedshah

March 7, 2011 at 11:22 PM

Posted in Useful Links

Where can you write Scripts? in otcl [ns2]

leave a comment »

After login into terminal, follow step given below

1. vi filename.tcl
It will open page, there you can write tcl scripts.

2. save file
Press esc-> colon (shift + semicolon) ->wq (save and quit)
It save the file

3. To run tcl script
ns filename.tcl

Basically NS 2 programming contains the following steps. Top

1.Create the event scheduler

2.Turn on tracing

3.Creating network

a) Computing setup routing – rtproto
b) Creating transport connection-Agents
c) Creating traffic-Applications

4. Monitoring

a) Visualization using nam

Every ns2 script starts with creating simulator object set ns [new Simulator]

How to create node
creation of nodes:
set n0 [$ns node]
set n1 [$ns node]

Creating link
link between nodes
$ns duplex-link $n0 $n1 1Mb 10ms DropTail

This line tells the simulator object to connect the nodes n0 and n1 with a duplex link with the bandwidth.1Megabit,  a delay of 10ms and a DropTail queue.

How to use Trace?

We use simulator to see results. How is it achieved? Using trace

Two types of trace

1. generic trace
for use with xgraph, and other things

2. nam trace
for use with visualization

# open trace file
set tracefile [open out.tr w]
$ns trace-all $tracefile

#Open the nam trace file
set nf [open out.nam w]
$ns namtrace-all $nf

Since we have started tracing, we should end also. For this we use finish procedure.

#Define a ‘finish’ procedure
proc finish {}
{
global ns tracefile nf
$ns flush-trace
close $nf
close $tracefile          # close tracefile
exec nam out.nam &   #Execute nam on the trace file
exit 0
}

Finish procedure is forced to be called at the end with the line

$ns at 5.0 “finish”

Every tcl script must contain following statement

$ns run

Written by umairahmedshah

March 7, 2011 at 11:16 PM

Posted in project activities

Wired networking in NS-2

leave a comment »

Written by umairabid

March 1, 2011 at 10:51 PM

Posted in Useful Links