2

I have a big doubt that I'm not able to solve.

Basically, I want to understand how the smart device that I have in my home communicate with their servers, or better, how their servers can call its and sending commands (like turn on/off) without any type of port forwarding.

I know that if I wont to access to a device remotely I need to expose it on the network through a port forwarding on my router, but, I didn't configured anything for these devices, so, what kind of method they use?

Could someone let me know?

1
  • Hi Pasquale, can you add some examples. Otherwise we'd be guessing. If I had to guess I'd say they're using some sort of HTTPS long polling or open connections like websockets. Neither of those needs port forwarding.
    – Helmar
    Jan 10, 2019 at 18:35

1 Answer 1

5

The answer is that the device connects out to the control server and maintains this connection.

The control server then uses this connection to forward requests.

Typically messaging protocols like MQTT are used as they designed to be used over a long running connection initiated by the client.

This approach also solves the problem that the controller would need to know where device was. Given most home internet connections use dynamic IP addresses (if not even worse CGNAT) this would mean that the device would need a way to update the control server every time the external IP address changed (which it would not easily be able to determine). Port forwarding also needs either the owner to be technically capable enough to set it up, or UPnP to be enabled (which is probably a bad idea in the current security landscape). Port forwarding also limits the number of devices that can be deployed behind a given router.

Also see my answer to how smart plugs work: How do smart plugs of domotic IoT work?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.