| Along with the development of network transmission devices, video-on-demand (VOD) becomes more and more populer on the Internet.Former VOD systems are based on Client/Server (C/S) concentrated architecture which not only limited the capability of VOD system and network bandwidth, but also make the VOD system burdened too heavy which leed to the bad user experience. The peer-to-peer (P2P) technology is different from C/S mode, each node in the net is peer to peer. Each node acts as both server and client to provide upload and regale on download. Resorts to its expansibility and high resilience to failure and haleness, the technology of P2P has developed swiftly and violently, and gradually applies to the field of video frequency technology.This thesis is based on the project of PPCDN. PPCDN is a supporting system of IPv6 stream distribution application system as well as a content distribution system based on P2P technology, sponsored by research of the IPv6 based next generation Internet key technology and industrialization promotion of Beijing Municipal Science and Technology Commission. The author founds a static mathematics model of the VOD process of PPCDN base on probability theory, and then studys the relationship between server's load and the length of buffer that each peer stores.This paper proposed a generic architecture of P2P simulator after examining the fundamental P2P theory and other P2P simulator, in order to analyse the VOD protocol and to optimize the system. Base on the generic simulator, a VOD protocol simulator is designed and implemented. Finally the protocol optimization work is accomplished with the help of VOD simulator.The VOD simulator is developed in C++ language with the modularization idea. It consists of four parts: the discrete event-driven module, the topology module, the protocol module and the input-output module. The discrete event-driven module is the key part of the simulator. It sorts and schedules all kinds of events effectively and all other modules are running on it. The topology module uses the GT-ITM network topology, and drives the whole system. The protocol module simulates the VOD protocol. The input-output module reads the configure files and outputs the outcomes. The author has optimized the PPCDN system with the support of the VOD simulator. Firstly, the author has proved the importance of the punishment and incentive mechanism to the VOD system and proposed some improvement of its Unchoke Algorithm. |