免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 3762 | 回复: 0
打印 上一主题 下一主题

P2PSim(1):GnutellaSim(libsynk+pdns+gnusim) 环境配置 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2009-12-30 17:12 |只看该作者 |倒序浏览
     感谢Q. He, M. Ammar, G. Riley, H. Raj and R. Fujimoto等人开发的用于P2P仿真的套件GnutellaSim。
     GnutellSim套件是一组与具体仿真平台相“隔离”的专用于P2P网络仿真的API接口,我们可以在此基础上在应用层进行网络元件的配置,完成P2P的网络仿真。  具体请参考该组件的发布网站:
http://www.cc.gatech.edu/computing/compass/gnutella/gnusim.html

     其实,在NS2上面安装新的仿真套件,真的是一项不简单的工作, 随时都可能出错,而且解决方法千差万别; 要顺利完成各种针对NS2的拓展,关键还是要多尝试,多看代码,多思考NS2的架构和组件模块,只有这样在遇到问题的时候,才能够比较清醒地、有方向地去寻找解决方案,寻求网络的信息,请求NS2高手的帮助啊!
     
     怕自己忘记繁琐的配置过程,所以,我把环境的配置过程稍作总结,因为我相信今后我的工组肯定也脱离不了P2P网络技术,而且我的NS2仿真平台肯定会经历好几次的重新安装和配置,所以现在把这个工作做好,可以为今后提供一定的方便。哈哈哈哈

安裝gnutellasim前要先裝PDNS,而裝PDNS要先裝libSynk,裝完libSynk和PDNS後再patch gnutellasim,
Linux下的一种可行的下载方法:
  • wget
    libSynk

  • wget
    PDNS patch

  • wget
    ns2.26-allinone
      
  • wget
    gnusim-ns2.26-v1.1.tgz

    准备工作:(我的NS2版本:ns2.34)
    libsynk-current.tar.Z
    pdns-2.26_patches-v2.gz
    gnusim-ns2.26-v1.1.tgz

    安装过程: (很漫长的等待,请读者在运行个条命令时,注意具体的当前目录,正确调整哦!)
    ############install libsynk###########
    #> cd ~
    #> gunzip -c libsynk-current.tar.Z | tar -xvpf -
    #> cd libsynk
    #> make
    #> cd fdkcompat
    #> make
    #########patch PDNS and install ns#######
    #> cd ~
    #> tar zxvf ns-allinone-2.26.tar.gz
    #> cd ns-allinone-2.25/ns-2.26/
    #>
    gunzip -c pdns-2.26_patches-v2.gz | patch -p3
    修改Makefile.in內
    KITHOME
    #> cd ..
    #> ./install
    ########patch gnutellasim##########
    #> cp gnutella-ns2.26-v1.1.tgz ~/ns-allinone-2.25/ns-2.26/
    #> cd ~/ns-allinone-2.25/ns-2.26/
    #> tar zxvf gnutella-ns2.26-v1.1.tgz
    #> ./install.sh


    网上的具体一点的描述,我先贴在下面,以后再精简:

    Building libSynk
    Decompress libSynk:
    cd $(HOME)
    gunzip -c libsynk-current.tar.Z | tar -xvpf -
    cd libsynk
    If you are using Myrinet, you must modify the appropriate makefiles before compiling. For instance, using Myrinet under Linux:
  • Edit the file Makefile in ~/libsynk so CFLAGS contains -DGM_AVAILABLE=1 and LDLIBS contains -lgm
  • Edit the file Makefile in ~/libsynk/fdkcompat so LDLIBS contains -lgm
  • For improved performance, you may want to specify -O2, -O3, or any other optimization parameters for your architecture.
    Now create the libraries:
    make
    cd fdkcompat
    make
    Building ns-2 and PDNS
    Decompress the baseline ns software:
    cd $(HOME)
    gunzip -c ns-allinone-2.27.tar.gz | tar -xvf -
    Move the PDNS patches (pdns_2.27_v1a.gz) file to the ~/ns-allinone-2.27/ns-2.27 directory and patch the stock ns:
    cd $(HOME)/ns-allinone-2.27/ns-2.27
    gunzip -c pdns_2.27_v1a.gz | patch -p3
    Next, edit the ~/ns-allinone-2.27/ns-2.27/Makefile.in file:
  • Edit the KITHOME macro on line 64 to reflect the correct directory of libSynk.
  • If you are using Myrinet, you will need to add -lgm on line 103 of the Makefile.in file.
  • Message Compression is enabled by default. To disable (not recommended), remove the define -DUSE_COMPRESSION on line 68.
  • Again, you may want to add an optimization parameters for your architecture into the Makefile under CCOPT.
    Install ns normally:
    cd $(HOME)/ns-allinone-2.27
    ./install


         
         


    本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u3/105477/showart_2135692.html
  • 您需要登录后才可以回帖 登录 | 注册

    本版积分规则 发表回复

      

    北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
    未成年举报专区
    中国互联网协会会员  联系我们:huangweiwei@itpub.net
    感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

    清除 Cookies - ChinaUnix - Archiver - WAP - TOP