Questions tagged [otcl]

11 questions
1
vote
1 answer

How to change the delay of a link in NS2 simulation?

I need to run a NS2 simulation that the delay of a link will change during the runtime, and I use following procedure in tcl script: $ns delay $node3 $node4 $delay_time to change the delay in a link between $node3 and $node4. But it only works…
YeJiabin
  • 1,038
  • 1
  • 9
  • 17
1
vote
3 answers

Unable to change the value of the variable

I'm using a discrete event simulator called ns-2 that was built using Tcl and C++. I was trying to write some code in TCL: set ns [new Simulator] set state 0 $ns at 0.0 "puts \"At 0.0 value of state is: $state\"" $ns at 1.0 "changeVal" $ns at 2.0…
Legend
  • 113,822
  • 119
  • 272
  • 400
1
vote
0 answers

How to get the (Link-layer) Source Node of a packet at runtime in NS2?

I'm using NS 2.35 to study the performance of layer-2 switches in networks. There are 2 questions (shown below that bothered me for a long time): I'd like to know how to get the (Link-layer) Source Node of a packet at runtime in NS2? I want to…
cgArsenal
  • 11
  • 2
1
vote
2 answers

Failed to install Otcl-1.14 for NS-2

I'm trying to install NS-2 on Mac OS X 10.9.x Mavericks with ns-allinone Everytime I run the install script, it fails in a step installing Otcl with the errors: rm -f libotcl otcl.o so_locations gcc -c -g -O2 -DNDEBUG -DUSE_SHM -DHAVE_UNISTD_H=1…
user2211319
1
vote
0 answers

How to implement application layer behaviour in ns-2 using Tcl

Clumsy title, apologies. I'm quite new to ns-2, well by that I mean I can create simulations fine as long as I don't need to do anything outside of the core functionality. I want to make a very simple SNMP model (as there is no SNMP model that I can…
0
votes
1 answer

Installing ns-allinone-2.29.3 on Ubuntu 11.10

I am trying to install Network Simulator allinone package (ns-allinone-2.29) on Ubuntu 11.10. I am actually interested in simulating bluetooth using the UCBT extension meant for ns. http://www.cs.uc.edu/~cdmc/ucbt/ states Plese install…
van_d39
  • 725
  • 2
  • 14
  • 28
0
votes
1 answer

ns2 global variable

I have created variable using loop like that: for {set i 0} {$i<5} {incr i} { set n($i) [$ns node] } How to call n($i) variable by some procedure? I call it as global n(0) n(1) n(2) n(3) n(4) But I got the error : ns: record: bad…
Ali Ismayilov
  • 1,707
  • 3
  • 22
  • 37
0
votes
1 answer

Count packets actively in Ns2

I have to count packets for each incoming flow actively in RED Queue in Ns2. I have to integrate it in the queue algorithm itself so that changes (in variables of active queues) occur when the packet in queued. For simple codes it's like: for each…
instame
  • 23
  • 2
0
votes
2 answers

NS2, Otcl: using a variable of an owned instance within a class

I'm using NS2 to create some new classes in C++ and then link them to otcl. The linkage and everything works, but when I try to use the otcl variables in an object, I'm having a trouble. For example, suppose I have a class "Node" with the variable…
Hussain
  • 11
  • 2
0
votes
1 answer

Path Tcl and Bash

i have a problem with path in a tcl file; I tried to use source " /tmp/mob.tcl " and this path in bash file : /opt/ns-allinone-2.35/ns-2.35/indep-utils/cmu-scen-gen/setdest/setdest -v 1 -n $n -p 10 -M 64 -t 100 -x 250 -y 250 >> /tmp/mob.tcl …
Amiga 500
  • 19
  • 1
  • 9
0
votes
1 answer

Passing the repeatTime from ns2 to .cc file

I am writing code for a simple simulation. We have 10 nodes and one sink node. I want to run the simulation for 5 times. The only thing I know so far is that I need to write set val(repeatTimes) 5, but I don't know how to use it in the simulation.…
Amir
  • 10,600
  • 9
  • 48
  • 75