ngsdn-tutorial icon indicating copy to clipboard operation
ngsdn-tutorial copied to clipboard

Are externs supported in the BMV2 switch used in the tutorial simulations ?

Open zakariaAitHmitti opened this issue 4 years ago • 1 comments
trafficstars

Hi, is it possible to add externs to the BMV2 switch used in the tutorial simulations ? if yes, could you provide clear steps on how to change the switch source code and rebuild it. Thank you so much !

zakariaAitHmitti avatar Jul 31 '21 13:07 zakariaAitHmitti

Hi @zakariaCreate ,

Consider that I have not made custom externs for BMv2 and integrate it with Stratum myself so my answer might not be completely correct.

According to the README, there is a VM with the NGSDN tutorial and dependencies. If you want to run your own externs, then you cannot use the resources from the VM. This seems to be because the exercises and the pre-built VM use Docker and a pre-packaged Stratum+BMv2 container. My guess is that the steps would have to be similar to the following order:

  • Clone your BMv2 repository and modify it to incorporate your externs. You can find some information about implementing your own externs in the following links that I found using Google:
  • Consider that there might be more changes in regard to v1model.p4 architecture file, p4c related libraries, simple_switch related libraries, maybe others from Stratum and so on. I am not sure about this but check previous files.
  • Consider that the NGSDN tutorial uses a container built with Mininet + Stratum + BMv2. If you check the repository of Stratum, it seems to me that the container is built according to the steps in file build-stratum-bmv2-container.sh.
  • The only part that I am not completely sure about is how you "link" your own version of BMv2 (with your own externs) to the whole build process. As far as I've seen, the .sh file mentioned before has the following line: bazel build //stratum/hal/bin/bmv2:${STRATUM_TARGET}_deb so you might have to modify how that .deb file is generated.
  • It seems to me that one or more files out of the multiple ones I found referring to BMv2 like: hal/lib/bmv2 BUILD file, hal/bin/bmv2 directory files, bazel/external/bmv2.BUILD might have to be modified modify. I cannot be sure though. Let's see if @pudelkoM knows it :)

Cheers,

ederollora avatar Jul 31 '21 16:07 ederollora