sttp / Specification

STTP Specification and Related Documentation
MIT License
9 stars 3 forks source link

TCP/UDP/TCP_UDP - Which ones? #1

Open StevenChisholm opened 7 years ago

StevenChisholm commented 7 years ago

I'd like to open a discussion on which protocols sttp should use. This seems like a fundamental area of discussion that we need to address and can greatly complicate the protocol and hinder adoption. The more complicated the protocol, the greater opportunity for bugs. And if we have to reinvent the features of TCP, I personally believe this project is doomed for failure.

I'm going to go ahead and voice my opinion. I believe this protocol should be TCP only. The only reason I can think of to implement UDP is for security purposes. This would be a unidirectional path from a higher security level to a lower one. It would also not be able to benefit from many of the features we'd include in the protocol. So if we want UDP, I'd recommend we write a completely separate protocol document rather than fill our document with (If UDP is used, then this, otherwise this).

While TCP has latency and bandwidth issues in C37.118, I believe these issues are far less prevalent when moving from a data concentrator to data concentrator level (which is probably the lowest level that sttp will reside).

Please comment as there are probably areas I'm not considering.

StevenChisholm commented 7 years ago

Note: A UDP data stream cannot take advantage of stateful compression. This means that a UDP stream will require at least 5 times more bandwidth. So a data stream consuming 4 mbit will now require 20 mbit to unreliably transmit data.

StevenChisholm commented 7 years ago

Update: I'll post what we're planning to move forward with right now. Given the objectives of the project (Publish/Subscribe; Request/Response; Encryption; Compression) it's clear that we need to build STTP on a reliable bi-directional transport protocol. STTP is an Application Layer protocol and not a Transport Protocol. Therefore, it really doesn't matter what transport protocol is used, but STTP will require the following:

The protocol won't require TCP as a transport protocol, so if UDP is desired, another protocol layer will need to be added on top of UDP to isolate STTP from these transport related complexities.

*We are considering the option of flagging certain messages as unreliable. Therefore if someone desires to split transport protocol layer, they can.

StevenChisholm commented 7 years ago

It appears that we will be able to support UDP unidirectional multicast with encryption. This will be detailed in an appendix after we are successful at coding the protocol. I don't anticipate initially supporting acknowledgements and re-transmitting data, but we'll cross that bridge when we get there.