Author Topic: How Do You Decide Which Protocol to Use in an IoT Application?  (Read 23267 times)

0 Members and 1 Guest are viewing this topic.

Offline paulca

  • Super Contributor
  • ***
  • Posts: 6554
  • Country: gb
Re: How Do You Decide Which Protocol to Use in an IoT Application?
« Reply #200 on: September 01, 2026, 11:40:40 am »
Its a good exercise though, to implement a transctional protocol over a "best effort" one like UDP.  TCP is a good reference of course as that is basically what it's for.

Its the same kind of exercise as:

Writing a synchronous protocol over an async layer.... or vice versa.
Mutating loops from while to for to "do..until" to "do..while".
Writing a filesystem in a database, writing a database in a filesystem.

They are all "69" problems.  The exercises work because they force you to turn the table around and look at it from a different direction.  Noticing they are just different "perspectives" on the same thing.  It make you correctly "hedge" on certain otherwise "blockers".  "Oh we can't do that we are async/sync" brittle boundardies etc.


EDIT:  "Mutating loops from while to for to "do..until" to "do..while"." 

This one bit me recently, pretty hard and nasty too.  I was introduced the 68k "Decrement and loop" DBRA and friends.  It's not even funny, stop laughing.  It's just not an intuitive way to write loops.  Its not bad when you accept it, but until you do it's a mind,. "Booork!"

DBRA (and peers) test if the condition is false first.  (defaults to "N" flag).  If it IS they decrement and then jump.  So it's test-postdecrement-jump.  What where they sniffing at the time.  However... as long as you remember to -1 your length, it works out fine.

I think if you simply it, it's just this:

while( index-- >= 0) ) {}

... wait...

{} do while( index-- >=0);

I think.

{} do until( index-- < 0);

Final answer.
« Last Edit: September 01, 2026, 11:56:15 am by paulca »
"What could possibly go wrong?"
Current Open Projects:  68000 Self Build computer + OS.
 

Offline EVblog1Topic starter

  • Regular Contributor
  • *
  • Posts: 145
  • Country: 00
Re: How Do You Decide Which Protocol to Use in an IoT Application?
« Reply #201 on: September 01, 2026, 01:43:13 pm »
 :-DD

Edit : Reply on #198
« Last Edit: September 01, 2026, 01:45:14 pm by EVblog1 »
 

Offline NorthGuy

  • Super Contributor
  • ***
  • Posts: 3571
  • Country: ca
Re: How Do You Decide Which Protocol to Use in an IoT Application?
« Reply #202 on: September 01, 2026, 04:10:13 pm »


That reminds me how people usually regard the biological evolution - as a peaceful process of gradual development. While in reality this is messy selection full of pain, blood, suffering, and death where only the fittest survives.

Same with TCP - packets are still tossed, many might be lost, but the protocol hides the details, so the end user doesn't see the "suffering", only the resulting success. That's a sign that the TCP protocol is working well!
 

Online abeyer

  • Frequent Contributor
  • **
  • Posts: 961
  • Country: us
Re: How Do You Decide Which Protocol to Use in an IoT Application?
« Reply #203 on: September 01, 2026, 07:21:39 pm »
While in reality this is messy selection full of pain, blood, suffering, and death where only the fittest survives.

This is particularly true when transmitting babies over low MTU links.
 
The following users thanked this post: 5U4GB


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf

 

- - -
-->