【正文】
ity, Yiyang, Hunan, 413000, China) Abstract: Ad Hoc is a multihop, temporary, free mobile work with no doesn‘t need existed infrastructure to support and it is constructed rapidly at anytime and particularity of Ad Hoc determines the specificity and importance of Routing Protocol. So we should design professional routing protocols and algorithms for Ad Hoc. This article researches the architecture and stratification of Ad Hoc , and then analyzes the routing protocol. By parison, select the monly used tabledriven routing protocol DSDV and ondemand driven routing protocol AODV and DSR for the study, use the work simulator NS2 to simulate. The delay, loss rate and throughput are selected as parameters to analyze the routing protocols and we evaluate their performance. The results show that when nodes and data trafiics are not large, the overall performance of DSR is the best。對(duì)本研究提供過幫助和做出過貢獻(xiàn)的個(gè)人或集體,均已在文中作了明確的說明并表示了謝意。 performance analysis 3 1 緒論 課題研究的背景 隨著信息技術(shù)的不斷發(fā)展,人們對(duì)移動(dòng)通信的需求越來越強(qiáng)。目前對(duì)各路由協(xié)議基于 UDP 連接的仿真比較成熟,而基于 TCP連接的仿真相對(duì)較少,因此本課題的路由仿真的數(shù)據(jù)流為 tcp 流,然后根據(jù)仿真的結(jié)果分析和 比較 各 協(xié)議 在隨節(jié)點(diǎn)不斷增加和節(jié)點(diǎn)移動(dòng)速度不斷增加 兩種 情況下 的性能。 ( 2) 動(dòng)態(tài)拓?fù)洌杭淳W(wǎng)絡(luò)中的節(jié)點(diǎn)可以任意移動(dòng),并且可以隨時(shí)關(guān)閉電臺(tái) 。 ( 5)其他應(yīng)用:可應(yīng)用于緊急和突發(fā)場(chǎng)合,如在發(fā)生了地震、水災(zāi)、火災(zāi)或遭受其它災(zāi)難后,固定的通信網(wǎng)絡(luò)設(shè)施無法正常工作的情況下組建無 線自組網(wǎng)。它最初的開發(fā)目的是為了研究大規(guī)模網(wǎng)絡(luò)以及當(dāng)前和未來網(wǎng)絡(luò)協(xié)議的交互行為。網(wǎng)絡(luò)組件模擬網(wǎng)絡(luò)設(shè)備或節(jié)點(diǎn)的通信,它們通過制定模擬場(chǎng)景和模擬進(jìn)程,交換特定的 分組來模擬真實(shí)網(wǎng)絡(luò)情況,并將執(zhí)行情況記錄到日志文件中,供用戶 分析解讀,獲取模擬結(jié)果。 由于 Linux 完全開放源代碼的特性,可根據(jù)需要任意修改源代碼。 NS2 模擬基本流程 圖 NS2 進(jìn)行網(wǎng)絡(luò)模擬的基本流程 是 否 否 否 是 是 問題定義 修改源碼? 修改源碼 編寫 Tcl 腳本 執(zhí)行模擬 分析結(jié)果 結(jié)果滿意 ? 分析問題 重新編譯 NS 編譯通過 ? 調(diào)試 結(jié)束 開始 11 使用 NS2 進(jìn)行網(wǎng)絡(luò)模擬的基本操作流程如圖 所示。 DSDV 以路由信息協(xié)議為基礎(chǔ)。活動(dòng)的意思是有數(shù)據(jù)包從源節(jié)點(diǎn)發(fā)往目的節(jié)點(diǎn),如果鏈路上不再有數(shù)據(jù)包傳遞,一段時(shí)間之后,鏈路就會(huì)過期,最終路由信息將會(huì)從中間節(jié)點(diǎn)的路由表中刪除 [7]。該統(tǒng)計(jì)量反應(yīng)了網(wǎng)絡(luò)的擁塞狀況,計(jì)算公式見式( )。 ( 1)移動(dòng)范圍: set topo [new Topography] 創(chuàng)建拓?fù)鋵?duì)象,在節(jié)點(diǎn)設(shè)置時(shí)使用它來進(jìn)行 配 置 $topo load_flatgrid 1000 1000 設(shè)定一個(gè) 1000x1000 的屏幕 ( 2)創(chuàng)建 God 對(duì)象, God( General operations director) 對(duì)象是一個(gè)存儲(chǔ)關(guān)于環(huán)境、網(wǎng)絡(luò)或者節(jié)點(diǎn)狀態(tài)等全局信息的對(duì)象: set god_ [create – god $val(nn)] $val(nn)仿真節(jié)點(diǎn)號(hào) TCP 代理的創(chuàng)建和設(shè)置 ( 1) TCP 代理創(chuàng)建步驟: 步驟一:創(chuàng)建一個(gè) Agent/TCP 對(duì)象,作為分組的發(fā)送器; 步驟二:設(shè)置 Agent/TCP 對(duì)象的部分 內(nèi)部變量; 步驟三:創(chuàng)建一個(gè) Agent/TCPSink 對(duì)象,作為分組的接收器; 步驟四:在發(fā)送和接收代理之間創(chuàng)建 connect 連接。 ( 9)分組大小,單位為字節(jié)。 如果程序很短,則程序代碼可以直接寫在命令行上,如下: $gawk ? program‘ inputfile1 inutfile2…… 其中, program 包括一些 pattern 和 action。 ② “ 移動(dòng)速度不斷增加 ” 情況下 各路由協(xié)議的仿真性能如圖 所示,仿真結(jié)果如表 所示。 27 參考文獻(xiàn) [1]鄭少仁,王海濤,趙志峰等 .Ad Hoc 網(wǎng)絡(luò)技術(shù) [M].北京:人民郵電出版社, 20xx: 10156. [2]陳晉倫 , 周正 .Ad Hoc 網(wǎng)絡(luò)技術(shù)及研究現(xiàn)狀 [J].信息技術(shù)與標(biāo)準(zhǔn)化, 20xx,( 6): 1014. [3]祖國(guó)建 .自組網(wǎng)體系結(jié)構(gòu)研究 [J].現(xiàn)代電子技術(shù), 20xx, 6( 21): 1725. [4]于斌,孫斌,溫暖等 . NS2 與網(wǎng)絡(luò)模擬 [M]. 北京:人民郵電出版社, 20xx: 13. [5]向明尚,陳素麗,劉延軍等 .NS2 網(wǎng)絡(luò)仿真平臺(tái)的探討與實(shí)現(xiàn) [J].大慶石油學(xué)院學(xué)報(bào), 20xx,( 2): 8793. [6]方路平,劉世華,陳盼等 .NS2 網(wǎng)絡(luò)模擬基礎(chǔ)與應(yīng)用 [M].北京:國(guó)防工業(yè)出版社, 20xx:8998. [7]洪錫軍,車克南,張激 . 無線自組網(wǎng)路由協(xié)議研究 [J]. 計(jì)算機(jī)工程, 20xx,( 8): 1028. [8]段云飛,周麗瓊,楊磊 .幾種典型的 Ad Hoc 路由協(xié)議仿真分析 [J].電力系統(tǒng)通信, 20xx,( 6): 617. [9] Performance Evaluation of Routing Protocols for Mobile AdHoc and Networks,1998: 152161. [10]Perkins CE,Bhagwat dynamic destinationsequenced distancevector routing(DSDV)for mobile Press,1994: 234244. [11]楊盤隆,鄭少仁 .Ad hoc 網(wǎng)絡(luò)中的路由算法 [J].軍事通信技術(shù), 20xx, 22(4): 4953. [12],implementation and testing of routing protocols for mobile adhoc works[M].University of Illinois at Urban aChampaign, 20xx: 2335. [13]趙建立, 宋雨 . 移動(dòng) Ad Hoc 網(wǎng)絡(luò)路由技術(shù)綜合分析 [J].河北師范大學(xué)學(xué)報(bào), 20xx,( 2):0207. [14], , ondemand minimum energy routing protocol for a wireless ad hoc work[J].Mobile Computing and Communications Review,20xx, (35):5360. [15]李承,汪為農(nóng) .淺議移動(dòng) Ad hoc 網(wǎng)絡(luò)路由協(xié)議中的安全性問題 [J].計(jì)算機(jī)工程與應(yīng)用,20xx, (22): 2833. [16]劉昌鑫 , 彭嵩松 , 吳蘭英 .基于 NS2 網(wǎng)絡(luò)仿真的實(shí)現(xiàn) [J].井岡山學(xué)院報(bào), 20xx,( 2):1421. [17]王金龍,王呈貴,吳啟暉等 .Ad Hoc 移動(dòng)無線網(wǎng)絡(luò) [M].北京:國(guó)防工業(yè)出版社, 20xx:4045. 28 [18]陳稼嬰,楊震. Ad hoc 網(wǎng)絡(luò)中基于節(jié)能的 AODV 路由算法改進(jìn) [J].南京郵電學(xué)院學(xué)報(bào),20xx, 24(3): 1822. [19], source routing in ad hoc wireless works[M]. Mobile Computing, 20xx: 263270. [20]SIVAKUMAR coreextraction distributed Ad hoc routing algorithm [J].IEEE J on Selected Areas in Comm, 1999, (8):13801394. [21]劉勃蘭,宋玲 . 基于 NS2 的移動(dòng)自組網(wǎng)路由協(xié)議的仿真與實(shí)現(xiàn)評(píng)論推薦 [J]. 計(jì)算機(jī)工程與應(yīng)用, 20xx, (6):162164. [22]Liang Route Maintenance in of Computer Science,Carleton University,20xx: 1523. [23]C Perkins,E Royer,S hoc OnDemand Distance Vector(AODV) Routing[J].IEEE Personal Communication,1997,(17): 3645. [24]V Park,S Routing Algorithm(TORA)[J].IETF MANET Working Group,1999,(33): 3241. [25] 肖永康,山秀明,任勇 .無線 Ad hoc 網(wǎng)絡(luò)及其研究難點(diǎn) .電信科學(xué), 20xx, 6: 1115. [26] 單思宇 .無線自組網(wǎng)中的路由協(xié)議 .電腦知識(shí)與技術(shù), 20xx, 5( 22): 122123. 29 致謝 首先我要感謝父母,正是他們?cè)谖?求學(xué)生涯中給予我最大的關(guān)心、理解、支持和鼓勵(lì),并且始終竭盡全力地給予我最好的學(xué) 習(xí)和生活條件,使我能夠克服前進(jìn)道路上的困難。 NS2 仿真環(huán)境為:虛擬機(jī) +Redhat。 ① “ 節(jié)點(diǎn)不斷增加 ” 情況下各路由協(xié)議的仿真性能如圖 所示。awk 最初在 1977 年完成。 ( 2)事件產(chǎn)生的時(shí)間,單位為秒。 channel Down target Up target Up target Up target mac Down target Down target Arp table target Addr demux entry Default target IP address Port demux Src/Sink Rtagent LL IFq ARP MAC NetIF Channel Radio Propagation Model Up target 16 移動(dòng)結(jié)點(diǎn)基本配置 參數(shù) 如下: $ns nodeconfig –adhocRouting 配置 adhoc 網(wǎng)絡(luò)的路由類型 llType 數(shù)據(jù)鏈路層類型 macType MAC 層類型 ifqType 隊(duì)列類型 ifqLen 隊(duì)列長(zhǎng)度 antType 天線類型 propType 無線信號(hào)傳輸模型 phyType 物理層類型 channelType 信道類型 topoInstance 拓?fù)鋵?duì)象 agentTrace 是否打開應(yīng)用層 Trace routerTrace 是否打開路由的 Trace macTrace 是否打開應(yīng) MAC 層的 Trace movementTrace 是 否打開節(jié)點(diǎn)位置和移動(dòng)信息的 Trace ( 2)移動(dòng)節(jié)點(diǎn)的創(chuàng)建:調(diào)用模擬器對(duì)象 ns 的內(nèi)部過程 node{}創(chuàng)建移動(dòng)節(jié)點(diǎn): for {set i 0} {$i $opt(nn)} {incr i} { set node($i) [$ns node] } 移動(dòng)節(jié)點(diǎn)的運(yùn)動(dòng) 在實(shí)際的無線自組網(wǎng)絡(luò)中,站點(diǎn)的位置可能是不確定的,也就是說站點(diǎn)是 移動(dòng)的,所以 NS2 中的移動(dòng)節(jié)點(diǎn)也應(yīng)該具有移動(dòng)性。在路由的建立和路由維護(hù)過程中,節(jié)點(diǎn)應(yīng)用“高度” Metric 來建立一個(gè)以目的節(jié)點(diǎn)為根的有向非循環(huán)圖。此過程中,會(huì)建立一個(gè)從源節(jié)點(diǎn)到目的節(jié)點(diǎn)的反 向路由,也就是從目的節(jié)點(diǎn)到源節(jié)點(diǎn)的路由。 一類是基