資源描述:
《實(shí)驗(yàn)4--無(wú)線(xiàn)個(gè)域網(wǎng)仿真(二)-ZBR協(xié)議.doc》由會(huì)員上傳分享,免費(fèi)在線(xiàn)閱讀,更多相關(guān)內(nèi)容在工程資料-天天文庫(kù)。
1、西安郵電大學(xué)(計(jì)算機(jī)學(xué)院)課內(nèi)實(shí)豔報(bào)告實(shí)驗(yàn)名稱(chēng):無(wú)線(xiàn)個(gè)域網(wǎng)仿真(二)-ZBR協(xié)議專(zhuān)業(yè):網(wǎng)絡(luò)工程班纏姓名學(xué)號(hào):指導(dǎo)教日期理解IEEE802.15.4協(xié)議的工作機(jī)制。%1.實(shí)驗(yàn)環(huán)境VirtualBox+Ubuntu+NS2%1.實(shí)驗(yàn)內(nèi)容1.ZBR協(xié)議ZBR為無(wú)線(xiàn)ZigBee網(wǎng)絡(luò)的網(wǎng)絡(luò)層協(xié)議,實(shí)現(xiàn)了低成本、低功耗、可靠性高等設(shè)計(jì)目標(biāo)。2.仿真拓?fù)鋵?shí)驗(yàn)網(wǎng)絡(luò)拓?fù)浣Y(jié)構(gòu)含21個(gè)節(jié)點(diǎn),節(jié)點(diǎn)編號(hào)從0到20連續(xù)編碼。?????CD?⑤??€9?③%1.實(shí)驗(yàn)過(guò)程及分析1.閱讀并解釋仿真代碼(WPANZigbee.tel),描述仿
2、真設(shè)置;Mac/802_15_4wpanCmdverboseonMac/802_15_4wpanNamnamStatusonPhy/Wi.relessPhysetCSTh「esh_1.33527e-06Phy/WirelessPhysetRXThresh^1.33527e-66模塊參數(shù)設(shè)置為802.15.4,使用802.15.4協(xié)議setappTtmel10insecondssetappTtme271tnsecondssetappTtme372insecondssetappTime473insecondss
3、etappTtme574tnsecondssetappTime675insecondssetstopTimeieeinseconds設(shè)置一個(gè)時(shí)間點(diǎn),進(jìn)行協(xié)調(diào)器與協(xié)調(diào)節(jié)點(diǎn)通信進(jìn)行控制。#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流量肚義設(shè)置速率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