blob: 82dba96c171a0d4374d7937140f1b807f5945230 [file] [log] [blame]
Nathan Skrzypczak9ad39c02021-08-19 11:38:06 +02001Stateless Traffic Gen with VPP
2==============================
3
4Its simple to configure vpp as a high-performance stateless traffic
5generator. A couple of vpp worker threads running on an older system can
6easily generate 20 MPPS worth of traffic.
7
8In the configurations shown below, we connect a vpp traffic generator
9and a vpp UUT using two 40 gigabit ethernet ports on each system:
10
11::
12
13 +-------------------+ +-------------------+
14 | traffic generator | | UUT |
15 | port 0 | <=======> | port 0 |
16 | 192.168.40.2/24 | | 192.168.40.1/24 |
17 +-------------------+ +-------------------+
18
19 +-------------------+ +-------------------+
20 | traffic generator | | UUT |
21 | port 1 | <=======> | port 1 |
22 | 192.168.41.2/24 | | 192.168.41.1/24 |
23 +-------------------+ +-------------------+
24
25Traffic Generator Setup Script
26------------------------------
27
28::
29
30 set int ip address FortyGigabitEthernet2/0/0 192.168.40.2/24
31 set int ip address FortyGigabitEthernet2/0/1 192.168.41.2/24
32 set int state FortyGigabitEthernet2/0/0 up
33 set int state FortyGigabitEthernet2/0/1 up
34
35 comment { send traffic to the VPP UUT }
36
37 packet-generator new {
38 name worker0
39 worker 0
40 limit 0
41 rate 1.2e7
42 size 128-128
43 tx-interface FortyGigabitEthernet2/0/0
44 node FortyGigabitEthernet2/0/0-output
45 data { IP4: 1.2.40 -> 3cfd.fed0.b6c8
46 UDP: 192.168.40.10 -> 192.168.50.10
47 UDP: 1234 -> 2345
48 incrementing 114
49 }
50 }
51
52 packet-generator new {
53 name worker1
54 worker 1
55 limit 0
56 rate 1.2e7
57 size 128-128
58 tx-interface FortyGigabitEthernet2/0/1
59 node FortyGigabitEthernet2/0/1-output
60 data { IP4: 1.2.4 -> 3cfd.fed0.b6c9
61 UDP: 192.168.41.10 -> 192.168.51.10
62 UDP: 1234 -> 2345
63 incrementing 114
64 }
65 }
66
67 comment { delete return traffic on sight }
68
69 ip route add 192.168.50.0/24 via drop
70 ip route add 192.168.51.0/24 via drop
71
72Note 1: the destination MAC addresses shown in the configuration (e.g.
733cfd.fed0.b6c8 and 3cfd.fed0.b6c9) **must** match the vpp UUT port MAC
74addresses.
75
76Note 2: this script assumes that /etc/vpp/startup.conf and/or the
77command-line in use specifies (at least) two worker threads. Uncomment
78workers 2 in the cpu configuration section of /etc/vpp/startup.conf:
79
80::
81
82 ## Specify a number of workers to be created
83 ## Workers are pinned to N consecutive CPU cores while skipping "skip-cores" CPU core(s)
84 ## and main thread's CPU core
85 workers 2
86
87Any plausible packet generator script - including one which replays pcap
88captures - can be used.
89
90UUT Setup Script
91----------------
92
93The vpp UUT uses a couple of static routes to forward traffic back to
94the traffic generator:
95
96::
97
98 set int ip address FortyGigabitEthernet2/0/0 192.168.40.1/24
99 set int ip address FortyGigabitEthernet2/0/1 192.168.41.1/24
100 set int state FortyGigabitEthernet2/0/0 up
101 set int state FortyGigabitEthernet2/0/1 up
102
103 ip route add 192.168.50.10/32 via 192.168.41.2
104 ip route add 192.168.51.10/32 via 192.168.40.2