|
| 1 | + |
| 2 | +.. SPDX-License-Identifier: Marvell-MIT |
| 3 | + Copyright (c) 2024 Marvell. |
| 4 | +
|
| 5 | +Running VPP applications |
| 6 | +======================== |
| 7 | + |
| 8 | +Prerequisites |
| 9 | +------------- |
| 10 | +a. Linux booted on Host and DPU |
| 11 | + |
| 12 | +b. Login to your docker on host and DPU |
| 13 | + |
| 14 | +c. Bind the pktio and crypto devices to vfio-pci |
| 15 | + |
| 16 | +.. code-block:: console |
| 17 | +
|
| 18 | + source dao-env.sh |
| 19 | +
|
| 20 | +
|
| 21 | +DAO Environment Setup |
| 22 | +--------------------- |
| 23 | +Following step is required to run only once after the first login to docker |
| 24 | + |
| 25 | +.. code-block:: console |
| 26 | +
|
| 27 | + ~# source /dao-env.sh |
| 28 | +
|
| 29 | +
|
| 30 | +L3 Router |
| 31 | +--------- |
| 32 | +a. start vpp with config file at /etc/vpp/pktio_startup.conf |
| 33 | + |
| 34 | +.. code-block:: console |
| 35 | +
|
| 36 | + ~# vpp -c /etc/vpp/pktio_startup.conf |
| 37 | +
|
| 38 | +
|
| 39 | +b. start vppctl command on console |
| 40 | + |
| 41 | +.. code-block:: console |
| 42 | +
|
| 43 | + ~# vppctl |
| 44 | +
|
| 45 | + vpp# set int state eth0 up |
| 46 | + vpp# set int state eth1 up |
| 47 | + vpp# set int ip address eth0 10.29.10.1/24 |
| 48 | + vpp# set int ip address eth1 10.29.20.2/24 |
| 49 | + vpp# set ip neighbor eth0 10.29.10.10 00:00:00:01:01:01 |
| 50 | + vpp# set ip neighbor eth1 10.29.20.20 00:00:00:02:01:01 |
| 51 | + vpp# ip route add 10.29.10.10/24 via eth0 |
| 52 | + vpp# ip route add 10.29.20.20/24 via eth1 |
| 53 | + vpp# show int |
| 54 | + vpp# trace add eth0-rx 5 |
| 55 | +
|
| 56 | +c. On host x86 machine, configure the IPs of the interfaces to send traffic |
| 57 | + |
| 58 | +.. code-block:: console |
| 59 | +
|
| 60 | + ~# ifconfig intf1 10.29.10.10/24 |
| 61 | + ~# ifconfig intf2 10.29.20.20/24 |
| 62 | +
|
| 63 | +d. Run tshark capture on intf2 |
| 64 | + |
| 65 | +.. code-block:: console |
| 66 | +
|
| 67 | + ~# tshark -i intf2 -Y "udp" -V |
| 68 | +
|
| 69 | +e. Run scapy and send traffic |
| 70 | + |
| 71 | +.. code-block:: console |
| 72 | +
|
| 73 | + ~# scapy |
| 74 | +
|
| 75 | + >>> sendp(Ether(dst="ba:7a:5a:ae:c7:ab",src="00:00:00:01:01:01")/IP(src="10.29.10.10",dst="10.29.20.20",len=60)/UDP(dport=4000,sport=4000,len=40)/Raw(RandString(size=32)), iface="intf1", return_packets=True, count=100) |
| 76 | +
|
| 77 | +f. Observe the traffic on tshark console on x86 host |
| 78 | + |
| 79 | +g. On VPP console check the graph walk |
| 80 | + |
| 81 | +.. code-block:: console |
| 82 | +
|
| 83 | + vpp# show trace |
| 84 | +
|
| 85 | +
|
| 86 | +VPP as IPsec Tunnel Originator |
| 87 | +------------------------------ |
| 88 | +h. start vpp with config file at /etc/vpp/pktio_startup.conf |
| 89 | + |
| 90 | +.. code-block:: console |
| 91 | +
|
| 92 | + ~# vpp -c /etc/vpp/crypto_startup.conf |
| 93 | +
|
| 94 | +i. start vppctl command on console |
| 95 | + |
| 96 | +.. code-block:: console |
| 97 | +
|
| 98 | + ~# vppctl |
| 99 | +
|
| 100 | + vpp# set int ip address eth0 10.29.10.1/24 |
| 101 | + vpp# set int state eth0 up |
| 102 | + vpp# set ip neighbor eth0 10.29.10.10 00:00:00:01:01:01 |
| 103 | + vpp# set int promiscuous on eth0 |
| 104 | + vpp# set int ip address eth1 192.168.1.1/24 |
| 105 | + vpp# set ip neighbor eth1 192.168.1.2 00:00:00:02:01:01 |
| 106 | + vpp# set int state eth1 up |
| 107 | + vpp# set int promiscuous on eth1 |
| 108 | + vpp# set ipsec async mode on |
| 109 | + vpp# ipsec itf create |
| 110 | + vpp# ipsec sa add 10 spi 1001 esp crypto-key 4a506a794f574265564551694d653768 crypto-alg aes-gcm-128 tunnel src 192.168.1.1 dst 192.168.1.2 esp |
| 111 | + vpp# ipsec sa add 20 spi 2001 inbound crypto-alg aes-gcm-128 crypto-key 4d4662776d4d55747559767176596965 tunnel src 192.168.1.2 dst 192.168.1.1 esp |
| 112 | + vpp# ipsec tunnel protect sa-out 10 ipsec0 |
| 113 | + vpp# set int state ipsec0 up |
| 114 | + vpp# set interface unnum ipsec0 use eth1 |
| 115 | + vpp# ip route add 10.29.20.20/24 via ipsec0 |
| 116 | + vpp# show int |
| 117 | + vpp# pcap trace tx intfc eth1 max 100 file outbound_enc.pcap |
| 118 | + vpp# trace add eth0-rx 5 |
| 119 | +
|
| 120 | +j. On host x86 machine, configure the IPs of the interfaces to send traffic |
| 121 | + |
| 122 | +.. code-block:: console |
| 123 | +
|
| 124 | + ~# ifconfig intf1 10.29.10.10/24 |
| 125 | + ~# ifconfig intf2 10.29.20.20/24 |
| 126 | +
|
| 127 | +k. Run tshark capture on intf2 |
| 128 | + |
| 129 | +.. code-block:: console |
| 130 | +
|
| 131 | + ~# tshark -i intf2 -Y "esp" -V |
| 132 | +
|
| 133 | +l. Run scapy and send traffic |
| 134 | + |
| 135 | +.. code-block:: console |
| 136 | +
|
| 137 | + ~# scapy |
| 138 | +
|
| 139 | + >>> sendp(Ether(dst="ba:7a:5a:ae:c7:ab",src="00:00:00:01:01:01")/IP(src="10.29.10.10",dst="10.29.20.20",len=60)/UDP(dport=4000,sport=4000,len=40)/Raw(RandString(size=32)), iface="intf1", return_packets=True, count=5) |
| 140 | +
|
| 141 | +m. Observe the ESP traffic on tshark console on x86 host |
| 142 | + ~# tshark -i intf2 -Y "esp" -V |
| 143 | + |
| 144 | +n. On VPP console check the graph walk |
| 145 | + vpp# show trace |
| 146 | + |
0 commit comments