@@ -1587,6 +1587,24 @@ next;
1587
1587
</p >
1588
1588
1589
1589
<ul >
1590
+ <li >
1591
+ <p >
1592
+ For each NAT entry of a distributed logical router (with
1593
+ distributed gateway router port) of type <code >snat</code >,
1594
+ a priorirty-120 flow with the match <code >inport == <var >P</var >
1595
+ && ip4.src == <var >A</var ></code > advances the packet to
1596
+ the next pipeline, where <var >P</var > is the distributed logical
1597
+ router port and <var >A</var > is the <code >external_ip</code > set
1598
+ in the NAT entry. If <var >A</var > is an IPv6 address, then
1599
+ <code >ip6.src</code > is used for the match.
1600
+ </p >
1601
+
1602
+ <p >
1603
+ The above flow is required to handle the routing of the East/west NAT
1604
+ traffic.
1605
+ </p >
1606
+ </li >
1607
+
1590
1608
<li >
1591
1609
<p >
1592
1610
L3 admission control: A priority-100 flow drops packets that match
@@ -2099,21 +2117,6 @@ icmp6 {
2099
2117
<code >redirect-chassis</code >.
2100
2118
</p >
2101
2119
2102
- <p >
2103
- For each configuration in the OVN Northbound database, that asks
2104
- to change the source IP address of a packet from <var >A</var > to
2105
- <var >B</var >, a priority-50 flow matches
2106
- <code >ip && ip4.dst == <var >B</var ></code > or
2107
- <code >ip && ip6.dst == <var >B</var ></code >
2108
- with an action
2109
- <code >REGBIT_NAT_REDIRECT = 1; next;</code >. This flow is for
2110
- east/west traffic to a NAT destination IPv4/IPv6 address. By
2111
- setting the <code >REGBIT_NAT_REDIRECT</code > flag, in the
2112
- ingress table <code >Gateway Redirect</code > this will trigger a
2113
- redirect to the instance of the gateway port on the
2114
- <code >redirect-chassis</code >.
2115
- </p >
2116
-
2117
2120
<p >
2118
2121
A priority-0 logical flow with match <code >1</code > has actions
2119
2122
<code >next;</code >.
@@ -2269,20 +2272,6 @@ icmp6 {
2269
2272
<code >redirect-chassis</code >.
2270
2273
</p >
2271
2274
2272
- <p >
2273
- For each configuration in the OVN Northbound database, that asks
2274
- to change the destination IP address of a packet from <var >A</var > to
2275
- <var >B</var >, a priority-50 flow matches <code >ip &&
2276
- ip4.dst == <var >B</var ></code > or <code >ip &&
2277
- ip6.dst == <var >B</var ></code > with an action
2278
- <code >REGBIT_NAT_REDIRECT = 1; next;</code >. This flow is for
2279
- east/west traffic to a NAT destination IPv4/IPv6 address. By
2280
- setting the <code >REGBIT_NAT_REDIRECT</code > flag, in the
2281
- ingress table <code >Gateway Redirect</code > this will trigger a
2282
- redirect to the instance of the gateway port on the
2283
- <code >redirect-chassis</code >.
2284
- </p >
2285
-
2286
2275
<p >
2287
2276
A priority-0 logical flow with match <code >1</code > has actions
2288
2277
<code >next;</code >.
@@ -2416,54 +2405,6 @@ output;
2416
2405
</p >
2417
2406
</li >
2418
2407
2419
- <li >
2420
- <p >
2421
- For distributed logical routers where one of the logical router
2422
- ports specifies a <code >redirect-chassis</code >, a priority-400
2423
- logical flow for each ip source/destination couple that matches the
2424
- <code >dnat_and_snat</code > NAT rules configured. These flows will
2425
- allow to properly forward traffic to the external connections if
2426
- available and avoid sending it through the tunnel.
2427
- Assuming the two following NAT rules have been configured:
2428
- </p >
2429
-
2430
- <pre >
2431
- external_ip{0,1} = <var >EIP{0,1}</var >;
2432
- external_mac{0,1} = <var >MAC{0,1}</var >;
2433
- logical_ip{0,1} = <var >LIP{0,1}</var >;
2434
- </pre >
2435
-
2436
- <p >
2437
- the following action will be applied:
2438
- </p >
2439
-
2440
- <pre >
2441
- eth.dst = <var >MAC0</var >;
2442
- eth.src = <var >MAC1</var >;
2443
- reg0 = ip4.dst; /* xxreg0 = ip6.dst; in the IPv6 case */
2444
- reg1 = <var >EIP1</var >; /* xxreg1 in the IPv6 case */
2445
- outport = <code >redirect-chassis-port</code >;
2446
- <code >REGBIT_DISTRIBUTED_NAT = 1; next;</code >.
2447
- </pre >
2448
-
2449
- <p >
2450
- Morover a priority-400 logical flow is configured for each
2451
- <code >dnat_and_snat</code > NAT rule configured in order to
2452
- not send traffic for local FIP through the overlay tunnels
2453
- but manage it in the local hypervisor
2454
- </p >
2455
- </li >
2456
-
2457
- <li >
2458
- <p >
2459
- For distributed logical routers where one of the logical router
2460
- ports specifies a <code >redirect-chassis</code >, a priority-300
2461
- logical flow with match <code >REGBIT_NAT_REDIRECT == 1</code > has
2462
- actions <code >ip.ttl--; next;</code >. The <code >outport</code >
2463
- will be set later in the Gateway Redirect table.
2464
- </p >
2465
- </li >
2466
-
2467
2408
<li >
2468
2409
<p >
2469
2410
IPv4 routing table. For each route to IPv4 network <var >N</var > with
@@ -2630,23 +2571,6 @@ outport = <var>P</var>;
2630
2571
</p >
2631
2572
</li >
2632
2573
2633
- <li >
2634
- <p >
2635
- For distributed logical routers where one of the logical router
2636
- ports specifies a <code >redirect-chassis</code >, a priority-400
2637
- logical flow with match <code >REGBIT_DISTRIBUTED_NAT == 1</code >
2638
- has action <code >next;</code >
2639
- </p >
2640
- <p >
2641
- For distributed logical routers where one of the logical router
2642
- ports specifies a <code >redirect-chassis</code >, a priority-200
2643
- logical flow with match <code >REGBIT_NAT_REDIRECT == 1</code > has
2644
- actions <code >eth.dst = <var >E</var >; next;</code >, where
2645
- <var >E</var > is the ethernet address of the router's distributed
2646
- gateway port.
2647
- </p >
2648
- </li >
2649
-
2650
2574
<li >
2651
2575
<p >
2652
2576
Static MAC bindings. MAC bindings can be known statically based on
@@ -2721,6 +2645,35 @@ outport = <var>P</var>;
2721
2645
</p >
2722
2646
</li >
2723
2647
2648
+ <li >
2649
+ <p >
2650
+ Static MAC bindings from NAT entries. MAC bindings can also be known
2651
+ for the entries in the <code >NAT</code > table. Below flows are
2652
+ programmed for distributed logical routers i.e with a distributed
2653
+ router port.
2654
+ </p >
2655
+
2656
+ <p >
2657
+ For each row in the <code >NAT</code > table with IPv4 address
2658
+ <var >A</var > in the <ref column =" external_ip"
2659
+ table =" NAT" db =" OVN_Northbound" /> column of
2660
+ <ref table =" NAT" db =" OVN_Northbound" /> table, a priority-100
2661
+ flow with the match <code >outport === <var >P</var > &&
2662
+ reg0 == <var >A</var ></code > has actions <code >eth.dst = <var >E</var >;
2663
+ next;</code >, where <code >P</code > is the distributed logical router
2664
+ port, <var >E</var > is the Ethernet address if set in the
2665
+ <ref column =" external_mac" table =" NAT" db =" OVN_Northbound" /> column
2666
+ of <ref table =" NAT" db =" OVN_Northbound" /> table for of type
2667
+ <code >dnat_and_snat</code >, otherwise the Ethernet address of the
2668
+ distributed logical router port.
2669
+ </p >
2670
+
2671
+ <p >
2672
+ For IPv6 NAT entries, same flows are added, but using the register
2673
+ <code >xxreg0</code > for the match.
2674
+ </p >
2675
+ </li >
2676
+
2724
2677
<li >
2725
2678
<p >
2726
2679
Dynamic MAC bindings. These flows resolve MAC-to-IP bindings
@@ -2843,20 +2796,6 @@ icmp4 {
2843
2796
</p >
2844
2797
2845
2798
<ul >
2846
- <li >
2847
- A priority-300 logical flow with match
2848
- <code >REGBIT_DISTRIBUTED_NAT == 1</code > has action
2849
- <code >next;</code >
2850
- </li >
2851
- <li >
2852
- A priority-200 logical flow with match
2853
- <code >REGBIT_NAT_REDIRECT == 1</code > has actions
2854
- <code >outport = <var >CR</var >; next;</code >, where <var >CR</var >
2855
- is the <code >chassisredirect</code > port representing the instance
2856
- of the logical router distributed gateway port on the
2857
- <code >redirect-chassis</code >.
2858
- </li >
2859
-
2860
2799
<li >
2861
2800
A priority-150 logical flow with match
2862
2801
<code >outport == <var >GW</var > &&
@@ -3148,19 +3087,6 @@ nd_ns {
3148
3087
ports specifies a <code >redirect-chassis</code >.
3149
3088
</p >
3150
3089
3151
- <p >
3152
- Earlier in the ingress pipeline, some east-west traffic was
3153
- redirected to the <code >chassisredirect</code > port, based on
3154
- flows in the <code >UNSNAT</code > and <code >DNAT</code > ingress
3155
- tables setting the <code >REGBIT_NAT_REDIRECT</code > flag, which
3156
- then triggered a match to a flow in the
3157
- <code >Gateway Redirect</code > ingress table. The intention was
3158
- not to actually send traffic out the distributed gateway port
3159
- instance on the <code >redirect-chassis</code >. This traffic was
3160
- sent to the distributed gateway port instance in order for DNAT
3161
- and/or SNAT processing to be applied.
3162
- </p >
3163
-
3164
3090
<p >
3165
3091
While UNDNAT and SNAT processing have already occurred by this
3166
3092
point, this traffic needs to be forced through egress loopback on
@@ -3176,23 +3102,20 @@ nd_ns {
3176
3102
3177
3103
<ul >
3178
3104
<li >
3179
- <p >
3180
- For each <code >dnat_and_snat</code > NAT rule couple in the
3181
- OVN Northbound database on a distributed router,
3182
- a priority-200 logical with match
3183
- <code >ip4.dst == <var >external_ip0</var > &&
3184
- ip4.src == <var >external_ip1</var ></code >, has action
3185
- <code >next;</code >
3186
- </p >
3187
-
3188
3105
<p >
3189
3106
For each NAT rule in the OVN Northbound database on a
3190
3107
distributed router, a priority-100 logical flow with match
3191
3108
<code >ip4.dst == <var >E</var > &&
3192
- outport == <var >GW</var ></code >, where <var >E</var > is the
3193
- external IP address specified in the NAT rule, and <var >GW</var >
3194
- is the logical router distributed gateway port, with the
3195
- following actions:
3109
+ outport == <var >GW</var > &&
3110
+ is_chassis_resident(<var >P</var >)</code >, where <var >E</var > is the
3111
+ external IP address specified in the NAT rule, <var >GW</var >
3112
+ is the logical router distributed gateway port. For dnat_and_snat
3113
+ NAT rule, <var >P</var > is the logical port specified in the NAT rule.
3114
+ If <ref column =" logical_port"
3115
+ table =" NAT" db =" OVN_Northbound" /> column of
3116
+ <ref table =" NAT" db =" OVN_Northbound" /> table is NOT set, then
3117
+ <var >P</var > is the <code >chassisredirect port</code > of
3118
+ <var >GW</var > with the following actions:
3196
3119
</p >
3197
3120
3198
3121
<pre >
0 commit comments