-
Notifications
You must be signed in to change notification settings - Fork 708
VPP STN_Testing
Dave Wallace edited this page Apr 21, 2026
·
1 revision
# In this simulation, we use 192.168.1.2/24 as the 'shared address' between a vpp interface, and one end of a veth pair connected to vpp
# We need to setup a testing environment that uses the stn path in an analogous manner to what we need it to do.
# To do this, we create a 'pretendroot' namespace, and connect vpp to it with an eth0 interface in the pretendroot namespace
sudo ip netns add pretendroot
sudo ip link add name vpp2eth0 type veth peer name eth0
# Don't forget to disable the tcp offload, or we will get bitten by the Linux kernels misbehavior around checksums over veth pairs
sudo ethtool --offload eth0 rx off tx off
sudo ip link set eth0 netns pretendroot
sudo ip netns exec pretendroot ip addr add 192.168.1.2/24 dev eth0
# Set the mac address of the eth0 interface. VPP will use 00:00:00:00:00:02 to address it, so we need to make sure the kernel accepts that mac for the eth0 interface
sudo ip netns exec pretendroot ip link set dev eth0 address 00:00:00:00:00:02
sudo ip netns exec pretendroot ip link set dev eth0 up
# Playing the part of our 'realnic' in this simulation, we create a 'realeth0' veth to connect to vpp.
# So that we can use it to originate traffic towards vpp, we give it IP 192.168.1.1/24
sudo ip link add name vpp2realeth0 type veth peer name realeth0
sudo ethtool --offload realeth0 rx off tx off
sudo ip addr add 192.168.1.1/24 dev realeth0
sudo ip link set dev realeth0 up
# Connect the vpp side of realeth0 (vpp2realeth0), addres it, and make sure its working
sudo vppctl create host-interface name vpp2realeth0
sudo vppctl set interface ip address host-vpp2realeth0 192.168.1.2/24
sudo vppctl set int state host-vpp2realeth0 up
ping 192.168.1.2
# Connect the vpp side of eth0 (vpp2eth0), set it up as an unnumbered slave of vpp2realeth0
sudo vppctl create host-interface name vpp2eth0
REALETH0_INT_IDX=$(sudo vppctl show int | grep host-vpp2realeth0 | awk '{print $2}')
echo ${REALETH0_INT_IDX}
ETH0_INT_IDX=$(sudo vppctl show int | grep host-vpp2eth0 | awk '{print $2}')
echo ${ETH0_INT_IDX}
echo sw_interface_set_unnumbered sw_if_index ${REALETH0_INT_IDX} unnum_if_index ${ETH0_INT_IDX} | sudo vpp_api_test | grep -v "#vat"
sudo vppctl set int state host-vpp2eth0 up
# Setup proxy arp for vpp2eth0
sudo vppctl set ip arp proxy 192.168.1.1-192.168.1.255
sudo vppctl set interface proxy-arp host-vpp2eth0 enable
# Setup the stn rule for 192.168.1.2 to host-vpp2eth0
sudo vppctl stn rule address 192.168.1.2 interface host-vpp2eth0
sudo vppctl show stn rule
# Don't forget to setup vpp trace
sudo vppctl trace add af-packet-input 100
sudo ip netns exec pretendroot ping 192.168.1.1
Ping works in this situation.
Set up an echo server in the pretendroot namespace, and telnet to it.
In one shell:
sudo ip netns exec pretendroot /bin/bash
ncat -l 2000 -k -c 'xargs -n1 echo'
In a second shell:
telnet 192.168.1.2 2000
And try the echo server.
TCP works in this senario.
If you look at Packet 4, you will see the icp echo response is being addressed to mac address 00:00:00:00:00:02 (and bogus source 00:00:00:00:00:01) which causes the eth0 interface to reject the response. Tests for TCP and UDP showed the same issue.
- VPP 2022 Make Test Use Case Poll
- VPP-AArch64
- VPP-ABF
- VPP Alternative Builds
- VPP API Concepts
- VPP API Versioning
- VPP-ApiChangeProcess
- VPP-ArtifactVersioning
- VPP-BIER
- VPP-Bihash
- VPP-BugReports
- VPP Build System Deep Dive
- VPP Build, Install, And Test Images
- VPP-BuildArtifactRetentionPolicy
- VPP-c2cpel
- VPP Code Walkthrough VoD
- VPP Code Walkthrough VoD Topic Index
- VPP Code Walkthrough VoDs
- VPP-CodeStyleConventions
- VPP-CodingTips
- VPP Command Line Arguments
- VPP Command Line Interface CLI Guide
- VPP-CommitMessages
- VPP-Committers-SMEs
- VPP-CommitterTasks-ApiFreeze
- VPP CommitterTasks Compare API Changes
- VPP-CommitterTasks-CutPointRelease
- VPP-CommitterTasks-CutRelease
- VPP-CommitterTasks-FinalReleaseCandidate
- VPP-CommitterTasks-PullThrottleBranch
- VPP-CommitterTasks-ReleasePlan
- VPP Configuration Tool
- VPP Configure An LW46 MAP E Terminator
- VPP Configure VPP As A Router Between Namespaces
- VPP Configure VPP TAP Interfaces For Container Routing
- VPP-CoreFileMismatch
- VPP-cpel
- VPP-cpeldump
- VPP-CurrentData
- VPP-DHCPKit
- VPP-DHCPv6
- VPP-DistributedOwnership
- VPP-Documentation
- VPP DPOs And Feature Arcs
- VPP EC2 Instance With SRIOV
- VPP-elog
- VPP-FAQ
- VPP Feature Arcs
- VPP-Features
- VPP-Features-IPv6
- VPP-FIB
- VPP-g2
- VPP Getting VPP 16.06
- VPP Getting VPP Release Binaries
- VPP-HA
- VPP-HostStack
- VPP-HostStack-BuiltinEchoClientServer
- VPP-HostStack-EchoClientServer
- VPP-HostStack-ExternalEchoClientServer
- VPP HostStack Hs Test
- VPP-HostStack-LDP-iperf
- VPP-HostStack-LDP-nginx
- VPP-HostStack-LDP-sshd
- VPP-HostStack-nginx
- VPP-HostStack-SessionLayerArchitecture
- VPP-HostStack-TestHttpServer
- VPP-HostStack-TestProxy
- VPP-HostStack-TLS
- VPP-HostStack-VCL
- VPP-HostStack-VclEchoClientServer
- VPP-Hotplug
- VPP How To Add A Tunnel Encapsulation
- VPP How To Build The Sample Plugin
- VPP How To Connect A PCI Interface To VPP
- VPP How To Create A VPP Binary Control Plane API
- VPP How To Deploy VPP In EC2 Instance And Use It To Connect Two Different VPCs
- VPP How To Optimize Performance %28System Tuning%29
- VPP How To Use The API Trace Tools
- VPP How To Use The C API
- VPP How To Use The Packet Generator And Packet Tracer
- VPP-Howtos
- VPP-index
- VPP Installing VPP Binaries From Packages
- VPP Interconnecting vRouters With VPP
- VPP Introduction To IP Adjacency
- VPP Introduction To N Tuple Classifiers
- VPP IP Adjacency Introduction
- VPP-IPFIX
- VPP-IPSec
- VPP IPSec And IKEv2
- VPP IPv6 SR VIRL Topology File
- VPP Java API
- VPP Java API Plugin Support
- VPP Jira Workflow
- VPP-Macswapplugin
- VPP-MakeTestFramework
- VPP-Meeting
- VPP-MFIB
- VPP Missing Prefetches
- VPP Modifying The Packet Processing Directed Graph
- VPP MPLS FIB
- VPP-NAT
- VPP Nataas Test
- VPP-OVN
- VPP Per Feature Notes
- VPP Performance Analysis Tools
- VPP-perftop
- VPP Progressive VPP Tutorial
- VPP Project Meeting Minutes
- VPP Pulling, Building, Running, Hacking And Pushing VPP Code
- VPP Pure L3 Between Namespaces With 32s
- VPP Pure L3 Container Networking
- VPP Pushing And Testing A Tag
- VPP Python API
- VPP-PythonVersionPolicy
- VPP-QuickTrexSetup
- VPP Random Hints And Kinks For KVM Usage
- VPP Release Plans Release Plan 16.09
- VPP Release Plans Release Plan 17.01
- VPP Release Plans Release Plan 17.04
- VPP Release Plans Release Plan 17.07
- VPP Release Plans Release Plan 17.10
- VPP Release Plans Release Plan 18.01
- VPP Release Plans Release Plan 18.04
- VPP Release Plans Release Plan 18.07
- VPP Release Plans Release Plan 18.10
- VPP Release Plans Release Plan 19.01
- VPP Release Plans Release Plan 19.04
- VPP Release Plans Release Plan 19.08
- VPP Release Plans Release Plan 20.01
- VPP Release Plans Release Plan 20.05
- VPP Release Plans Release Plan 20.09
- VPP Release Plans Release Plan 21.01
- VPP Release Plans Release Plan 21.06
- VPP Release Plans Release Plan 21.10
- VPP Release Plans Release Plan 22.02
- VPP Release Plans Release Plan 22.06
- VPP Release Plans Release Plan 22.10
- VPP Release Plans Release Plan 23.02
- VPP Release Plans Release Plan 23.06
- VPP Release Plans Release Plan 23.10
- VPP Release Plans Release Plan 24.02
- VPP Release Plans Release Plan 24.06
- VPP Release Plans Release Plan 24.10
- VPP Release Plans Release Plan 25.02
- VPP Release Plans Release Plan 25.06
- VPP Release Plans Release Plan 25.10
- VPP Release Plans Release Plan 26.02
- VPP Release Plans Release Plan 26.06
- VPP-RM
- VPP-SecurityGroups
- VPP Segment Routing For IPv6
- VPP Segment Routing For MPLS
- VPP Setting Up Your Dev Environment
- VPP-SNAT
- VPP Software Architecture
- VPP STN Testing
- VPP The VPP API
- VPP Training Events
- VPP-Troubleshooting
- VPP-Troubleshooting-BuildIssues
- VPP-Troubleshooting-Vagrant
- VPP Tutorial DPDK And MacSwap
- VPP Tutorial Routing And Switching
- VPP-Tutorials
- VPP Use VPP To Chain VMs Using Vhost User Interface
- VPP Use VPP To Connect VMs Using Vhost User Interface
- VPP Using mTCP User Mode TCP Stack With VPP
- VPP Using VPP As A VXLAN Tunnel Terminator
- VPP Using VPP In A Multi Thread Model
- VPP-VOM
- VPP VPP BFD Nexus
- VPP VPP Home Gateway
- VPP VPP WIKI DEPRECATED CONTENT
- VPP-VPPCommunicationsLibrary
- VPP-VPPConfig
- VPP What Is ODP4VPP
- VPP What Is VPP
- VPP Working Environments
- VPP Working With The 16.06 Throttle Branch