1 Generating traffic with VPP
2 ===========================
4 Vpp includes a fairly capable network simulator plugin, which can
5 simulate real-world round-trip times and a configurable network packet
6 loss rate. It’s perfect for evaluating the performance of a TCP stack
7 under specified delay/bandwidth/loss conditions.
9 The “nsim” plugin cross-connects two physical interfaces at layer 2,
10 introducing the specified delay and network loss parameters.
11 Reconfiguration on the fly is OK, with the proviso that packets held in
12 the network simulator scheduling wheel will be lost.
17 Configuration by debug CLI is simple. First, specify the simulator
18 configuration: unidirectional delay (half of the desired RTT), the link
19 bandwidth, and the expected average packet size. These parameters allow
20 the network simulator allocate the right amount of buffering to produce
21 the requested delay/bandwidth product.
25 set nsim delay 25.0 ms bandwidth 10 gbit packet-size 128
27 To simulate network packet drops, add either “packets-per-drop ” or
28 “drop-fraction [0.0 … 1.0]” parameters:
32 set nsim delay 25.0 ms bandwidth 10 gbit packet-size 128 packets-per-drop 10000
34 Remember to configure the layer-2 cross-connect:
38 nsim enable-disable <interface-1> <interface-2>
40 Packet Generator Configuration
41 ------------------------------
43 Here’s a unit-test configuration for the vpp packet generator:
48 set int ip address loop0 11.22.33.1/24
49 set int state loop0 up
52 set int ip address loop1 11.22.34.1/24
53 set int state loop1 up
55 set nsim delay 1.0 ms bandwidth 10 gbit packet-size 128 packets-per-drop 1000
56 nsim enable-disable loop0 loop1
58 packet-generator new {
64 data { IP4: 1.2.3 -> 4.5.6
65 UDP: 11.22.33.44 -> 11.22.34.44
71 For extra realism, the network simulator drops any specific packet with
72 the specified probability. In this example, we see that slight variation
73 from run to run occurs as it should.
80 9991 nsim Packets buffered
81 9 nsim Network loss simulation drop packets
82 9991 ethernet-input l3 mac mismatch
89 9993 nsim Packets buffered
90 7 nsim Network loss simulation drop packets
91 9993 ethernet-input l3 mac mismatch