A home router can let a phone, laptop, television and dozens of other devices use one internet connection. The devices may each have a private IPv4 address, while websites on the public internet see a shared public address. The technology that makes this common arrangement possible is Network Address Translation (NAT), usually combined with Port Address Translation (PAT).
NAT and PAT are often discussed as if they were identical. They are closely related, but the distinction matters: basic NAT translates addresses, while PAT also translates transport ports so many simultaneous conversations can share one public IPv4 address. This guide explains the packet flow, router tables, inbound port forwarding, CGNAT, IPv6 and the security trade-offs.
1. Why networks use address translation
An ordinary home network may contain phones, laptops, televisions, cameras and smart devices. Each device needs an address so that packets can be delivered across the local network. The addresses commonly assigned inside a home are private IPv4 addresses. They are not globally unique and are not intended to be routed across the public internet. Yet all those devices may need to visit websites, use cloud applications and communicate with services outside the home.
Network Address Translation (NAT) changes address information in packets as they pass through a router or another network gateway. It allows traffic using one addressing realm to communicate with another. In a common home arrangement, the router translates private source addresses to the public IPv4 address assigned by the internet provider. Replies are translated back and delivered to the correct device.
NAT is often described as a way to share one public IP address among many devices. That is a useful summary of the common home-router arrangement, but NAT includes more than one technique. Basic NAT maps addresses. Network Address Port Translation (NAPT), often casually called PAT, also maps transport-layer identifiers such as TCP or UDP ports. The distinction explains how many simultaneous conversations can share one public IPv4 address.
This guide follows the packet transformations, explains translation tables, compares NAT and PAT, examines inbound connections and port forwarding, and describes the effects on gaming, VPNs, peer-to-peer applications and IPv6. It also separates NAT from a firewall: the two may be implemented in the same router, but they solve different problems.
2. What are private and public IPv4 addresses?
IPv4 uses 32-bit addresses. A public IPv4 address is globally unique within the public addressing system and can be used for internet routing, subject to routing policy. A private IPv4 address is drawn from ranges reserved for private internets. The familiar private ranges are 10.0.0.0/8, 172.16.0.0/12 and 192.168.0.0/16. A home router might use 192.168.1.1 as its local address and assign devices values such as 192.168.1.20 or 192.168.1.21. For the wider transition from IPv4 to IPv6, including how NAT64 and CGNAT fit into the picture, read the IPv6 guide.
Private addresses can be reused by many separate homes and businesses because they are not globally routed as unique public destinations. Two unrelated networks can both have a device at 192.168.1.20 without conflict while they remain separate. A gateway must translate or otherwise connect addressing realms when traffic leaves one private network for the public internet.
A public address is not automatically a permanent address. Providers may assign dynamic addresses that change after a lease expires, a connection reconnects or the provider changes its allocation. Some subscribers receive a shared provider-side address through Carrier-Grade NAT rather than an individually assigned public IPv4 address. The address displayed by an online IP-check service may therefore belong to an upstream provider translation device, not the customer's own router.
IPv6 changes the address-availability picture because its address space is vastly larger. Many IPv6 networks can assign globally routable addresses to devices, although firewalls and routing policy still control reachability. NAT is not a mandatory feature of IPv6 internet access. IPv6 does not mean every device should accept unsolicited inbound traffic; a stateful firewall can still restrict connections.
3. What is Network Address Translation (NAT)?
Basic NAT changes IP address information in packet headers. In a simple outbound example, a laptop sends a packet with source address 192.168.1.20 toward a public server. The home router replaces the private source address with its external public address before forwarding the packet. When the reply returns to that public address, the router uses its translation state to restore the destination address to 192.168.1.20 and forwards the packet on the local network.
Traditional NAT maintains a relationship between internal and external addressing. A basic one-to-one mapping can translate one private address to one public address. That is different from the common home-router configuration in which many internal devices share one public IPv4 address by using port translation.
NAT devices also update checksums affected by the changed addresses. IPv4 has a header checksum, and TCP and UDP checksums include a pseudo-header containing IP address information. A translator that changes addresses or ports must adjust the relevant checksums so that receivers can validate the packet.
NAT is usually performed at a boundary between networks, such as a home gateway, enterprise edge router, cloud network gateway or provider translation platform. The device needs to see the packets in both directions for a flow, or otherwise have synchronized state, so that replies can be mapped correctly. If traffic for one connection takes a different unsynchronized translation path, the connection may fail.
4. What is PAT or NAPT?
Port Address Translation (PAT) is a widely used name for Network Address Port Translation, or NAPT. Instead of translating only the IP address, the device also translates a TCP or UDP port. This lets many internal endpoints share one public IPv4 address while keeping their conversations distinguishable.
Imagine a laptop at 192.168.1.20 opening a web connection from local TCP port 51520 to a server at 203.0.113.80 on TCP port 443. At the internet edge, the router may translate the source to its public address 198.51.100.25 and allocate an external source port such as 62001. A second device can use the same public address at the same time with a different translated source port. The server's reply goes to the public address and translated port; the router consults its mapping and forwards the packet to the original private address and port.
Port translation is not limited to TCP. UDP conversations can also use translated ports, and some NAT implementations handle ICMP query identifiers. The exact mapping and filtering behaviour depends on the protocol and implementation. The important concept is that the external endpoint must be unambiguous enough for the translator to associate a reply with the correct internal flow.
In everyday product menus, the word PAT may appear less often than NAT. A home router may simply label the feature NAT, NAT forwarding or port mapping even when it uses NAPT for outbound connections. Network engineers may use PAT, NAPT and NAT overload to describe the many-to-one address-and-port sharing model.
5. Step by step: how an outbound connection crosses a NAT router
First, a device obtains its local IP configuration, usually through DHCP. It receives an IP address, subnet mask or prefix, default gateway and DNS settings. When the user opens a website, the device resolves the domain name and chooses an address for the remote service. The application creates a transport connection, often TCP or QUIC over UDP.
The device sends a packet to the default gateway because the destination is outside its local subnet. The router receives the packet and checks whether it matches an existing translation entry. If it is a new flow, the router creates a mapping according to its NAT policy. For NAPT, that entry associates the internal source address and port with an external address and port, together with the remote endpoint information used by the implementation.
The router rewrites the packet's source address and, when required, source port. It updates checksums and forwards the packet toward the provider. The remote server sees the translated public-side source endpoint rather than the private address used inside the home network.
When the server replies, the packet reaches the public address and port that the router used for the mapping. The router checks its translation state, rewrites the destination address and port back to the internal endpoint, updates checksums and forwards the packet to the device. The device receives a reply that belongs to its original conversation.
The mapping remains available while the session is active or until the NAT's timeout policy removes it. TCP state, UDP traffic activity and implementation-specific timers influence how long entries remain. When the state expires, a later packet may no longer match the old mapping. Applications that rely on long-idle UDP flows can therefore need keepalive traffic or reconnection logic.
6. NAT translation tables and connection state
A NAT translation table records how internal endpoints correspond to external endpoints. A simplified NAPT entry might contain the protocol, internal source IP and port, external translated IP and port, remote destination IP and port, state and timeout. Real devices may store additional fields, flags, counters and filtering information.
The table is what allows a router to share one public address without mixing replies between devices. The translated source port is one part of the lookup, but implementations differ in how they create mappings and decide which remote systems are allowed to send packets back through an existing entry.
TCP is stateful by design. A NAT device can observe connection setup, established traffic, closure and retransmissions, and it may maintain protocol state. UDP has no TCP-style handshake or connection close, so a NAT generally uses observed packets and timers to keep a temporary mapping. A UDP application that sends no traffic for a while may find its mapping expired.
Table capacity matters. A busy gateway can maintain many concurrent translations, especially when numerous devices open browser tabs, messaging sessions, streaming connections and background services. A device that runs out of available state or ports may fail to create new mappings. Users may experience intermittent connection failures even though the physical broadband link remains up.
Administrators can investigate translation-table usage, port allocation, timeout behaviour and resource exhaustion in router diagnostics. Consumer routers expose different levels of detail. If a device frequently loses sessions under load, check firmware, connection limits, CPU and memory usage, and whether an upstream provider is also translating traffic.
7. Static NAT, dynamic NAT and PAT compared
Static NAT creates a fixed mapping between an internal address and an external address. It is useful when a host or service needs a predictable public-side address, subject to firewall rules and routing. A static mapping does not by itself make every service on the host safe or accessible; the gateway's security policy still matters.
Dynamic NAT allocates an external address from a configured pool when an internal endpoint initiates communication. The mapping is selected from available addresses and may not remain permanent. Dynamic NAT is more flexible than a manually assigned one-to-one mapping, but it still requires enough external addresses for the intended allocation model.
PAT or NAPT allows many internal addresses and transport ports to share one external address by assigning distinct translated ports. This is the familiar approach used by many home routers and small-office gateways. It conserves public IPv4 addresses, but introduces dependence on mapping state and port availability.
These categories describe translation behaviour, not a complete security architecture. Static NAT, dynamic NAT and PAT can coexist with firewall policies, access-control lists, intrusion prevention and logging. When reviewing a network design, identify the actual translation rule and the separate rule that decides which packets are permitted.
8. Inbound connections and port forwarding
Outbound connections are straightforward for a stateful NAT because the internal device initiates the flow and creates a mapping. An unsolicited inbound packet has no existing mapping that identifies which private host should receive it. The router cannot safely guess the intended destination.
Port forwarding, also called destination NAT or a virtual-server rule in many routers, creates a configured mapping from a public-side address and port to a private-side host and port. For example, a rule might forward TCP port 8443 on the router's public address to TCP port 443 on an internal server. External clients connect to the public endpoint, and the router rewrites the destination to the private server.
Port forwarding requires more than a router checkbox. The internal host should have a stable address, either a carefully configured static address or a DHCP reservation. The service must be listening on the intended port, the host firewall must allow the traffic, the edge firewall must permit it, and the provider must route the public address to the customer gateway. If the ISP places the customer behind CGNAT, a forwarding rule on the home router may not be reachable from the public internet.
Expose only the service that is needed. Prefer secure protocols, strong authentication, timely updates and a restricted source-address policy where practical. Do not expose router administration, remote desktop or storage interfaces to the internet merely to test whether forwarding works. A port-forwarding rule is an exposure decision, not a substitute for application security.
Hairpin NAT, also called NAT loopback, allows an internal client to reach an internal server by using the network's external address. Not all routers support it. Without hairpin support, a service may work from outside the home but fail when a device inside the same LAN tries to access the public hostname. Split-horizon DNS or a local DNS override can be alternatives.
9. NAT, firewalls and the mistaken idea that NAT is security
NAT and firewalling are different functions. NAT rewrites address or port information so packets can cross between addressing realms. A firewall applies a security policy that allows, rejects or otherwise handles traffic based on rules such as source, destination, protocol, port, connection state and application context.
Many consumer routers combine NAT and stateful firewall behaviour in one appliance. That combination often blocks unsolicited inbound traffic because there is no matching connection state or forwarding rule. Users may then conclude that NAT itself is the firewall. The distinction matters because a network can perform NAT while allowing broad inbound traffic, or use a firewall without translating addresses.
Private IPv4 addresses are not a security boundary on their own. Devices inside a LAN can still be attacked by another compromised device, malicious software, an untrusted guest or an exposed service. A NAT gateway does not automatically inspect application content, patch endpoints, enforce identity or prevent phishing.
Use explicit firewall rules and network segmentation for security. Keep router firmware current, disable unnecessary remote administration, change default credentials and review port-forwarding rules. Treat UPnP or automatic port mapping as a convenience with security implications: applications may request inbound mappings, so administrators should understand which devices can create them and how long they persist.
10. Why NAT can affect online gaming, voice and peer-to-peer apps
Many client-server applications work smoothly through NAT because the client initiates an outbound connection and the router creates a mapping for replies. Some real-time, peer-to-peer or multiplayer applications need two devices to establish direct communication even though both are behind NAT devices. The challenge is that neither side may know the public-side address and port that the other side can reach.
NAT traversal techniques attempt to establish a working path. Session Traversal Utilities for NAT (STUN) can help an endpoint discover the public-side address and port that a server observes. Interactive Connectivity Establishment (ICE) gathers candidate addresses and tests connectivity paths. Traversal Using Relays around NAT (TURN) provides a relay when a direct path cannot be established. These techniques are commonly used in real-time communications, but the details depend on the application and network.
Some routers use endpoint-independent mappings, while others create mappings that depend on the remote endpoint. Filtering behaviour can also vary. These differences affect whether a packet from a new remote peer can reach an existing mapping. NAT behaviour standards describe recommended characteristics to improve interoperability, but real devices and networks may differ.
Games may label NAT status as open, moderate or strict. These labels are application-specific summaries of the connectivity tests used by that game, not universal classifications of internet quality or security. A strict label can affect matchmaking or peer-to-peer hosting even when ordinary web browsing and streaming work normally.
Port forwarding can help a specific game or service when its documented requirements are clear and the user controls the public-side gateway. It cannot solve every traversal problem, especially when there is another NAT upstream at the provider. Avoid copying random port lists from unrelated games or opening broad port ranges without understanding the application.
11. What is Carrier-Grade NAT (CGNAT)?
Carrier-Grade NAT is translation performed by an internet provider within its network. A customer may have a private or shared address on the router's WAN interface, while the provider translates many subscribers' traffic to a pool of public IPv4 addresses. This lets providers conserve scarce public IPv4 resources while continuing to offer IPv4 connectivity.
CGNAT is different from the NAT performed by a customer's own router, although the two can be layered. A home device may first be translated from 192.168.1.20 to the router's WAN address. The provider's CGN then translates that WAN-side source to a public address shared by multiple customers. This arrangement is sometimes called double NAT, but the provider-side layer has its own allocation and policy constraints.
A common clue is that the router's WAN IPv4 address differs from the address reported by an external IP-check service. Addresses in 100.64.0.0/10 are reserved for shared address space and are often used for provider-side CGN. A private WAN address can also indicate an upstream NAT. These clues are useful, but confirm with the provider because network designs vary.
CGNAT can make inbound hosting, remote access and some peer-to-peer applications harder. A port-forwarding rule on the home router controls only the customer's own gateway. It cannot create a mapping on the provider's translation device. Possible options include requesting a public IPv4 address from the provider, using a provider-supported static address, adopting an outbound overlay or VPN with a relay, or using IPv6 where both endpoints and the service support it.
CGNAT is not automatically a sign of poor performance. It can add state and operational complexity, but speed and latency depend on the provider's implementation, capacity, routing and load. Diagnose the actual symptom rather than assuming that a shared public address is the cause of every slow connection.
12. NAT and IPv6: is translation still necessary?
IPv6 was designed with a very large address space so that networks do not need address sharing for the same reason as IPv4. A network can assign globally scoped IPv6 addresses to devices and route them end to end, subject to firewall and routing policy. This makes it possible to avoid many of the address-translation constraints associated with IPv4.
IPv6 does not remove the need for security controls. A stateful firewall can block unsolicited inbound traffic while allowing return traffic for connections initiated from inside. Administrators should not assume that a globally scoped IPv6 address means a device is automatically exposed, nor should they rely on address obscurity as protection.
Some deployments use translation between IPv6 and IPv4 to reach services that exist only on the other protocol. NAT64 and DNS64 are examples of mechanisms that help IPv6-only clients access IPv4-only destinations. These are not identical to the common home-router PAT arrangement. They solve an interworking problem between protocol families.
Network Address and Port Translation from IPv6 to IPv6 is sometimes called NPTv6 or NAT66 in particular designs, but it is not a general requirement for ordinary IPv6 connectivity. Address translation may be used for specific operational reasons, yet it can complicate end-to-end communication and should be selected deliberately rather than carried over from IPv4 without analysis.
For a household, the practical goal is usually to enable stable IPv6 connectivity from the provider and router, maintain an appropriate firewall policy and allow devices to use IPv6 when available. IPv4 may still be needed for destinations that have not adopted IPv6, so dual-stack operation remains common.
13. Common NAT problems and how to troubleshoot them
If outbound internet access works but inbound hosting does not, check whether the customer has a public IPv4 address, whether the router has the correct forwarding rule, whether the internal server is listening, and whether host and edge firewalls allow the service. Confirm from an external network rather than testing only from inside the LAN.
If port forwarding stops working after a router restart, verify that the internal host's address has not changed. Use a DHCP reservation or a stable address configuration. Also check whether the public IP address changed and whether a dynamic DNS record points to the current address.
If a game or voice application reports strict NAT, check the router's NAT behaviour, UPnP policy, application documentation and whether an upstream CGNAT exists. Do not enable every automatic mapping feature or forward every suggested port without assessing the risk.
If some sessions fail after a period of inactivity, investigate UDP mapping timeouts, TCP state timeouts and application keepalive behaviour. Some networks remove idle mappings to reclaim resources. Applications may need to refresh a mapping or reconnect after it expires.
If many devices experience intermittent connection failures, inspect the NAT table, available ports, router resource usage and provider-side translation. A router may have reached a connection or state limit even when its wireless signal and broadband sync remain healthy.
If the WAN address is in a private range or in 100.64.0.0/10, compare it with the public address seen externally. Ask the provider whether CGNAT is in use and whether a public IPv4 service is available. Do not assume that changing a local port-forward rule will affect the provider's NAT.
14. A practical home-router checklist
Identify the router's LAN address, WAN address and whether the WAN uses IPv4, IPv6 or both. Check the local address range and confirm that the DHCP server is assigning addresses as expected. Record whether the provider uses a dynamic or static public address.
Before creating a port-forwarding rule, write down the service, protocol, external port, internal host address and internal port. Confirm the service owner's official documentation rather than relying on generic port lists. Reserve the internal address so that the rule does not silently point to a different device later.
Review the firewall policy separately from NAT. Limit the rule to the required protocol and port, and restrict source addresses if the service supports that. Disable the rule when it is no longer required. Avoid exposing administration interfaces or insecure legacy services.
Test the service from a genuinely external network, such as a mobile connection with Wi-Fi disabled. A test from the same LAN can be affected by hairpin NAT support and may not represent the public path. If the external test fails, verify provider routing, CGNAT status, the server's listening socket and local firewall logs.
Keep router firmware current and review automatic port mapping features. If UPnP is enabled, understand which local applications can request mappings and how the router displays active rules. For business networks, log translation events where possible and ensure that address-and-port records can be correlated with timestamps when investigating abuse reports.
15. NAT logging, privacy and operational considerations
Because multiple internal users may share one public IPv4 address, an external server's log may show only the translated public address and port. To identify the internal subscriber or device associated with a connection, an operator may need translation records that include the public address, translated port, protocol and precise timestamp. Time synchronization and retention policy are therefore important operational considerations.
Translation logs can contain sensitive browsing or connection metadata. Collect only what is necessary for a legitimate operational or legal purpose, restrict access, protect stored records and apply an appropriate retention schedule. A public IP address alone may not identify one individual or device when NAT or CGNAT is involved.
Large NAT deployments must manage address pools, port allocation, table capacity, failover and logging at scale. If a provider uses multiple translation nodes, it must design routing and state handling so that replies reach a device that knows the mapping. Failover can disrupt active sessions if the state is not preserved or replicated.
Applications that embed IP addresses or port information inside their payloads can be harder to use through NAT, because the translator may not understand or rewrite the application data. Application-level gateways have historically attempted to help with selected protocols, but they can introduce complexity and security risks. Modern applications often use explicit NAT traversal or relay mechanisms instead.
16. NAT, PAT and the wider internet: key takeaways
NAT changes network-layer addressing so packets can move between addressing realms. PAT or NAPT adds transport-port translation, allowing many internal devices to share a public IPv4 address. A translation table links the inside endpoint to the outside mapping so that replies can return to the right device.
Port forwarding creates a configured path for selected inbound traffic, but it is not a general opening of the entire private network. It should be limited to a specific service and protected by firewalls and secure application configuration. CGNAT adds a provider-controlled translation layer that a customer cannot usually configure from a home router.
IPv6 can reduce the need for address sharing, but does not remove the need for firewalling or careful service exposure. NAT is neither a complete security solution nor a universal cause of poor performance. It is an address and transport translation mechanism with practical trade-offs.
For more network troubleshooting, explore the [CGNAT guide](/blog/ipv6-explained-internet-transition/) and [network connectivity articles](/blog/category/internet-problems-fixes/). Use TEZZ CONNECT's speed test for throughput and latency measurements, then combine those results with router status, address information and service-specific tests when diagnosing a connection.
17. Frequently asked questions
What is the difference between NAT and PAT?
NAT changes IP address information. PAT, also called NAPT, changes IP addresses and transport ports so multiple internal endpoints can share one public IPv4 address.
Is PAT the same as NAPT?
In common networking usage, PAT and NAPT describe the same many-to-one address-and-port translation model, although product terminology can vary.
Why does my router use NAT?
A home router commonly uses NAT/PAT so devices with private IPv4 addresses can share the public IPv4 address assigned to the household.
Does NAT improve internet speed?
NAT is not a speed-boosting technology. Performance depends on router capacity, translation load, routing, provider network conditions and the applications being used.
Is NAT a firewall?
No. NAT rewrites address or port information. A firewall applies security rules. Home routers often combine both functions, which can make them seem like one feature.
What is port forwarding?
Port forwarding creates a rule that maps traffic arriving at a public-side address and port to a selected internal host and port. It should expose only the service that is required.
Why does port forwarding not work with CGNAT?
A home router controls only its own translation. If the provider also translates the connection, unsolicited inbound traffic may never reach the home router unless the provider supplies a reachable public mapping or address.
How can I tell if my ISP uses CGNAT?
Compare the router's WAN IPv4 address with the address reported by an external IP-check service. A WAN address in 100.64.0.0/10 or a private range can indicate upstream translation; confirm with the provider.
Does IPv6 use NAT?
Ordinary IPv6 connectivity generally does not require NAT for address sharing because of its large address space. Firewalls still control unsolicited inbound traffic, and translation mechanisms such as NAT64 support IPv6/IPv4 interworking.
Can NAT cause gaming or video-call problems?
Some NAT mapping and filtering behaviours can make peer-to-peer connections harder to establish. Applications may use STUN, ICE or TURN relays, and results depend on the NATs and network policies involved.
Standards and further reading
- IETF RFC 3022 — Traditional IP Network Address Translator: describes basic NAT and network address/port translation.
- IETF RFC 4787 — NAT Behavioural Requirements for Unicast UDP: best current practice for UDP NAT behaviour.
- IETF RFC 5382 — NAT Behavioural Requirements for TCP: best current practice for TCP NAT behaviour.
- IETF RFC 7857 — Updates to NAT Behavioural Requirements: operational clarifications for NAT44 behaviour.
- IETF RFC 6888 — Common Requirements for Carrier-Grade NATs: requirements for provider-side shared IPv4 translation.
- IETF RFC 6598 — Shared Address Space Request: defines the 100.64.0.0/10 shared address range used in provider networks.
- IETF RFC 6146 — Stateful NAT64: specifies stateful translation between IPv6 and IPv4.
- IETF RFC 8445 — Interactive Connectivity Establishment (ICE): describes connectivity checks and candidate selection for NAT traversal.
These references define protocol behaviour and deployment requirements. Router menus and provider services may use different names, so check the documentation for the specific equipment and service being configured.
