You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/virtual-network/nat-gateway/nat-gateway-resource.md
+18-18Lines changed: 18 additions & 18 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -47,15 +47,17 @@ Private Link uses the private IP addresses of your virtual machines or other com
47
47
48
48
### Connect to the internet with NAT gateway
49
49
50
-
NAT gateway is recommended for outbound scenarios for all production workloads where you need to connect to a public endpoint. When NAT gateway is configured to subnets, all previous outbound configurations, such as Load balancer or instance-level public IPs (IL PIPs) are superseded and NAT gateway directs all outbound traffic to the internet. Return traffic in response to an outbound initiated flow will also go through NAT gateway. Inbound initiated traffic is not affected by the addition of NAT gateway. Inbound traffic through Load balancer or IL PIPs are translated separately from outbound traffic through NAT gateway. This separation allows inbound and outbound services to coexist seamlessly.
50
+
NAT gateway is recommended for all production workloads where you need to connect to a public endpoint over the internet. When NAT gateway is configured to subnets, all previous outbound configurations, such as Load balancer or instance-level public IPs (IL PIPs) are superseded by NAT gateway. Outbound initiated and return traffic go through NAT gateway. There's no down time on outbound connectivity after adding NAT gateway to a subnet with existing outbound configurations.
51
51
52
52
### Coexistence of outbound and inbound connectivity
53
53
54
+
NAT gateway, Load balancer and instance-level public IPs are flow direction aware. NAT gateway can coexist in the same virtual network as Load balancer and IL PIPs to provide outbound and inbound connectivity seamlessly. Inbound traffic through Load balancer or IL PIPs is translated separately from outbound traffic through NAT gateway.
55
+
54
56
The following scenarios are examples of how to ensure coexistence of Load balancer or instance level public IPs for inbound with NAT gateway for outbound.
55
57
56
58
#### NAT and VM with an instance-level public IP
57
59
58
-
:::image type="content" source="./media/nat-overview/flow-direction2.png" alt-text="Diagram that depicts a NAT gateway resource that consumes all IP addresses for a public IP prefix and directs that traffic to and from two subnets of VMs and a virtual machine scale set.":::
60
+
:::image type="content" source="./media/nat-overview/flow-direction2.png" alt-text="Diagram that depicts a NAT gateway resource that consumes all IP addresses for a public IP prefix and directs that traffic to and from two subnets that contain VMs and a virtual machine scale set.":::
59
61
60
62
*Figure: Virtual Network NAT and VM with an instance level public IP*
61
63
@@ -104,7 +106,7 @@ For guides on how to enable NSG flow logs, see [Enabling NSG Flow Logs](../../ne
104
106
105
107
Each NAT gateway can provide up to 50 Gbps of throughput. This data throughput includes data processed both outbound and inbound through a NAT gateway resource. You can split your deployments into multiple subnets and assign each subnet or group of subnets a NAT gateway to scale out.
106
108
107
-
NAT gateway can support up to 50,000 concurrent connections per public IP address to the same destination endpoint over the internet for TCP and UDP. NAT gateway can process 1M packets per second and scale up to 5M packets per second.
109
+
NAT gateway can support up to 50,000 concurrent connections per public IP address **to the same destination endpoint** over the internet for TCP and UDP. NAT gateway can process 1M packets per second and scale up to 5M packets per second.
108
110
109
111
Review the following section for details and the [troubleshooting article](./troubleshoot-nat.md) for specific problem resolution guidance.
110
112
@@ -133,33 +135,33 @@ NAT gateway interacts with IP and IP transport headers of UDP and TCP flows. NAT
133
135
134
136
Source Network Address Translation (SNAT) rewrites the source of a flow to originate from a different IP address and/or port. Typically, SNAT is used when a private network needs to connect to a public host over the internet. SNAT allows multiple VM instances within the private VNet to use the same single Public IP address or set of IP addresses (prefix) to connect to the internet.
135
137
136
-
NAT gateway SNATs the private IP address and source port of a virtual machine (or other compute resource) to a static public IP address before going outbound to the internet from a virtual network. When making connections to the same destination endpoint, a different source port is used for the connection so that connections can be distinguished from one another. SNAT port exhaustion occurs when a source endpoint has run out of available SNAT ports to differentiate between new connections.
138
+
NAT gateway SNATs the private IP address and port of a virtual machine to a static public IP address and SNAT port before going outbound to the internet from a virtual network. Each new connection to the same destination endpoint uses a different SNAT port so that connections can be distinguished from one another. SNAT port exhaustion occurs when a source endpoint has run out of available SNAT ports to differentiate between new connections.
137
139
138
140
### Example SNAT flows for NAT gateway
139
141
140
142
The following example flows explain the basic concept of SNAT and how it works with NAT gateway.
141
143
142
-
In the table below the VM is making connections to destination IP 65.52.0.1 from the following source tuples (IPs and ports):
144
+
In the table below the VM makes connections to destination IP 65.52.0.1 from the following source tuples (IPs and ports):
143
145
144
146
| Flow | Source tuple | Destination tuple |
145
147
|:---:|:---:|:---:|
146
148
| 1 | 192.168.0.16:4283 | 65.52.0.1:80 |
147
149
| 2 | 192.168.0.16:4284 | 65.52.0.1:80 |
148
150
| 3 | 192.168.0.17.5768 | 65.52.0.1:80 |
149
151
150
-
When NAT gateway is configured with public IP address 65.52.1.1, the source IPs are SNAT'd into NAT gateway's public IP address as shown below:
152
+
When NAT gateway is configured with public IP address 65.52.1.1, the source IPs are SNAT'd into NAT gateway's public IP address and a SNAT port as shown below:
The source IP address and port of each flow is SNAT'd to the public IP address 65.52.1.1 (source tuple after SNAT) and to a different port for each new connection going to the same destination endpoint. The act of NAT gateway replacing all of the source ports and IPs with the public IP and port before connecting to the internet is known as *IP masquerading* or *port masquerading*. Multiple private sources are masqueraded behind a public IP.
160
+
"IP masquerading" or "port masquerading" is the act of replacing the private IP and port with the public IP and port before connecting to the internet. Multiple private resources can be masqueraded behind the same public IP of NAT gateway.
159
161
160
162
### NAT gateway dynamically allocates SNAT ports
161
163
162
-
NAT gateway dynamically allocates SNAT ports across a subnet's resources (ie virtual machines). SNAT port inventory is made available by attaching public IP addresses to NAT gateway. All available SNAT ports in inventory can be used by any virtual machine on subnets configured with NAT gateway:
164
+
NAT gateway dynamically allocates SNAT ports across a subnet's private resources such as virtual machines. SNAT port inventory is made available by attaching public IP addresses to NAT gateway. All available SNAT portscan be used on-demand by any virtual machine in subnets configured with NAT gateway:
163
165
164
166
:::image type="content" source="./media/nat-overview/lb-vnnat-chart.png" alt-text="Diagram that depicts the inventory of all available SNAT ports used by any VM on subnets configured with NAT.":::
165
167
@@ -175,15 +177,13 @@ After a SNAT port is released, it's available for use by any VM on subnets confi
175
177
176
178
### Source (SNAT) port reuse
177
179
178
-
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 there is no existing connection going to the same destination IP and port.
179
-
180
-
The following illustrates this concept as an additional flow to the preceding set, with a VM flowing to a new destination IP 65.52.0.2.
180
+
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 SNAT port can be reused when connecting to a different destination IP and port as shown below with this extra flow.
181
181
182
182
| Flow | Source tuple | Destination tuple |
183
183
|:---:|:---:|:---:|
184
184
| 4 | 192.168.0.16:4285 | 65.52.0.2:80 |
185
185
186
-
A NAT gateway will translate flow 4 to a source port that may already be in use for other destinations as well (see flow 1 from table above). See [Scale NAT gateway](#scalability) for more discussion on correctly sizing your IP address provisioning.
186
+
A NAT gateway will translate flow 4 to a SNAT port that may already be in use for other destinations as well (see flow 1 from table above). See [Scale NAT gateway](#scalability) for more discussion on correctly sizing your IP address provisioning.
@@ -201,11 +201,11 @@ The following table provides information about when a TCP port becomes available
201
201
202
202
| Timer | Description | Value |
203
203
|---|---|---|
204
-
| TCP FIN | After a connection is closed by a TCP FIN packet, a 65second timer is activated that holds down the SNAT port. The SNAT port will be available for reuse after the timer ends. | 65 seconds |
205
-
| TCP RST | After a connection is closed by a TCP RST packet (reset), a 20second timer is activated that holds down the SNAT port. When the timer ends, the port is available for reuse. | 20 seconds |
206
-
| TCP half open | During connection establishment where one connection endpoint is waiting for acknowledgment from the other endpoint, a 25second timer is activated. If no traffic is detected, the connection will close. Once the connection has closed, the source port is available for reuse to the same destination endpoint. | 25 seconds |
204
+
| TCP FIN | After a connection is closed by a TCP FIN packet, a 65-second timer is activated that holds down the SNAT port. The SNAT port will be available for reuse after the timer ends. | 65 seconds |
205
+
| TCP RST | After a connection is closed by a TCP RST packet (reset), a 20-second timer is activated that holds down the SNAT port. When the timer ends, the port is available for reuse. | 20 seconds |
206
+
| TCP half open | During connection establishment where one connection endpoint is waiting for acknowledgment from the other endpoint, a 25-second timer is activated. If no traffic is detected, the connection will close. Once the connection has closed, the source port is available for reuse to the same destination endpoint. | 25 seconds |
207
207
208
-
For UDP traffic, after a connection has closed, the port will be in hold down for 65 seconds before it is available for reuse.
208
+
For UDP traffic, after a connection has closed, the port will be in hold down for 65 seconds before it's available for reuse.
209
209
210
210
### Idle Timeout Timers
211
211
@@ -225,7 +225,7 @@ Design recommendations for configuring timers:
225
225
226
226
- TCP keepalives can be used to provide a pattern of refreshing long idle connections and endpoint liveness detection. TCP keepalives appear as duplicate ACKs to the endpoints, are low overhead, and invisible to the application layer.
227
227
228
-
- Because UDP idle timeout timers are not configurable, UDP keepalives should be used to ensure that the idle timeout value isn't reached and that the connection is maintained. Unlike TCP connections, a UDP keepalive enabled on one side of the connection only applies to traffic flow in one direction. UDP keepalives must be enabled on both sides of the traffic flow in order to keep the traffic flow alive.
228
+
- Because UDP idle timeout timers aren't configurable, UDP keepalives should be used to ensure that the idle timeout value isn't reached, and that the connection is maintained. Unlike TCP connections, a UDP keepalive enabled on one side of the connection only applies to traffic flow in one direction. UDP keepalives must be enabled on both sides of the traffic flow in order to keep the traffic flow alive.
229
229
230
230
## Limitations
231
231
@@ -235,7 +235,7 @@ Design recommendations for configuring timers:
235
235
236
236
- To upgrade a basic public IP address to standard, see [Upgrade a public IP address](../ip-services/public-ip-upgrade-portal.md)
237
237
238
-
- NAT gateway does not support ICMP
238
+
- NAT gateway doesn't support ICMP
239
239
240
240
- IP fragmentation isn't available for NAT gateway.
0 commit comments