aboutsummaryrefslogtreecommitdiffstats
path: root/docs/testing/user/userguide/east-west-benchmarking/Bidirectional Test with PROX.md
blob: 5f4e6f3abda16aeb5eb2c1e15440e6fa8e43b106 (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
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
# Configure PROX for bidirectional traffic

To configure PROX for bidirectional traffic starting from a unidirectional setup just modify the `parameters.lua`  and the `prox.cfg` and then modify the vSwitch configuration to connect the interfaces also in the opposite direction.

### Modify the `parameters.lua` file

Duplicate these parameters:

- `local_ip`
- `local_hex_ip`
- `local_hex_mac`
- `gencores`
- `latcores`

Adjust the names to make them unique. The file now should look like this:

```
...
local_ip1="192.168.30.11/24"
local_hex_ip1=convertIPToHex(local_ip1)
local_ip2="192.168.30.12/24"
local_hex_ip2=convertIPToHex(local_ip2)
...
local_hex_mac1="de ad c3 52 79 9b"
local_hex_mac2="02 09 c0 fd ba 1f"
gencores1="15"
gencores2="16"
latcores1="17"
latcores2="18"
...
```

### Modify the `prox.cfg` file

In this file duplicate the gencore and the latcore tasks adjust the tasks names and the variables names according to the ones in `parameters.lua` and then invert the ports number in the new tasks.

After these changes, the result is below:

```
[core $gencores1]
name=p0
task=0
mode=gen
tx port=p0
bps=1250000000
pkt inline=${local_hex_mac2} 00 00 00 00 00 00 08 00 45 00 00 2e 00 01 00 00 40 11 f7 7d ${local_hex_ip1} ${local_hex_ip2} 0b b8 0b b9 00 1a 55 7b
pkt size=60
min bulk size=$mbs
max bulk size=16
drop=yes
lat pos=42
accuracy pos=46
packet id pos=50
signature=0x98765432
signature pos=56
;arp update time=1

[core $gencores2]
name=p1
task=0
mode=gen
tx port=p1
bps=1250000000
pkt inline=${local_hex_mac1} 00 00 00 00 00 00 08 00 45 00 00 2e 00 01 00 00 40 11 f7 7d ${local_hex_ip2} ${local_hex_ip1} 0b b8 0b b9 00 1a 55 7b
pkt size=60
min bulk size=$mbs
max bulk size=16
drop=yes
lat pos=42
accuracy pos=46
packet id pos=50
signature=0x98765432
signature pos=56
;arp update time=1

[core $latcores1]
name=lat1
task=0
mode=lat
;sub mode=l3
rx port=p1
lat pos=42
accuracy pos=46
packet id pos=50
signature=0x98765432
signature pos=56
accuracy limit nsec=1000000
latency bucket size=${bucket_size_exp}
;arp update time=1

[core $latcores2]
name=lat2
task=0
mode=lat
;sub mode=l3
rx port=p0
lat pos=42
accuracy pos=46
packet id pos=50
signature=0x98765432
signature pos=56
accuracy limit nsec=1000000
latency bucket size=${bucket_size_exp}
;arp update time=1
```

### Modify VPP

To configure the opposite direction just copy the l2patches for the unidirectional traffic and invert the ports number:

```
vpp# show l2patch
                  memif1/0 -> memif3/0
                  memif4/0 -> memif2/0
vpp# test l2patch rx memif2/0 tx memif4/0
vpp# test l2patch rx memif3/0 tx memif1/0
vpp# show l2patch
                  memif1/0 -> memif3/0
                  memif2/0 -> memif4/0
                  memif3/0 -> memif1/0
                  memif4/0 -> memif2/0
```

###  Modify OvS-DPDK

To configure the opposite direction just edit the `setup-flows.sh`  copying the existing flows for the unidirectional traffic and invert the ports actions:

``` bash
udo ovs-ofctl --timeout 10 -O OpenFlow13 del-flows vsperf-br0
sudo ovs-ofctl --timeout 10 -O Openflow13 add-flow vsperf-br0 in_port=1,idle_timeout=0,action=output:3
sudo ovs-ofctl --timeout 10 -O Openflow13 add-flow vsperf-br0 in_port=4,idle_timeout=0,action=output:2
sudo ovs-ofctl --timeout 10 -O Openflow13 add-flow vsperf-br0 in_port=3,idle_timeout=0,action=output:1
sudo ovs-ofctl --timeout 10 -O Openflow13 add-flow vsperf-br0 in_port=2,idle_timeout=0,action=output:4
```

Run `sudo ./setup_flows.sh` and verify that the flows are correct by running `sudo ovs-ofctl dump-flows vsperf-br0`:

``` bash
[opnfv@worker utilities]$ sudo ovs-ofctl dump-flows vsperf-br0
 cookie=0x0, duration=10.400s, table=0, n_packets=0, n_bytes=0, in_port=1 actions=output:3
 cookie=0x0, duration=10.348s, table=0, n_packets=0, n_bytes=0, in_port=4 actions=output:2
 cookie=0x0, duration=10.410s, table=0, n_packets=0, n_bytes=0, in_port=3 actions=output:1
 cookie=0x0, duration=10.358s, table=0, n_packets=0, n_bytes=0, in_port=2 actions=output:4
```

### Configure rapid environment and files

On Node 1 source the rapidenv and enter the rapid folder:

```bash
[opnfv@worker ~]$ source rapidenv/bin/activate
(rapidenv) [opnfv@worker ~]$  cd rapid
(rapidenv) [opnfv@worker rapid]$
```

Now we need to modify the `.env` ,  `.tst` files to run the `runrapid.py` script that do the tests.

For the `topology-3.env`:

```
[rapid]
loglevel = DEBUG
version = 19.6.30
total_number_of_machines = 1

[M1]
name = rapid-pod-1
admin_ip = 10.244.1.157
dp_ip1 = 192.168.30.11
dp_mac1 = de:ad:c3:52:79:9b
dp_ip2 = 192.168.30.12
dp_mac2 = 02:09:c0:fd:ba:1f


[ssh]
key=rapid_rsa_key
user = root

[Varia]
vim = Openstack
stack = rapid
```

Before editing the `.tst` file, the new `prox.cfg` file should be copied under a folder in the same Node, in this case under `~/configs` and renamed as `prox-bi.cfg`.

The `topology-3.tst`:

```
[TestParameters]
name = Rapid_ETSINFV_TST009
number_of_tests = 1
total_number_of_test_machines = 1
lat_percentile = 99

[TestM1]
name = Generator
prox_launch_exit = false
config_file = configs/prox-bi.cfg
dest_vm = 1
mcore = [14]
gencores = [15,16]
latcores = [17,18]

[test1]
test=TST009test
warmupflowsize=128
warmupimix=[64]
warmupspeed=1
warmuptime=2
imixs=[[64],[128],[256],[512],[1024],[1280],[1512]]
flows=[1]
drop_rate_threshold = 0
MAXr = 3
MAXz = 5000
MAXFramesPerSecondAllIngress = 12000000
StepSize = 10000
```

### Running the tests

Now that it's all configured, the test can be started form the rapid folder with the `runrapid.py` script, passing the two files as arguments:

``` bash
(rapidenv) [opnfv@worker rapid]$ python runrapid.py --env topology-3.env --test topology-3.tst  --map machine.map --runtime 10 --screenlog DEBUG
```