Networking & IoT · Interview question

What is NAT and why does it shape IoT device architecture?

A strong answer

NAT (Network Address Translation) lets many devices on a private network share a single public IP address: the router rewrites the source IP and port of outbound packets to its own public IP and a unique port, records the mapping, and reverses the translation on the replies so they reach the right internal device. It exists primarily because IPv4 public addresses are scarce. The crucial consequence for IoT is directionality: a device behind NAT has only a private address with no public reachability, so an external server cannot initiate a connection to it, there's no inbound mapping until the device creates one. Therefore IoT devices are designed to dial out: the device opens an outbound connection to a public cloud server or message broker and keeps it alive, and all communication (commands from the cloud, telemetry from the device) flows over that device-initiated connection. This is exactly why MQTT and similar IoT protocols use a broker the device connects to, rather than a model where the cloud connects in. Workarounds for true inbound reach exist (port forwarding, hole punching, VPNs, IPv6 which removes the need for NAT), but the dominant pattern is outbound-and-keep-open precisely because of NAT.

What a weak answer sounds like

You know the answer. Do you know what gets you dinged?

Pro breaks down the answer most candidates actually give to this question — and the specific reason an interviewer marks it down. It’s the difference between sounding correct and sounding senior, on all 472 questions.

From the lesson

IP Addressing

How a packet finds a device: IPv4/IPv6 addresses split into network and host by the subnet mask, the same-subnet-vs-gateway decision, plus DHCP, NAT, and why IoT devices dial out.

More IP Addressing questions

Browse all 472 interview questions
What is NAT and why does it shape IoT device architecture? | EmbeddedPrep.io