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