Chinaunix首页 | 论坛 | 博客
  • 博客访问: 831897
  • 博文数量: 180
  • 博客积分: 10029
  • 博客等级: 上将
  • 技术积分: 2185
  • 用 户 组: 普通用户
  • 注册时间: 2009-11-06 09:15
文章存档

2010年(133)

2009年(47)

我的朋友

分类: 系统运维

2010-10-14 22:06:00

     NS2的核心组件主要是使用C++语言编写的,并通过OTCL机制为仿真脚本提供调用界面。 使用NS2做网络协议和网络性能分析、测量方面的工作,一般需要熟练做到以下两方面:
    (1) 能熟练编写TCL脚本,设定合适的网络场景对自己感兴趣的协议进行测试;
    (2) 掌握NS2下协议编写和修改的过程, 能够读懂相关协议的代码,具备调试能力,并能够修改协议。
     在此,我将简单介绍如何使用Source Insight这一款软件查看NS2中的代码。
  
1.
   
   
  
   


2. 将.cc 文件添加到Source Insight中:

   1) “Options”     --> “Document Options”

   2) “Document Options” :

         "Document Type" 列表中 选择 "C++ Source File" 选项    -->       Add “;*.cc” in “File filter”     -->   “Close”


3. 将.tcl文件添加到Source Insight中:
     1)  Download tcl language file from:


     2)   “Options” Menu --> “Preferences”   --> “Languages”  

     3)    In “Languages” Tab:

            Click “import”    --> Select “TCL.CLF”    --> Select “TCL” in “Language” --> Click “Doc Types…” Button in “Languages”   --> “Document Options”

      4)   In “Document Options” Dialog:

            Click “Add Type…”  -->  Type “tcl” as Document Type Name --> Type “*.tcl” in “File filter” --> Select “TCL” in “Language” Droplist   -->  Select "Include when adding to projects" Checkbox   --> Click “Close” Button


4. 导入 NS2 源代码

     1)  Click "Project" Menu --> New Project --> Type “NS2” as the project name --> Click “OK” Button --> Click “OK” Button in “New Project Setting” Dialog --> “Add and Remove Project Files” Dialog

    2)  In “Add and Remove Project Files” Dialog:

        Select the NS2 source code file folder --> Click “Add All” Button --> Select “Recursively add lower sub-directories” --> Click “OK” Button --> Click “OK” for importing source code --> Click “Close” Button in “Add and Remove Project Files” Dialog

    (以上两步即完成了将NS2代码导入到Source Insight中,其他的分析技巧请参考使用手册).

    还可以选择其他软件:
      KDevelop 、 Eclipse for C++
阅读(2584) | 评论(1) | 转发(0) |
给主人留下些什么吧!~~

chinaunix网友2010-10-15 17:48:52

很好的, 收藏了 推荐一个博客,提供很多免费软件编程电子书下载: http://free-ebooks.appspot.com