🌐 Networking Intermediate

What is NAT overload (PAT) and how does it work?

Why Interviewers Ask This

This tests whether you can apply Networking knowledge to real-world scenarios. Interviewers are looking for clarity of thought and evidence that you've encountered this in production code.

Answer

PAT (Port Address Translation), also called NAT overload or NAPT, is the most common form of NAT used in homes and businesses. It allows many private IP addresses to share a single public IP by using unique port numbers to distinguish connections. When a device (192.168.1.10) connects to a web server, the router translates the source IP to its public IP and assigns a unique source port (e.g., 54321) from the ephemeral range. The NAT table records: private IP:port → public IP:port. When the reply arrives, the router uses the destination port to look up the NAT table entry and forward to the correct internal device. This allows a home router to handle thousands of simultaneous connections from multiple devices using one public IP. The port number becomes the multiplexing key. PAT supports up to 65,535 simultaneous connections per public IP (limited by available port numbers).

Pro Tip

Before answering, structure your response: one-line definition → real-world analogy → concrete example from a project. This makes even complex Networking answers easy to follow.