xref: /illumos-gate/usr/src/test/net-tests/tests/forwarding/README (revision c61a1653a4d73dbc950dac7d96350fd6cb517486)
1Running
2-------
3
4* Create three native zones and start them.
5
6* Edit config/ip_forwarding.config, entering the names of the zones
7  you created.
8
9* Run /opt/net-tests/bin/nettest.
10
11Overview
12--------
13
14The tests in this directory test the IP forwarding path under several
15different variations. All tests require three zones. The tests use
16these three zones, along with the simnet driver, to emulate a real IP
17forwarding scenario involving multiple hosts. All tests verify that
18TCP, UDP, ICMP, IPv4/IPv6, and fragmented IPv4/IPv6 traffic can cross
19the IP forwarding datapath. Each test differs in its emulation of
20various hardware offload features (which would typically be presented
21by real NICs). The diagrams below gives a visual representation of the
22situations we are testing and shows how the test components relate to
23each other.
24
25no mac-loopback
26---------------
27
28In this configuration we make sure that the packet travels from server
29to router via "the wire".
30
31                                        +----------------------------+
32+----------------------------+          |router zone                 |
33|client zone                 |          | +-------------------------+|
34|(ipft_client_nic0)          |          | |ipft_router_nic0         ||
35|  +----------------------+  |          | |+----------------------+ ||
36|  |ipft_client0          |  |          | ||ipft_client_r0        | ||
37|  |192.168.77.2          |<-+-- Wire --+->|192.168.77.1          | ||
38|  |fd00:0:1:4d::2        |  |          | ||fd00:0:1:4d::1        | ||
39|  +----------------------+  |          | |+----------------------+ ||
40+----------------------------+          | +-------------------------+|
41                                        |              ^             |
42                                        |              |             |
43                                        |              |             |
44                                        |              |             |
45                                        |              |             |
46                                        |       IP     |             |
47                                        |   forwarding |             |
48                                        |              |             |
49                                        |              |             |
50                                        |              |             |
51+----------------------------+          |              v             |
52|server zone                 |          |+-------------------------+ |
53|(ipft_server_nic0)          |          ||ipft_router_nic1         | |
54|  +----------------------+  |          || +----------------------+| |
55|  |ipft_server0          |  |          || |ipft_server_r0        || |
56|  |VLAN 5                |  |   Wire   || |VLAN 5                || |
57|  |192.168.88.2          |<-+----------++>|192.168.88.1          || |
58|  |fd00:0:1:58::2        |  |          || |fd00:0:1:58::1        || |
59|  +----------------------+  |          || +----------------------+| |
60+----------------------------+          |+-------------------------+ |
61                                        +----------------------------+
62
63mac-loopback
64------------
65
66In this configuration we make sure that the packet travels from server
67to router via mac-loopback.
68
69                                        +----------------------------+
70+----------------------------+          |router zone                 |
71|client zone                 |          | +-------------------------+|
72|(ipft_nic0)                 |          | |ipft_nic1                ||
73|  +----------------------+  |          | |+----------------------+ ||
74|  |ipft_client0          |  |          | ||ipft_client_r0        | ||
75|  |192.168.77.2          |<-+-- Wire --+->|192.168.77.1          | ||
76|  |fd00:0:1:4d::2        |  |          | ||fd00:0:1:4d::1        | ||
77|  +----------------------+  |          | |+----------------------+ ||
78+----------------------------+          | +-------------------------+|
79                                        |              ^             |
80                                        |              |             |
81                                        |              |             |
82                                        |              |             |
83                                        |              |             |
84                                        |       IP     |             |
85                                        |   forwarding |             |
86                                        |              |             |
87                                        |              |             |
88                                        |              |             |
89+----------------------------+          |              v             |
90|server zone                 |          |+-------------------------+ |
91|(ipft_nic1)                 |          ||ipft_nic1                | |
92|  +----------------------+  |          || +----------------------+| |
93|  |ipft_server0          |  |   MAC    || |ipft_server_r0        || |
94|  |VLAN 5                |  | loopback || |VLAN 5                || |
95|  |192.168.88.2          |<-+----------++>|192.168.88.1          || |
96|  |fd00:0:1:58::2        |  |          || |fd00:0:1:58::1        || |
97|  +----------------------+  |          || +----------------------+| |
98+----------------------------+          |+-------------------------+ |
99                                        +----------------------------+
100
101Requirements
102------------
103
104* The client and server zones must provide `/usr/bin/socat`. It would
105  be nice to use netcat but our native version is missing features
106  like connection timeout.
107
108* The user must both create and start the three required zones.
109
110* All three zones should be native zones.
111
112* You must edit the ip_forwarding.config file; providing it with the
113  names of the zones you have created.
114
115Files
116-----
117
118ip_fowarding
119
120	The main test script; it provides the logic for all the tests
121	below. The different test variations are controlled by options
122	and it takes the three zones as arguments. This script may be
123	run by hand but it's easier to use ip_fwd_suite for that
124	purpose.
125
126ip_fwd_suite
127
128	This script runs the various configurations of the IP
129	forwarding test suite. You can run the entire suite or just a
130	single test via the '-n' option. The "Test Matrix" section
131	below gives an overview of all the tests in the suite.
132
133ip_fwd_XXX
134
135	These scripts are mostly here to work around the fact that the
136	test-runner cannot pass arguments to individual tests. In
137	order to avoid running everything as the "ip_fwd_suite" test,
138	we create a file for each configuration. This gives individual
139	reporting of each test and steers us clear of tripping the
140	timeout. You can also run these scripts by hand like so:
141
142	NET_TESTS=/opt/net-tests /opt/net-tests/tests/forwarding/ip_fwd_001
143
144config/ip_forwarding.config
145
146	This file must be modified to contain the names of the zones
147	the user crated for running these tests.
148
149Test Matrix
150-----------
151
152This is a breakdown of all the tests in the IP forwarding test suite.
153If a given offload is enabled or disable, it is done so for all
154interfaces involved in the test.
155
156NAME	Tx IP	Tx ULP		LSO	Rx IP	mac-loopback
157001	off	none		off	off	no
158002	on	partial		off	off	no
159003	on	partial		on	off	no
160004	on	fullv4		off	off	no
161005	on	fullv4		on	off	no
162006	off	none		off	on	no
163007	on	partial		off	on	no
164008	on	partial		on	on	no
165009	on	fullv4		off	on	no
166010	on	fullv4		on	on	no
167
168011	off	none		off	off	yes
169012	on	partial		off	off	yes
170013	on	partial		on	off	yes
171014	on	fullv4		off	off	yes
172015	on	fullv4		on	off	yes
173016	off	none		off	on	yes
174017	on	partial		off	on	yes
175018	on	partial		on	on	yes
176019	on	fullv4		off	on	yes
177020	on	fullv4		on	on	yes
178