NAT44: active-passive HA (VPP-1571)
[vpp.git] / src / plugins / nat / nat_ha_doc.md
1 # Active-Passive NAT HA
2
3 ## Introduction
4
5 One NAT node actively manages traffic while the other is synchronized and ready to transition to the active state and takes over seamlessly and enforces the same NAT sessions when failure occur. Both nodes share the same configuration settings.
6
7 ## Configuration
8
9 ### NAT HA protocol
10 Session synchronization traffic is distributed through an IPv4 UDP connection. The active node sends NAT HA protocol events to passive node. To achieve reliable transfer NAT HA protocol uses acknowledgement with re-transmission. This require the passive node to respond with an acknowledgement message as it receives the data. The active node keeps a record of each packet it sends and maintains a timer from when the packet was sent. The active node re-transmits a packet if the timer expires before receiving the acknowledgement.
11
12 ### Topology
13
14 The two NAT nodes have a dedicated link (interface GE0/0/3 on both) to synchronize NAT sessions using NAT HA protocol.
15
16         +-----------------------+
17         |    outside network    |
18         +-----------------------+
19          /                     \
20         /                       \
21        /                         \
22       /                           \
23      /                             \
24 +---------+                   +---------+
25 | GE0/0/1 | Active    Passive | GE0/0/1 |
26 |         |                   |         |
27 |  GE0/0/3|-------------------|GE0/0/3  |
28 |         |   sync network    |         |
29 | GE0/0/0 |                   | GE0/0/0 |
30 +---------+                   +---------+
31      \                             /
32       \                           /
33        \                         /
34         \                       /
35          \                     /
36         +-----------------------+
37         |    inside network     |
38         +-----------------------+
39
40 ### Active node configuration
41
42 ```
43 set interface ip address GigabitEthernet0/0/1 10.15.7.101/24
44 set interface ip address GigabitEthernet0/0/0 172.16.10.101/24
45 set interface ip address GigabitEthernet0/0/3 10.0.0.1/24
46 set interface state GigabitEthernet0/0/0 up
47 set interface state GigabitEthernet0/0/1 up
48 set interface state GigabitEthernet0/0/3 up
49 set interface nat44 in GigabitEthernet0/0/0 out GigabitEthernet0/0/1
50 nat44 add address 10.15.7.100
51 nat ha listener 10.0.0.1:1234
52 nat ha failover 10.0.0.2:2345
53 ```
54
55 ### Passive node configuration
56
57 ```
58 set interface ip address GigabitEthernet0/0/1 10.15.7.102/24
59 set interface ip address GigabitEthernet0/0/0 172.16.10.102/24
60 set interface ip address GigabitEthernet0/0/3 10.0.0.2/24
61 set interface state GigabitEthernet0/0/0 up
62 set interface state GigabitEthernet0/0/1 up
63 set interface state GigabitEthernet0/0/3 up
64 set interface nat44 in GigabitEthernet0/0/0 out GigabitEthernet0/0/1
65 nat44 add address 10.15.7.100
66 nat ha listener 10.0.0.2:2345
67 ```
68