ShadowKatStudios / OC-Minitel

Easy-to-implement networking protocol for OpenComputers
https://oc.shadowkat.net/minitel/
Mozilla Public License 2.0
41 stars 12 forks source link

Data length seems to be limited to 255 bytes #21

Closed ghost closed 5 years ago

ghost commented 5 years ago

My reading of the specification says that the data is a string, and that strings are at most 255 bytes in length. This seems very restrictive if bulk transfer is needed (e.g. file transfer), since anything bigger than 255 bytes has to be broken into multiple packets and recombined at the other end.

Either the data field should be expanded, a standard protocol for transfer of data too large to fit in the field written, or preferably both.

XeonSquared commented 5 years ago

That is not the case, fortunately. The data portion has a configurable max size in the current implementations but isn't strictly limited by the standard:

Strings in Minitel packets, with the exception of the data portion, have the following restrictions:

  • Minimum length of 1 character
  • Maximum length of 255 characters
  • ASCII 0 through 31 are not allowed
  • ASCII 127 is not allowed
  • ASCII 128 and above (ie unicode) behavior is undefined and should be used with caution.
ghost commented 5 years ago

Ah. I missed that when I read the spec; not sure how. However, I would still like a standard bulk transfer protocol, since things like file transfer might need to move very large amounts of data.

XeonSquared commented 5 years ago

Layer 4 exists pretty much to do that; due to the explicit acknowledgement packets you can have guaranteed ordering if you wait for the acknowledgement of the previous packet.

Admittedly it's not ideal, but it's stupidly simple allowing for implementations to also be stupidly simple, which is one of the main goals.

ghost commented 5 years ago

That's a good point. Perhaps a large-message framing system on top of L5? First message with number of messages, then that many messages following should be pieced together into the final result.

XeonSquared commented 5 years ago

I've been considering and discussing a parallel protocol to the standard layer 5 protocol for higher efficiency between hosts that support it, though implementation details are ... in progress. The trick would be allowing smarter negotiation of protocols, but that would require changing the standards slightly.

XeonSquared commented 5 years ago

Going to point this to #12 instead given it's effectively what this turned into - a better stream protocol for the sake of performance.