error-handling - 单独网络的LTE网络在ns2中出现错误

标签 error-handling ns2 lte

我按站模拟adhoc网络,我的代码和错误如下

Mac/802_11Ext set CWMin_            15
Mac/802_11Ext set CWMax_            1023
Mac/802_11Ext set SlotTime_         0.000009
Mac/802_11Ext set SIFS_             0.000016
Mac/802_11Ext set ShortRetryLimit_  7
Mac/802_11Ext set LongRetryLimit_   4
Mac/802_11Ext set HeaderDuration_   0.000020 
Mac/802_11Ext set SymbolDuration_   0.000004
Mac/802_11Ext set BasicModulationScheme_ 0
Mac/802_11Ext set use_802_11a_flag_ true
Mac/802_11Ext set RTSThreshold_     2000
Mac/802_11Ext set MAC_DBG           0
#=====================================================================
 Phy/WirelessPhyExt set CSThresh_           6.30957e-12
Phy/WirelessPhyExt set Pt_                 0.001
Phy/WirelessPhyExt set freq_               5.18e9
Phy/WirelessPhyExt set noise_floor_        2.51189e-13
Phy/WirelessPhyExt set L_                  1.0
Phy/WirelessPhyExt set PowerMonitorThresh_ 2.10319e-12
Phy/WirelessPhyExt set HeaderDuration_     0.000020
Phy/WirelessPhyExt set BasicModulationScheme_ 0
Phy/WirelessPhyExt set PreambleCaptureSwitch_ 1
Phy/WirelessPhyExt set DataCaptureSwitch_  0
Phy/WirelessPhyExt set SINR_PreambleCapture_ 2.5118
Phy/WirelessPhyExt set SINR_DataCapture_   100.0
Phy/WirelessPhyExt set trace_dist_         1e6
Phy/WirelessPhyExt set PHY_DBG_            0
Phy/WirelessPhyExt set CPThresh_           0 ;# not used at the moment
Phy/WirelessPhyExt set RXThresh_           0 ;# not used at the moment
#=====================================================================
#configure RF model parameters
Antenna/OmniAntenna set Gt_ 1.0
Antenna/OmniAntenna set Gr_ 1.0
Propagation/Nakagami set use_nakagami_dist_ false
Propagation/Nakagami set gamma0_ 2.0
Propagation/Nakagami set gamma1_ 2.0
Propagation/Nakagami set gamma2_ 2.0
Propagation/Nakagami set d0_gamma_ 200
Propagation/Nakagami set d1_gamma_ 500
Propagation/Nakagami set m0_  1.0
Propagation/Nakagami set m1_  1.0
Propagation/Nakagami set m2_  1.0
Propagation/Nakagami set d0_m_ 80
Propagation/Nakagami set d1_m_ 200
set opt(namfile)         out.nam
set opt(tracefile)       out.tr
set val(chan)    Channel/WirelessChannel;    #channel type
set val(prop)    Propagation/Nakagami;  #radio-propagation model
set val(netif)   Phy/WirelessPhyExt;            #network interface type
set val(mac)     Mac/802_11Ext;                 #MAC type
set val(ifq)     Queue/LTEQueue/ULAirQueue;    #interface queue type
set val(ifqlen)  100;                         #max nbr of packets in ifq
set val(ll)      LL;                         #link layer type
set val(ant)     Antenna/OmniAntenna;        #antenna type
set val(adhocRP) AODV;                       #routing protocol
set val(x)       1903;                        #x dimension of the topography
set val(y)       882;                        #y dimension of the topography
set val(stop)    3607.0;                      #simulation time
set val(mobility) "mobility.tcl"
set val(start)     1
set val(stop)     3607.0
set val(nn)            38
set val(eNB)          1
#set val(gw_discovery) reactive;                #gateway discovery method
#---------------------------
#Initialize Global Variables
#---------------------------
#create a simulator object
set ns_ [new Simulator]
$ns_ color 0 Brown
#----------------------------------------
#Define The Hierachial Topology Structure
#----------------------------------------
$ns_ node-config -addressType hierarchical
 AddrParams set domain_num_ 2
lappend clusterNbr 2 2
AddrParams set cluster_num_ $clusterNbr
lappend eilastlevel 2 2 [expr $val(nn)/2+1] [expr $val(nn)/2-5]
AddrParams set nodes_num_ $eilastlevel
#create trace objects for ns and nam
$ns_ use-newtrace
set nstrace [open $opt(tracefile) w]
$ns_ trace-all $nstrace
set namtrace [open $opt(namfile) w]
 $ns_ namtrace-all-wireless $namtrace $val(x) $val(y)
#--------------------------------------------------------
 #create a topology object and define topology
 #--------------------------------------------------------
 set topo [new Topography]
 $topo load_flatgrid $val(x) $val(y)
 #--------------------------------------------------------
 # Create GOD
   #--------------------------------------------------------
  set god [create-god [expr $val(nn)+$val(eNB)]]
 set aGW [$ns_ node 0.0.0]
  set server [$ns_ node 0.0.1]
  #Use hierarchical addresses for GWs and MNs
   set chan1 [new $val(chan)]
    #configure for gateway
  $ns_ node-config -adhocRouting $val(adhocRP) \
  -llType $val(ll)            \
  -macType $val(mac)          \
  -ifqType $val(ifq)          \
  -ifqLen $val(ifqlen)        \
  -antType $val(ant)          \
  -propType $val(prop)        \
  -phyType $val(netif)        \
  -topoInstance $topo         \
  -channel $chan1             \
   -agentTrace ON              \
   -routerTrace ON             \
   -macTrace ON                \
    -movementTrace ON
    $ns_ node-config -wiredRouting ON
     set eNB(0) [$ns_ node 2.0.0]
    $eNB(0) random-motion 0
    $eNB(0) set X_ 500.0
    $eNB(0) set Y_ 100.0
    $eNB(0) set Z_ 0.0
     $ns_ at 0.00 "$eNB(0) setdest 500 100 0"
    $ns_ node-config -wiredRouting OFF
     for {set i 0} {$i < $val(nn)} {incr i} {
     set node_($i) [$ns_ node 2.0.[expr $i + 1]]
     $node_($i) base-station [AddrParams addr2id [ $server node-addr]]
    $node_($i) random-motion 0
 }
 #20 defines the node size in nam, must adjust it according to your  scenario
#The function must be called after mobility model is defined
for {set i 0} {$i < $val(nn)} {incr i} {        
$ns_ initial_node_pos $node_($i) 20     
} 
$ns_ simplex-link $eNB(0) $aGW 1000Mb 2ms LTEQueue/ULS1Queue 
$ns_ simplex-link $aGW $eNB(0) 1000Mb 2ms LTEQueue/DLS1Queue 
#The bandwidth between aGW and server is not the bottleneck.
$ns_ simplex-link $aGW $server 5000Mb 2ms DropTail
$ns_ simplex-link $server $aGW 5000Mb 2ms LTEQueue/DLQueue
$ns_ duplex-link-op $server $aGW orient down
$ns_ duplex-link-op $aGW $eNB(0) orient left-down   
#---------------------
#Source Mobility Pattern
#---------------------
source $val(mobility)
#----------------
#Labels & Color
#----------------
$server color blue
$aGW color green
$eNB(0) color red
$ns_ at 0.0 "$server label \"SERVER\""
$ns_ at 0.0 "$aGW label \"GTW\""
$ns_ at 0.0 "$eNB(0) label eNB_0"
for {set i 0} {$i < $val(nn)} {incr i} {
$ns_ at 0.0 "$node_($i) label \"vehicle [expr $i]\""
  }
   #-----------------------------------
  #Define Node Initial Position In Nam
  #-----------------------------------
  #--------------------- #Setup Traffic 
  for {set i 0} {$i < $val(nn)} {incr i} {
 set udp($i) [new Agent/UDP]
 set null($i) [new Agent/Null]
  $ns_ attach-agent $node_($i) $udp($i)
  $ns_ attach-agent $server $null($i)
  $udp($i) set fid_ 0
    $ns_ connect $udp($i) $null($i)
   set cbr($i) [new Application/Traffic/CBR]
    $cbr($i) attach-agent $udp($i)
      $cbr($i) set packetSize_ 512
    $cbr($i) set interval_ 0.2
  $ns_ at $val(start) "$cbr($i) start"
   $ns_ at $val(stop) "$cbr($i) stop"
        }
         #-----------------------------------
        #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).0 "expr $server reset";
     #$ns_ at $val(stop).0 "expr $server reset";
    $ns_ at $val(stop).0001 "stop"
    $ns_ at $val(stop).0002 "puts \"NS EXITING...\" ; $ns_ halt"
     proc stop {} {
    global ns_ nstrace namtrace
     $ns_ flush-trace
     close $nstrace
        close $namtrace
        exec nam out.nam &
            exit 0
           }
        puts "Starting simulation..."
        $ns_ run

及其错误:

madani @ ubuntu:〜/cluster $ ns map.tcl
设置了num_nodes 39
初始化列表xListHead
开始模拟...
分段故障(核心已转储)

最佳答案

在仿真中可以将Queue/LTEQueue/DLAirQueue与{Propagation/NakagamiPhy/WirelessPhyExtMac/802_11Ext +建议的“802.11p设置”}一起使用。 LTE文件示例:bicfixdownlink.tcl https://drive.google.com/file/d/0B7S255p3kFXNSmd4Q3h3dXp1QWc/view?usp=sharing

source 802.11p-file

set opt(chan)           Channel/WirelessChannel     ;# channel type
set opt(prop)           Propagation/Nakagami        ;# radio-propagation model
set opt(netif)          Phy/WirelessPhyExt           ;# network interface type
set opt(mac)            Mac/802_11Ext                ;# MAC type
set opt(ifq)            Queue/LTEQueue/DLAirQueue    ;# interface queue type

... 802.11p-file是您的问题代码。

编辑后的“bicfixdownlink.tcl”使用LTE修补的ns可以正常运行。 “nam”动画很好。 xgraph输出是可以接受的:
xgraph down0 down1 down2 down3 down4 &
编辑:其他示例,L-guindy-teatinos40A.tcl + flowmod-teatinos-M40.tcl + mobmod-teatinos-M40A.tcl,其中L-guindy- *使用mobmod-teatinos-M40A.tcl的802.11p设置https://drive.google.com/file/d/0B7S255p3kFXNRkVKVFBuNnFLcG8/view?usp=sharing

Teatinos SUMO文件来自http://neo.lcc.uma.es/staff/jamal/vanet/?q=node/11

关于error-handling - 单独网络的LTE网络在ns2中出现错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44811835/

相关文章:

linux - make 命令在 NS 2.35 中不起作用

java - (CellIdentityLte) - 我该如何使用它?

vbscript - VB脚本集语句

tcl - 错误 "Floating point exception (core dumped)"是什么原因

python - 如何从python中的system()命令捕获异常

c++ - 为什么我们使用 "const char* const* argv"而不是 "char *"?

at-command - 如何使用从 SIM 卡检索到的信息配置调制解调器模块

javascript - 在 JavaScript 中扩展 Error 的好方法是什么?

c++ - 如何将有关最顶层调用/上下文的信息添加到异常