資源描述:
《實驗4--無線個域網(wǎng)仿真(二)-ZBR協(xié)議.doc》由會員上傳分享,免費在線閱讀,更多相關內(nèi)容在工程資料-天天文庫。
1、西安郵電大學(計算機學院)課內(nèi)實豔報告實驗名稱:無線個域網(wǎng)仿真(二)-ZBR協(xié)議專業(yè):網(wǎng)絡工程班纏姓名學號:指導教日期理解IEEE802.15.4協(xié)議的工作機制。%1.實驗環(huán)境VirtualBox+Ubuntu+NS2%1.實驗內(nèi)容1.ZBR協(xié)議ZBR為無線ZigBee網(wǎng)絡的網(wǎng)絡層協(xié)議,實現(xiàn)了低成本、低功耗、可靠性高等設計目標。2.仿真拓撲實驗網(wǎng)絡拓撲結構含21個節(jié)點,節(jié)點編號從0到20連續(xù)編碼。?????CD?⑤??€9?③%1.實驗過程及分析1.閱讀并解釋仿真代碼(WPANZigbee.tel),描述仿
2、真設置;Mac/802_15_4wpanCmdverboseonMac/802_15_4wpanNamnamStatusonPhy/Wi.relessPhysetCSTh「esh_1.33527e-06Phy/WirelessPhysetRXThresh^1.33527e-66模塊參數(shù)設置為802.15.4,使用802.15.4協(xié)議setappTtmel10insecondssetappTtme271tnsecondssetappTtme372insecondssetappTime473insecondss
3、etappTtme574tnsecondssetappTime675insecondssetstopTimeieeinseconds設置一個時間點,進行協(xié)調(diào)器與協(xié)調(diào)節(jié)點通信進行控制。#InitializeGlobalVariablessetns[newSimulator]settracefd[openWPAN_Ztgbee.trw]$nstrace-all$tracefdif{$val(nam)"=="WPANZigbee.nan"}{setnamtrace[open?/$val(nam)w]$nsnamt
4、race-all-wireless$namtrace$val(x)$val(y)}$nsputs?nam?t「aceall{#nam4wpan#}settopo[newTopography]$topoload__flatgrtd$val(x)$val(y)setgod_[create-god$val(nn)]setchan_l_[new$val(chan)]初始化數(shù)據(jù)^TrafficDeftnttton"Mac/802_15_4wpanNamPlaybackRate4ms$nsat$appTtnelMac/
5、802_15_4wpanNamPlaybackRate1.0msH$nsat[expr$appTtmel+0.5]Mac/802_15_4wpanNamPlaybackRate2.0ms"$nsat$appTtmel"putsMTransmttttngdata..-MMproccbrtrafftc{srcdstintervalstartttme}{globalnsnode_setudp_($s「c)[newAgent/UDP]eval$nsattach-agent$node_($src)$u
6、dp_($src)setnull_($dst)[newAgent/Null]eval$nsattach-agent$node_($dst)$null_($dst)setcbr_($src)[newAppltcatton/Traffic/CBR]eval$cbr_($src)setpacketStze_80eval$cbr_($src)setinterval^$tntervaleval$cbr.($src)setrandom^0eval$cbr_($src)attach-agent$udp_($
7、s「c)eval$nsconnect$udp_($s「c)$null_($dst)$nsat$startttme$cbr_($src)start11流量肚義設置速率procftptraffic{srcdststarttime}{globalnsnode_settcp($src)[newAgent/TCP]eval$tcp($src)setpacketStze_60setstnk($dst)[newAgent/TCPStnk]eval$nsattach-agent$node_($src)$tcp($
8、src)eval$nsattach-agent$node_($dst)$stnk($dst)eval$nsconnect$tcp($src)$stnk($dst)setftp($src)[newApplication/FTP]eval$ftp($src)attach-agent$tcp($src)$nsat$startttne$ftp($src)start"}控制ftp包if{"$val(trafft