LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking > Linux - Wireless Networking
User Name
Password
Linux - Wireless Networking This forum is for the discussion of wireless networking in Linux.

Notices


Reply
  Search this Thread
Old 11-04-2013, 02:32 AM   #1
buptmuye
LQ Newbie
 
Registered: Apr 2013
Location: China
Posts: 18

Rep: Reputation: Disabled
segment fault of ns2-crcn when running .tcl


Hello everyone.
Thanks for knudfl's help,I finally install ns-allinone-2.31 with crcn.zip
flukily.
However,when I run some test cases,segment fault appears.I tried GDB,but still don't understand the mechanism or reason of ns2.
The segment fault seems like memory leaks finally causes downtime.
Here is one test case:
Code:
  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(ant)       Antenna/OmniAntenna       ; #Antenna model
  set val(rp)        AOMDV     ;#Routing Protocol
  set val(ifq)       Queue/DropTail/PriQueue                  ;# interface queue type
  set val(ifqlen)    50      ;# max packet in ifq
  set val(mac)       Mac/802_11      ;# MAC type
  set val(ll)        LL                         ;# link layer type
  set val(nn)        50               ;# number of mobilenodes
  set val(ni)        3               ;# number of interfaces
  set val(channum)     2     ;# number of channels per radio
  set val(cp)        ./random50100.tcl     ;      # topology traffic file 
  set val(stop)      100                ;# simulation time
  # ==================================================================
  # Main Program
  # ======================================================================
      
      
  # Initialize Global Variables
  set ns_        [new Simulator]
  set tracefd     [open ./50100.tr w]
  $ns_ trace-all $tracefd
      
  # set up topography object
  set topo       [new Topography]
  $topo load_flatgrid 1000 1000
      
  #create nam
  set namtrace [open ./50100.nam w]
  $ns_ namtrace-all-wireless $namtrace 1000 1000
      
  # Create God
  set god_ [create-god $val(nn)]
  # configure node
  $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 ON
      
      
   for {set i 0} {$i < [expr $val(ni) * $val(channum)]} {incr i} {
                set chan_($i) [new $val(chan)]
    }
      
      
  #configure for interface and channel
  $ns_ node-config -ifNum $val(ni) -channel $chan_(0)
  $ns_ node-config -ChannelNum $val(channum)
      
  for {set i 0} {$i < [expr $val(ni) * $val(channum)]} {incr i} {
             $ns_ add-channel $i $chan_($i)
  }
      
  for {set i 0} {$i < $val(nn) } {incr i} {
         set node_($i) [$ns_ node]
           $node_($i) set recordIfall 1
         $node_($i) random-motion 0      ;# disable random motion
  $god_ new_node $node_($i)
  }
      
      
  source $val(cp)      ;    #source topology and traffic file generated by others
      
  # Tell nodes when the simulation ends
  for {set i 0} {$i < $val(nn) } {incr i} {
        $ns_ at $val(stop).0 "$node_($i) reset"; 
  }
  $ns_ at  $val(stop).0002 "puts \"NS EXITING...\" ; $ns_ halt "
  proc stop {} {
      global ns_ tracefd
      $ns_ flush-trace
      close $tracefd
      exec nam ./test.nam &
      exit 0
  }
  puts "Starting Simulation..." 
  $ns_ run
 
  


Reply

Tags
aomdv, crcn, ns2



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
ns2.31 and CRCN patch buptmuye Linux - Wireless Networking 27 01-06-2016 06:27 PM
[SOLVED] The problem of running the tcl script file in the NS2.31+crcn environment syxcod Linux - Software 16 11-24-2015 04:12 PM
how to solve crcn problem in ns2? lavendar89 Linux - Software 1 09-25-2013 04:57 PM
HELP ME: Error while running tcl scrip for ZRP in NS2.33 ubuntu 10.04 vuichoigiaitri Ubuntu 1 12-02-2012 10:11 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking > Linux - Wireless Networking

All times are GMT -5. The time now is 04:15 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration