毕业论文有关车联网中的协议比较分析
ns2吧
全部回复
仅看楼主
level 8
saber🍁 楼主
各位大神吧友,我这边要进行协议比较分析,目前只运行了一个简单的simulator,能够进行运行和画图,但是到了车联网的实际协议,比如aodv.dsr.dsdv,有关理论分析的比较多,实际实验操作的就很少。最近好不容易找到了aodv的tcl,但却运行不了,应该缺文件,有没有人帮我指导指导,关键就是tcl脚本和awk脚本,底层的不用管。
2017年03月13日 00点03分 1
level 8
saber🍁 楼主
希望有人吧
2017年03月13日 00点03分 2
level 8
saber🍁 楼主
大家有兴趣可以看看,这是可以运行的aodv.tcl
2017年03月15日 05点03分 4
level 8
saber🍁 楼主
# A 100-node example for ad-hoc simulation with AODV
# Define options
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) 12 ;# number of mobilenodes
set val(rp) AODV ;# routing protocol
set val(x) 500 ;# X dimension of topography
set val(y) 400 ;# Y dimension of topography
set val(stop) 150 ;# time of simulation end
set ns [new Simulator]
set tracefd [open testAODV.tr w]
set windowVsTime2 [open win.tr w]
set namtrace [open testAODV.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 $val(nn)
#
# Create nn mobilenodes [$val(nn)] and attach them to the channel.
#
# configure the nodes
$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) \
-channelType $val(chan) \
-topoInstance $topo \
-agentTrace ON \
-routerTrace ON \
-macTrace OFF \
-movementTrace ON
for {
set i 0
} {
$i < $val(nn)
} {
incr i
} {
set node_($i) [$ns node]
$node_($i) set X_ [ expr 10+round(rand()*480) ]
$node_($i) set Y_ [ expr 10+round(rand()*380) ]
$node_($i) set Z_ 0.0
}
for {
set i 0
} {
$i < $val(nn)
} {
incr i
} {
$ns at [ expr 15+round(rand()*60) ] "$node_($i) setdest [ expr 10+round(rand()*480) ] [ expr 10+round(rand()*380) ] [ expr 2+round(rand()*15) ]"
}
#Giving color and label to nodes
$node_(8) color "orange"
$ns at 0.0 "$node_(8) color orange"
$ns at 0.1 "$node_(8) label sink2"
$node_(2) color "red"
$ns at 0.0 "$node_(2) color red"
$ns at 0.1 "$node_(2) label source2"
$node_(0) color "green"
$ns at 0.0 "$node_(0) color green"
$ns at 0.1 "$node_(0) label sink1"
$node_(5) color "magenta"
$ns at 0.0 "$node_(5) color magenta"
$ns at 0.1 "$node_(5) label source1"
#Generation of movements
#$ns at 10.0 "$node_(0) setdest 250.0 250.0 3.0"
#$ns at 15.0 "$node_(1) setdest 45.0 285.0 5.0"
#$ns at 70.0 "$node_(5+2) setdest 480.0 300.0 5.0"
#$ns at 20.0 "$node_(3) setdest 200.0 200.0 5.0"
#$ns at 25.0 "$node_(4) setdest 50.0 50.0 10.0"
#$ns at 60.0 "$node_(5) setdest 150.0 70.0 2.0"
#$ns at 90.0 "$node_(6) setdest 380.0 150.0 8.0"
#$ns at 42.0 "$node_(7) setdest 200.0 100.0 15.0"
#$ns at 55.0 "$node_(8) setdest 50.0 275.0 5.0"
#$ns at 19.0 "$node_(9) setdest 250.0 250.0 7.0"
#$ns at 90.0 "$node_(10) setdest 150.0 150.0 20.0"
# Set a TCP connection between node_(2) and node_(8)
set tcp [new Agent/TCP/Newreno]
$tcp set class_ 2
set sink [new Agent/TCPSink]
$ns attach-agent $node_(2) $tcp
$ns attach-agent $node_(8) $sink
$ns connect $tcp $sink
set ftp [new Application/FTP]
$ftp attach-agent $tcp
$ns at 10.0 "$ftp start"
set tcp [new Agent/TCP/Newreno]
$tcp set class_ 2
set sink [new Agent/TCPSink]
$ns attach-agent $node_(5) $tcp
$ns attach-agent $node_(0) $sink
$ns connect $tcp $sink
set ftp [new Application/FTP]
$ftp attach-agent $tcp
$ns at 10.0 "$ftp start"
# Printing the window size
proc plotWindow {
tcpSource file
} {
global ns
set time 0.01
set now [$ns now]
set cwnd [$tcpSource set cwnd_]
puts $file "$now $cwnd"
$ns at [expr $now+$time] "plotWindow $tcpSource $file"
}
$ns at 10.1 "plotWindow $tcp $windowVsTime2"
# Define node initial position in nam
for {
set i 0
} {
$i < $val(nn)
} {
incr i
} {
# 30 defines the node size for nam
$ns initial_node_pos $node_($i) 30
}
# Telling nodes when the simulation ends
for {
set i 0
} {
$i < $val(nn)
} {
incr i
} {
$ns at $val(stop) "$node_($i) reset";
}
# ending nam and the simulation
$ns at $val(stop) "$ns nam-end-wireless $val(stop)"
$ns at $val(stop) "stop"
$ns at 150.00 "puts \"end simulation\" ; $ns halt"
proc stop {
} {
global ns tracefd namtrace
$ns flush-trace
close $tracefd
close $namtrace
}
$ns run
2017年03月15日 05点03分 5
level 8
saber🍁 楼主
大家首先要有aodv的C++底层,然后创建场景文件
步骤一:在终端~/ns-allinone-2.35/ns-2.35/indep-utils/cmu-scen-gen/路径下输入命令:
ns cbrgen.tcl -type cbr -nn 50 -seed 1 -mc 10 -rate 2.0 > cbr-50n-10c-2p
步骤二:在终端~/ns-allinone-2.35/ ns-2.35/indep-utils/cmu-scen-gen/setdest/路径下输入命令:
setdest -n 50 -p 0 -M 20 -t 300 -x 1000 -y 300 > scene-50n-0p-20M-300t-1000-300
2017年03月15日 05点03分 6
level 8
saber🍁 楼主
然后就是把那个aodv.tcl添加进去,在路径下ns aodv.tcl就行了
2017年03月15日 06点03分 7
level 1
楼主你好,我是大四的要做车联网这方面的毕业设计,有些问题想向您请教可以吗?
2017年05月20日 02点05分 8
可以请问一下,你是做车联网具体什么方面的吗[疑问]
2019年03月06日 10点03分
@金衣服 同学我帮你做一套,选题参考一些师兄师姐的题目,最好能看一篇论文例子导师最多管管题目,格式正常用心写基本可以过的,没那么多硬核要求。
2019年03月07日 16点03分
@贴吧用户_71C8DRN 我是硕士研究生,论文抓得比较严哦[泪]
2019年03月10日 05点03分
我的毕设也是关于车联网的,请问有懂信道接入协议的吗
2021年04月22日 14点04分
level 2
你好,请问你在做车载网仿真时使用的mac层协议是什么,可否求一份[email protected]
2017年12月09日 19点12分 11
1