[NS與網絡模擬簡介]

作者徐雷鳴 龐博 趙耀

http://www.ptpress.com.cn/books/Book_Information.asp?BID=11867

 

標準書號

ISBN 7-115-11867

頁   數

195  

開   本

16開

版   次

1版第1次

初版時間

2003年11月

本印次時間

2003年11月

責任編輯

徐享華

定   價

27元 (民眾幣)

    張

13  

    數

307  千字

    數

4500  

庫   存

有 書

 

目錄

1章  認識NS                                                                                          1

1.1           NS與通信網路類比                                                                   1

1.1.1        什麼是類比                                                                                 1

1.1.2      通信網路類比概述                                                                     1

1.1.3      網路類比的需求和NS的設計目標                                          2

1.2         NS原理概述                                                                               3

1.3         使用NS進行網路類比的方法和一般過程                              5

1.4         NS的歷史與版本                                                                       6

1.5         NS手冊                                                                                       7

1.6         相關的工具和資源                                                                     8

1.7         NS方法學                                                                                   9

2章  NS快速上手                                                                               10

2.1         NS的下載與安裝                                                                       10

2.1.1      在Linux下使用allinone模式安裝NS                                      10

2.1.2      在Windows下安裝NS                                                               12

2.2         NS的目錄架構                                                                           17

2.3         營運NS和nam                                                                           17

2.4         第1個Tcl腳本                                                                          18

2.5         營運無線類比                                                                             20

3章  Tcl和Otcl                                                                                    26

3.1         可擴展的命令語言Tcl                                                               26

3.1.1      基本命令格式                                                                             26

3.1.2      變量                                                                                             26

3.1.3      組合(grouping)和替代(substitution)                                 27

3.1.4      數學運算                                                                                     29

3.1.5      流程控制                                                                                     30

3.1.6      過程                                                                                             34

3.1.7      數組                                                                                             36

3.2         Otcl面向對象的Tcl                                                                 37

3.2.1      類和對象                                                                                     37

3.2.2      成員變量和成員函數的定義                                                     38

3.2.3      對象的初始化和銷毀                                                                 39

3.2.4      繼承                                                                                             39

4章  分裂對象模型和TclCL                                                              43

4.1         分裂對象模型                                                                             43

4.1.1      為什麼要用兩種語言                                                                 43

4.1.2      Otcl和C++類的對應關係                                                          44

4.1.3      類命名規則                                                                                 45

4.2         Otcl和C++之間的對象連接                                                      45

4.2.1      TclObject和TclClass                                                                   45

4.2.2      變量綁定                                                                                     47

4.2.3      command方法                                                                             49

4.2.4      代碼分析                                                                                     50

4.3         Tcl類                                                                                           52

4.3.1      獲取Tcl類的實例                                                                      52

4.3.2      調用Otcl過程                                                                             53

4.3.3      返回值                                                                                         53

4.3.4      對象查找                                                                                     54

4.4         嵌入的Tcl                                                                                   54

4.4.1      EmbeddedTcl                                                                               54

4.4.2      代碼分析                                                                                     55

5章  NS基礎                                                                                       57

5.1         NS的事件調度機製                                                                   57

5.1.1      類比和離散事件類比                                                                 57

5.1.2      事件(event)                                                                             58

5.2         節點(node)                                                                             59

5.2.1      創建節點                                                                                     60

5.2.2      配置節點                                                                                     60

5.2.3      分類器(classifier)                                                                   63

5.3         鏈路(link)                                                                               68

5.3.1      創建單向鏈路                                                                             68

5.3.2      Tcl中的SimpleLink類                                                               69

5.3.3      Connector類                                                                                72

5.4         定時器(timer)                                                                         73

5.4.1      C++抽象基類TimerHandler                                                        73

5.4.2      例子TCP重傳定時器                                                             75

5.4.3      Otcl Timer類                                                                               76

5.5         分組頭管理                                                                                 77

5.5.1      協議和分組頭                                                                             77

5.5.2      添加新分組頭                                                                             79

5.5.3      選擇類比中使用的分組頭                                                         79

5.5.4      與分組相關的類                                                                         81

5.5.5      例子                                                                                             88

5.6         代理(agent)                                                                             89

5.6.1      Agent類的狀態變量和方法                                                       89

5.6.2      協議Agent                                                                                   89

5.6.3      Otcl中的Agent類                                                                      90

5.6.4      UDP                                                                                              91

5.6.5      TCP                                                                                              93

5.7         應用層                                                                                         97

5.7.1      Application類                                                                              97

5.7.2      運輸層代理的API函數                                                             98

5.7.3      流量發生器(TrafficGenerator類)                                          100

5.7.4      應用類比器Telnet和FTP                                                       104

5.8         無線網路                                                                                     104

5.8.1      基本的無線模型                                                                         105

5.8.2      創建MobileNode                                                                         105

5.8.3      移動節點的運動                                                                         107

5.8.4      移動節點的組成                                                                         107

5.9         trace文件                                                                                     108

5.9.1      在Tcl中使用Trace類                                                               109

5.9.2      C++的Trace類                                                                            111

5.9.3      trace文件格式                                                                             113

5.9.4      無線類比的trace文件格式                                                        117

6章  相關工具詳解                                                                             126

6.1         gawk                                                                                             126

6.1.1      gawk概述                                                                                    126

6.1.2      開始使用gawk                                                                            127

6.1.3      讀取輸入檔案                                                                             128

6.1.4      打印輸出                                                                                     129

6.1.5      匹配模式Pattern                                                                  130

6.1.6      Actions中的運算式Expression                                           131

6.1.7      Actions裡面的控制語句                                                            132

6.1.8      內建函數Built-in Functions                                                 134

6.1.9      使用者定義的函數User-defined Functions                         135

6.1.10    應用舉例                                                                                     136

6.1.11    結論                                                                                             137

6.2         繪圖工具gnuplot                                                                        137

6.2.1      啟動和退出gnuplot                                                                    137

6.2.2      簡單繪圖                                                                                     138

6.2.3      三維繪圖                                                                                     142

6.2.4      圖形顯示設置                                                                             142

6.3         cbrgen                                                                                          145

6.4         setdest                                                                                           146

6.5         threshold工具                                                                              148

6.6         nam                                                                                              149

6.6.1      nam簡介                                                                                     149

6.6.2      Nam用戶界面                                                                             149

6.6.3      nam入門                                                                                     150

6.6.4      NS中控制nam動畫顯示的命令                                               153

6.7         xgraph                                                                                          154

6.8         Tracegraph                                                                                   156

7  案例分析                                                                                     158

7.1         教育、研究方面的應用                                                             158

7.2         應用的一個完整例子                                                         159

7.2.1      例子                                                                                     159

7.2.2      添加協議類                                                                                 159

7.2.3      增加包頭類型                                                                             161

7.2.4      編譯代碼                                                                                     163

7.2.5      初步測試                                                                                     163

7.2.6      場景測試                                                                                     166

7.2.7      trace分析                                                                                     167

7.2.8      使用nam查看營運過程                                                            172

7.2.9      MFlood類的程式清單                                                                174

8章  調試技術 (Debug)                                                                      183

8.1         Otcl調試技術                                                                              184

8.1.1      輸出提示訊息                                                                             184

8.1.2      利用Otcl命令                                                                             184

8.1.3      使用Tcl調試器                                                                          184

8.2         利用KDevelop調試NS                                                             187

8.2.1      KDevelop簡介                                                                            187

8.2.2      為NS建立KDevelop工程                                                        190

8.2.3      調試舉例                                                                                     192

8.3         如何區分Otcl錯誤和C++錯誤                                                 194

8.4         向別人求助                                                                                 195

 

[筆者評論]

        本書在筆者八月初到北京的時候,也購買了一本。在購買前,看到很多人對這本書評價並不是很高,自己看過以後,終於能瞭解是什麼原因,這是因為這本書超過50%的資料都是翻譯國外關於NS2的資料,例如書中的第三章則是翻譯Shyam Pather的文章、第五章的內容也大都取自於NS Manual,所以對於一些人會覺得這本書只是一本翻譯文件的整理,因此覺得此書並不是很好,但是筆者的觀點卻不是如此,筆者認為這本書還是有利用的價值,特別是對初學者,因為這本書把許多相關的資料都收集了,熟讀後必然會有所收穫,因此筆者覺得若是經濟允許的話,可以購買本來閱讀,但是,身為一個研究者,認為此書中去引用或翻譯他人的文件,卻沒有寫出參考出處,筆者認為是不好的,因為這樣會讓不知道的人認為所有的內容都是作者自己撰寫,這是嫖竊原作者的智慧,希望此書作者在以後出書時,要注意一下。