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