diff --git a/src/tests/p4-fwd-l1/README.md b/src/tests/p4-fwd-l1/README.md new file mode 100644 index 0000000000000000000000000000000000000000..b7da0fd88c6b54e4210d5f0d6664ae1ce219fafb --- /dev/null +++ b/src/tests/p4-fwd-l1/README.md @@ -0,0 +1,47 @@ +# Tests for P4 functionality of TeraFlowSDN + +This directory contains the necessary scripts and configurations to run tests for a simple port forwarding TFS program atop software-based P4 switches (using Mininet). + +## Prerequisites + +This test requires some custom monitoring services (latency monitoring and probe). +These services are implemented in Rust and can be found in the `./probe` directory. +To build these services on your target platform, follow the instructions in `./probe/probe-tfs/README.md`. + +## Basic scripts + +To run the experiments you should use the five scripts in the following order: + +```shell +setup.sh +run_test_01_bootstrap.sh +run_test_02_create_service.sh +run_test_03_delete_service.sh +run_test_04_cleanup.sh +``` + +The `setup` script copies the necessary artefacts to the SBI service pod. It should be run just once, after a fresh install of TFS. +The `bootstrap` script registers the context, topology, links, and devices to TFS. +The `create` service script establishes a service between two endpoints. +The `delete` service script deletes the aforementioned service. +The `cleanup` script deletes all the objects (context, topology, links, and devices) from TFS. + +## Objects file + +The above bash scripts make use of the corresponding python scripts found under `./tests/` directory. +More important is the `./tests/Objects.py` file, which contains the definition of the Context, Topology, Devices, Links, Services. **This is the file that needs changes in case of a new topology.** + +Check the `./tests/Objects.py` file before running the experiment to make sure that the switches' details are correct (ip address, port, etc.) + +## Mininet topologies + +In the `./mininet/` directory there are different mininet topology examples. The current `./tests/Objects.py` file corresponds to the `./mininet/8switch3path.py` topology. Additionally there is a backup file `./tests/topologies/6switchObjects.py` which corresponds to the `./mininet/6switch2path.py`. + +## P4 artefacts + +In the `./p4/` directory there are compiled p4 artefacts of the pipeline that will be pushed to the p4 switch, along with the p4-runtime definitions. +The `./setup.sh` script copies from this directory. So if you need to change p4 program, make sure to put the compiled artefacts there. + +## Latency probe + +In the `./probe/` directory there is a little program which calculates latency between two hosts in mininet and sends these measurements to the Monitoring component. For specific instructions, refer to the corresponding `./probe/README.md` file. diff --git a/src/tests/p4/__init__.py b/src/tests/p4-fwd-l1/__init__.py similarity index 100% rename from src/tests/p4/__init__.py rename to src/tests/p4-fwd-l1/__init__.py diff --git a/src/tests/p4/deploy_specs.sh b/src/tests/p4-fwd-l1/deploy_specs.sh similarity index 100% rename from src/tests/p4/deploy_specs.sh rename to src/tests/p4-fwd-l1/deploy_specs.sh diff --git a/src/tests/p4/mininet/1switch1path.py b/src/tests/p4-fwd-l1/mininet/1switch1path.py similarity index 100% rename from src/tests/p4/mininet/1switch1path.py rename to src/tests/p4-fwd-l1/mininet/1switch1path.py diff --git a/src/tests/p4/mininet/2switch1path.py b/src/tests/p4-fwd-l1/mininet/2switch1path.py similarity index 100% rename from src/tests/p4/mininet/2switch1path.py rename to src/tests/p4-fwd-l1/mininet/2switch1path.py diff --git a/src/tests/p4/mininet/4switch2path.py b/src/tests/p4-fwd-l1/mininet/4switch2path.py similarity index 100% rename from src/tests/p4/mininet/4switch2path.py rename to src/tests/p4-fwd-l1/mininet/4switch2path.py diff --git a/src/tests/p4/mininet/6switch2path.py b/src/tests/p4-fwd-l1/mininet/6switch2path.py similarity index 100% rename from src/tests/p4/mininet/6switch2path.py rename to src/tests/p4-fwd-l1/mininet/6switch2path.py diff --git a/src/tests/p4/mininet/8switch3path.py b/src/tests/p4-fwd-l1/mininet/8switch3path.py similarity index 100% rename from src/tests/p4/mininet/8switch3path.py rename to src/tests/p4-fwd-l1/mininet/8switch3path.py diff --git a/src/tests/p4/p4/bmv2.json b/src/tests/p4-fwd-l1/p4/bmv2.json similarity index 100% rename from src/tests/p4/p4/bmv2.json rename to src/tests/p4-fwd-l1/p4/bmv2.json diff --git a/src/tests/p4/p4/main.p4 b/src/tests/p4-fwd-l1/p4/main.p4 similarity index 100% rename from src/tests/p4/p4/main.p4 rename to src/tests/p4-fwd-l1/p4/main.p4 diff --git a/src/tests/p4/p4/p4info.txt b/src/tests/p4-fwd-l1/p4/p4info.txt similarity index 100% rename from src/tests/p4/p4/p4info.txt rename to src/tests/p4-fwd-l1/p4/p4info.txt diff --git a/src/tests/p4/probe/README.md b/src/tests/p4-fwd-l1/probe/README.md similarity index 100% rename from src/tests/p4/probe/README.md rename to src/tests/p4-fwd-l1/probe/README.md diff --git a/src/tests/p4/probe/monitoring_kpis.ipynb b/src/tests/p4-fwd-l1/probe/monitoring_kpis.ipynb similarity index 100% rename from src/tests/p4/probe/monitoring_kpis.ipynb rename to src/tests/p4-fwd-l1/probe/monitoring_kpis.ipynb diff --git a/src/tests/p4/probe/monitoring_kpis.py b/src/tests/p4-fwd-l1/probe/monitoring_kpis.py similarity index 100% rename from src/tests/p4/probe/monitoring_kpis.py rename to src/tests/p4-fwd-l1/probe/monitoring_kpis.py diff --git a/src/tests/p4/probe/probe-tfs/.gitignore b/src/tests/p4-fwd-l1/probe/probe-tfs/.gitignore similarity index 100% rename from src/tests/p4/probe/probe-tfs/.gitignore rename to src/tests/p4-fwd-l1/probe/probe-tfs/.gitignore diff --git a/src/tests/p4/probe/probe-tfs/Cargo.toml b/src/tests/p4-fwd-l1/probe/probe-tfs/Cargo.toml similarity index 100% rename from src/tests/p4/probe/probe-tfs/Cargo.toml rename to src/tests/p4-fwd-l1/probe/probe-tfs/Cargo.toml diff --git a/src/tests/p4/probe/probe-tfs/LICENSE b/src/tests/p4-fwd-l1/probe/probe-tfs/LICENSE similarity index 100% rename from src/tests/p4/probe/probe-tfs/LICENSE rename to src/tests/p4-fwd-l1/probe/probe-tfs/LICENSE diff --git a/src/tests/p4-fwd-l1/probe/probe-tfs/README.md b/src/tests/p4-fwd-l1/probe/probe-tfs/README.md new file mode 100644 index 0000000000000000000000000000000000000000..3cff11314ee92db79d7b56c03e38a8a7f2acadec --- /dev/null +++ b/src/tests/p4-fwd-l1/probe/probe-tfs/README.md @@ -0,0 +1,21 @@ +# Rust-tfs + +Client for TFS functionalities written in Rust. + +## Dependencies + +This project requires the cargo Rust compiler: + +```sh +sudo apt-get install protobuf-compiler cargo +``` + +## Build + +Build sources as follows: + +```sh +cargo build +``` + +After a successfuly build, two new executables will be generated in `target/`. diff --git a/src/tests/p4/probe/probe-tfs/build.rs b/src/tests/p4-fwd-l1/probe/probe-tfs/build.rs similarity index 100% rename from src/tests/p4/probe/probe-tfs/build.rs rename to src/tests/p4-fwd-l1/probe/probe-tfs/build.rs diff --git a/src/tests/p4/probe/probe-tfs/connect_to_mininet.sh b/src/tests/p4-fwd-l1/probe/probe-tfs/connect_to_mininet.sh similarity index 100% rename from src/tests/p4/probe/probe-tfs/connect_to_mininet.sh rename to src/tests/p4-fwd-l1/probe/probe-tfs/connect_to_mininet.sh diff --git a/src/tests/p4/probe/probe-tfs/deploy.sh b/src/tests/p4-fwd-l1/probe/probe-tfs/deploy.sh similarity index 100% rename from src/tests/p4/probe/probe-tfs/deploy.sh rename to src/tests/p4-fwd-l1/probe/probe-tfs/deploy.sh diff --git a/src/tests/p4/probe/probe-tfs/proto b/src/tests/p4-fwd-l1/probe/probe-tfs/proto similarity index 100% rename from src/tests/p4/probe/probe-tfs/proto rename to src/tests/p4-fwd-l1/probe/probe-tfs/proto diff --git a/src/tests/p4/probe/probe-tfs/src/agent.rs b/src/tests/p4-fwd-l1/probe/probe-tfs/src/agent.rs similarity index 99% rename from src/tests/p4/probe/probe-tfs/src/agent.rs rename to src/tests/p4-fwd-l1/probe/probe-tfs/src/agent.rs index 749e42a6c81ce0523ae2cf52a29e9c90c43f48e7..81bc1a2a0b40947fd8b77f99ef10be8032eb66f7 100644 --- a/src/tests/p4/probe/probe-tfs/src/agent.rs +++ b/src/tests/p4-fwd-l1/probe/probe-tfs/src/agent.rs @@ -195,6 +195,7 @@ async fn main() -> Result<(), Box> { endpoint_id: None, slice_id: None, connection_id: None, + link_id: None, kpi_description: format!( "Latency value for service {}", event_service.service_uuid.unwrap().uuid diff --git a/src/tests/p4/probe/probe-tfs/src/ping.rs b/src/tests/p4-fwd-l1/probe/probe-tfs/src/ping.rs similarity index 100% rename from src/tests/p4/probe/probe-tfs/src/ping.rs rename to src/tests/p4-fwd-l1/probe/probe-tfs/src/ping.rs diff --git a/src/tests/p4/run_test_01_bootstrap.sh b/src/tests/p4-fwd-l1/run_test_01_bootstrap.sh similarity index 100% rename from src/tests/p4/run_test_01_bootstrap.sh rename to src/tests/p4-fwd-l1/run_test_01_bootstrap.sh diff --git a/src/tests/p4/run_test_02_create_service.sh b/src/tests/p4-fwd-l1/run_test_02_create_service.sh similarity index 100% rename from src/tests/p4/run_test_02_create_service.sh rename to src/tests/p4-fwd-l1/run_test_02_create_service.sh diff --git a/src/tests/p4/run_test_03_delete_service.sh b/src/tests/p4-fwd-l1/run_test_03_delete_service.sh similarity index 100% rename from src/tests/p4/run_test_03_delete_service.sh rename to src/tests/p4-fwd-l1/run_test_03_delete_service.sh diff --git a/src/tests/p4/run_test_04_cleanup.sh b/src/tests/p4-fwd-l1/run_test_04_cleanup.sh similarity index 100% rename from src/tests/p4/run_test_04_cleanup.sh rename to src/tests/p4-fwd-l1/run_test_04_cleanup.sh diff --git a/src/tests/p4/setup.sh b/src/tests/p4-fwd-l1/setup.sh similarity index 100% rename from src/tests/p4/setup.sh rename to src/tests/p4-fwd-l1/setup.sh diff --git a/src/tests/p4/tests/.gitignore b/src/tests/p4-fwd-l1/tests/.gitignore similarity index 100% rename from src/tests/p4/tests/.gitignore rename to src/tests/p4-fwd-l1/tests/.gitignore diff --git a/src/tests/p4/tests/BuildDescriptors.py b/src/tests/p4-fwd-l1/tests/BuildDescriptors.py similarity index 100% rename from src/tests/p4/tests/BuildDescriptors.py rename to src/tests/p4-fwd-l1/tests/BuildDescriptors.py diff --git a/src/tests/p4/tests/LoadDescriptors.py b/src/tests/p4-fwd-l1/tests/LoadDescriptors.py similarity index 100% rename from src/tests/p4/tests/LoadDescriptors.py rename to src/tests/p4-fwd-l1/tests/LoadDescriptors.py diff --git a/src/tests/p4/tests/Objects.py b/src/tests/p4-fwd-l1/tests/Objects.py similarity index 100% rename from src/tests/p4/tests/Objects.py rename to src/tests/p4-fwd-l1/tests/Objects.py diff --git a/src/tests/p4/tests/__init__.py b/src/tests/p4-fwd-l1/tests/__init__.py similarity index 100% rename from src/tests/p4/tests/__init__.py rename to src/tests/p4-fwd-l1/tests/__init__.py diff --git a/src/tests/p4/tests/test_functional_bootstrap.py b/src/tests/p4-fwd-l1/tests/test_functional_bootstrap.py similarity index 100% rename from src/tests/p4/tests/test_functional_bootstrap.py rename to src/tests/p4-fwd-l1/tests/test_functional_bootstrap.py diff --git a/src/tests/p4/tests/test_functional_cleanup.py b/src/tests/p4-fwd-l1/tests/test_functional_cleanup.py similarity index 100% rename from src/tests/p4/tests/test_functional_cleanup.py rename to src/tests/p4-fwd-l1/tests/test_functional_cleanup.py diff --git a/src/tests/p4/tests/test_functional_create_service.py b/src/tests/p4-fwd-l1/tests/test_functional_create_service.py similarity index 100% rename from src/tests/p4/tests/test_functional_create_service.py rename to src/tests/p4-fwd-l1/tests/test_functional_create_service.py diff --git a/src/tests/p4/tests/test_functional_delete_service.py b/src/tests/p4-fwd-l1/tests/test_functional_delete_service.py similarity index 100% rename from src/tests/p4/tests/test_functional_delete_service.py rename to src/tests/p4-fwd-l1/tests/test_functional_delete_service.py diff --git a/src/tests/p4/tests/topologies/6switchObjects.py b/src/tests/p4-fwd-l1/tests/topologies/6switchObjects.py similarity index 100% rename from src/tests/p4/tests/topologies/6switchObjects.py rename to src/tests/p4-fwd-l1/tests/topologies/6switchObjects.py diff --git a/src/tests/p4/README.md b/src/tests/p4/README.md deleted file mode 100644 index 43920d14d5e99214bb2ad8418cc4babcae5be91c..0000000000000000000000000000000000000000 --- a/src/tests/p4/README.md +++ /dev/null @@ -1,41 +0,0 @@ -# Tests for P4 functionality of TeraFlowSDN - -This directory contains the necessary scripts and configurations to run tests for the P4 functionality of TFS. - -## Basic scripts - -To run the experiments you should use the five scripts in the following order: -``` -setup.sh -run_test_01_bootstrap.sh -run_test_02_create_service.sh -run_test_03_delete_service.sh -run_test_04_cleanup.sh -``` - -The setup script copies the necessary artifacts to the SBI service pod. It should be run just once, after a fresh install of TFS. -The bootstrap script registers the context, topology, links and, devices to TFS. -The create service scripts establishes a service between two endpoints. -The delete service script delete the aforementioned service. -Cleanup script deletes all the objects (context, topology, links, devices) from TFS. - -## Objects file - -The above bash scripts make use of the corresponding python scripts found under `./tests/` directory. -More important is the `./tests/Objects.py` file, which contains the definition of the Context, Topology, Devices, Links, Services. **This is the file that need changes in case of a new topology.** - -Check the `./tests/Objects.py` file before running the experiment to make sure that the switches details are correct (ip address, port, etc.) - -## Mininet topologies - -In the `./mininet/` directory there are different mininet topology examples. The current `./tests/Objects.py` file corresponds to the `./mininet/8switch3path.py` topology. Additionally there is a backup file `./tests/topologies/6switchObjects.py` which corresponds to the `./mininet/6switch2path.py`. - -## P4 artifacts - -In the `./p4/` directory there are the compiled p4 artifacts that contain the pipeline that will be pushed to the p4 switch, along with the p4-runtime definitions. -The `./setup.sh` script copies from this directory. So if you need to change p4 program, make sure to put the compiled artifacts here. - -## Latency probe - -In the `./probe/` directory there is a little program which calculates latency between two hosts in mininet and sends them to the Monitoring component. For specific instructions, refer to the corresponding `./probe/README.md` file. - diff --git a/src/tests/p4/probe/probe-tfs/README.md b/src/tests/p4/probe/probe-tfs/README.md deleted file mode 100644 index f88d7c542dae22ad623797f43750e0589d2473cf..0000000000000000000000000000000000000000 --- a/src/tests/p4/probe/probe-tfs/README.md +++ /dev/null @@ -1,2 +0,0 @@ -# rust-tfs -Client for TFS functionalities written in Rust. diff --git a/src/tests/p4/probe/probe-tfs/target/x86_64-unknown-linux-musl/release/tfsagent b/src/tests/p4/probe/probe-tfs/target/x86_64-unknown-linux-musl/release/tfsagent deleted file mode 100755 index b7cef11a433c6bf2eeb94638fa90d93f25acd3c8..0000000000000000000000000000000000000000 Binary files a/src/tests/p4/probe/probe-tfs/target/x86_64-unknown-linux-musl/release/tfsagent and /dev/null differ diff --git a/src/tests/p4/probe/probe-tfs/target/x86_64-unknown-linux-musl/release/tfsping b/src/tests/p4/probe/probe-tfs/target/x86_64-unknown-linux-musl/release/tfsping deleted file mode 100755 index 6e943d292dd6653e857bf5eea3258d38ad246026..0000000000000000000000000000000000000000 Binary files a/src/tests/p4/probe/probe-tfs/target/x86_64-unknown-linux-musl/release/tfsping and /dev/null differ