This repository contains the experimentation setup with eBPF on CloudLab. It uses the cloudlab-tools repository as the submodule to automate the setup for running eBPF programs on CloudLab.
To update the repository to use the latest version of the cloudlab-tools submodule, run the following command:
make update-cl-tools- Run the following command to create the required CloudLab config. This will create a
.cloudlab/cloudlab_config.mkfile which will be used to setup the CloudLab environment. Add your CloudLab username, ssh-key path, and the node IPs in the file.:
make cl-setup- Open terminal (call it
terminal-1) and SSH into the CloudLab machine and run the following command (replaceNODE_1with the node name).
make cl-ssh-host NODE=NODE_1- Clone the repository in the CloudLab machine by running the following command in
terminal-1.
git clone --recursive https://github.com/rutu-sh/cloudlab-ebpf.gitor
If you want to upload the code from local to CloudLab machine, open another terminal (call it terminal-2) and run the following command. This is a good option if you want to try out your code without the need to commit and push it to the repository.
make cl-sync-code NODE=NODE_1To sync the code to a particular path on the cloudlab node, run the following command:
make cl-sync-code NODE=NODE_1 REMOTE_DIR=PATH_ON_NODEBy default, the remote dir is ~/src.
- CD into the the
cloudlab-ebpfdirectory in cloudlab (interminal-1) and run the following command to setup the environment:
make- Create a folder for your experiment in the experiments directory and add the eBPF
Ccode and thegen.gofile. Thegen.gofile is used to generate theBPFbytecode from theCcode. But it requires clang, llvm, and other dependencies. If you're using a Mac, run the following command. This will perform the code generation part and copy the generated go and the object files to your experiment folder. Then you can start working on the rest of the go code.
make go-generate-exp NODE=NODE_0 EXPERIMENT=<experiment-name>Example:
make go-generate-exp NODE=NODE_0 EXPERIMENT=simple-tracepoint-hook