[ns] Display in NAM

2011-01-31 Thread lalit isarani

Dear All,

I am working on Online Video Streaming, and i have to build a topology using
gt-itm topology generator.
Following is the program, but in output i m not getting any display on
Network animator (NAM).
can anybody suggest me the correction in program?

set ns [new Simulator]

set nf [open out.nam w]
$ns namtrace-all $nf

proc finish {} {
global ns nf
$ns flush-trace
close $nf
exec nam out.nam 
exit 0
}



# Generated by sgb2ns, created by Polly Huang
# GRAPH (#nodes #edges id uu vv ww xx yy zz):
# 100 354
transtub(0,3,0,0,{1,89,3,1.000,0.000,0.000},{4,44,3,0.600,0.000,0.000},{8,36,3,0.420,0.000,0.000})
89 2 4 0


proc create-topology {nsns node linkBW} {
upvar $node n
upvar $nsns ns

set verbose 1

if {$verbose} {
puts creating nodes...
}
for {set i 0} {$i  100} {incr i} {
set n($i) [$ns node]
}

# EDGES (from-node to-node length a b):
if {$verbose} {
puts -nonewline Creating links 0...
flush stdout
}
$ns duplex-link-of-interfaces $n(0) $n(18) $linkBW 270ms DropTail
$ns duplex-link-of-interfaces $n(0) $n(5) $linkBW 160ms DropTail
$ns duplex-link-of-interfaces $n(0) $n(1) $linkBW 230ms DropTail
$ns duplex-link-of-interfaces $n(0) $n(3) $linkBW 310ms DropTail
$ns duplex-link-of-interfaces $n(1) $n(42) $linkBW 330ms DropTail
$ns duplex-link-of-interfaces $n(1) $n(29) $linkBW 80ms DropTail
$ns duplex-link-of-interfaces $n(1) $n(28) $linkBW 120ms DropTail
$ns duplex-link-of-interfaces $n(1) $n(2) $linkBW 140ms DropTail
$ns duplex-link-of-interfaces $n(1) $n(3) $linkBW 250ms DropTail
$ns duplex-link-of-interfaces $n(2) $n(77) $linkBW 240ms DropTail
if {$verbose} { puts -nonewline 10...; flush stdout }
$ns duplex-link-of-interfaces $n(2) $n(69) $linkBW 300ms DropTail
$ns duplex-link-of-interfaces $n(2) $n(58) $linkBW 270ms DropTail
$ns duplex-link-of-interfaces $n(2) $n(54) $linkBW 60ms DropTail
$ns duplex-link-of-interfaces $n(2) $n(45) $linkBW 210ms DropTail
$ns duplex-link-of-interfaces $n(3) $n(91) $linkBW 190ms DropTail
$ns duplex-link-of-interfaces $n(3) $n(89) $linkBW 180ms DropTail
$ns duplex-link-of-interfaces $n(4) $n(5) $linkBW 100ms DropTail
$ns duplex-link-of-interfaces $n(4) $n(11) $linkBW 220ms DropTail
$ns duplex-link-of-interfaces $n(5) $n(6) $linkBW 270ms DropTail
$ns duplex-link-of-interfaces $n(5) $n(8) $linkBW 370ms DropTail
if {$verbose} { puts -nonewline 20...; flush stdout }
$ns duplex-link-of-interfaces $n(5) $n(9) $linkBW 230ms DropTail
$ns duplex-link-of-interfaces $n(5) $n(10) $linkBW 420ms DropTail
$ns duplex-link-of-interfaces $n(5) $n(12) $linkBW 280ms DropTail
$ns duplex-link-of-interfaces $n(6) $n(8) $linkBW 200ms DropTail
$ns duplex-link-of-interfaces $n(6) $n(10) $linkBW 150ms DropTail
$ns duplex-link-of-interfaces $n(6) $n(12) $linkBW 70ms DropTail
$ns duplex-link-of-interfaces $n(7) $n(9) $linkBW 190ms DropTail
$ns duplex-link-of-interfaces $n(8) $n(9) $linkBW 140ms DropTail
$ns duplex-link-of-interfaces $n(8) $n(10) $linkBW 220ms DropTail
$ns duplex-link-of-interfaces $n(8) $n(12) $linkBW 270ms DropTail
if {$verbose} { puts -nonewline 30...; flush stdout }
$ns duplex-link-of-interfaces $n(9) $n(11) $linkBW 120ms DropTail
$ns duplex-link-of-interfaces $n(9) $n(12) $linkBW 220ms DropTail
$ns duplex-link-of-interfaces $n(13) $n(15) $linkBW 160ms DropTail
$ns duplex-link-of-interfaces $n(13) $n(16) $linkBW 40ms DropTail
$ns duplex-link-of-interfaces $n(14) $n(16) $linkBW 40ms DropTail
$ns duplex-link-of-interfaces $n(14) $n(18) $linkBW 230ms DropTail
$ns duplex-link-of-interfaces $n(15) $n(17) $linkBW 190ms DropTail
$ns duplex-link-of-interfaces $n(15) $n(19) $linkBW 190ms DropTail
$ns duplex-link-of-interfaces $n(16) $n(18) $linkBW 190ms DropTail
$ns duplex-link-of-interfaces $n(18) $n(19) $linkBW 340ms DropTail
if {$verbose} { puts -nonewline 40...; flush stdout }
$ns duplex-link-of-interfaces $n(20) $n(24) $linkBW 250ms DropTail
$ns duplex-link-of-interfaces $n(20) $n(26) $linkBW 220ms DropTail
$ns duplex-link-of-interfaces $n(20) $n(27) $linkBW 80ms DropTail
$ns duplex-link-of-interfaces $n(21) $n(24) $linkBW 220ms DropTail
$ns duplex-link-of-interfaces $n(21) $n(25) $linkBW 120ms DropTail
$ns duplex-link-of-interfaces $n(21) $n(27) $linkBW 160ms DropTail
$ns duplex-link-of-interfaces $n(22) $n(24) $linkBW 260ms DropTail
$ns duplex-link-of-interfaces $n(22) $n(27) $linkBW 180ms DropTail
$ns duplex-link-of-interfaces $n(22) $n(28) $linkBW 180ms DropTail
$ns duplex-link-of-interfaces $n(23) $n(27) $linkBW 190ms DropTail
if {$verbose} { puts -nonewline 50...; flush stdout }
$ns duplex-link-of-interfaces $n(24) $n(27) $linkBW 220ms DropTail
$ns duplex-link-of-interfaces $n(25) $n(28) $linkBW 70ms DropTail
$ns duplex-link-of-interfaces $n(26) $n(27) $linkBW 140ms DropTail
$ns duplex-link-of-interfaces $n(26) $n(28) $linkBW 160ms DropTail
$ns duplex-link-of-interfaces $n(29) $n(31) $linkBW 130ms DropTail
$ns duplex-link-of-interfaces $n(29) $n(36) $linkBW 240ms DropTail
$ns duplex-link-of-interfaces $n(30) $n(31) $linkBW 230ms 

[ns] Changing behaviour of node.

2011-01-31 Thread swat_nag


Im kind of new to ns2, i need help in changing the default working of the
node. I dont know how to apply the changes to the code.

COnsider 3 nodes: A,B and C. C is like a router. A sends packet to B through
C and B sends to A via C. In normal operation, when C gets the packets
simultaneously, it sends one by one to A and after that to B (not at a
time). But i want C to send both the packets simultaneously to A and B. Like
this in the receiver end, A will XOR the received packets with its own
packet so that it receives its required packet. B also does the same. 

Can u please tell me how to implement this?...and wat changes are to be made
and where?... 
I would really appreciate your help!
-- 
View this message in context: 
http://old.nabble.com/Changing-behaviour-of-node.-tp30800274p30800274.html
Sent from the ns-users mailing list archive at Nabble.com.



Re: [ns] umts in ns2.29

2011-01-31 Thread RamiHach


hi,
I am doing the same as you. working with UMTS on cygwin. did you find the
patch for UMTS. I want to simulate heteregenous envirment. (UMTS and WIFI
and WIMAX) to study the handover between them
waiting your reply plz


wajdouch wrote:
 
 hi,
 can you help me?
 i want to simulate umts senario with ns2.29
 il yes can you send me the patch umts and how can installed it.(site:
 where can i download it)
 i have installed ns2.29 in windows XP with cygwin
 thanks for your help
 
 

-- 
View this message in context: 
http://old.nabble.com/umts-in-ns2.29-tp26016001p30806146.html
Sent from the ns-users mailing list archive at Nabble.com.



Re: [ns] Changing behaviour of node.

2011-01-31 Thread Manoj_Kumar



swat_nag wrote:
 
 Im kind of new to ns2, i need help in changing the default working of the
 node. I dont know how to apply the changes to the code.
 
 COnsider 3 nodes: A,B and C. C is like a router. A sends packet to B
 through C and B sends to A via C. In normal operation, when C gets the
 packets simultaneously, it sends one by one to A and after that to B (not
 at a time). But i want C to send both the packets simultaneously to A and
 B. Like this in the receiver end, A will XOR the received packets with its
 own packet so that it receives its required packet. B also does the same. 
 
 Can u please tell me how to implement this?...and wat changes are to be
 made and where?... 
 I would really appreciate your help!
 
In  short, you would want to implement the concept of Network Coding?

-
---
ManojKumar.A
---
Blog: http://getch.wordpress,com
Mailing list guidelines: http://goo.gl/xC874
-- 
View this message in context: 
http://old.nabble.com/Changing-behaviour-of-node.-tp30800274p30806623.html
Sent from the ns-users mailing list archive at Nabble.com.



[ns] Adding a new command

2011-01-31 Thread isenturk

Hi,
Since there is no node-down command defined for 802_11 like the one in
802_15_4 I m trying to add one to 802_11. As you may know there is a
command  method defined like this in mac-802_11.cc

Mac802_11::command(int argc, const char*const* argv)

When I add my node_down command in that method I get a tcl error.
When I check I saw that each time when there is no such command found
command method of a more general class is called.

For instance when there is no such command in 802_11 then mac command

Mac::command(argc, argv);

is called. If not found again then

BiConnector::command(argc, argv);

command is called from mac class. I tried adding my command also in
Agent.cc and Object.cc commands but id didnt work either. I got
following tcl error.. Can you see what Im missing?


ns: _o1279 node-down11:
(_o1279 cmd line 1)
invoked from within
_o1279 cmd node-down11
invoked from within
catch $self cmd $args ret
invoked from within
if [catch $self cmd $args ret] {
set cls [$self info class]
global errorInfo
set savedInfo $errorInfo
error error when calling class $cls: $args $...
(procedure _o1279 line 2)
(SplitObject unknown line 2)
invoked from within
_o1279 node-down11






Re: [ns] Adding a new command

2011-01-31 Thread Mubashir Rehmani

Hi,

Please try to access the mac command() by writing the following commands in
your tcl script:

setMub_Mac_(0) [$node_(0) set mac_(0)]
$ns_ at 0.0 $Mub_Mac_(0) *myfunction* 1;

Define *myfunction* in the Command of Mac802_11...Once the handler is in
myfunction of Command of Mac801_11, then there you can call the function
node-down...


Hope it helps
Best Regards
Mubashir Husain Rehmani
Lip6/UPMC, Paris, France

On 31 January 2011 20:56, isent...@cs.siu.edu wrote:


 Hi,
 Since there is no node-down command defined for 802_11 like the one in
 802_15_4 I m trying to add one to 802_11. As you may know there is a
 command  method defined like this in mac-802_11.cc

 Mac802_11::command(int argc, const char*const* argv)

 When I add my node_down command in that method I get a tcl error.
 When I check I saw that each time when there is no such command found
 command method of a more general class is called.

 For instance when there is no such command in 802_11 then mac command

 Mac::command(argc, argv);

 is called. If not found again then

 BiConnector::command(argc, argv);

 command is called from mac class. I tried adding my command also in
 Agent.cc and Object.cc commands but id didnt work either. I got
 following tcl error.. Can you see what Im missing?


 ns: _o1279 node-down11:
(_o1279 cmd line 1)
invoked from within
 _o1279 cmd node-down11
invoked from within
 catch $self cmd $args ret
invoked from within
 if [catch $self cmd $args ret] {
 set cls [$self info class]
 global errorInfo
 set savedInfo $errorInfo
 error error when calling class $cls: $args $...
(procedure _o1279 line 2)
(SplitObject unknown line 2)
invoked from within
 _o1279 node-down11







-- 
Mubashir Husain Rehmani


Re: [ns] Urgent Help Needed with running AODV on NS-2.34

2011-01-31 Thread Anoop thesis

Thanks .


This tool is a good help for referece purposes.

Appreciate the help

On Fri, Jan 28, 2011 at 5:30 PM, kdcorp khalidst...@hotmail.com wrote:



 You can use this great tool TCL Script Generator to generate NS2 script
 via
 a java GUI, very useful
 http://mohittahiliani.blogspot.com/2009/10/tcl-script-generator.html click
 here


 -
 I hope this have been informative for you

 --
 View this message in context:
 http://old.nabble.com/Urgent-Help-Needed-with-running-AODV-on-NS-2.34-tp30774273p30792141.html
 Sent from the ns-users mailing list archive at Nabble.com.




Re: [ns] Packets in link's Queue

2011-01-31 Thread Teerawat@UBC

HI,

NS2 implements buffering in link, not in node. This is to model the link with 
large bandwidth-delay product. For example, consider a link with 100 Mbps link 
and 1 s propagation delay, and packets whose size is 1 Mbits. Then this link 
can stores upto 100 packets at any instance. 

Best Regards,

Teerawat Issariyakul
http://www.ns2ultimate.com/
http://www.facebook.com/pages/Teerawat-Issariyakul/358240861417
http://twitter.com/T_Bear
http://www.t-issariyakul.blogspot.com
http://www.ece.ubc.ca/~teerawat


On Jan 28, 2011, at 4:24 PM, Hosseini Nezhad wrote:

 
 Hi
 
 Suppose that, Node(A) want to send packets to Node(B) by TCP protocol.
 
 Node(A) send a packet , after deliver that ACK send 2 packets and
 after deliver those ACk send 4 packets and ... .
 
 The bandwidth =2Mbps
 Propagation delay is= 10ms
 Link's Queue length=20
 
 My Question is :
 Why some packets(almost 14 packets) go in link's queue?How I can
 describe this event?
 
 Thanks
 




Re: [ns] Urgent Help Needed with running AODV on NS-2.34

2011-01-31 Thread ankur goyal

Hi Anoop,

As you said you have already generated the traffic file and scenario file
from the internal script provided in NS-2 installation than in your tcl
script there is no use to mention the below lines, you can simply scrap
these lines from your TCL script:

# Provide initial location of mobilenodes
#$node_(0) set X_ 10.0
#$node_(0) set Y_ 15.0

$node_(0) set Z_ 0.0

#$node_(1) set X_ 20.0
#$node_(1) set Y_ 25.0
#$node_(1) set Z_ 0.0

#$node_(2) set X_ 200.0
#$node_(2) set Y_ 225.0
#$node_(2) set Z_ 0.0

# Generation of movements
#$ns at 10.0 $node_(0) setdest 10.0 5.0 3.0
#$ns at 15.0 $node_(1) setdest 45.0 14.0 5.0
#$ns at 110.0 $node_(0) setdest 48.0 5.0 5.0

# 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

Because if you see the traffic generation file and scenario file than you
will find alll these details are already present in those two file. Also
apart from this, the error

warning: Please use -channel as shown in tcl/ex/wireless-mitf.tcl

is just a warning and it wil not affect your simulation and results in any
way. Though its a good practice to use the new version of specifying the
channel in TCL file and that new method of specifying the channel is
provided in wireless-mitf.tcl a already provided TCL file with NS2
installation.

Also the tool provided in the below link is not very handy (thats what i
felt when i used it) as the tcl file generated by that tool for 50 nodes
will be a huge file and if you get any error than it will be little
complicated for you to debug it as you are new user.

Just for your understanding, refer to the 2 below link which i am providing
you. Also after some time i will provide you my simulation for AODV and DSR
for 50 nodes along with the awk script to play with the trace files. But
before that refer to the below links and try to understand their tcl files
and their scripts.

http://140.116.72.80/~smallko/ns2/adhoc_routing.htm
http://users.crhc.illinois.edu/thkim/ece439/ns2_assignment2.htm

Also remember, you might get some error while running the TCL files given in
these 2 links which if you observer closely you can rectify by urself or
else you can drop me a mail if you face any problem.



On Tue, Feb 1, 2011 at 9:36 AM, ankur goyal dream.an...@gmail.com wrote:

 Hi Anoop,

 As you said you have already generated the traffic file and scenario file
 from the internal script provided in NS-2 installation than in your tcl
 script there is no use to mention the below lines, you can simply scrap
 these lines from your TCL script:

 # Provide initial location of mobilenodes
 #$node_(0) set X_ 10.0
 #$node_(0) set Y_ 15.0

 $node_(0) set Z_ 0.0

 #$node_(1) set X_ 20.0
 #$node_(1) set Y_ 25.0
 #$node_(1) set Z_ 0.0

 #$node_(2) set X_ 200.0
 #$node_(2) set Y_ 225.0
 #$node_(2) set Z_ 0.0

 # Generation of movements
 #$ns at 10.0 $node_(0) setdest 10.0 5.0 3.0
 #$ns at 15.0 $node_(1) setdest 45.0 14.0 5.0
 #$ns at 110.0 $node_(0) setdest 48.0 5.0 5.0

 # 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

 Because if you see the traffic generation file and scenario file than you
 will find alll these details are already present in those two file. Also
 apart from this, the error

 warning: Please use -channel as shown in tcl/ex/wireless-mitf.tcl

 is just a warning and it wil not affect your simulation and results in any
 way. Though its a good practice to use the new version of specifying the
 channel in TCL file and that new method of specifying the channel is
 provided in wireless-mitf.tcl a already provided TCL file with NS2
 installation.

 Also the tool provided in the below link is not very handy (thats what i
 felt when i used it) as the tcl file generated by that tool for 50 nodes
 will be a huge file and if you get any error than it will be little
 complicated for you to debug it as you are new user.

 Just for your understanding, refer to the 2 below link which i am providing
 you. Also after some time i will provide you my simulation for AODV and DSR
 for 50 nodes along with the awk script to play with the trace files. But
 before that refer to the below links and try to understand their tcl files
 and their scripts.

 http://140.116.72.80/~smallko/ns2/adhoc_routing.htm
 http://users.crhc.illinois.edu/thkim/ece439/ns2_assignment2.htm


 Also remember, you might get some error while running the TCL files given
 in these 2 links which if you observer closely you can rectify by urself or
 else you can drop me a mail if you face any problem.


 On 

Re: [ns] Changing behaviour of node.

2011-01-31 Thread swat_nag


Yes, i want to do network coding... Can you tell me how to do it?as in
what all do i have to know to go about it?... 

Manoj_Kumar wrote:
 
 
 swat_nag wrote:
 
 Im kind of new to ns2, i need help in changing the default working of the
 node. I dont know how to apply the changes to the code.
 
 COnsider 3 nodes: A,B and C. C is like a router. A sends packet to B
 through C and B sends to A via C. In normal operation, when C gets the
 packets simultaneously, it sends one by one to A and after that to B (not
 at a time). But i want C to send both the packets simultaneously to A and
 B. Like this in the receiver end, A will XOR the received packets with
 its own packet so that it receives its required packet. B also does the
 same. 
 
 Can u please tell me how to implement this?...and wat changes are to be
 made and where?... 
 I would really appreciate your help!
 
 In  short, you would want to implement the concept of Network Coding?
 

-- 
View this message in context: 
http://old.nabble.com/Changing-behaviour-of-node.-tp30800274p30813965.html
Sent from the ns-users mailing list archive at Nabble.com.