博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

PeerSim中一些自己的理解

Posted on 2011-06-04 11:28  天地玄黄  阅读(569)  评论(0编辑  收藏  举报

     PeerSim是用Java语言写的可以模拟P2P系统的软件。刚开始看。有一些比较晦涩的地方,记录一下自己的理解。

 

1、这个模拟器的运行过程:

     Simulation ---> read config file ---> set up network (nodes, protocols) ---> initialization (init states of protocols) (Control object) ---> driven engine

 

2、Simulation model: 1) network size

                                  2) protocols –> to initialization

                                  3) control –> to monitor some properties –> to modify some parameters

                                  4) Simulator <config.txt>

 

3、interfaces:

        Node: network address, contain protocols

        CDProtocol: periodic activity

        Linkable: neighbers in network

        Control: observe and modify the network

 

4、Configuration file entries:

        <properties>.<component>[.<parameter>]  [full_path]classname

                 |___________|

                            |_____>mapped to a index(#)

        空格之前的部分叫做Key, 空格之后的叫做Value

        PeerSim可以自动搜索CLASSPATH来确定classname的位置,所以一般不用指定full_path

 

5、include.init <> <> … 定义了哪些Initializer 可以运行,并且规定了它们的运行顺序。如果没有指定(即没有include.init这一项),默认是字母顺序执行。

     include还可以有include.protocol <>  和 include.control <> 选项。

 

 

 

      [1] PeerSim HOWTO 1: http://peersim.sourceforge.net/tutorial1/tutorial1.html