NS-3 簡介

NS-3 簡介
全稱爲 Network Simulator 3
官網: http://www.nsnam.org/
ns-2 的官網: http://isi.edu/nsnam/ns/

目前,比較流行的版本有NS-2,以及NS-3。
NS-2採用C++和OTcl代碼編寫,在學習過程中需要學習新的OTcl語言。NS-3全部採用C++語言編寫,並且還可以用Python語言編寫代碼。
相對來說,NS-2的資料比較多。因爲NS-2流行好幾年了,流行的協議,畢業論文的相關代碼,都比較多。
但是,如果您是初學,個人建議你還是學習NS-3.因爲NS-3全部採用C++編寫,一般來說大家都會C++,上手容易。而且,在編程方面,NS-3更加靈活。

ns-3目前的最新版本號是ns-3.12(2011年10月23日)
ns-3.10以前的版本是集成化設計。
ns-3-dev, ns-3.12,ns-3.11,ns-3.10, 都採用模塊化設計,比如,你想調用core模塊, #include "ns3/core-module.h" 就行了。
程序的設計,越來越複雜,在具體設計程序中,不同用戶用的模塊都不一樣。因此,模塊化設計更加方便、靈活。
用戶還可以自己設計模塊,然後添加到ns-3中。見例: http://blog.csdn.net/barcodegun/article/details/6898193

用戶可以根據自己的要求,安裝相關版本,我安裝的是 ns-3-dev版本。

本文主要介紹ns-3.

NS-3方面的資料:
官網:     http://www.nsnam.org/
Wiki:   http://www.nsnam.org/wiki/index.php/Main_Page

資料下載: http://www.nsnam.org/ns-3-dev/documentation/
在上面網站中,主要有以下主要資料:
Tutorial:  初步介紹NS-3的相關知識,以及下載及安裝,簡單使用。
Manual:    更深一步講解NS-3的相關知識。
Model Library: 主要介紹NS-3的相關模塊。用戶可以選擇自己實際需要的模塊學習,不需要全部看。
API Documentation: 在線幫助手冊。   http://www.nsnam.org/docs/doxygen/index.html

在編程中,最常用的就是 http://www.nsnam.org/docs/doxygen/index.html   查詢類的成員函數,類的屬性等。
此在線文檔用doxygen程序生成,   http://www.doxygen.org/index.html
原理是在編寫ns-3代碼時,用doxygen規定的註釋。
比如:
/**
  * \param firstParam a short description of the purpose of this parameter
  * \returns a short description of what is returned from this function.
  *
  * A detailed description of the purpose of the method.
  */
 int DoSomething (int firstParam);
將在幫助文檔中生成:
A detailed description of the purpose of the method.
Parameters:
firstParam   a short description of the purpose of this parameter
Returns:
a short description of what is returned from this function.
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章