Forum > Networking and Web Programming

Basic Data Exchange over home network

<< < (2/3) > >>

AlanTheBeast:

--- Quote from: PierceNg on May 10, 2021, 03:58:17 am ---MQTT https://mqtt.org/ is designed for IoT networking.

--- End quote ---

Thanks!


--- Quote from: MarkMLl on May 10, 2021, 09:31:49 am ---In that case either follow @PierceNg and use whatever you can find available, or stick to UDP which is a very thin wrapper over IP which is a very thin wrapper over Ethernet

--- End quote ---

Thanks!

Probably get to this on Friday.

MarkMLl:
The problem with TCP- and I note that MQTT uses it- is that while the trivial protocol isn't too bad in practice it relies on a very large number of "options". There is truly vast scope for error, to the extent that between its inception in the 1970s and (say) 2010 not just some but /most/ implementations had bugs that could be exploited for intrusion or a (D)DoS.

Saying that it's for strictly local use so it doesn't have to be robust is, as I'm quite sure you're aware, no defence.

I don't know what would be involved in an "SCTP-lite", i.e. a minimal implementation for something like Ultibo, but it might be worth reviewing.

Later: sniffing around for "SCTP-Lite", https://www.pdl.cmu.edu/mailinglists/ips/mail/msg03648.html discusses the addition of framing on top of TCP, but this would obviously assume all the baggage of TCP. There's obviously been no movement on that in the intervening 19 (!) years, but that's not to say that there isn't a need for it.

So what have I got against using TCT where it's not needed? These for a start:

https://lcamtuf.coredump.cx/oldtcp/tcpseq.html
https://lcamtuf.coredump.cx/newtcp/

/If/ I had time and incentive to look at this (which I don't), I think I'd set up MQTT on two PCs using SCTP and then investigate what parts of the protocol were actually needed. But https://www.uni-due.de/~be0001/sctplib/index.html or http://www.sctp.de/sctp-download.html would probably be a good start.

MarkMLl

AlanTheBeast:

--- Quote from: MarkMLl on May 10, 2021, 10:29:47 pm ---Saying that it's for strictly local use so it doesn't have to be robust is, as I'm quite sure you're aware, no defence.


--- End quote ---

Not sure what you're alluding to, but what I am doing is a project where I need some very basic communication between some Pi's and my computer.  This is not release code, but tooling for my own needs.  For data 'robustness' I will indeed be implementing a basic checksum such as Fletcher and keeping the blocks small (256 byte or so) with a mechanism to signal bad blocks back to the sender.  Not sure if I'll throw block serial numbering and recovery on top of that.  The files I'll be transporting are pretty small generally.

I could do something basic where the sender sends an arbitrary number of blocks, say 10 and not send anymore until it receives a 'pass' for a block by seq number.  If it receives a pass, then send a new block; if it receives a fail, then send a replacement for the block that failed.  If a timeout expires, then abandon the transfer.

Or, given that the file sizes will be pretty small (several MB at most), just 1 block at a time, repeating blocks if failed and a general timeout.

MarkMLl:

--- Quote from: AlanTheBeast on May 15, 2021, 01:54:43 pm ---
--- Quote from: MarkMLl on May 10, 2021, 10:29:47 pm ---Saying that it's for strictly local use so it doesn't have to be robust is, as I'm quite sure you're aware, no defence.

--- End quote ---
Not sure what you're alluding to, but what I am doing is a project where I need some very basic communication between some Pi's and my computer.  This is not release code, but tooling for my own needs.

--- End quote ---

Come on old chap. You've been knocking around industry for long enough to know that roughly 50% of the software (and much hardware) in circulation is stuff knocked together on those terms, which somebody (else) has then pressed into service where it's publicly visible.

https://www.theregister.com/2020/04/27/who_me/

MarkMLl

AlanTheBeast:

--- Quote from: PierceNg on May 10, 2021, 03:58:17 am ---
--- Quote from: AlanTheBeast on May 09, 2021, 08:18:15 pm ---I have a RPi4 project using Ultibo RTL (no OS).
I'd like a bare bones ethernet solution where my Mac can send/receive arbitrary data from the Pi and v-v.  (I'd be writing the code for each machine). 

--- End quote ---

MQTT https://mqtt.org/ is designed for IoT networking. Here's an implementation for Ultibo: https://github.com/pjde/ultibo-mqtt. Search the forum for threads of MQTT for FPC / Lazarus on the usual 'regular' operating systems.

--- End quote ---

In the end that's way over the top of what I want to do.

I really need something very basic on the Mac end to do UDP in Free Pascal.  I'll implement what I need under that.

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version