P4 Easily Deployable Testing Solution for IPv6

I’ve been using: GitHub - p4lang/tutorials: P4 language tutorials as a source for examples and tutorials to learn/practice writing P4 code and testing it in a virtual network through Mininet. The GitHub tutorials contained in that repository for ipv4 were incredibly helpful ( also Andy’s help :smile: ) and it was super beneficial to have a virtual environment that I could just quickly spin up to test my P4 code by just doing ./make run.

However, I just found out that Mininet doesn’t support ipv6 and so when I tried to test my ipv6 p4 code, it was not working. I’m pretty new to a lot of these tools and so I was wondering if there was a testing environment/virtual network like Mininet on a VM that I can download and easily use to simplify the testing process. I read something about there being Mininet add ons for ipv6 but am not sure how P4 would interface with those. Any guidance regarding if such a VM/toolset exists already or advice how to proceed will be greatly helpful. Thank you again!

Hi @ThePuriProdigy,

you can use tcpreplay and/or scapy python module, in both case you can inject the traffic on a physical or virtual interface

How would I load the p4 code and create a virtual switch then? Would I still use Mininet?

You can use mininet if you need a network, otherwise you can use a single istance of a bmv2 switch GitHub - p4lang/behavioral-model: The reference P4 software switch

I might be misunderstanding something but I was under the assumption/knowledge that Mininet only supports ipv4 not ipv6 - or does it?

I use podman/docker to run Mininet in a container. You can pick between bmv2 or stratum. Then, I use port forwarding to access the P4Runtime ports of the switches, and load the compiled P4 program that way.

There are some scripts (net/run.sh) here: finsy/examples at main · byllyfish/finsy · GitHub

Mininet supports IPv6 but you have to write your own custom “topo” python file to add the hosts.

-Bill

How did you deal with the podman noout issue? It’s complaining about unknown flag --noout (I have the latest version of podman)

I use podman 4.3.1 on MacOS installed via HomeBrew. 4.3.1 is the latest release. The --noout flag stops podman from printing the image/container ID when starting; it limits the verbosity of the output for cosmetic reasons. Please check your podman --version.

UPDATE: The ngsdn and simple examples have --noout issues using podman 3.4.4 on ubuntu 22.04. I will fix. Thanks.

@ThePuriProdigy I believe that you can send any kind of traffice within a mininet network. By default you can easilly send arp, ipv4 and udp/tcp traffic, because mininett have iperf and ping embedded in his shell. But if you have a “traffic generator” you can send custom traffic on a interface.

@byllyfish I’m now getting Error: short-name “opennetworking/mn-stratum” did not resolve to an alias and no unqualified-search registries are defined in “/etc/containers/registries.conf”

I’ve tried podman docker pulling the container but it results in the same issue. Am I missing a step?

The scripts don’t use the fully qualified names. The fully-qualified name is “docker.io/opennetworking/mn-stratum”. I will fix that. My system works because I have the following uncommented line in my /etc/containers/registries.conf file:

unqualified-search-registries = [“docker.io”]

If you have further questions, you may create a Github issue at Issues · byllyfish/finsy · GitHub