Report: Configure 2009.44
[csit.git] / docs / report / introduction / methodology_nat44.rst
1 Network Address Translation IPv4 to IPv4
2 ----------------------------------------
3
4 NAT44 Prefix Bindings
5 ^^^^^^^^^^^^^^^^^^^^^
6
7 NAT44 prefix bindings should be representative to target applications,
8 where a number of private IPv4 addresses from the range defined by
9 :rfc:`1918` is mapped to a smaller set of public IPv4 addresses from the
10 public range.
11
12 Following quantities are used to describe inside to outside IP address
13 and port bindings scenarios:
14
15 - inside-addresses, ports-per-inside-address, number of inside source
16   addresses (representing inside hosts) and number of TCP/UDP source
17   ports per inside source address.
18 - outside-addresses, number of outside (public) source addresses
19   allocated to NAT44. The maximal number of ports-per-outside-address
20   usable for NAT is 64 512 (in non-reserved port range 1024-65535,
21   :rfc:`4787`).
22 - sharing-ratio, equal to inside-addresses / outside-addresses.
23
24 CSIT NAT44 tests are designed to take into account the maximum number of
25 ports (sessions) required per inside host (inside-address) and at the
26 same time to maximize the use of outside-address range by using all
27 available outside ports. With this in mind, the following scheme of
28 NAT44 sharing ratios has been devised for use in CSIT:
29
30 +--------------------------+---------------+
31 | ports-per-inside-address | sharing-ratio |
32 +==========================+===============+
33 | 63                       | 1024          |
34 +--------------------------+---------------+
35 | 126                      | 512           |
36 +--------------------------+---------------+
37 | 252                      | 256           |
38 +--------------------------+---------------+
39 | 504                      | 128           |
40 +--------------------------+---------------+
41
42 Initial CSIT NAT44 tests, including associated TG/TRex traffic profiles,
43 are based on ports-per-inside-address set to 63 and the sharing ratio of
44 1024. This approach is currently used for all NAT44 tests including
45 NAT44det (NAT44 deterministic used for Carrier Grade NAT applications)
46 and NAT44ed.
47
48 ..
49     .. TODO::
50
51     Note that in the latter case, due to overloading of (ouside-address,
52     outside-port) tuple for different endpoint destinations the actual
53     sharing ratio is likely to different, as it will depend on the
54     destination addresses used by NAT'ed flows.
55
56 Private address ranges to be used in tests:
57
58 - 192.168.0.0 - 192.168.255.255 (192.168/16 prefix)
59
60   - Total of 2^16 (65 536) of usable IPv4 addresses.
61   - Used in tests for up to 65 536 inside addresses (inside hosts).
62
63 - 172.16.0.0 - 172.31.255.255  (172.16/12 prefix)
64
65   - Total of 2^20 (1 048 576) of usable IPv4 addresses.
66   - Used in tests for up to 1 048 576 inside addresses (inside hosts).
67
68 NAT44 Session Scale
69 ~~~~~~~~~~~~~~~~~~~
70
71 NAT44 session scale tested is govern by the following logic:
72
73 - Number of inside addresses/hosts H[i] = (H[i-1] x 2^2) with H(0)=1 024, i = 1,2,3, ...
74
75   - H[i] = 1 024, 4 096, 16 384, 65 536, 262 144, 1 048 576, ...
76
77 - Number of sessions S[i](ports-per-host) = H[i] * ports-per-inside-address
78
79   - ports-per-host = 63
80
81 +---+---------+------------+
82 | i |   hosts |   sessions |
83 +===+=========+============+
84 | 0 |   1 024 |     64 512 |
85 +---+---------+------------+
86 | 1 |   4 096 |    258 048 |
87 +---+---------+------------+
88 | 2 |  16 384 |  1 032 192 |
89 +---+---------+------------+
90 | 3 |  65 536 |  4 128 768 |
91 +---+---------+------------+
92 | 4 | 262 144 | 16 515 072 |
93 +---+---------+------------+
94
95 NAT44 Deterministic
96 ^^^^^^^^^^^^^^^^^^^
97
98 NAT44det throughput tests are using TRex STL (Stateless) API and traffic
99 profiles, similar to all other stateless packet forwarding tests like
100 ip4, ip6 and l2, sending UDP packets in both directions
101 inside-to-outside and outside-to-inside. See
102 :ref:`data_plane_throughput` for more detail.
103
104 NAT44det translation entries are created during the ramp-up phase
105 preceding the throughput test, followed by verification that all entries
106 are present, before proceeding to the throughput test. This ensures
107 session setup does not impact the forwarding performance test.
108
109 Associated CSIT test cases use the following naming scheme to indicate
110 NAT44det scenario tested:
111
112 - ethip4udp-nat44det-h{H}-p{P}-s{S}-[mrr|ndrpdr|soak]
113
114   - {H}, number of inside hosts, H = 1024, 4096, 16384, 65536, 262144.
115   - {P}, number of ports per inside host, P = 63.
116   - {S}, number of sessions, S = 64512, 258048, 1032192, 4128768,
117     16515072.
118   - [mrr|ndrpdr|soak], MRR, NDRPDR or SOAK test.
119
120 NAT44 Endpoint-Dependent
121 ^^^^^^^^^^^^^^^^^^^^^^^^
122
123 NAT44ed is benchmarked using following methodologies:
124
125 - Uni-directional throughput using *stateless* traffic profile.
126 - Connections-per-second using *stateful* traffic profile.
127 - Bi-directional throughput using *stateful* traffic profile.
128
129 Uni-directional NAT44ed throughput tests are using TRex STL (Stateless)
130 APIs and traffic profiles, but with packets sent only in
131 inside-to-outside direction. Due to indeterministic bindings of outside
132 to inside (src_addr,src_port) that are created dynamically at flow start
133 bidirectional testing is not possible with stateless traffic profiles.
134 See :ref:`data_plane_throughput` for more detail.
135
136 Similarly to NAT44det, NAT44ed uni-directional throughput tests include
137 a ramp-up phase to establish and verify the presence of required NAT44ed
138 binding entries. NAT44ed CPS (connections-per-second) and throughput /
139 PPS stateful tests do not have a ramp-up phase.
140
141 Stateful NAT44ed tests are using TRex ASTF (Advanced Stateful) APIs and
142 traffic profiles, with packets sent in both directions. Tests are run
143 with both UDP and TCP/IP sessions.
144
145 Associated CSIT test cases use the following naming scheme to indicate
146 NAT44DET case tested:
147
148 - Stateless: ethip4udp-nat44ed-h{H}-p{P}-s{S}-udir-[mrr|ndrpdr|soak]
149
150   - {H}, number of inside hosts, H = 1024, 4096, 16384, 65536, 262144.
151   - {P}, number of ports per inside host, P = 63.
152   - {S}, number of sessions, S = 64512, 258048, 1032192, 4128768,
153     16515072.
154   - udir-[mrr|ndrpdr|soak], unidirectional stateless tests MRR, NDRPDR
155     or SOAK.
156
157 - Stateful: ethip4[udp|tcp]-nat44ed-h{H}-p{P}-s{S}-[cps|pps]-[mrr|ndrpdr]
158
159   - [udp|tcp], UDP or TCP/IP sessions
160   - {H}, number of inside hosts, H = 1024, 4096, 16384, 65536, 262144.
161   - {P}, number of ports per inside host, P = 63.
162   - {S}, number of sessions, S = 64512, 258048, 1032192, 4128768,
163     16515072.
164   - [cps|pps], connections-per-second session establishment rate or
165     packets-per-second throughput rate.
166   - [mrr|ndrpdr], bidirectional stateful tests MRR, NDRPDR.