Search code examples
tcparchitecturebackendiotnetwork-protocols

Multiple IOT devices communicating to a server Asynchronously via TCP


I want multiple IoT devices (Say 50) communicating to a server directly asynchronously via TCP. Assume all of them have a heartbeat pulse every 30 seconds and may drop off and reconnect at variable times.

Can anyone advice me the best way to make sure no data is dropped or blocked when multiple devices are communicating simultaneously?


Solution

  • TCP by itself ensures no data loss during the communication between a client and a server. It does that by the use of sequence numbers and ACK messages.

    Technically, before the actual data transfer happens, a TCP connection is created between the client (which can be an IoT device, or any other device) and the server. Then, the data is split into multiple packets and sent over the network through that connection. All TCP-related mechanisms like flow-control, error-detection, congestion-detection, and many others, take place once the data starts to flow.

    The wiki page for TCP is a pretty good start if you want to learn more about how it works.

    Apart from that, as long as your server has enough capacity to support the flow of requests coming from the devices, then everything should work (at least in theory).