Trying out the Behavioral Model#1
Open
anshumanmohan wants to merge 5 commits into
Open
Conversation
Command is `p4c-vitisnet default.p4 -o default.json`
Command was `run-p4bm-vitisnet -j default.json -s cli_commands.txt`
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I've been playing with AMD's P4 Behavioral Model, and I'm stashing my progress here.
Things mostly progress as documented here. In some cases I found the docs confusing, but basically I got through it.
Requirements
default.p4underprogs/default/.traffic_in.pcapunderprogs/default/.run_trafficwhile specifying the PCAP file above, and then exiting. Seecli_commands.txtunderprogs/default/.Running
The command is
run-p4bm-vitisnet -j default.json -s cli_commands.txt. The result is a new file,traffic_out.pcap.Other info
Instead of a PCAP, it is also possible to provide packet info in a different, human-readable format with extension
.user. Seetraffic_in.userunderprogs/default/. If the BM does not see a PCAP with the correct name, it uses the.userfile if there is one. This also means that the result is a.userfile. You can see an example of this underprogs/five_tuple.The instructions mention:
along with instructions on how to write this
.tclfile. This did not work for me; I got an "Inappropriate ioctl for device" error. Besides, I was just able to make it work without doing anything to get into a "Vivado context". Please let me know if this divergence is of interest, and I'll make an issue with a minimal example!Above I have described the "script" style of working with the BM, which rolls together the "control plane" and "data plane" of the simulated network. It is possible to work with these separately, as described here. Below I reproduce the commands that worked for me.
p4bm-vitisnet default.json &to launch the control plane process as a background task.p4bm-vitisnet-cli. In the CLI now presented, run:run_traffic ./trafficexittraffic_out.pcapwill be created. If you had notraffic_in.pcapbut did have atraffic_in.usersitting around, thentraffic_out.userwill be created.