WO2009152721A1 - 支持大规模的分布式p2p仿真系统及实现方法和装置 - Google Patents

支持大规模的分布式p2p仿真系统及实现方法和装置 Download PDF

Info

Publication number
WO2009152721A1
WO2009152721A1 PCT/CN2009/072000 CN2009072000W WO2009152721A1 WO 2009152721 A1 WO2009152721 A1 WO 2009152721A1 CN 2009072000 W CN2009072000 W CN 2009072000W WO 2009152721 A1 WO2009152721 A1 WO 2009152721A1
Authority
WO
WIPO (PCT)
Prior art keywords
simulation
peer
module
message
synchronization
Prior art date
Application number
PCT/CN2009/072000
Other languages
English (en)
French (fr)
Inventor
施广宇
龙有水
Original Assignee
华为技术有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 华为技术有限公司 filed Critical 华为技术有限公司
Publication of WO2009152721A1 publication Critical patent/WO2009152721A1/zh

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/104Peer-to-peer [P2P] networks

Definitions

  • the present invention relates to the field of computer network technologies, and in particular, to a large-scale distributed P2P simulation system and an implementation method and apparatus.
  • P2P network technology has gradually become a hotspot in the research and application of IT technology.
  • Embodiments of the present invention provide a large-scale distributed P2P network simulation system, which attempts to solve the problem of solving large-scale simulation capability of a P2P system, especially when large-scale network layer simulation is required.
  • a large-scale distributed P2P network simulation system includes: an overlay layer module, where the overlay layer module is composed of a peer node, and each peer node is connected.
  • a distributed message module which implements message interaction between different machines; a simulation synchronization module that implements simulation and simulation clock consistency at different simulation clock points by different machines.
  • an embodiment of the present invention provides a method for establishing a large-scale distributed P2P network simulation system, including:
  • the overlay layer module is composed of peer nodes by an overlay layer, and each peer node forms a peer-to-peer network system by implementing a peer-to-peer protocol;
  • Constructing a distributed message module which realizes message interaction between different machines; constructs an emulation synchronization module, which realizes the consistency of simulation and simulation clocks of different machines at the same simulation clock point.
  • the embodiment of the present invention further provides a method for simulating synchronization in a large-scale distributed peer-to-peer network simulation system, where the method is:
  • One of the machines is set as a server through a configuration file, and the server is responsible for receiving synchronization requests of other machines and responding to synchronization requests of other machines;
  • the embodiment of the present invention further provides a method for supporting synchronous message processing in a large-scale distributed P2P network simulation system, where the method is:
  • the client sends a synchronization request, and the synchronization request is sent to the distributed message interface of the server through the distributed message interface of the client;
  • the server accepts the synchronization request
  • the server sends a synchronization request response, by serving
  • the distributed message interface of the server is sent to the client's distributed message interface
  • the client accepts a sync request response.
  • the embodiment of the present invention further provides a method for supporting a large-scale distributed peer-to-peer network simulation system for performing synchronous message processing, where the method is:
  • the socket connection session establishes a socket connection with other machines and uses the socket to send messages.
  • the P2P simulation system provided by the embodiment of the present invention implements large-scale overlay layer simulation by using distributed overlay simulation and simulation clock synchronization.
  • FIG. 1 is a flowchart of a method for supporting a large-scale distributed P2P network simulation system according to an embodiment of the present invention.
  • FIG. 2 is a flowchart of a method for topology segmentation according to an embodiment of the present invention.
  • FIG. 3 is a flowchart of a network layer initialization method according to an embodiment of the present invention.
  • FIG. 4 is a flowchart of distributed message processing during simulation according to an embodiment of the present invention.
  • FIG. 5 is a flowchart of synchronous message processing during simulation according to an embodiment of the present invention.
  • FIG. 6 is a schematic structural diagram of an embodiment of a supportive large-scale distributed peer-to-peer network simulation system according to the present invention.
  • FIG. 7 is a schematic structural diagram of a simulation synchronization module in an embodiment supporting a large-scale distributed peer-to-peer network simulation system according to the present invention.
  • the physical meaning and mathematical characteristics of the actual network properties can be found that the topology of the actual network has a property, that is, the community structure.
  • the entire network is composed of several associations.
  • the connections between the nodes within each community are relatively close, but the connections between the various communities are relatively sparse. Within these societies, the connections between nodes are very close, and the connections between communities are much more sparse.
  • the technical solution of the embodiment of the present invention is based on the above guiding idea.
  • the simulation system provided by the embodiment of the invention comprises five parts, including topology segmentation, network layer simulation, overlay layer simulation, distributed message and simulation synchronization.
  • the topology is divided into independent pre-processing processes, and the next four parts constitute the simulation runtime environment.
  • Topology splits the original topology file into multiple topology files and saves them on different machines, providing topology input data for the network layer when the simulation system is running.
  • the network layer reads the split topology data, establishes a network layer router and a local link connecting the local network layer router and a remote link connecting the network bridges of different machines.
  • the overlay layer consists of peer nodes that simulate the peer-to-peer protocol. When the overlay simulation relies on network layer emulation, the overlay layer calls the network layer interface to connect the peer nodes and routers, and the messages between the overlay peer nodes are forwarded through the routers at the network layer.
  • the distributed message module implements message interaction between different machines, including network layer messages, overlay messages, and synchronization messages.
  • the simulation synchronization adopts a C/S (Client/Server, client/server) mode, and the server receives the synchronization request signal of each client and responds to the synchronization request signal, and the client responds according to the response as shown in FIG. 1.
  • a method for supporting a large-scale distributed P2P network simulation system the specific implementation process is as follows: S10 builds a topology segmentation module that splits the original topology file into multiple topology files and saves them on different machines.
  • the machine is a device loaded with an emulation system, such as a personal computer or the like.
  • Each machine in the application can also save the topology files of the global network. Therefore, each machine in the simulation system saves the global topology and its own topology file after segmentation.
  • the topology is divided into independent pre-processing processes, and the input is the original topology file, and the output is divided into multiple topology files.
  • the topology segmentation process in this embodiment is as follows:
  • S101 calculates the interface of the node according to the shortest path.
  • Any node of the original topology map randomly selects multiple destination nodes (such as 100 or all) and calculates the shortest path from the node to any destination node.
  • the number of nodes is calculated based on the shortest path, and the node number is defined as the total number of times the shortest path passes through the node.
  • S102 segments the topology domain.
  • a node with a median less than a certain value is regarded as an edge layer node, and the node is merged from the edge layer, and it is merged into a new set with a smaller number of connected nodes; the set selects the most connected set or node merges For the next round of collections, until the number of sets equals the specified number of split fields and the number of nodes in each set satisfies a certain range of conditions.
  • the nodes are uniformly distributed and the number of inter-domain links is the smallest.
  • S103 performs subnetting.
  • a node with a median less than a certain value is regarded as an edge layer node, and the node is merged from the edge layer, and it is merged into a new set with a smaller number of connected nodes, when the number of nodes in the set reaches a predetermined value.
  • the collection is a subnet.
  • the final total number of subnets is also a preset number.
  • the intra-domain nodes are grouped into local networks by subnetting.
  • S 104 allocates an address and a mask.
  • Each domain is assigned a domain address and a domain level mask
  • each subnet is assigned a subnet address and a subnet mask
  • each node is assigned an address and its corresponding address mask.
  • S105 outputs the divided topology.
  • Output a global topology file containing each domain address and mask information, as well as inter-domain link information.
  • a local topology file for each domain is output.
  • the local topology file contains a node address, a node mask, a subnet address, a subnet mask, and link information.
  • the link information includes information such as delay and bandwidth derived from the original topology file. Save different domain local topology files on different machines, and save the global topology files on all machines as the network layer of the simulation process. Park enters the data.
  • S20 constructs a network layer simulation module.
  • the process of constructing the network layer emulation module includes network layer initialization and network layer access.
  • the network layer initialization process in this embodiment is as follows:
  • S201 establishes a router and a local link of the network layer according to local local topology file data.
  • the link contains information such as delay and bandwidth, which can be derived from topology file data or dynamically generated according to an algorithm.
  • S202 establishes a remote virtual link between routers of different machine network layers according to the global topology file data.
  • the remote virtual link enables messaging between different machines by calling a distributed message interface.
  • S203 configures routes according to the shortest path algorithm, such as intra-subnet routing, inter-subnet routing, and inter-domain routing.
  • the intra-subnet route and the inter-subnet route use the local link as the route egress, and the inter-domain route uses the remote virtual link as the egress route.
  • Configure the default route on the S204 Configure the link exit with the shortest route to pass the default route as the default route.
  • the network layer supports emulation of the UDP/TCP messaging process and the Traceroute command implementation.
  • S30 Constructs an overlay simulation module.
  • the overlay layer consists of peer nodes, and each peer node forms a P2P network system by implementing a peer-to-peer protocol.
  • Overlay simulation includes initialization, establishment of peer node instances, and peer node message communication.
  • the configuration parameters are read from the configuration file, and the runtime parameters of the overlay layer are set according to the configuration parameters, including the peer protocol parameters, whether to use the network layer simulation and other parameters.
  • Load each function according to the runtime parameters such as loading the corresponding class factory according to the peer-to-peer protocol parameters, and performing network layer emulation initialization when using the network layer emulation function.
  • the access layer node access network layer has two modes: random access and edge access:
  • the random access mode is that the overlay node randomly selects a router from the local network layer to establish a connection relationship, and the edge connection
  • the incoming mode is that the overlay node randomly selects a router whose median is less than a predetermined value from the network layer of the local device.
  • Establishing a peer node instance The generation of a peer node is triggered by an event, which can be read from a file or generated by the emulator at runtime. After the new peer is generated, the overlay sends a node join notification message to all other machines through the distributed message interface to ensure that each machine has consistent global overlay node information. (If the network layer emulation function is used, when the overlay layer generates a new peer, the network layer interface is called to establish a connection relationship with the router.) Then, the new peer sends a join request message to the bootstrap node to join P2P network system. The departure process of the peer node is similar to the above process.
  • the S40 constructs a distributed message module.
  • the distributed message module implements message interaction between different machines, including network layer messages, overlay messages, and synchronization messages.
  • the emulation process establishes a Socket connection between any two machines during the initialization phase. Different messages can share the Socket session if the target machine is the same during the simulation run.
  • the distributed message module ensures reliable delivery of messages.
  • the S50 constructs an analog synchronization module.
  • the simulation synchronization uses the C/S (Client / Server) mode to coordinate the synchronization signals between different machines.
  • C/S Customer / Server
  • the server is responsible for receiving synchronization requests from other machines and responding to synchronization requests from other machines.
  • the simulation synchronization includes simulation initialization synchronization and runtime simulation clock synchronization, that is, the simulation initialization synchronization module and the simulation clock synchronization module are included in the construction simulation synchronization module.
  • the simulation initialization synchronization ensures that the simulation environment of the different machines is ready, and then the simulation starts at the same simulation clock point.
  • the emulation clock synchronizes the emulation clock forward by event triggering.
  • the consistency of the emulation clock is ensured by setting the same synchronous clock checkpoint and synchronous clock signal interaction between different machines. Different simulation time period accuracy can be achieved by setting the synchronous clock checkpoint.
  • the simulation system constructed by the above method realizes large-scale overlay simulation by using distributed overlay simulation and simulation clock synchronization.
  • the method for peer node message communication in the above simulation system is: When the peer node sends a message to the destination peer node, the process is different depending on whether the network layer is used for simulation. If using the network layer The emulation function, the peer node encapsulates the message as a network layer message and forwards it to its access router. The access router forwards through the network layer to the destination router, and the destination router is the access router of the destination peer.
  • the peer node first determines its domain number based on the ID of the destination peer (the address of the peer node in the hash space, and the different machines generate peers with different hash space addresses) If the source peer node is in the same domain, the message is sent directly to the destination peer node. Otherwise, the message is sent to the machine where the destination domain is located through the distributed message interface. After receiving the message through the distributed interface, the machine where the destination domain is located sends the message directly to the destination peer node.
  • the overlay node When using network layer emulation, the overlay node implements the message transmission by calling the network layer interface.
  • the network layer first encapsulates the message into a network layer message according to the overlay node matching the corresponding connection router and forwards it to the connection router for processing.
  • the source router finds the link egress according to the destination router address matching its routing table with the longest prefix, and forwards the message to the next hop router through the link egress.
  • the next hop continues to look up the route for forwarding until it reaches the destination. If the destination router address is located on another machine, the link exit corresponds to the remote link, and the message exchange of the remote link is implemented through the distributed message interface.
  • T401 encapsulates the message according to the message type.
  • the message Before each module calls the distributed message interface to send a message, the message is encapsulated according to the message type, and the encapsulated message contains the message of the destination domain.
  • T402 adds the message to the send list of the socket connection session.
  • the distributed message interface matches the corresponding socket connection session based on the destination field of the message, and the message is added to the send list of the socket connection session.
  • the T403 socket connection session establishes a socket connection with other machines, and uses the socket to send and receive Interest. You should also check the send list before sending the message.
  • a socket connection session When a socket connection session receives a message sent by another machine, it first parses the message type, and invokes different message processing processes depending on the message type.
  • the T501 client sends a synchronization request, and the synchronization request is sent to the distributed message interface of the server through the distributed message interface of the client;
  • the T502 server accepts the synchronization request
  • T503 determines whether a synchronization request sent by all clients is received
  • the server sends a synchronization request response, which is sent to the distributed message interface of the client through the distributed message interface of the server;
  • the T506 client accepts a synchronization request response.
  • the present invention supports an embodiment of a large-scale distributed peer-to-peer network simulation system, as shown in Figure 6, which includes:
  • An overlay module 601 the overlay layer of the overlay module is composed of peer nodes, and each peer node forms a peer-to-peer network system by implementing a peer-to-peer protocol;
  • the distributed message module 602 the distributed message module implements message interaction between different machines; the simulation synchronization module 603, which implements the simulation and simulation clock consistency of different machines at the same simulation clock point.
  • system further includes:
  • the topology segmentation module 604 divides the original global topology file into a plurality of topology files and saves the local topology files belonging to the local machine.
  • the network layer simulation module 605 loads the local local topology file and the global topology file to establish a network layer.
  • the distributed message module establishes a socket connection between two machines.
  • the simulation synchronization module includes:
  • the simulation initialization synchronization module 701 starts the simulation at the same simulation clock point after the simulation initialization module realizes the simulation environment of different machines;
  • the simulation clock synchronization module 702 realizes the simulation clock to advance by event triggering, and realizes the consistency of the simulation clock by setting the same synchronous clock checkpoint and the synchronous clock signal between different machines.
  • the simulated synchronization module further sets a synchronous clock checkpoint 703 that implements different simulation time period precisions.
  • the nodes in the overlay module access the network layer module through random access or edge access.
  • the random access mode is that the overlay node randomly selects a router from the network layer of the local device to establish a connection relationship
  • the edge access mode is that the overlay node randomly selects a router whose median is less than a preset value from the network layer of the local device.
  • the emulation synchronization module uses a client/server mode to coordinate synchronization signals between different machines.
  • a person skilled in the art can understand that all or part of the process of implementing the above embodiment method can be completed by a computer program to instruct related hardware, and the program can be stored in a computer readable storage medium. In execution, the flow of an embodiment of the methods as described above may be included.
  • the storage medium may be a magnetic disk, an optical disk, a read-only memory (ROM), or a random access memory (RAM).

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computer And Data Communications (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Description

支持大 «莫的分布式 P2P仿真系统及实现方法和装置 技术领域
本发明涉及计算机网络技术领域,尤其涉及一种支持大规模的分布式 P2P 仿真系统及实现方法和装置。
背景技术
随着对等 (Peer-to-Peer, P2P)网络的飞速发展, P2P网络技术已经逐渐成为 当今 IT技术领域研究与应用的热点。
目前仿真 (simulation)在 P2P 系统的评估和分析中发挥着重要作用。 很多 研究者认为底层网络布局对 P2P 系统性能有较大的影响。 目前采用的是基于 Ns-2.27 ( Network Simulator )和 PDNS ( Parallel/Distributed Network Simulator ) 开发的仿真 Gnutella系统的仿真器。 PDNS是 NS2的分布式版本。 NS2是一 个广泛应用的面向对象的, 离散事件驱动的网络仿真器。 通过 NS2、 PDNS 和 Gnutellasim三者的结合, 可以实现基于 Gnutella协议的 P2P系统的并行分 布的仿真。请实现过程为安装 Ns2、 PDNS和 gnutellasim,并且作相应的配置; 使用 NS2 和 PDNS 提供的用户接口编写 TCL脚本实现网络层仿真; 使用 Gnutellasim提供的用户接口编写 TCL脚本实现 P2P用户行为仿真。
但现有的仿真器多基于不考虑底层网络的简单模型或者实现简单的小规 模网络层仿真。 同时多数仿真器仅支持特定协议的较小规模仿真。 上述缺陷 导致使用现有仿真器进行仿真的实用性和真实性无法满足实验需求。
发明内容
本发明实施例提供一种支持大规模分布式 P2P 网络仿真系统, 试图解决 解决 P2P 系统大规模仿真能力问题, 特别是在需要大规模网络层仿真时的能 力问题。
本发明实施例所提供的一种支持大规模分布式 P2P网络仿真系统, 包括: 覆盖层模块, 该覆盖层模块由覆盖层由对等节点组成, 各个对等节点通 过实现对等协议构成对等网络系统;
分布式消息模块, 该分布式消息模块实现不同机器间的消息交互; 仿真同步模块, 该仿真同步模块实现不同机器在相同的仿真时钟点开始 仿真及仿真时钟的一致性。
同时本发明实施例提供一种建立支持大规模分布式 P2P 网络仿真系统的 方法, 包括:
构造覆盖层模块模块, 该覆盖层模块由覆盖层由对等节点组成, 各个对 等节点通过实现对等协议构成对等网络系统;
构造分布式消息模块, 该分布式消息模块实现不同机器间的消息交互; 构造仿真同步模块, 该仿真同步模块实现不同机器在相同的仿真时钟点 开始仿真及仿真时钟的一致性。
同时本发明实施例还提供一种大规模分布式对等网络仿真系统中仿真同 步的方法, 所述方法为:
利用分布式消息模式在不同机器间实现消息交互;
通过配置文件设置其中一台机器作为服务器, 服务器负责接收其他机器 的同步请求并响应其他机器的同步请求;
在不同机器仿真环境就绪后在相同的仿真时钟点开始仿真;
设置同步时钟检查点和同步时钟信号交互, 以保证仿真时钟的一致性。 同时本发明实施例还提供支持大规模分布式 P2P 网络仿真系统进行仿真 时同步消息处理的方法, 所述方法为:
客户机发送同步请求, 所述的同步请求通过客户机的分布式消息接口发 送给服务器的分布式消息接口;
服务器接受该同步请求;
判断是否接收到所有客户机发送的同步请求;
如果否则继续接受客户机的同步请求;
如果接收到所有客户机的同步请求, 服务器发送同步请求响应, 通过服 务器的分布式消息接口发送给客户机的分布式消息接口;
客户机接受同步请求响应。
进一步本发明实施例还提供支持大规模分布式对等网络仿真系统进行仿 真时分布式消息处理的方法, 所述方法为:
根据消息类型对消息进行封装;
将该消息加入该套接字连接会话的发送列表;
套接字连接会话与其它机器建立套接字连接, 利用该套接字发送消息。 本发明实施例提供的 P2P仿真系统利用分布式的覆盖层仿真和仿真时钟 同步实现大规模的覆盖层仿真。
附图说明
为了更清楚地说明本发明实施例或现有技术中的技术方案, 下面将对实 施例或现有技术描述中所需要使用的附图作简单地介绍, 显而易见地, 下面 描述中的附图仅仅是本发明的一些实施例, 对于本领域普通技术人员来讲, 在不付出创造性劳动性的前提下, 还可以根据这些附图获得其他的附图。
图 1为本发明实施例建立一种支持大规模分布式 P2P网络仿真系统的方 法流程图。
图 2为本发明实施例中拓朴分割方法流程图。
图 3为本发明实施例中网络层初始化方法流程图。
图 4为本发明实施例进行仿真时分布式消息处理流程图。
图 5为本发明实施例进行仿真时同步消息处理流程图。
图 6 为本发明支持大规模分布式对等网络仿真系统的实施例的结构示意 图。
图 7 为本发明支持大规模分布式对等网络仿真系统的实施例中仿真同步 模块的结构示意图。
具体实施方式
下面将结合本发明实施例中的附图, 对本发明实施例中的技术方案进行 清楚、 完整地描述, 显然, 所描述的实施例仅仅是本发明一部分实施例, 而 不是全部的实施例。 基于本发明中的实施例, 本领域普通技术人员在没有作 出创造性劳动前提下所获得的所有其他实施例, 都属于本发明保护的范围。
在对本发明实施例的研究中发现, 对实际网络性质的物理意义和数学特 性进行研究, 可以发现实际网络的拓朴结构具有一个性质, 即社团结构。 既 整个网络是由若干个社团构成的, 每个社团内部的节点之间的连接相对非常 紧密,但是各个社团之间的连接却相对来说比较稀疏。 在这些社团内部, 节点 之间的联系非常紧密, 而社团之间的联系就稀疏得多。 本发明实施例的技术 方案基于上述指导思想。
本发明实施例所提供的仿真系统由五部分组成, 包括拓朴分割、 网络层 仿真、 覆盖层仿真、 分布式消息和仿真同步。 其中拓朴分割为独立的预处理 进程, 后面的四部分构成仿真运行时环境。
拓朴分割将原始的拓朴文件分割为多个拓朴文件并保存在不同的机器, 为仿真系统运行时建立网络层提供拓朴输入数据。 网络层读入分割后的拓朴 数据, 建立网络层路由器以及连接本地网络层路由器的本地链路和连接不同 机器间网络层路由器的远程链路。 覆盖层由对等节点组成, 实现对等协议的 仿真。 当覆盖层仿真依赖于网络层仿真时, 覆盖层调用网络层接口连接对等 节点和路由器, 覆盖层对等节点间的消息通过网络层的路由器进行转发。 当 覆盖层仿真不依赖于网络层仿真时, 如果目的节点在本机, 覆盖层对等节点 的消息直接发到目的对等节点, 否则通过调用分布式消息接口进行转发。 分 布式消息模块实现不同机器间的消息交互, 包括网络层消息、 覆盖层消息和 同步消息。 仿真同步采用 C/S ( Client /Server, 客户端 /服务器)模式, 通过服 务器接收各个客户机的同步请求信号并响应同步请求信号, 客户机根据响应 如图 1所示, 本发明实施例建立一种支持大规模分布式 P2P网络仿真系 统的方法, 具体实现过程如下: S10构建拓朴分割模块,该模块将原始的拓朴文件分割为多个拓朴文件并 保存在不同的机器中。 所述机器为装载仿真系统得设备, 例如个人计算机等。 应用中各机器还可同时保存全局网络的拓朴文件。 所以仿真系统中每一台机 器保存全局的拓朴及分割后属于自身的拓朴文件。 拓朴分割为独立运行的预 处理进程, 输入为原始拓朴文件, 输出为分割后的多个拓朴文件。
如图 2所示, 本实施例中拓朴分割过程如下:
S101根据最短路径计算节点的介数。
原始拓朴图的任一个节点随机选多个目的节点 (如 100个或所有), 计 算该节点到任一目的节点的最短路径。 根据最短路径计算节点的介数, 节点 介数定义为最短路径经过该节点的总次数。
S102对拓朴域进行分割。 将介数小于某个值的节点视为边缘层节点, 从 边缘层开始合并节点, 将它与介数较小的连接节点合并为新的集合; 集合选 择有最多链路相连的集合或节点合并为下一轮的集合, 直到集合数量等于指 定的分割域数量并且每个集合内的节点数满足一定的范围条件。 通过上述的 拓朴域分割将节点尽量均勾分布并且域间链路数最小。
S103进行子网划分。 将介数小于某个值的节点视为边缘层节点, 从边缘 层开始合并节点, 将它与介数较小的连接节点合并为新的集合, 当集合中的 节点个数达到一预定值时所述集合为一个子网。 最后总的子网个数也为一预 设数量。 通过划分子网将域内节点按社团组成本地网。
S 104分配地址和掩码。 给每个域分配域地址和域级掩码, 给每个子网分 配子网地址和子网掩码, 给每个节点分配地址及其对应的地址掩码。
S105输出分割后的拓朴。 输出一个全局拓朴文件, 包含每个域地址及掩 码信息, 以及域间链路信息。 输出每个域的局部拓朴文件, 局部拓朴文件包 含节点地址、 节点掩码、 子网地址、 子网掩码及链路信息。 链路信息包括时 延和带宽等来源于原始拓朴文件的信息。 将不同的域局部拓朴文件保存在不 同的机器上, 全局拓朴文件保存在所有的机器上, 作为仿真进程的网络层拓 朴输入数据。
S20 构造网络层仿真模块。 构造网络层仿真模块的过程包括网络层初始 化、 网络层接入。
网络层初始化时加载本地局部拓朴文件和全局拓朴文件, 建立网络层。 如图 3所示, 本实施例中网络层初始化过程如下:
S201根据本地局部拓朴文件数据建立网络层的路由器及本地链路。 链路 包含了时延和带宽等信息, 可以来源于拓朴文件数据或者根据某种算法动态 产生。
S202根据全局拓朴文件数据建立不同机器网络层路由器间的远程虚拟链 路。 远程虚拟链路通过调用分布式消息接口实现不同机器间的消息传送。
S203根据最短路径算法配置路由, 如子网内路由、 子网间路由、 域间路 由。 子网内路由和子网间路由使用本地链路作为路由出口, 域间路由使用远 程虚拟链路作为出口路由。
S204配置缺省路由: 将最短路径经过次数最多的链路出口配置为缺省路 由出口。
初始化完成后, 进行网络层接入。 网络层支持仿真 UDP/TCP的消息传递 过程和 Traceroute命令实现。
S30 构造覆盖层仿真模块。 覆盖层由对等节点组成, 各个对等节点通过 实现对等协议构成 P2P 网络系统。 覆盖层仿真包括初始化、 建立对等节点实 例、 对等节点消息通信。
初始化阶段从配置文件读入配置参数, 根据配置参数设置覆盖层的运行 时参数, 包括对等协议参数、 是否使用网络层仿真等参数。 根据运行时参数 加载各功能, 如根据对等协议参数加载相应的类工厂, 使用网络层仿真功能 时进行网络层仿真初始化。
覆盖层节点接入网络层有随机接入和边缘接入两种方式: 随机接入方式 为覆盖层节点从本机的网络层中随机选择一个路由器建立连接关系, 边缘接 入方式为覆盖层节点从本机的网络层中随机选择介数小于某个预先设定值的 路由器。
建立对等节点实例: 对等节点的产生由事件触发, 事件可从文件读入或 者由仿真器在运行时产生。 新的对等点产生后, 覆盖层通过分布式消息接口 向其它所有机器发送节点加入通知消息, 以保证各机器拥有一致的全局覆盖 层节点信息。 (如果使用网络层仿真功能, 覆盖层产生新的对等点时, 调用网 络层接口将该对等点与路由器建立连接关系。)然后, 新对等点向引导节点发 送加入请求消息, 从而加入 P2P 网络系统。 对等节点的离开过程与上述过程 类似。
S40构造分布式消息模块。 分布式消息模块实现不同机器间的消息交互, 包括网络层消息、 覆盖层消息和同步消息。 仿真进程在初始化阶段建立任意 两台机器间的 Socket (套接字)连接, 在仿真运行时不同的消息如果目标机 器相同, 可以共享 Socket会话。 分布式消息模块能够保证消息的可靠发送。
S50构造仿真同步模块。 仿真同步采用 C/S ( Client /Server )模式协调不 同机器间的同步信号。 仿真运行时, 通过配置文件设置其中一台机器作为服 务器, 服务器负责接收其他机器的同步请求并响应其他机器的同步请求。 仿 真同步包括仿真初始化同步、 运行时仿真时钟同步, 即在构造仿真同步模块 中包含仿真初始化同步模块及仿真时钟同步模块。 仿真初始化同步保证不同 机器的仿真环境都准备就绪, 然后在相同的仿真时钟点开始仿真。 仿真时钟 同步通过事件触发实现仿真时钟向前推进, 不同机器间通过设置相同同步时 钟检查点和同步时钟信号交互来保证仿真时钟的一致性。 通过设置同步时钟 检查点, 可实现不同的仿真时间周期精度。
通过上述方法构造出来的仿真系统利用分布式的覆盖层仿真和仿真时钟 同步实现大规模的覆盖层仿真。
在上述仿真系统中对等节点消息通信的方法为: 对等节点向目的对等节 点发送消息时, 根据是否使用网络层仿真其过程有所不同。 如果使用网络层 仿真功能, 对等节点将消息封装为网络层消息, 转发到其接入路由器。 接入 路由器通过网络层路由转发最终到达目的路由器, 而目的路由器为目的对等 节点的接入路由器。 如果没有使用网络层仿真功能, 对等节点首先根据目的 对等点的 ID (对等节点在哈希空间中的地址, 不同的机器产生具有不同哈希空 间地址的对等节点)判断其域编号, 如果与源对等节点在同一个域, 直接将消 息发送到目的对等节点, 否则, 将消息通过分布式消息接口发送到目的域所 在的机器。 目的域所在的机器通过分布式接口接收到该消息后, 直接将消息 发送到目的对等节点。
基于上述支持大规模分布式 P2P 网络仿真系统进行仿真时网络层仿真的 过程为:
在使用网络层仿真时, 覆盖层节点通过调用网络层接口实现消息的发送。 网络层首先根据覆盖层节点匹配相应的连接路由器, 将消息封装为网络层消 息并转给连接路由器处理。 源路由器根据目的路由器地址按最长前缀匹配其 路由表找到链路出口, 通过该链路出口将消息转发到下一跳路由器, 下一跳 继续查找路由进行转发直到到达目的地。 如果目的路由器地址位于另一台机 器, 则链路出口对应的是远程链路, 通过分布式消息接口实现远程链路的消 息交互。
基于上述支持大规模分布式 P2P 网络仿真系统进行仿真时分布式消息处 理过程如图 4所示:
T401 根据消息类型对消息进行封装。
各个模块调用分布式消息接口发送消息前, 先根据消息类型对消息进行 封装, 封装后的消息包含了目的域的消息。
T402将该消息加入该套接字连接会话的发送列表。
分布式消息接口根据消息的目的域匹配相应的套接字连接会话, 将该消 息加入该套接字连接会话的发送列表。
T403套接字连接会话与其它机器建立套接字连接, 利用该套接字发送消 息。 在发送消息前还应该检查发送列表。
套接字连接会话接收到其他机器发送过来的消息时, 首先解析消息类型, 根据消息类型不同, 调用不同的消息处理过程。
基于上述支持大规模分布式 P2P 网络仿真系统进行仿真时同步消息处理 过程如图 5所示:
T501客户机发送同步请求, 所述的同步请求通过客户机的分布式消息接 口发送给服务器的分布式消息接口;
T502服务器接受该同步请求;
T503判断是否接收到所有客户机发送的同步请求;
T504如果否则继续接受客户机的同步请求;
T505如果接受到所有客户机的同步请求, 服务器发送同步请求响应, 通 过服务器的分布式消息接口发送给客户机的分布式消息接口;
T506客户机接受同步请求响应。
完成时钟同步处理。
本发明支持大规模分布式对等网络仿真系统的实施例, 如图 6 所示, 包 括:
覆盖层模块 601 , 该覆盖层模块的覆盖层由对等节点组成, 各个对等节点 通过实现对等协议构成对等网络系统;
分布式消息模块 602, 该分布式消息模块实现不同机器间的消息交互; 仿真同步模块 603 ,该仿真同步模块实现不同机器在相同的仿真时钟点开 始仿真及仿真时钟的一致性。
进一步的, 所述系统还包括:
拓朴分割模块 604,该拓朴分割模块将原始的全局拓朴文件分割为多个拓 朴文件并保存属于本地机器的局部拓朴文件。
网络层仿真模块 605 ,该网络层模块加载本地局部拓朴文件和全局拓朴文 件建立网络层。 所述分布式消息模块在两台机器之间建立套接字连接。
如图 7所示, 所述仿真同步模块包括:
仿真初始化同步模块 701 ,该仿真初始化同步模块实现不同机器的仿真环 境准备后在相同的仿真时钟点开始仿真;
仿真时钟同步模块 702,该仿真时钟同步模块通过事件触发实现仿真时钟 向前推进, 不同机器间通过设置相同同步时钟检查点和同步时钟信号交互实 现仿真时钟的一致性。
另外, 所述仿真同步模块还设置一同步时钟检查点 703 , 该同步时钟检查 点周期实现不同的仿真时间周期精度。
所述覆盖层模块中的节点通过随机接入或边缘接入方式接入网络层模 块,
所述随机接入方式为覆盖层节点从本机的网络层中随机选择一个路由器 建立连接关系,
所述边缘接入方式为覆盖层节点从本机的网络层中随机选择介数小于某 个预先设定值的路由器。
所述仿真同步模块采用客户机 /服务器模式协调不同机器间的同步信号。 本领域普通技术人员可以理解实现上述实施例方法中的全部或部分流 程, 是可以通过计算机程序来指令相关的硬件来完成, 所述的程序可存储于 一计算机可读取存储介质中, 该程序在执行时, 可包括如上述各方法的实施 例的流程。其中,所述的存储介质可为磁碟、光盘、只读存储记忆体( Read-Only Memory, ROM )或随机存^ ^己忆体 ( Random Access Memory, RAM )等。
以上所述仅为本发明的较佳实施例而已, 并非用于限定本发明的保护范 围。 凡在本发明的精神和原则之内, 所作的任何修改、 等同替换以及改进等, 均应包含在本发明的保护范围之内。

Claims

权利 要求 书
1、 一种支持大规模分布式对等网络仿真系统, 其特征在于, 包括: 覆盖层模块, 该覆盖层模块的覆盖层由对等节点组成, 各个对等节点通过 实现对等协议构成对等网络系统;
分布式消息模块, 该分布式消息模块实现不同机器间的消息交互; 仿真同步模块, 该仿真同步模块实现不同机器在相同的仿真时钟点开始仿 真及仿真时钟的一致性。
2、 如权利要求 1所述的系统, 其特征在于, 所述系统还包括: 拓朴分割模块, 该拓朴分割模块将原始的全局拓朴文件分割为多个拓朴文 件并保存属于本地机器的局部拓朴文件。
3、 如权利要求 2所述的系统, 其特征在于, 所述系统还包括:
网络层仿真模块, 该网络层模块加载本地局部拓朴文件和全局拓朴文件建 立网络层。
4、 如权利要求 1所述的系统, 其特征在于, 所述分布式消息模块在两台机 器之间建立套接字连接。
5、 如权利要求 1所述的系统, 其特征在于, 所述仿真同步模块包括: 仿真初始化同步模块, 该仿真初始化同步模块实现不同机器的仿真环境准 备后在相同的仿真时钟点开始仿真;
仿真时钟同步模块, 该仿真时钟同步模块通过事件触发实现仿真时钟向前 推进, 不同机器间通过设置相同同步时钟检查点和同步时钟信号交互实现仿真 时钟的一致性。
6、 如权利要求 5所述的系统, 其特征在于, 所述仿真同步模块还设置一同 步时钟检查点, 该同步时钟检查点周期实现不同的仿真时间周期精度。
7、 如权利要求 2所述的系统, 其特征在于,
覆盖层模块中的节点通过随机接入或边缘接入方式接入网络层模块, 所述随机接入方式为覆盖层节点从本机的网络层中随机选择一个路由器建 立连接关系,
所述边缘接入方式为覆盖层节点从本机的网络层中随机选择介数小于某个 预先设定值的路由器。
8、 如权利要求 5所述的系统, 其特征在于, 所述仿真同步模块采用客户机 /服务器模式协调不同机器间的同步信号。
9、 一种构建支持大规模分布式对等网络仿真系统得方法, 其特征在于, 包 括:
构造覆盖层模块, 该覆盖层模块的覆盖层由对等节点组成, 各个对等节点 通过实现对等协议构成对等网络系统;
构造分布式消息模块, 该分布式消息模块实现不同机器间的消息交互; 构造仿真同步模块, 该仿真同步模块实现不同机器在相同的仿真时钟点开 始仿真及仿真时钟的一致性。
10、 如权利要求 9所述的方法, 其特征在于, 该方法还包括:
构造拓朴分割模块, 该拓朴分割模块将原始的全局拓朴文件分割为多个拓 朴文件并保存属于本地机器的局部拓朴文件。
11、 如权利要求 9所述的方法, 其特征在于, 该方法还包括:
构造网络层仿真模块, 该网络层模块加载本地局部拓朴文件和全局拓朴文 件建立网络层。
12、 如权利要求 10所述的方法, 其特征在于, 构造拓朴分割模块过程中, 分对拓朴进行分割的方法为: 根据最短路径计算节点的介数;
根据节点的介数对拓朴域进行分割;
根据节点的介数进行子网划分;
给每个域分配域地址和域级掩码, 给每个子网分配子网地址和子网掩码, 给每个节点分配地址及其对应的地址掩码; 输出分割后的拓朴。
13、 如权利要求 11所述的方法, 其特征在于, 构造网络层仿真模块时, 对 网络层初始化的方法为: 根据本地局部拓朴文件数据建立网络层的路由器及本地链路;
根据全局拓朴文件数据建立不同机器网络层路由器间的远程虚拟链路; 根据最短路径算法配置路由;
将最短路径经过次数最多的链路出口配置为缺省路由出口。
14、 如权利要求 11所述的方法, 其特征在于, 所述方法: 覆盖层节点通过随机接入或边缘接入方式接入网络层;
所述随机接入方式为覆盖层节点从本机的网络层中随机选择一个路由器建 立连接关系;
所述边缘接入方式为覆盖层节点从本机的网络层中随机选择介数小于某个 预先设定值的路由器。
15、 如权利要求 9所述的方法, 其特征在于, 在构造覆盖层模块过程中建 立对等节点实例的步骤为:
新的对等点产生后, 覆盖层通过分布式消息接口向其它所有机器发送节点 力口入通知消息; 新对等点向弓 1导节点发送加入请求消息, 加入对等网络系统。
16、 如权利要求 9所述的方法, 其特征在于, 在构造分布式消息模块的过 程中, 在初始化阶段建立两台机器间的套接字连接, 在仿真运行时不同的消息 如果目标机器相同, 则共享套接字会话。
17、 如权利要求 9所述的方法, 其特征在于, 在构造仿真同步模块时采用 客户机 /服务器模式协调不同机器间的同步信号。
18、 一种大规模分布式对等网络仿真系统中仿真同步的方法, 其特征在于, 利用分布式消息模式在不同机器间实现消息交互,
所述方法包括:
通过配置文件设置其中一台机器作为服务器, 服务器负责接收其他机器的 同步请求并响应其他机器的同步请求; 在不同机器仿真环境就绪后在相同的仿真时钟点开始仿真;
设置同步时钟检查点和同步时钟信号交互, 以保证仿真时钟的一致性。
19、 如权利要求 18所述的方法, 其特征在于, 该方法还包括:
设置同步时钟检查点, 实现不同的仿真时间周期精度。
20、 一种支持大规模分布式对等网络仿真系统进行仿真时同步消息处理的 方法, 其特征在于, 所述方法包括:
客户机发送同步请求, 所述的同步请求通过客户机的分布式消息接口发送 给服务器的分布式消息接口;
服务器接受该同步请求;
判断是否接收到所有客户机发送的同步请求;
如果否则继续接受客户机的同步请求;
如果接收到所有客户机的同步请求, 服务器发送同步请求响应, 通过服务 器的分布式消息接口发送给客户机的分布式消息接口;
客户机接受同步请求响应。
21、 一种支持大规模分布式对等网络仿真系统进行仿真时分布式消息处理 的方法, 其特征在于, 所述方法包括:
根据消息类型对消息进行封装;
将该消息加入该套接字连接会话的发送列表;
套接字连接会话与其它机器建立套接字连接, 利用该套接字发送消息。
22、 如权利要求 21所述的方法, 其特征在于, 封装后的消息包含了目的域 的消息, 分布式消息接口根据消息的目的域匹配相应的套接字连接会话, 将该 消息加入该套接字连接会话的发送列表。
PCT/CN2009/072000 2008-06-20 2009-05-26 支持大规模的分布式p2p仿真系统及实现方法和装置 WO2009152721A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN200810067957.2 2008-06-20
CN 200810067957 CN101610275B (zh) 2008-06-20 2008-06-20 支持大规模的分布式p2p仿真系统及实现方法和装置

Publications (1)

Publication Number Publication Date
WO2009152721A1 true WO2009152721A1 (zh) 2009-12-23

Family

ID=41433685

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2009/072000 WO2009152721A1 (zh) 2008-06-20 2009-05-26 支持大规模的分布式p2p仿真系统及实现方法和装置

Country Status (2)

Country Link
CN (1) CN101610275B (zh)
WO (1) WO2009152721A1 (zh)

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104518896A (zh) * 2013-09-30 2015-04-15 中国电信股份有限公司 基于内部网关协议路由介数的网络脆弱性分析方法和装置
CN104518893A (zh) * 2013-09-29 2015-04-15 中国电信股份有限公司 大型ip网络igp拓扑中关键节点链路定位方法和装置
CN111770521A (zh) * 2019-09-17 2020-10-13 上海森首科技股份有限公司 一种具有时钟同步及计算功能的无线基站
CN112558903A (zh) * 2020-12-09 2021-03-26 北京仿真中心 一种基于组件的分布式仿真模型显控系统和交互方法
CN114638184A (zh) * 2022-05-23 2022-06-17 南昌大学 门级电路的仿真方法、系统、存储介质及设备
CN114827220A (zh) * 2022-04-15 2022-07-29 武汉光庭信息技术股份有限公司 一种座舱域应用仿真平台

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101841531B (zh) * 2010-03-16 2013-04-03 中国科学院计算技术研究所 Cdn-p2p混合网络的模拟方法和系统
CN102122254A (zh) * 2011-02-25 2011-07-13 南京大学 一种基于逻辑时钟的智能空间感知方法

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1780290A (zh) * 2004-11-23 2006-05-31 北京航空航天大学 对等结构的分布交互仿真运行系统实现方法

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1780290A (zh) * 2004-11-23 2006-05-31 北京航空航天大学 对等结构的分布交互仿真运行系统实现方法

Non-Patent Citations (4)

* Cited by examiner, † Cited by third party
Title
"11th IEEE Symposium on Distributed Simulation and Real-Time Applications", 31 December 2007, article ADNANE CABANI ET AL.: "Distributed Multiagent Simulation on P2P Architecture", pages: 76 - 79 *
"Performance, Computing and Communications Conference, 2008. IPCCC 2008. IEEE International", 9 December 2008, article GUANGYU SHI ET AL.: "A High Scalability P2P Simulation Framework with Measured Realistic Network Layer Support", pages: 311 - 318 *
LECHANG CHENG ET AL.: "P2PNET: A SIMULATION ARCHITECTURE FOR LARGE-SCALE P2P SYSTEMS", NEW TECHNOLOGIES, MOBILITY AND SECURITY, 13 November 2007 (2007-11-13), pages 567 - 571 *
WU CHUNJIANG: "Research and realization of distributed P2P simulation technology", MASTER DISSERTATION, 17 March 2009 (2009-03-17), pages 31 - 97 *

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104518893A (zh) * 2013-09-29 2015-04-15 中国电信股份有限公司 大型ip网络igp拓扑中关键节点链路定位方法和装置
CN104518896A (zh) * 2013-09-30 2015-04-15 中国电信股份有限公司 基于内部网关协议路由介数的网络脆弱性分析方法和装置
CN111770521A (zh) * 2019-09-17 2020-10-13 上海森首科技股份有限公司 一种具有时钟同步及计算功能的无线基站
CN112558903A (zh) * 2020-12-09 2021-03-26 北京仿真中心 一种基于组件的分布式仿真模型显控系统和交互方法
CN112558903B (zh) * 2020-12-09 2023-07-28 北京仿真中心 一种基于组件的分布式仿真模型显控系统和交互方法
CN114827220A (zh) * 2022-04-15 2022-07-29 武汉光庭信息技术股份有限公司 一种座舱域应用仿真平台
CN114638184A (zh) * 2022-05-23 2022-06-17 南昌大学 门级电路的仿真方法、系统、存储介质及设备

Also Published As

Publication number Publication date
CN101610275B (zh) 2012-04-04
CN101610275A (zh) 2009-12-23

Similar Documents

Publication Publication Date Title
WO2009152721A1 (zh) 支持大规模的分布式p2p仿真系统及实现方法和装置
Baumgart et al. OverSim: A flexible overlay network simulation framework
Kobo et al. Fragmentation-based distributed control system for software-defined wireless sensor networks
García et al. Planetsim: A new overlay network simulation framework
Conti et al. A cross-layer optimization of gnutella for mobile ad hoc networks
Baumgart et al. OverSim: A scalable and flexible overlay framework for simulation and real network applications
CN105162704B (zh) Overlay网络中组播复制的方法及装置
CN111698164B (zh) 虚拟机的网络路由方法、装置和管理服务器
Gray et al. Simulation framework for distributed SDN-controller architectures in OMNeT++
Uddin et al. Performance analysis of SDN based firewalls: POX vs. ODL
Bedhief et al. From evaluating to enabling sdn for the internet of things
CN103297861B (zh) 一种基于PeerSim的P2P视频点播仿真系统
CN102752173B (zh) 支持大规模复杂dtn网络的分布式仿真系统和仿真方法
US20190190813A1 (en) Method for Synchronizing Topology Information in SFC Network, and Routing Network Element
Gao et al. Congestion-aware multicast plug-in for an SDN network operating system
Ripeanu et al. In search of simplicity: a self‐organizing group communication overlay
Luk et al. RRG: redundancy reduced gossip protocol for real-time N-to-N dynamic group communication
Cramer et al. Bootstrapping chord in ad hoc networks not going anywhere for a while
Rehena et al. SPIN implementation in TinyOS environment using nesC
San Ting et al. A generic peer-to-peer network simulator
Ali et al. Simulation of P2P overlays over MANETs: impediments and proposed solution
CN112769698B (zh) 一种路由实现方法和装置
US20190007277A1 (en) Large network simulator for device characterization
Baumgart et al. Realistic underlays for overlay simulation
CN104754033B (zh) 在ndn下基于双向管道方式实现虚拟机在线迁移的方法

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 09765360

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 09765360

Country of ref document: EP

Kind code of ref document: A1