[ns] How to get pointer MyMac from tcl?
I need to create the direct communication beetwen MyAgent and MyMac. I use TclObject::lookup(argv[2]) in command of myAgent to access at pointer of Mac. But $opt(MyMac) from Tcl is รจ string and not a pointer. How to get pointer create in TclClass from Tcl Script? Thank Giuseppe -- View this message in context: http://www.nabble.com/How-to-get-pointer-MyMac-from-tcl--tf4119057.html#a11714387 Sent from the ns-users mailing list archive at Nabble.com.
Re: [ns] how to get node id in classifier
It is a normal node, not mobile node. i know classifier is one part of node. but classifier can't get the node id. if i include node.h, it will show some error. I think classifier is one part of node, so can't include it. but how know, the processing classifier is in which node? this is my problem. Mohammed wrote: I understand from your query that you want to know the current execution mobile node , is it that write? From the error message you get, means net_id variable not found(not declare) so may be the data structure (procedure) you deal with node identification does not handle , so I advice you to read the structure more times, may the point will be clear. Mohammed AbuHajar rubenjy [EMAIL PROTECTED] wrote: thanks for your replay it also show 'net_id' undeclared (first function) error: (Each undeclared identifier is reported only once for each function it appears in. ) 2007/7/19, Mohammed Abu Hajar : Try this: printf(net_id = %d,net_id.getNSAddr_t()); Mohammed AbuHajar rubenjy wrote: when i use the code in classifier.cc printf(net_id = %s,net_id.dump()); it show net_id undeclared. Mohammed wrote: through net_id.dump() in other words use: printf(net_id = %s,net_id.dump()); rubenjy wrote: hello, i want to get node id in classifier.cc i don't know how to get node id. so i include node.h and write code (follow) Node* tempnode; int ttmp; if (tempnode){ ttmp=tempnode-address(); ttmp=tempnode-nodeid(); } but it had segmentation fault(core dumped). i used gdb to trace it. gdb show program received signal SIGILL, Illegal instruction somebody can tell me how to get node id ? -- View this message in context: http://www.nabble.com/how-to-get-node-id-in-classifier-tf4103981.html#a11671028 Sent from the ns-users mailing list archive at Nabble.com. -- View this message in context: http://www.nabble.com/how-to-get-node-id-in-classifier-tf4103981.html#a11674298 Sent from the ns-users mailing list archive at Nabble.com. -- View this message in context: http://www.nabble.com/how-to-get-node-id-in-classifier-tf4103981.html#a11722607 Sent from the ns-users mailing list archive at Nabble.com.
[ns] Source Specific Multicast problem
I used the SSM extension model http://eden.dei.uc.pt/~tandre/ssm_extension/index.htm I found this have one problem. the receiver received multicast data, but the data willn't in agent's recv function (like LossMonitor::recv(...)) but it also have not any error. is somebody knew, where is the problem. -- View this message in context: http://www.nabble.com/Source-Specific-Multicast-problem-tf4121956.html#a11722633 Sent from the ns-users mailing list archive at Nabble.com.
[ns] Why NAM doesn't dispaly the packet dropped because of collision?
Hi all, I've been doing wireless simulations these days. I want to show NAM to my colleagues to help them to better know about how RTS/CTS reduce the chance of collisions. But I found NAM doesn't display the packet dropped because of collisions. Why? Here is a line of the trace file and the NAM trace file for a packet dropped because of collision: Trace File Info: d -t 2.267517062 -Hs 2 -Hd -2 -Ni 2 -Nx 700.00 -Ny 200.00 -Nz 0.00 -Ne -1.00 -Nl MAC -Nw COL -Ma 5fe -Md 2 -Ms 0 -Mt 0 NAM Trace File Info: d -t 2.267517062 -s 2 -d -1 -p RTS -e 44 -c 2 -a 0 -i 0 -k MAC Why doesn't NAM display this dropping action? And to be specific, following is my TCL scripts. set opt(RTS) 1 set opt(Time) 20 # == # Default Script valions # == 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(rp)DSR ;# routing protocol set val(x) 1000 set val(y) 500 set val(stoptime) $opt(Time) # == # Initialize Global Variables set ns_ [new Simulator] $ns_ use-newtrace if {!$opt(RTS)} { #set RTSThreshold_ to 3000(Larger than any packet size of up level), so RTS wolud never be sent. Mac/802_11 set RTSThreshold_ 3000 ;# bytes puts Mac/802_11 RTSThreshold_: [Mac/802_11 set RTSThreshold_], RTS/CTS is turned off set tracefd [open col-hidden.tr w] set namtrace [open col-hidden.nam w] } else { set tracefd [open rts-hidden.tr w] set namtrace [open rts-hidden.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 create-god $val(nn) # New API to config node: # 1. Create channel (or multiple-channels); # 2. Specify channel in node-config (instead of channelType); # 3. Create nodes for simulations. # Create channel #1 and #2 set chan_1_ [new $val(chan)] set chan_2_ [new $val(chan)] $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) \ -topoInstance $topo \ -agentTrace ON \ -routerTrace ON \ -macTrace ON \ -movementTrace OFF \ -channel $chan_1_ set node_(0) [$ns_ node] set node_(1) [$ns_ node] set node_(2) [$ns_ node] $node_(0) random-motion 0 $node_(1) random-motion 0 $node_(2) random-motion 0 # # Provide initial (X,Y, for now Z=0) co-ordinates for mobilenodes # $node_(0) set X_ 500.0 $node_(0) set Y_ 200.0 $node_(0) set Z_ 0.0 $node_(1) set X_ 300.0 $node_(1) set Y_ 200.0 $node_(1) set Z_ 0.0 $node_(1) label hidden_to_node2 $node_(2) set X_ 700.0 $node_(2) set Y_ 200.0 $node_(2) set Z_ 0.0 $node_(2) label hidden_to_node1 for {set i 0} {$i $val(nn)} {incr i} { $ns_ initial_node_pos $node_($i) 30 } # Setup traffic flow between nodes 0 and 1 # TCP connections between node_(0) and node_(1) set tcp1 [new Agent/TCP] $tcp1 set class_ 2 set sink1 [new Agent/TCPSink] $ns_ attach-agent $node_(1) $tcp1 $ns_ attach-agent $node_(0) $sink1 $ns_ connect $tcp1 $sink1 set ftp1 [new Application/FTP] $ftp1 attach-agent $tcp1 $ns_ at 0.1 $ftp1 start # Setup traffic flow between nodes 0 and 2 # udp connections between node_(0) and node_(2) #set udp [new Agent/UDP] #set null [new Agent/Null] #$ns_ attach-agent $node_(2) $udp #$ns_ attach-agent $node_(0) $null #$ns_ connect $udp $null #set cbr [new Application/Traffic/CBR] #$cbr attach-agent $udp #$ns_ at 0.1 $cbr start set tcp2 [new Agent/TCP] $tcp2 set class_ 2 set sink2 [new Agent/TCPSink] $ns_ attach-agent $node_(2) $tcp2 $ns_ attach-agent $node_(0) $sink2 $ns_ connect $tcp2 $sink2 set ftp2
[ns] ns 2.2x installing problem
Hello everyone I installed ns 2.31 without any problem on centos5. but now I have a problem on installing ns allinone 2.28. At first i received this error: *checking system version (for dynamic loading)... ./configure: line 7624: syntax error near unexpected token ')' ./configure: line 7624: ' OSF*)' tcl8.3.2 configuration failed! Exiting ... Tcl is not part of the ns project. Please see www.Scriptics.com to see if they have a fix for your problem. and I found a solution in Internet: The problem lies in how bash 3.1.x and 4.x.x parse the configure file. This will simply pass through bash 3.0.x and lower versions. So in order to make things work changed the following lines tcl: file tcl8.x.x/unix/tcl.m4. tk: file tk8.x.x/unix/tcl.m4. otcl: file otcl-1.x/configure.in. to: system=MP-RAS-`awk ' { print $3 } '/etc/.relid` Now after changing the configuration files you will have to delete older configure file and any cache if it exists in the respective folders. After that do not forget to run autoconf from command line in the respective folders to generate a fresh configure file. i change the three above files then i run autoconf (without deleting any configuration file!) [EMAIL PROTECTED] unix]# autoconf and i saw this error: configure.in:199: error: do not use LIBOBJS directly, use AC_LIBOBJ (see section `AC_LIBOBJ vs LIBOBJS' If this token and others are legitimate, please use m4_pattern_allow. See the Autoconf documentation. and now i don't now how to solve this. can anybody help me? regards, [EMAIL PROTECTED] - Boardwalk for $500? In 2007? Ha! Play Monopoly Here and Now (it's updated for today's economy) at Yahoo! Games.
[ns] How to Install FHCF on NS-2
Hi ns-users, Finally, I managed to resolve the problems with the installation of the fhcf scheme.. If anyone has a problem installing it, i will be more than happy to help :-) Anyways, i will post the right steps for the installation as soon as i have some free time... Best regards, Ashraf Bourawy.