troubleshooting Networks
NAT mapping collisions and port exhaustion
A full NAT port pool can block a new UDP mapping while an existing mapping stays usable. The key evidence is whether the sender needed a slot and whether one was available before the request.
What it means
A full NAT port pool can prevent a new outbound UDP mapping without preventing a sender from using a mapping it already has. A mapping associates an internal IP address and UDP port with an external IP address and UDP port. To tell whether a request fits, first ask whether it needs a new mapping. Only then does the number of available slots decide the result.
Try it
Simulation: Start with 3 external port slots, 2 existing distinct mappings, 0 expired mappings, and a new request, with scenario evidence provided. One slot is free before the request. The NAT allocates it, leaving 3 active mappings and 0 free slots.
NAT mapping collisions and port exhaustion
Explain how NAT translation state and available external ports constrain outbound flows
After expiration, a free unique slot can be allocated for a new or expired mapping.
Allocation steps
- Initially occupied2
- Expired0
- Active before request2
- RequestAllocate one slot
A slot picture is a count, not the identity or port number of any mapping. The pool assumes unique slots and immediate eligibility of released slots.
Evaluated inputs
- Required scenario evidence
- provided
- Existing distinct mappings
- 2 count
- External port slots
- 3 count
- Expired mappings
- 0 count
- Requested mapping
- new
One public address, one transport (UDP), endpoint-independent mapping abstraction, fixed no-overloading pool; no actual allocator, timer policy, packet forwarding or reachability.
About this model
The controls set only a local, bounded scenario. The computed branch is not a verdict about a live system. Inputs listed as not evaluated did not participate in this branch after validation.
Reset restores the original inputs. It does not change the open or closed state of help or FAQ answers.
- Change Existing distinct mappings from 2 to 3. With none expired, the new request finds all three slots occupied. The result is
exhausted: 3 active mappings, 0 free slots. - Keep the pool full and change Requested mapping to
existing. This stipulates that the sender's own mapping is still active. The result isreuse: 3 active mappings, 0 free slots. The sender does not need a fourth slot. - Change Requested mapping back to
newand set Expired mappings to 1. Of the three starting mappings, only two are still active when the request arrives. The result isallocate: the request takes the available slot, leaving 3 active mappings and 0 free slots.
Each scenario evaluates one request from the selected starting counts. Reset restores the original example. Counts must be whole numbers: the pool can have 1–20 slots, starting mappings cannot outnumber slots, and expired mappings must be a subset of the starting mappings. A fractional count is invalid, not rounded. With valid inputs but scenario evidence set to missing, the outcome is unknown, not exhausted.
What counts as a collision?
The simulation uses one public address and endpoint-independent UDP mappings. That means the same internal address and UDP port can use their still-active mapping even when sending to a different remote destination. An active mapping belonging to a different internal endpoint is not a match.
Read the occupancy before and after the request separately. For example, with 3 occupied slots in a pool of 3, 1 expired mapping and an existing active flow, the pre-request active count is 2. Reuse leaves it at 2; a new request would take the free slot and leave 3. Both scenarios start from the same pool and expiration count.
In this pool, assigning the same external port to two distinct active mappings is not allowed. One occupied port rules out that slot; it does not establish exhaustion unless every eligible slot is occupied. An expired mapping, on the other hand, no longer matches the sender. If the sender returns, it needs a fresh allocation. The simulation counts the slot released by expiration as immediately available but does not choose a particular port number.
Real allocation policies can differ. Reusing one mapping is not the same as assigning an overlapping external port to distinct mappings. RFC 7857 §3 updates the original port-assignment rule in RFC 4787: it permits overlap under conditions where distinct remote endpoints keep the mappings distinguishable. The simulation excludes that option. It also excludes reassignment delays: in a carrier-grade NAT, a mapping can be gone before its port is eligible to be assigned again. RFC 6888 §3 recommends a delay with exceptions.
In practice
If new outbound UDP traffic fails while traffic using an existing mapping continues, check the NAT's read-only mapping or allocation records, if available to you, for the time of the failed request. Did the sender already have a matching mapping? If not, was a mapping created, or did allocation fail for lack of an eligible port? Compare records for the same address, transport, and applicable subscriber limit. A count taken afterward is ambiguous: in the examples above, both a successful last allocation and a refused allocation leave zero free slots.
If the mapping was created, lack of a slot did not prevent that allocation. Filtering and the rest of the network path are separate questions; a mapping record does not prove delivery. If you cannot establish the mapping state and allocation policy at the relevant time, leave the cause unknown rather than changing the NAT configuration. Count the mappings that needed a slot and the slots they could actually use—not the numbers in the port range.
Frequently asked questions
Editorial questions based on the listed sources and explicitly labeled local examples.
Is the real port limit always 65,535?
No. Count usable mappings under the specified address, transport and allocation policy. A subscriber quota may constrain capacity; optional port overlapping for distinct remote endpoints changes the relationship between mapping count and numeric ports.
Can packets share a mapping?
Yes. The same stipulated internal endpoint can reuse an existing mapping in this example. Separately, RFC 7857 permits overlapping external ports for distinct remote endpoints under specified conditions; the lab does not simulate that second kind of reuse.
Can a successful allocation still leave zero free slots?
Yes. The last free slot can be allocated successfully, while a later request needing another slot can fail. The final count can be identical. You need the request outcome and the pre-request occupancy to distinguish them.
Why can expiration help?
In this fixed-pool example, expiration makes a slot available. In a CGN, deallocation need not mean immediate reassignment: RFC 6888 recommends a reuse delay with exceptions, including guidance for state loss. The lab does not model that timer.
Sources & model boundaries
Primary references used for this explanation. The interactive example is an educational model, not a live check.
- RFC 4787: NAT Behavioral Requirements for Unicast UDP
4.1,4.2.1,4.3. RFC 4787 §4.1 defines UDP mapping behavior; §4.2.1 discusses port assignment and the original REQ-3 restriction. RFC 7857 §3 later permits qualified port overlapping. §5 treats filtering separately; a free translation slot is not a reachability test.
Checked .
- RFC 6888: Common Requirements for Carrier-Grade NATs
Sections 3 (REQ-8, REQ-11), 4 and 5. RFC 6888 describes CGN resource limits and allocation tradeoffs, including per-subscriber constraints (§3 REQ-11; §5). Usable mapping capacity depends on address, transport and allocation policy; it is not the numeric port range. §3 REQ-8 recommends a configurable reassignment delay with exceptions; the lab assumes immediately usable expired slots.
Checked .
- RFC 7857: Updates to Network Address Translation (NAT) Behavioral Requirements
§§3–7 (especially §§3–4). Section 3 allows optional port overlapping for distinct remote endpoints when mappings remain distinguishable; section 4 qualifies paired-address exhaustion behavior. Sections 5–7 refine mapping/filtering behavior and refresh. The fixed unique-slot example deliberately excludes overlapping ports and alternative addresses.
Checked .