Hi 

I think packetdrill can be used for the development of new feature for VPP HostStack. So I share how to use packetdrill to test VPP HostStack by veth-pair.

1. Clone packetdrill form  https://github.com/google/packetdrill.git , apply the  patch named pd.patch  and build it

2. The patch named vpp_pd.patch is for vpp  which is used to adapte to packetdrill, and building VPP will generate libpd.so . This file is for packetdrill.

3. Create veth interfaces on host

    ip link add name vppvethout type veth peer name vppvethhost
    ip link set dev vppvethout up
    ip link set dev vppvethhost up
    ip addr add 10.10.1.1/24 dev vppvethhost

4. Create vpp host- interface
    create host-interface name vppvethout  hw-addr  ee:ff:ff:ff:ff:ff
    set int state host-vppvethout up
    set int ip address host-vppvethout 10.10.1.2/24
    show int addr
    ping 10.10.1.1

5. Run the packetdrill script to test VPP Hoststack

LD_PRELOAD=$(vpp)/build-root/install-vpp-native/vpp/lib/libvcl_ldpreload.so VCL_CONFIG=./vcl.conf ./packetdrill --local_ip=10.10.1.2 --remote_ip=10.10.1.1 --so_filename=$(vpp)/build-root/install-vpp native/vpp/lib/libpd.so ./close-remote-fin-then-close.pkt

note : close-remote-fin-then-close.pkt is a little different from the native   file in packetdrill. 

I hope it is useful for you。

Regards
Longfei








Attachment: pd.patch
Description: Binary data

Attachment: vpp_pd.patch
Description: Binary data

Attachment: close-remote-fin-then-close.pkt
Description: Binary data

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.

View/Reply Online (#15853): https://lists.fd.io/g/vpp-dev/message/15853
Mute This Topic: https://lists.fd.io/mt/72516405/21656
Group Owner: vpp-dev+ow...@lists.fd.io
Unsubscribe: https://lists.fd.io/g/vpp-dev/unsub  [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to