Compare with Modbuse IP Transport type TCP, how many bandwidth saved if use Transport type TCP, keep alive?
how many bandwidth saved for use Modbuse IP TCP keep alive?
Not really a Mango question, and offhand I wouldn't expect it to have an easy answer other than 'a little'. I would imagine it to depend upon the size and frequency of the requests. I would encourage you to test! I would expect more savings as the polls got faster and to some extent larger, and expect it to consume more bandwidth if the polls were very infrequent (looks like > 2 hours by default) and TCP keep alive traffic composes most of the bandwidth usage.
- This stack overflow thread is relevant: https://stackoverflow.com/questions/1480236/does-a-tcp-socket-connection-have-a-keep-alive
- The use of keepAlive as a setting is in the TcpMaster: https://github.com/infiniteautomation/modbus4j/blob/master/Modbus4J/src/com/serotonin/modbus4j/ip/tcp/TcpMaster.java
Thank you for so detail answer, phildunlap. As for polls every second, is that mean TCP keep alive will consume less bandwidth than TCP? Any figure about that? Estimated need more bandwidth of 5% or 20% like that?
That will again depend on the size of the request.
Blindly trusting the numbers from this stack overflow thread (as I'm not that deep in the TCP protocol typically): https://stackoverflow.com/questions/31378403/how-much-data-it-cost-to-set-up-a-tcp-connection
Without keep alive it would be opened and closed each poll, so 296bytes / poll. 24 * 3600 * 296 = 25574400 so maybe 25.5MB / day
But I would still encourage you to meter it if that overhead is important.