Check: Port Numbers and NAT for IoT

Knowledge check · self-test
Check: Port Numbers and NAT for IoT
### Predict the NAT Table Event {.depth-l0} Inbound port forwarding is a separate NAT rule. It creates a standing path toward a named private service rather than waiting for that service to open an outbound flow. Exposing an IoT service this way also needs firewall and authentication decisions. Now let the second sensor contact a different broker. Even if both outward flows use public port 61002 at different times, destination address, destination port, protocol, and session timing still distinguish their NAT state. A capture that records only the public source port is incomplete. Keep-alive timing must sit below the shortest idle timeout on the real path. If a router drops MQTT state after 60 seconds and the sensor stays silent for 90 seconds, the next broker packet may meet no NAT mapping. A 45-second keep-alive may preserve the path, but only a test on that router can confirm its timeout and battery cost. - **Predict:** The first sensor reconnects and receives public port 62010. Can an old reply to 61001 reach the new socket? **Check:** Not through the new mapping; the translated port belongs to the earlier NAT state. - **Predict:** A firewall permits outbound MQTT but blocks inbound new connections. Can replies on the established flow still return? **Check:** Usually yes, because the NAT and firewall state tie those replies to the sensor’s outbound conversation.
### Predict the NAT Table Event {.depth-l0} Inbound port forwarding is a separate NAT rule. It creates a standing path toward a named private service rather than waiting for that service to open an outbound flow. Exposing an IoT service this way also needs firewall and authentication decisions. Now let the second sensor contact a different broker. Even if both outward flows use public port 61002 at different times, destination address, destination port, protocol, and session timing still distinguish their NAT state. A capture that records only the public source port is incomplete. Keep-alive timing must sit below the shortest idle timeout on the real path. If a router drops MQTT state after 60 seconds and the sensor stays silent for 90 seconds, the next broker packet may meet no NAT mapping. A 45-second keep-alive may preserve the path, but only a test on that router can confirm its timeout and battery cost. - **Predict:** The first sensor reconnects and receives public port 62010. Can an old reply to 61001 reach the new socket? **Check:** Not through the new mapping; the translated port belongs to the earlier NAT state. - **Predict:** A firewall permits outbound MQTT but blocks inbound new connections. Can replies on the established flow still return? **Check:** Usually yes, because the NAT and firewall state tie those replies to the sensor’s outbound conversation.
Back to Port Numbers and NAT for IoT: Choose and Diagnose the Return Path