Font Size: a A A

Design And Realization Of A Peer To Peer Net Communication System

Posted on:2011-11-23Degree:MasterType:Thesis
Country:ChinaCandidate:X S LiuFull Text:PDF
GTID:2178360305454599Subject:Software engineering
Abstract/Summary:PDF Full Text Request
Point to Point Technology (peer-to-peer, referred to as P2P) networking technology,known as peering. It is widely applied in the file-sharing, real-time media operations and other fields. Compared with a client - server mode with fixed server, P2P networks take full advantage of all the client-side resources, including bandwidth, storage space and computing power. As system requests increase, the entire capacity of the system continues to grow. At the same time, P2P network distribution increases the system robustness, the system will not collapse at a single point, which is of great significance for the application running in an unstable terminalThis paper aims to design P2P network transmission systems Software Development Kit (P2PNetLib) to meet the development needs of P2P network model. The kit can provide support for P2P application development, reduce application development costs and improving development efficiency. To this end development kit designed to the following features:First, the network communication module can initiate and establish a network connection, being able to send and receive data. Development Kit use Socket technology, a popular network technology currently. Since the majority of packaging Socket network communication protocol, and is supported by the majority of the mainstream operating systems, which makes development kit (P2PNetLib) has a strong ability to transplant.Second, development kit also provides session management capabilities. To use development kits session management, applications can be easily customized for specific applications of the session operations, rather than concerned about the session establishment, withdrawal and management of specific work, thereby enhancing the efficiency of the development. In addition, the development kit also has a multi-session concurrent ability to support multiple sessions simultaneously.Third, for different applications, network transmission of the object may include data, voice, images, and many other types of instruction, which may also need to address the encryption, compression and so on, the corresponding development kits provide a means to address these semantic representation needs. It is defined in the development of the network packet how to transfer object (CNetObjet) used for packaging a variety of data and methods of operation. The network transfer object (CNetObjet) is actually a data set, data set contains a variety of basic data types, through these data types'combinations to build different data objects. In addition, through C + + overloading technology, development kits also achieved a network transfer object (CNetObjet) on the network "flow" type of input and output functions. Through this mechanism, application systems operate object (CNetObjet) and network flow (CNetStream) in network, shielding the data received, transferred and other details of network operations, reducing the complexity of development, increasing development efficiency.Fourth, development kit also provides a mechanism to enable conversation and coordination between the conversation thread and the UI thread. Development Kit for the worker threads to defend the independence of the message queue, such as conversation thread to send a message to the UI thread, UI thread is the first to copy this message to its own message queue and message loop in subsequent processing, which greatly reduces the deadlock probability.Fifth, to facilitate the application to use, development package is eventually provided to the applications in dynamic link libraries and header files (. H).To test the performance of point-point Development Kit (P2PNetLib), a test system is also designed based on the development kit (P2PNetLib). The test system transmits video, music, large files (these files are usually a few megabytes) on the LAN. This application system requires a few tests to achieve the following objectives: First, a faster transfer speed; second, the ability to be able to Resume after interruption, that is, not from scratch, re-transmission (because of large file size); third, the ability to concurrent transmission, that is the ability to send and receive many files at the same timeTest system consists of UI module, session module, session management module, receiver module and error handling, listening components, etc. UI module consists of sending, receiving, receiving status display, interface components. Conversation function is the development package CNetThread by overloading the class session virtual function implementation, which is operated by the sender and the receiver logic, the logic component, controlling and driving network communications capabilities to send and receive documents through the conversation logic; session management functions is used to complete the session creation, cancellation and management functions.When application development is completed, through test it can be found that operation is stable and file transfers faster, file transfer can be stabilized from the breakpoint Resume basically achieved the goal of system development. Proof-point development kit (P2PNetLib) has a strong practicality. Development Kit shortcomings are mainly in two aspects: First, the development package, scattered on the development of a number of parameters within the packet (such as the transmission packet size, the number of concurrent reception and transmission, listen port, etc.), does not provide a uniform application of the upper interface, resulting in inconvenience in use; the second is the lack of an agreement to provide more customized support, currently only provides a virtual function by the user of the session protocol design, development package should be further on the current classification of the mainstream P2P protocol to provide packaging to the user, allowing users to set the corresponding parameters in the common P2P application development, without designing from scratch.With the popularity of the network and personal computing capabilities continue to strengthen, the distribution of computing resources, storage resources and communications resources on network are very rich, P2P-based model of the system has a very broad application prospects. "Point to Point Communication System Development Kit (P2P development kit)" P2P model for the development of application systems is supposed to provide strong support, which makes the development of P2P applications no longer concerned about the low-level details, so that developers can be more concentrated on application-related work, which has a very positive significance for the development works related.
Keywords/Search Tags:Point to point, network communication, C++, socket, multi-threading technology, overloading, file transfer
PDF Full Text Request
Related items