Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Getting started

TL;DR

Select and install a P4

...

data-plane target platform architecture

Expand
titleBMv2


Expand
titleubuntu 18.04


Code Block
languagebash
themeMidnight
sudo add-apt-repository ppa:frederic-loui/p4lang-3rd-party 
sudo apt-get update

sudo add-apt-repository ppa:frederic-loui/p4lang-master-bionic-nightly
sudo apt-get update



Expand
titleubuntu 20.04


Code Block
languagebash
themeMidnight
sudo add-apt-repository ppa:frederic-loui/p4lang-3rd-party-focal 
sudo add-apt-repository ppa:frederic-loui/p4lang-master-focal-nightly 
sudo apt-get update



Expand
titledebian 10


Code Block
languagebash
themeMidnight
echo 'deb https://download.opensuse.org/repositories/home:/frederic-loui:/p4lang:/p4c/Debian_10/  ./" | sudo tee /etc/apt/source.list.d/p4lang.list
sudo apt-get update




Expand
titleTOFINO

Software for TOFINO NPU is subject to a Software License and Confidentiality Agreement (SLACA)

If you are an R&E organization please submit an application via INTEL/BAREFOOT FASTER portal

From there you'll be able to install INTEL/BAREFOOT P4Studio also call BAREFOOT Software Development Environment (SDE)

Install FreeRouter control-plane

Expand
titleubuntu 18.04 & 20.04


Code Block
languagebash
themeMidnight
sudo add-apt-repository ppa:frederic-loui/freerouter-nightly
sudo apt-get update
sudo apt-get install freerouter-native freerouter



Expand
titledebian 10


Code Block
languagebash
themeMidnight
echo 'deb https://download.opensuse.org/repositories/home:/frederic-loui:/freerouter/Debian_10/  ./" | sudo tee /etc/apt/source.list.d/p4lang.list
sudo apt-get update


Install RARE software

Expand
titleBMv2


Code Block
languagebash
themeMidnight
git clone https://github.com/frederic-loui/RARE.git



Expand
titleTOFINO

Before anything, you'll have to install BAREFOOT SDE following BAREFOOT instruction. TOFINO code can be found here: (From GÉANT Bitbucket RARE repository)

https://bitbucket.software.geant.org/projects/RARE/repos/rare/browse

Code Block
languagebash
themeMidnight
git clone https://bitbucket.software.geant.org/scm/rare/rare.git

(in compliance with INTEL/BAREFOOT announcement that grant the publication of the P4 code)

Build & Run RARE software

Expand
titleBMv2 with P4Runtime (simple_swicth_grpc) 


Code Block
languagebash
themeMidnight
cd 02-PE-labs/0001-vpn-over-bgp-isis-sr-operation
make

in order stop the whole setup:

Code Block
languagebash
themeMidnight
cd 02-PE-labs/0001-vpn-over-bgp-isis-sr-operation
make clean



Expand
titleTOFINO with BFRuntime (bf_switchd)


Expand
titleOn virtual TOFINO model

Compile P4 bf_router.p4 program

  • with MPLS profile
Code Block
languagebash
themeMidnight
export RARE=/home/p4 
$SDE/tools/p4_build.sh -I$RARE/p4src/ -DHAVE_MPLS -DHAVE_BRIDGE $RARE/p4src/bf_router.p4
  • with SRv6 profile
Code Block
languagebash
themeMidnight
export RARE=/home/p4 
$SDE/tools/p4_build.sh -I$RARE/p4src/ -DHAVE_SRV6 -DHAVE_BRIDGE -DHAVE_NAT $RARE/p4src/bf_router.p4

run TOFINO model

Code Block
languagebash
themeMidnight
cd $SDE 
./run_tofino_model.sh -p bf_router .

run TOFINO bf_switchd

Code Block
languagebash
themeMidnight
cd $SDE 
./run_switchd.sh -p bf_router

run Freerouter control plane

Code Block
languagebash
themeMidnight
cd $RARE/02-PE-labs/0001-vpn-over-bgp-isis-sr-operation 
./make

in order to stop FreeRouter

Code Block
languagebash
themeMidnight
cd $RARE/02-PE-labs/0001-vpn-over-bgp-isis-sr-operation 
./make clean

run bf_forwarder.py interface

Code Block
languagebash
themeMidnight
cd $RARE/bfrt_python 
./bf_forwarder.py



Expand
titleOn hardware WEDGEBF10032X

Compile P4 bf_router.p4 program

  • with MPLS profile
Code Block
languagebash
themeMidnight
export RARE_PATH=/home/p4 
$SDE/tools/p4_build.sh -I$RARE/p4src/  -DHAVE_MPLS -DHAVE_BRIDGE -D_WEDGE100BF32X_ $RARE/p4src/bf_router.p4
  • with SRv6 profile
Code Block
languagebash
themeMidnight
export RARE=/home/p4 
$SDE/tools/p4_build.sh -I$RARE/p4src/ -DHAVE_SRV6 -DHAVE_BRIDGE -DHAVE_NAT -D_WEDGE100BF32X_ $RARE/p4src/bf_router.p4

run TOFINO bf_switchd

Code Block
languagebash
themeMidnight
cd $SDE 
./run_switchd.sh -p bf_router

run Freerouter control plane.   

Code Block
languagebash
themeMidnight
cd $RARE/100-WEDGE-100BF-32X/0001-vpn-over-bgp-isis-sr-operation 
./make

in order to stop FreeRouter

Code Block
languagebash
themeMidnight
cd $RARE/100-WEDGE-100BF-32X/0001-vpn-over-bgp-isis-sr-operation 
./make clean

run bf_forwarder.py interface

Code Block
languagebash
themeMidnight
cd $RARE/bfrt_python 
./bf_forwarder.py