Dear All I am trying to make a simulation with satellite+wired+wireless nodes in the scenario using hierarchical addresses. I have downloaded and modified the example given below: when i run the example without hierarchical addresses it runs fine but when i use hierarchical addresses it gives me following error: ****************************************************************************************************************************************** ERROR: [...@localhost NS2]$ ns aawal.tcl num_nodes is set 6 Stub No. 1 size of istr[i] is > unsigned long Error!! str2addr:Address 1784827763 outside range of address field length 2048
****************************************************************************************************************************************** ************************************************** Source code Example Starts here *************************************************** ### This simulation is an example of combination of wired, wireless ### and geo-satellite topologies. set ns [new Simulator] $ns node-config -addressType hierarchical AddrParams set domain_num_ 2 ;# domain number AddrParams set cluster_num_ {5 5} ;# cluster number for each domain lappend tmp 5 lappend tmp 5 lappend tmp 5 lappend tmp 5 lappend tmp 5 lappend tmp 5 lappend tmp 5 lappend tmp 5 lappend tmp 5 lappend tmp 5 lappend tmp 5 lappend tmp 5 AddrParams set nodes_num_ $tmp global opt_sat set opt_sat(chan) Channel/Sat set opt_sat(bw_up) 0.5Mb set opt_sat(bw_down) 0.5Mb set opt_sat(phy) Phy/Sat set opt_sat(mac) Mac/Sat set opt_sat(ifq) Queue/DropTail set opt_sat(qlim) 50 set opt_sat(ll) LL/Sat global opt_mobile set opt_mobile(chan) Channel/WirelessChannel set opt_mobile(prop) Propagation/TwoRayGround set opt_mobile(netif) Phy/WirelessPhy set opt_mobile(mac) Mac/802_11 set opt_mobile(ifq) Queue/DropTail/PriQueue set opt_mobile(ll) LL set opt_mobile(ant) Antenna/OmniAntenna set opt_mobile(ifqlen) 50 set opt_mobile(tr) test-mobile-satellite.tr set opt_mobile(namtr) test-mobile-satellite.nam set opt_mobile(nn) 5 set opt_mobile(adhocRouting) NOAH set opt_mobile(stop) 50 set num_wired_nodes 2 set num_bs_nodes 1 set net_distance 10000.0 set opt_mobile(x) [expr $opt_mobile(nn) * 100.0 * 2 + 100.0 + $net_distance] set opt_mobile(y) 1000 # set up for hierarchical routing # $ns node-config -addressType hierarchical # AddrParams set domain_num_ 4 # lappend cluster_num 1 1 1 1 # AddrParams set cluster_num_ $cluster_num # lappend eilastlevel 20 20 20 20 # AddrParams set nodes_num_ $eilastlevel # create topology of the wireless nodes to keep connectivity info set topo [new Topography] $topo load_flatgrid $opt_mobile(x) $opt_mobile(y) # god needs to know the number of all wireless interfaces create-god [expr $opt_mobile(nn) + $num_bs_nodes] # setup the trace file set tracefd [open $opt_mobile(tr) w] $ns trace-all $tracefd $ns trace-all-satlinks $tracefd set namtracefd [open $opt_mobile(namtr) w] $ns namtrace-all $namtracefd # Set up satellite and terrestrial nodes # Configure the node generator for bent-pipe satellite # geo-repeater uses type Phy/Repeater $ns node-config -satNodeType geo-repeater \ -phyType Phy/Repeater \ -channelType $opt_sat(chan) \ -downlinkBW $opt_sat(bw_down) \ -wiredRouting ON # GEO satellite at 95 degrees longitude West puts "Stub No. 1" set geo [$ns node 0.2.0] puts "Stub No. 2" $geo set-position 13#-95 $geo color red $geo shape box # Configure the node generator for satellite terminals $ns node-config -satNodeType terminal \ -llType $opt_sat(ll) \ -ifqType $opt_sat(ifq) \ -ifqLen $opt_sat(qlim) \ -macType $opt_sat(mac) \ -phyType $opt_sat(phy) \ -channelType $opt_sat(chan) \ -downlinkBW $opt_sat(bw_down) \ -wiredRouting ON # Two terminals: one in NY and one in SF set vsat1 [$ns node 0.3.0] $vsat1 set-position 43.71 10.38; # NY set vsat2 [$ns node 0.1.0] $vsat2 set-position 43.71 10.38; # SF #new-terminal 43.71 10.38 #new-terminal 43.71 10.38 $vsat1 color blue $vsat1 shape hexagone $vsat2 color green $vsat2 shape hexagone # Add GSLs to geo satellites $vsat1 add-gsl geo $opt_sat(ll) $opt_sat(ifq) $opt_sat(qlim) $opt_sat(mac) $opt_sat(bw_up) \ $opt_sat(phy) [$geo set downlink_] [$geo set uplink_] $vsat2 add-gsl geo $opt_sat(ll) $opt_sat(ifq) $opt_sat(qlim) $opt_sat(mac) $opt_sat(bw_up) \ $opt_sat(phy) [$geo set downlink_] [$geo set uplink_] # unset the satellite node type, to create other nodes. $ns unset satNodeType_ $ns unset channelType_ $ns node-config -reset # create some desktop pc to transfer data from olsr to satellite set w1 [$ns node 0.4.0] $w1 color blue $ns at 0.0 "$w1 add-mark w1 blue" set w2 [$ns node 0.0.0] $w2 color green $ns at 0.0 "$w2 add-mark w2 green" # create links from desktop to vsat $ns duplex-link $w1 $vsat1 100Mb 0.01ms DropTail $ns duplex-link $w2 $vsat2 100Mb 0.01ms DropTail $ns node-config -adhocRouting $opt_mobile(adhocRouting) \ -llType $opt_mobile(ll) \ -macType $opt_mobile(mac) \ -ifqType $opt_mobile(ifq) \ -ifqLen $opt_mobile(ifqlen) \ -antType $opt_mobile(ant) \ -propInstance [new $opt_mobile(prop)] \ -phyType $opt_mobile(netif) \ -channel [new $opt_mobile(chan)] \ -topoInstance $topo \ -wiredRouting ON \ -agentTrace ON \ -routerTrace ON \ -macTrace ON # create base station 1 set BS1 [$ns node 1.0.0] $BS1 random-motion 0 $BS1 color yellow $BS1 shape box $BS1 set X_ [expr $opt_mobile(nn) * 100.0] $BS1 set Y_ [expr 500.0 + ((($opt_mobile(nn) * 93) % 21) - 10 ) * 10.0] $BS1 set Z_ 0.0 #--------------------------------------------------------------------------- # Create mobile nodes #--------------------------------------------------------------------------- for {set i 0} {$i < $opt_mobile(nn)} {incr i} { set node1($i) [$ns node 1.0.[expr $i+1]] $node1($i) color green $node1($i) random-motion 1 $node1($i) set X_ [expr $i * 100.0 + $net_distance] $node1($i) set Y_ [expr 500.0 + ((($i * 93) % 21) - 10 ) * 10.0] $node1($i) set Z_ 0.0 $ns initial_node_pos $node1($i) 20 $node1($i) base-station [AddrParams addr2id [$BS1 node-addr]] } # create links between wired and BS nodes $ns duplex-link $w1 $BS1 100Mb 1ms DropTail # setup TCP connections set tcp1 [new Agent/TCP] $ns attach-agent $node1(0) $tcp1 set sink1 [new Agent/TCPSink] $ns attach-agent $w2 $sink1 set ftp1 [new Application/FTP] $ftp1 attach-agent $tcp1 $ns connect $tcp1 $sink1 $ns at 2 "$cbr start" $ns at 25 "$cbr stop" $ns at 3 "$ftp1 start" $ns at 45 "$ftp1 stop" for {set i 1} {$i < $opt_mobile(stop)} {} { $ns at $i "puts $i\n" set i [expr $i * 1.2] } #for {set i } {$i < $opt_mobile(nn) } {incr i} { # $ns at $opt_mobile(stop).0000010 "$node1($i) reset"; #} #$ns at $opt_mobile(stop).0000010 "$BS1 reset"; $ns at $opt_mobile(stop).1 "puts \"NS EXITING...\" ; $ns halt" puts "Starting Simulation..." $ns run ************************************************** Source code Example Ends here *************************************************** Can anyone please help me in sorting this problem. Best Regards Sahib -- View this message in context: http://old.nabble.com/problem-in-Wireless%2Bwired%2Bsatellite-using-hierarchical-addresses-tp28245490p28245490.html Sent from the ns-users mailing list archive at Nabble.com.