Search code examples
network-programmingnat

Why is NAT causing problems for server running on the home network?


NAT has enjoyed widespread deployment in recent years. But NAT is not without detractors. First, one might argue that, port numbers are meant to be used for addressing processes, not for addressing hosts. This violation can indeed cause problems for servers running on the home network, since, as we have seen in Chapter 2, server processes wait for incoming requests at well-known port numbers and peers in a P2P protocol need to accept incoming connections when acting as servers.

From Kurose & Ross, Computer networking: a top down approach, 7th. p.375.


Solution

  • I don't know how much you know NAT, so I'll first give a short introduction.

    NAT, network address translation, comes from the shortage of IPV4 addresses, and it builds a safe way for home users like firewall.

    There are four types of NAT used now, full cone NAT, restricted NAT, port restricted NAT, symmetric NAT, you can google them for detail differencees.

    Let's look at what will happen when we build server behind a NAT router.

    1. If you don't do NAT traversal, then the clients can not access to server if only the server access to them first.

    2. Then if you do the NAT traversal. For some types it can work, but for others it can't.

    3. What's more, if you're successful to open the door, then all the clients/attackers can connect to the server without any check. So you lose the safe security of NAT, then you need to build it by yoursel. Then, why do you need the NAT?

    In a word, NAT causes many problems for server on the home network, and they are not needed.