1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 2021 <2022> 2023 2024 2025 | Index | 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 2021 <2022> 2023 2024 2025 |
<== Date ==> | <== Thread ==> |
---|
Subject: | Re: EPICS on ESP32 |
From: | Joel Sherrill via Tech-talk <tech-talk at aps.anl.gov> |
To: | Eric Norum <ericnorum at gmail.com> |
Cc: | "tech-talk at aps.anl.gov" <tech-talk at aps.anl.gov> |
Date: | Wed, 31 Aug 2022 13:09:57 -0500 |
The most important reason that UDP is more appropriate for basic command/reply operations is that it puts you in control of the retries. You can keep track of how many times they are required and you can tune the retry timeouts as you wish. For example, many of my ’network attached device’ UDP ASYN drivers work as follows:
- Send a command
- if a reply is not received in 100 ms then send the command again
- if a reply is not received in 1 second then send the command again — after 5 attempts report an error
Some other UDP advantages:
- UDP is much simpler — direct implementation in FPGA firmware is quite feasible.
- UDP has lower network overhead — in the absence of errors the only packets on the wire are the commands and replies.
- UDP is connectionless — there’s no overhead in setting up communication nor the possibility of dangling resources on unexpected loss of an IOC (e.g. the IOC host crashes without closing all the TCP streams).
Although TCP is ‘reliable’ you still have to check the success of every I/O request so there’s really not much programming overhead needed when using UDP.If you’re transferring very large amounts of data then TCP is likely easier to implement to provide high bandwidth, but in pretty much all other cases I’d recommend UDP.On Aug 31, 2022, at 12:50 AM, Florian Feldbauer <florian at ep1.ruhr-uni-bochum.de> wrote:Thanks for all the feedback,
I have to admit I did not properly checked the memory of the chip compared to the requirements for an IOC.
And I also might have mixed up RTEMS with RTOS 😅I guess I either stay with my current design (TCP socket on the module using StreamDevice + Asyn for communication with an external IOC) or I'll switch to ModbusTCP.
Btw Eric, why do you think UDP would be more appropriate than TCP?
Cheers,
Florian