I have an IoT edge device which is currently configured as a TCP server; the device gathers and processes some data, and then passes it to the connected clients. This works as intended when the server and client(s) are on the same network.
However, the above represents only one of four possible use cases:
- Edge device and client(s) on the same network (as per above).
- Edge device connected to internet via modem/router, with client(s) on a different network.
- Edge device connected to internet via mobile phone hotspot, with client(s) on a different network.
- Edge device connected to internet via 4G dongle, with client(s) on a different network.
In case 2 above, I understand how the process in case 1 can be applied, by establishing port forwarding on the edge device's connected modem/router and using the network's public IP address. However, from my understanding, port forwarding is unavailable (for all intents and purposes) when using a mobile hotspot connection. Similarly, 4G dongle carriers don't (typically) provide a public IP address, so routing a TCP connection to the edge device server wouldn't work in this case either.
What options are available which would allow for client-server TCP connections for all four use cases? For additional context and consideration, the TCP data will also need to be secured/obfuscated. Additionally, the data is time-sensitive, so ensuring minimal delay between transmission of the data from the server and reception of the data by the client(s) is paramount.