Skip to content

Commit 9e0a167

Browse files
Update README.md
1 parent 19f4839 commit 9e0a167

File tree

1 file changed

+24
-42
lines changed

1 file changed

+24
-42
lines changed

README.md

Lines changed: 24 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,16 @@
11
# Standard Network Library
2-
High Performance, easy to use network library supporting 16k+ concurrent clients.
2+
High Performance, easy to use network library supporting 16k+ concurrent clients on all provided topologies.
3+
Designed for distributed realtime concurrent applications over LAN or Internet.
34
</br>Provides infrastructure for high throughput message passing, P2P, Nat Traversal, Reliable Udp.
4-
</br>This repository consist of main core assembly and several serialization spesific implementation assemblies.
5+
</br>This repository consist of main core assembly and several serialization spesific sub assemblies.
56
## Core Network Library
6-
Network Library, which is the core of entire network library. It has all the logic associated with the network system and sub systems, starting from raw bytes to abstractions such as P2P lobbies. It provides generic templates to be used with any serialization methodology.
7+
Network Library, which is the core of entire network library. Includes all logic associated with the network systems, starting from raw bytes to abstractions such as P2P lobbies. It provides generic templates to be used with any type of serialization.
78

89
### Core Components
9-
Plug&Play high performance models, working with raw bytes.
10+
Plug&Play mature high performance models, working with raw bytes. Also used as base for complex abstracted models.
1011
- ```Tcp Server/Client model``` with dynamic buffering and queueing sub systems, bytes can come fragmented like regular sockets.
1112
- ```Tcp Byte Message Server/Client``` where bytes are sent with 4 byte lenght header. It ensure atomic message delivery without fragmentation.
12-
- ```Udp Server/Client``` standard udp with optimised for performance.
13+
- ```Udp Server/Client``` udp system where a server is emulated with optimised for performance.
1314
- ```Reliable Udp Client/Server``` where modern TCP protocol is implemented over Udp.
1415
- Secure variants of all of the above(SSL with TLS for Tcp, Symetric Key AES for Udp).
1516

@@ -20,24 +21,26 @@ Involves generic models which can work with any serialization protocol.
2021
- ```P2P Relay Client/Server``` where Peers(Clients) discover each other via Relay server, can use Udp/Rudp/Tcp to communicate. Supports Udp Holepunch.
2122
- ```P2P Room/Lobby Server/Client``` extention of Relay model where peers can define a room, similar to game matchmaking servers.
2223

23-
### Low Level Features
24+
### Internal Features
25+
#### Message Buffering/Queueing
26+
- Tcp models a buffering/queueing system is implemented. This system is activated only during high load.
27+
In a nutsell, if the socket is busy sending, next messages are buffered/queued and stiched together. When the socket becomes available again, sent as batch. Its like Naggle, but without sacrificing the fast sends on moderate/low traffic.
28+
- This improves the throughput of small messages quite significantly (1000 fold compared to naive sends) as shown on benchmarks.
2429

2530
#### Advanced Memory Management
2631
- Library implements "Shared Thread Local Memory Pool", where all byte arrays and the stream backing buffers are rented from. Memory is weak referenced. Pool allows minimum number GC cycles and automatically trims on system memory pressure.
2732
- As an example, RelayServer can relay 21 Gigabyte/s Udp traffic using 36 mb process memory with 0 GC Collects.
28-
29-
#### Message Buffering
30-
- Tcp models a buffering/queueing system is implemented. This system is activated only during high load.
31-
In a nutsell, if the socket is busy sending, next messages are collected and stiched together and sent as batch when the socket becomes available again. Its like Naggle, but without sacrificing the fast sends on moderate traffic.
32-
- This improves the throughput of small messages quite significantly as shown on benchmarks.
3333

34-
Library is tested with as many clients as OS(Windows) supports (around 16k dynamic ports). Data reliability(includung RUDP) is tested over the internet extensively.
35-
Nat Traversal Udp holepunching is also tested over the internet with great success.
34+
#### Build In Serialization
35+
- Library provides high performance binary encoders for primitivish* types and employs static srialization for internal message types and carrier classes with smallest possible byte size.
3636

37-
Note: Libary has unsafe code and stack allocations. But these parts are well tested and not subject to change.
37+
Library is tested with as many clients as OS(Windows) supports (around 16k dynamic ports). Data reliability includung RUDP is tested over the internet extensively.
38+
Nat Traversal Udp holepunching is also tested over the internet with success.
39+
40+
Note: Libary has unsafe code and stack allocations. Unsafe sections are well tested and not subject to change.
3841

3942
## Sub Assemblies
40-
Generic models from main assembly are implemented with the spesific serializers.
43+
Generic models from main assembly are implemented with the spesific serializers. All method signatures and usage are identical.
4144
It includes:
4245
- Protobuf-Net
4346
- MessagePack
@@ -77,9 +80,9 @@ Infinite Echo benchmarks are done by sending set of messages to server and getti
7780
|Mumber Of Clients|Protobuf Echo per Second|Secure Protobuf Echo per Second|
7881
|---|---|---|
7982
|100|9,440,000|8,050,000|
80-
|1000|8,380,000|7,980,000|
81-
|5000|8,360,000|7,950,000|
82-
|10000|8,340,000|7,890,000|
83+
|1000|8,780,000|7,480,000|
84+
|5000|8,360,000|7,390,000|
85+
|10000|8,340,000|7,350,000|
8386

8487
#### Note
8588
This benchmarks is only sending message envelope with raw byte payload. For serialization spesific performance please refer to:
@@ -186,30 +189,9 @@ Declare your type:
186189
```
187190
## MessageProtocol Server/Client
188191

189-
Message protocol is something I came up with to wrap all types of messages with a standard header.
190-
It is an extention of Pure Message Server/Client. Difference here is we have ```MessageEnvelope``` As a Carrier/Metadata/Header class.
191-
```MessageEnvelope``` is serialized Statically, independently of serialization protocol.
192-
As for the reason for it, please refer the document [SerializationBenchmarks](SerializationBenchmarks.md)
193-
194-
You can define a header, key-value pairs, as metadata and information about the payload.
195-
Most importantly the Payload propery of the envelope carries the Inner message bytes.
196-
```UnpackPayload<T>()``` will deserialize the message on your type from the payload bytes.
197-
198-
It can also be raw bytes coming from some source (i.e. jpg image). Which you can set it by MessageEnvelope.SetPayload() method on the sender side.
199-
You cant send both raw bytes and an serializable inner message with same envelope, Inner message will overwrite your payload.
200-
This bytes are volatile (will be overwitten once code leaves the stack) unless you call LockBytes() method or copy manually. (important if you store it somewhere)
201-
202-
203-
Its a simple implementation of a generic class from Standard Library.
204-
```c#
205-
public class SecureProtoMessageServer : GenericSecureMessageServerWrapper<ProtoSerializer>
206-
{
207-
public SecureProtoMessageServer(int port, X509Certificate2 cerificate) : base(port, cerificate)
208-
{
209-
}
210-
}
211-
```
212-
### Usage
192+
Message protocol is implemented for wrapping all dynamic message types with a standard header.
193+
Please refer to [MessageProtocol Documentation](MessageProtocol.md) for detailed explanation.
194+
213195
You can declare your payload types, which any type that is serializable with protobuf.
214196
```c#
215197
[ProtoContract]

0 commit comments

Comments
 (0)