Efficient Simulation of Large-Scale P2P Networks Packet-level vs. Flow-level Simulations
這篇paper的作者Kolja Eger用ns2寫了bittorrent的simulation,並open source
所以想要用ns2寫p2p simulation的人,這個東西會是個不錯的參考
原本bittorrentsim是放在作者學校的網站上:
http://www.tuhh.de/et6/research/bittorrentsim/
然而,Kolja Eger畢業了,網站被移除了
經詢問,Eger把code改放到他的google site
https://sites.google.com/site/koljaeger/bittorrent-simulation-in-ns-2
然而,他的bittorent code是以patch file release的,並且是給ns-2.29用的
為此,我必需裝一個ns-2.29來安裝他的bittorrentsim
然而,安裝ns-2.29的過程不那麼順利
make時會有一堆error,據悉是gcc改版,規則變嚴格的原因
(這個我有印象,有次gcc更新後,本來可以make的code會make過不了)
我特地找個比較久的linux virtualbox image:Fedora Core 5
沒想這個distribution的gcc還蠻新的:gcc version 4.1.0 20060304 (Red Hat 4.1.0-3)
(其實我不確定是distribution本來的版本就這麼新,還是我以前有做過更新……)
所以make ns-2.29還是會有一堆error
要安裝ns-2.29時會出現一堆error,按照下列這個連結的方法就可以裝起ns-2.29
ns-2.29在Ubuntu8.04中的安装
基本上面文章的解法可行,按照他的方法,我把ns-2.29裝起來了
但是過程中會遇到另一個問題是文章中沒提到的,據說是bash 3.1.I的關係
error code如下:
checking system version (for dynamic loading)... ./configure: line 6017: syntax error near unexpected token `('
在ns-allinone-2.29的目錄下,複製下面這行:
for f in $(find -name configure); do sed "s/relid'/relid/" -i $f; done
貼上,執行,問題就解了
這個解法的原文出處:Compiling Network Simulator 2.29
到這裡,就裝好ns-2.29了
可以開始動手安裝bittorrentsim了
.