【正文】
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。對本研究提供過幫助和做出過貢獻的個人或集體,均已在文中作了明確的說明并表示了謝意。 performance analysis 3 1 緒論 課題研究的背景 隨著信息技術的不斷發(fā)展,人們對移動通信的需求越來越強。目前對各路由協(xié)議基于 UDP 連接的仿真比較成熟,而基于 TCP連接的仿真相對較少,因此本課題的路由仿真的數(shù)據(jù)流為 tcp 流,然后根據(jù)仿真的結果分析和 比較 各 協(xié)議 在隨節(jié)點不斷增加和節(jié)點移動速度不斷增加 兩種 情況下 的性能。 ( 2) 動態(tài)拓撲:即網(wǎng)絡中的節(jié)點可以任意移動,并且可以隨時關閉電臺 。 ( 5)其他應用:可應用于緊急和突發(fā)場合,如在發(fā)生了地震、水災、火災或遭受其它災難后,固定的通信網(wǎng)絡設施無法正常工作的情況下組建無 線自組網(wǎng)。它最初的開發(fā)目的是為了研究大規(guī)模網(wǎng)絡以及當前和未來網(wǎng)絡協(xié)議的交互行為。網(wǎng)絡組件模擬網(wǎng)絡設備或節(jié)點的通信,它們通過制定模擬場景和模擬進程,交換特定的 分組來模擬真實網(wǎng)絡情況,并將執(zhí)行情況記錄到日志文件中,供用戶 分析解讀,獲取模擬結果。 由于 Linux 完全開放源代碼的特性,可根據(jù)需要任意修改源代碼。 NS2 模擬基本流程 圖 NS2 進行網(wǎng)絡模擬的基本流程 是 否 否 否 是 是 問題定義 修改源碼? 修改源碼 編寫 Tcl 腳本 執(zhí)行模擬 分析結果 結果滿意 ? 分析問題 重新編譯 NS 編譯通過 ? 調(diào)試 結束 開始 11 使用 NS2 進行網(wǎng)絡模擬的基本操作流程如圖 所示。 DSDV 以路由信息協(xié)議為基礎?;顒拥囊馑际怯袛?shù)據(jù)包從源節(jié)點發(fā)往目的節(jié)點,如果鏈路上不再有數(shù)據(jù)包傳遞,一段時間之后,鏈路就會過期,最終路由信息將會從中間節(jié)點的路由表中刪除 [7]。該統(tǒng)計量反應了網(wǎng)絡的擁塞狀況,計算公式見式( )。 ( 1)移動范圍: set topo [new Topography] 創(chuàng)建拓撲對象,在節(jié)點設置時使用它來進行 配 置 $topo load_flatgrid 1000 1000 設定一個 1000x1000 的屏幕 ( 2)創(chuàng)建 God 對象, God( General operations director) 對象是一個存儲關于環(huán)境、網(wǎng)絡或者節(jié)點狀態(tài)等全局信息的對象: set god_ [create – god $val(nn)] $val(nn)仿真節(jié)點號 TCP 代理的創(chuàng)建和設置 ( 1) TCP 代理創(chuàng)建步驟: 步驟一:創(chuàng)建一個 Agent/TCP 對象,作為分組的發(fā)送器; 步驟二:設置 Agent/TCP 對象的部分 內(nèi)部變量; 步驟三:創(chuàng)建一個 Agent/TCPSink 對象,作為分組的接收器; 步驟四:在發(fā)送和接收代理之間創(chuàng)建 connect 連接。 ( 9)分組大小,單位為字節(jié)。 如果程序很短,則程序代碼可以直接寫在命令行上,如下: $gawk ? program‘ inputfile1 inutfile2…… 其中, program 包括一些 pattern 和 action。 ② “ 移動速度不斷增加 ” 情況下 各路由協(xié)議的仿真性能如圖 所示,仿真結果如表 所示。 27 參考文獻 [1]鄭少仁,王海濤,趙志峰等 .Ad Hoc 網(wǎng)絡技術 [M].北京:人民郵電出版社, 20xx: 10156. [2]陳晉倫 , 周正 .Ad Hoc 網(wǎng)絡技術及研究現(xiàn)狀 [J].信息技術與標準化, 20xx,( 6): 1014. [3]祖國建 .自組網(wǎng)體系結構研究 [J].現(xiàn)代電子技術, 20xx, 6( 21): 1725. [4]于斌,孫斌,溫暖等 . NS2 與網(wǎng)絡模擬 [M]. 北京:人民郵電出版社, 20xx: 13. [5]向明尚,陳素麗,劉延軍等 .NS2 網(wǎng)絡仿真平臺的探討與實現(xiàn) [J].大慶石油學院學報, 20xx,( 2): 8793. [6]方路平,劉世華,陳盼等 .NS2 網(wǎng)絡模擬基礎與應用 [M].北京:國防工業(yè)出版社, 20xx:8998. [7]洪錫軍,車克南,張激 . 無線自組網(wǎng)路由協(xié)議研究 [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)絡中的路由算法 [J].軍事通信技術, 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]趙建立, 宋雨 . 移動 Ad Hoc 網(wǎng)絡路由技術綜合分析 [J].河北師范大學學報, 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) .淺議移動 Ad hoc 網(wǎng)絡路由協(xié)議中的安全性問題 [J].計算機工程與應用,20xx, (22): 2833. [16]劉昌鑫 , 彭嵩松 , 吳蘭英 .基于 NS2 網(wǎng)絡仿真的實現(xiàn) [J].井岡山學院報, 20xx,( 2):1421. [17]王金龍,王呈貴,吳啟暉等 .Ad Hoc 移動無線網(wǎng)絡 [M].北京:國防工業(yè)出版社, 20xx:4045. 28 [18]陳稼嬰,楊震. Ad hoc 網(wǎng)絡中基于節(jié)能的 AODV 路由算法改進 [J].南京郵電學院學報,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 的移動自組網(wǎng)路由協(xié)議的仿真與實現(xiàn)評論推薦 [J]. 計算機工程與應用, 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)絡及其研究難點 .電信科學, 20xx, 6: 1115. [26] 單思宇 .無線自組網(wǎng)中的路由協(xié)議 .電腦知識與技術, 20xx, 5( 22): 122123. 29 致謝 首先我要感謝父母,正是他們在我 求學生涯中給予我最大的關心、理解、支持和鼓勵,并且始終竭盡全力地給予我最好的學 習和生活條件,使我能夠克服前進道路上的困難。 NS2 仿真環(huán)境為:虛擬機 +Redhat。 ① “ 節(jié)點不斷增加 ” 情況下各路由協(xié)議的仿真性能如圖 所示。awk 最初在 1977 年完成。 ( 2)事件產(chǎn)生的時間,單位為秒。 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 移動結點基本配置 參數(shù) 如下: $ns nodeconfig –adhocRouting 配置 adhoc 網(wǎng)絡的路由類型 llType 數(shù)據(jù)鏈路層類型 macType MAC 層類型 ifqType 隊列類型 ifqLen 隊列長度 antType 天線類型 propType 無線信號傳輸模型 phyType 物理層類型 channelType 信道類型 topoInstance 拓撲對象 agentTrace 是否打開應用層 Trace routerTrace 是否打開路由的 Trace macTrace 是否打開應 MAC 層的 Trace movementTrace 是 否打開節(jié)點位置和移動信息的 Trace ( 2)移動節(jié)點的創(chuàng)建:調(diào)用模擬器對象 ns 的內(nèi)部過程 node{}創(chuàng)建移動節(jié)點: for {set i 0} {$i $opt(nn)} {incr i} { set node($i) [$ns node] } 移動節(jié)點的運動 在實際的無線自組網(wǎng)絡中,站點的位置可能是不確定的,也就是說站點是 移動的,所以 NS2 中的移動節(jié)點也應該具有移動性。在路由的建立和路由維護過程中,節(jié)點應用“高度” Metric 來建立一個以目的節(jié)點為根的有向非循環(huán)圖。此過程中,會建立一個從源節(jié)點到目的節(jié)點的反 向路由,也就是從目的節(jié)點到源節(jié)點的路由。 一類是基