陳愛霞 杜友?!£愔信e
摘要:基于NS2的Ad hoc網絡路由協議的仿真和改進文獻很多,但少有給出仿真實現的具體過程,讓一些入門階段的研究人員知其然而不知其如何然。該文以Ad hoc 網絡典型路由協議AODV為例,介紹了AODV協議的基本原理,利用 NS2平臺對其仿真,并對產生的跟蹤文件進行性能分析,編寫腳本批處理分析文件生成結果數據,用gunplot對數據繪圖直觀展現。結果說明AODV路由協議對不同傳輸機制的數據流的支持差異是很明顯的,CBR流比TCP流的傳輸效率更高、網絡開銷更少。完整的OTcl場景腳本和參數設計給入門級網絡協議研究者提供了很好的參考。
關鍵詞:Ad Hoc網絡; NS2;AODV;仿真;性能分析
中圖分類號:TP393 文獻標識碼:A 文章編號:1009-3044(2014)30-7021-04
NS2 Simulates Typical Routing Protocol of Ad Hoc Network and Analyze its Performance
CHEN Ai-xia, DU You-fu, CHEN Zhong-ju
(Computer Science College, Yangtze University, Jingzhou 434023, China)
Abstract: Though there were lots of papers referring to simulation and improving routing protocols for Ad hoc network based on NS2, few of them introduced the specific procedure of simulation. So it is difficult for researchers at the introductory level to know well. Here sets a case study of AODV, a typical protocol of Ad Hoc network. Firstly, brief the principles of ADOV protocol. Secondly, present its concrete simulation on NS2, analyze the result trace file, write a script to batch process analysis files for data.at last, and show plot data directly using gunplot. Results indicate that the difference is very obvious while AODV Routing Protocol supporting for data stream of different transport mechanisms. CBR stream transmission is more efficient than that of TCP and less network overhead. A set of OTcl scene scripts with parameters designed offers good references to elementary learner.
Key words: Ad Hoc network; NS2; AODV; Simulation; performance analysis
Ad hoc網絡是無線通信網絡的一種,但有別于傳統的無線網絡,不需要依賴有線網絡作為基礎設施的基站或熱點,并且無線節點之間可以自由的通信[1]。Ad hoc網絡的顯著特點就是無中心、自組織、支持動態的網絡拓撲結構、移動終端的可攜便捷性、支持多跳路由等,它的出現真正實現任何環境任何時間的自由通信,并且為軍事領域、救災環境提供有效的解決方案,成為當今無線網絡研究的主流[2]。路由協議作為移動自組網的核心技術之一,具有很高的研究價值。
NS2是面向對象、離散事件驅動的一款開源的協議仿真軟件。NS2 使用兩種語言,C++和OTcl,底層具體協議模擬,高效處理字節、報頭等信息用C++編寫,NS2編譯執行[3],網絡組件和環境的具體參數設置,及整個模擬場景過程由OTcl腳本編寫,NS2解釋器解釋執行?!?br>