Document version 2.5
kNet is a connection-oriented network protocol for transmitting arbitrary application-specific messages between network hosts. It is designed primarily for applications that require a method for rapid space-efficient real-time communication.
kNet consists of two major specifications. At a lower level, the Transport-level specification defines methods like:
How a session is initialized, maintained and shut down.
How data bytes are transferred between hosts.
How reliable messages, data ordering requirements and large transfers are handled.
How flow management and congestion control may be performed.
Building on top of that, the Application-level specification, along with a reference C++ implementation, offers most notably the following features:
How to describe your own application-level protocol sets and their transmission parameters.
How to model message dependencies and prioritization.
How to perform content-based late data replacement.
How to perform data serialization.
These two specifications and the reference implementation form a complete base on which to build a networking server+client application. Alternatively, only the Transport-level specification can be used, while replacing the application-level features with a different model. The implementation exposes the library that it uses internally for data serialization, but it is possible to use any other solution as well. There are plenty of choices available: boost serialization, CodeSynthesis XSD, Eet, gSOAP, MFC, Google protobuf, Qt QDataStream, s11n, Poco Serializer, Sweet Persist, tpl, xserial, yaml-cpp, or integrate your own.
This documentation was generated as a part of the C++ reference implementation of the protocol. More information can be found in the following topic pages.
The following samples demonstrate how to use the protocol library.
|SimpleChat||A simple example of client<->server message passing. |
|GroupChatServer||Implements a multi-user chat server that broadcasts messages between each participant. |
|GroupChatClient||Implements a multi-user chat client. |
|ConnectFlood||Stress tests a server by hammering it with several simultaneous connections. |
|LatencyTest||Measures the network latency between two hosts. |
|SpeedTest||Measures the network bandwidth from one host to another. |
|FileTransfer||A command-line utility to copy files from one host to another. |
|MessageCompiler||A command-line tool to generate C++ headers out of protocol message XML description files. |
|TwoStreams||Mix lossy high priority message streaming with low priority background data transfer. |
|PoorNetwork||Asserts that message ordering and reliability work in lossy and jittery network conditions. |
|SpeexVoip||Shows how to use speex to implement voice communication for multiple users. |
|TrashTalk||A client/server that floods the peer with random data. |
Downloadable prebuilt packages of the library or the samples are not yet available. The official source repository of kNet is hosted at https://bitbucket.org/clb/knet/ .