感谢Q. He, M. Ammar, G. Riley, H. Raj and R. Fujimoto等人开发的用于P2P仿真的套件GnutellaSim。
GnutellSim套件是一组与具体仿真平台相“隔离”的专用于网络仿真的API接口,我们可以在此基础上在应用层进行网络元件的配置,完成P2P的网络仿真。 具体请参考该组件的
在NS2上面安装新的仿真套件,真的是一项不简单的工作, 随时都可能出错,而且解决方法千差万别; 要顺利完成对NS2的拓展,关键还是要多尝试,多看代码,多思考NS2的架构和它包含的组件,只有这样在遇到问题的时候,才能够比较清醒地、有方向地去寻找解决方案,寻求网络的信息,请求NS2高手的帮助啊!
我怕自己忘记繁琐的配置过程,所以在此把配置过程稍作总结。因为我相信。今后我的工组肯定也脱离不了P2P网络技术,而且将来我可能会经历多次重新安装和配置,所以现在把这个工作做好,可以为今后提供一定的方便,节省时间。哈哈哈哈
安裝gnutellasim前要先裝PDNS,而裝PDNS要先裝libSynk,裝完libSynk和PDNS後再patch gnutellasim,
Linux下的一种可行的下载方法:
准备工作:(我的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:
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 |
阅读(2992) | 评论(0) | 转发(0) |