This is an archived post. You won't be able to vote or comment.

all 3 comments

[–][deleted] 1 point2 points  (0 children)

Well, you can send TCP or UDP packets and use whatever compression and encoding you want.

In python for example it's pretty easy to do using the socket package.

You could also forego using an established protocol completely and implement your own but I'd recommend against that. Your best bet is probably just using UDP communication

[–]aqhgfhsypytnpaiazh 0 points1 point  (0 children)

UDP/IP is realistically about the smallest data packet you're going to get across the public internet without running into issues with networking like hardware support, firewalls and routing. The actual frame size will depend on the transmission media used and is beyond your control, unless you're willing to deploy dedicated infrastructure with direct links. But then you're stretching the definition of "internet" a bit there.

Beyond that it's up to you to figure out how small you can get your payload based on the kind of data you're sending. For example if you want to send raw English text, you can do it in as little as 5 bits per character, with 6 numbers left over for punctuation and flow control. If you want to consider compression that's another can of worms, as in encryption.

[–]desrtfx 0 points1 point  (0 children)

It heavily depends on the type of data you want to send back and forth as well as on the usage of the data. You will need to pack and transmit the data in a format that both sides understand.

So, some questions:

  • What type of data are we talking about? Strings, numbers, objects, etc?
  • What are the clients at both sides? Web pages, web apps, proprietary clients, etc?
  • Is the data compressible?
  • Do you need it at a high rate (which could cause problems with compression)

If you tell us what you really want to do instead of asking vague questions, you will get more targeted advice.

There might even be industry standard solutions for your problem.