Skip to content

Commit 39ad2f6

Browse files
Updates to snat port reuse section
1 parent b9c8531 commit 39ad2f6

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

articles/virtual-network/nat-gateway/nat-gateway-resource.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -132,15 +132,15 @@ The source IP address and port of each flow is SNAT'd to the public IP address 6
132132

133133
#### Source (SNAT) port reuse
134134

135-
Azure provides ~64,000 SNAT ports per public IP address. For each public IP address attached to NAT gateway, the entire inventory of ports provided by those IPs is made available to any virtual machine instance within a subnet that is also attached to NAT gateway. NAT gateway selects a port at random out of the available inventory of ports for a virtual machine to use. Each time a new connection is made to the same destination endpoint over the internet, a new source port is used. As mentioned in the [Performance](#performance) section, NAT gateway supports up to 50,000 concurrent connections per public IP address to the same destination endpoint over the internet. NAT gateway will continue to select a new source port at random to go to the same destination endpoint until no more SNAT ports are available for use. If NAT gateway doesn't find any available SNAT ports, only then will it reuse a SNAT port. A port can be reused so long as it's going to a different destination endpoint.
135+
Azure provides ~64,000 SNAT ports per public IP address. For each public IP address attached to NAT gateway, the entire inventory of ports provided by those IPs is made available to any virtual machine instance within a subnet that is also attached to NAT gateway. NAT gateway selects a port at random out of the available inventory of ports to make new outbound connections. If NAT gateway doesn't find any available SNAT ports, then it will reuse a SNAT port. A port can be reused so long as it's going to a different destination endpoint. As mentioned in the [Performance](#performance) section, NAT gateway supports up to 50,000 concurrent connections per public IP address to the same destination endpoint over the internet.
136136

137137
The following flow illustrates this concept with a VM flowing to destination IP 65.52.0.2 after flows 1 - 3 from the above tables have already taken place.
138138

139139
| Flow | Source tuple | Destination tuple |
140140
|:---:|:---:|:---:|
141141
| 4 | 192.168.0.16:4285 | 65.52.0.2:80 |
142142

143-
A NAT gateway will translate flow 4 to a source port that may have been recently used for a different destination endpoint. See [Scale NAT](#scale-nat) for more discussion on correctly sizing your IP address provisioning.
143+
A NAT gateway will likely translate flow 4 to a source port that may be used for other destinations as well. See [Scale NAT](#scale-nat) for more discussion on correctly sizing your IP address provisioning.
144144

145145
| Flow | Source tuple | Source tuple after SNAT | Destination tuple |
146146
|:---:|:---:|:---:|:---:|
@@ -154,7 +154,7 @@ SNAT provided by NAT is different from SNAT provided by a [load balancer](../../
154154

155155
- NAT gateway selects source ports at random for outbound traffic flow whereas Load Balancer selects ports sequentially.
156156

157-
- NAT gateway doesn't reuse a SNAT port until no other SNAT ports are available to make new connections, whereas Load Balancer looks to select the lowest available SNAT port in sequential order.
157+
- NAT gateway reuses SNAT ports for connections to different destination endpoints if no other source ports are available, whereas Load Balancer looks to select the lowest available SNAT port in sequential order.
158158

159159
### On-demand
160160

@@ -183,7 +183,7 @@ SNAT maps private addresses to one or more public IP addresses, rewriting the so
183183

184184
NAT gateway opportunistically reuses source (SNAT) ports. When you scale your workload, assume that each flow requires a new SNAT port, and then scale the total number of available IP addresses for outbound traffic. Carefully consider the scale you're designing for, and then allocate IP addresses quantities accordingly.
185185

186-
SNAT ports set to different destinations will most likely be reused when possible. As SNAT port exhaustion approaches, flows may not succeed.
186+
SNAT ports to different destinations are most likely to be reused when possible. As SNAT port exhaustion approaches, flows may not succeed.
187187

188188
For a SNAT example, see [SNAT fundamentals](#source-network-address-translation).
189189

0 commit comments

Comments
 (0)