ProtoN (network protocol)
Posted: Tue Mar 31, 2020 10:55 pm
Hi. Didn't posted much stuff here for a long time. Well this one is large enough.
This is my new UDP-based protocol. I had an old need to create something like this, going to use it in some project later (even in some online game, I'm expecting it will be fine for this too).
The concept is something like "TCP-over-UDP" and a bit similar to Google's QUIC protocol (for example, there are others of such type).
Advantages comparing to raw TCP:
- it should be faster/more responsible
- it should be more fault-tolerant (provide faster reaction in cases of packet lost)
- it can work with much lower traffic overhead (TCP overhead is 2.8% minimum, often much higher)
- it is UDP-based, this brings lesser problems with NAT or firewall
Comparing to raw UDP:
- it takes care of packet loss
- provides retransmission mechanism
- provides connection state control/timeouts/keepalive
- all such things that UDP lacks by design
General:
- it's usage is much more reliable than any raw protocol
- it can be customized to fit different tasks (for example, large "session size" is very good to transfer files)
Disadvantages:
- it is software-level protocol, though it is optimized a bit, it anyway consumes much more resources than raw TCP or UDP
- for now I didn't test it in any real project and conditions, only synthetic tests
- there is no encryption at protocol layer. I'm planning RSA+AES, but for now all goes to application responsibility
Implementation:
- a standalone code module
Download:
https://github.com/Lunasole/ProtoN
(oh at last I've started to use modules in my purebasic codes...)
That's all^^ Look at this stuff if interesting.
This is my new UDP-based protocol. I had an old need to create something like this, going to use it in some project later (even in some online game, I'm expecting it will be fine for this too).
The concept is something like "TCP-over-UDP" and a bit similar to Google's QUIC protocol (for example, there are others of such type).
Advantages comparing to raw TCP:
- it should be faster/more responsible
- it should be more fault-tolerant (provide faster reaction in cases of packet lost)
- it can work with much lower traffic overhead (TCP overhead is 2.8% minimum, often much higher)
- it is UDP-based, this brings lesser problems with NAT or firewall
Comparing to raw UDP:
- it takes care of packet loss
- provides retransmission mechanism
- provides connection state control/timeouts/keepalive
- all such things that UDP lacks by design
General:
- it's usage is much more reliable than any raw protocol
- it can be customized to fit different tasks (for example, large "session size" is very good to transfer files)
Disadvantages:
- it is software-level protocol, though it is optimized a bit, it anyway consumes much more resources than raw TCP or UDP
- for now I didn't test it in any real project and conditions, only synthetic tests
- there is no encryption at protocol layer. I'm planning RSA+AES, but for now all goes to application responsibility
Implementation:
- a standalone code module
Download:
https://github.com/Lunasole/ProtoN
(oh at last I've started to use modules in my purebasic codes...)
That's all^^ Look at this stuff if interesting.