Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updating instructions for Trying out L3AF on Azure VMs #42

Closed
wants to merge 6 commits into from

Conversation

t-cindywan
Copy link

No description provided.

specified the instructions for trying out L3AF on your local machine and moved host prerequisites under this section
Added section on trying out L3AF on Ubuntu and detailed host prerequisites as well as installation instructions.
@dthaler
Copy link
Collaborator

dthaler commented Jul 20, 2022

Fixes #38

Github repositories to your Azure VM.
2. Download and install Go for Linux version 1.18.4 or greater at https://go.dev/doc/install. Make sure that you do **not** use `sudo apt install`,
because this command will install version 1.13 but the installation requires version 1.17 at the minimum.
3. Edit `config.yaml` to point to the [L3AFD repository](https://github.com/l3af-project/l3afd) on your host machine.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The config.yaml file is used for port forwarding and sharing of the host folder in a Vagrant virtual machine. Please remove this line from the document.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe this should be l3afd.cfg

2. Download and install Go for Linux version 1.18.4 or greater at https://go.dev/doc/install. Make sure that you do **not** use `sudo apt install`,
because this command will install version 1.13 but the installation requires version 1.17 at the minimum.
3. Edit `config.yaml` to point to the [L3AFD repository](https://github.com/l3af-project/l3afd) on your host machine.
4. Run `install.sh` to install package dependencies, Grafana, Prometheus, the eBPF source code you need to build your eBPF programs against,
Copy link
Contributor

@sanfern sanfern Jul 20, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In this case, install.sh should be replaced by provision.sh

`sudo ./l3afd --config /vagrant/cfg/l3afd.cfg`.

## Trying out your L3AFD Server
1. Start test web servers by running the following commands on your Azure VM: `go run l3af-arch/dev_environment/code/web-server.go -port 8080 > /var/log/web-server1.log 2>&1 &` and `go run l3af-arch/dev_environment/code/web-server.go -port 8081 > /var/log/web-server1.log 2>&1 &`.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need to add steps to ensure the eBPF package repository service is running locally. cd /srv/l3afd python3 -m http.server 8000 &

3. Verify that you can send traffic to one of the test web servers running on the Azure VM with this command:
`hey -n 200 -c 20 http://<ip-address-of-your-azure-vm>:8080`. This command should return a latency distribution histogram that shows
most traffic clustered near the top of the graph at very low latency.<p align="center"><img src="https://user-images.githubusercontent.com/106849610/179866166-597bef0d-2f5f-4ae7-89ee-1acdda5fd060.png" width="400" height="200"/></p>
4. Load and run the ratelimiter eBPF program in the kernel with the following command: `curl -X POST http://<ip-address-of-your-azure-vm>:7080/l3af/configs/v1/update -d "@payload.json"`.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The path to payload.json needs to be specified. There are multiple eBPF programs contained in this file (ratelimiter, connection_limit, and flow exporter). It may be necessary to rephrase it or create a new json file containing only the ratelimiter program. The values for the keys host_name and iface should be updated.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should supply a couple of different payload.json options that somebody can select.

  1. Can be simple with single program such as rate limiter
  2. Can be multiple programs chained together

Copy link
Contributor

@jniesz jniesz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We are planning to include a new script to get l3afd set up on more environments, such as WSL2, Azure VM, Vagrant, and deploy on Mac M1 chipset.

Github repositories to your Azure VM.
2. Download and install Go for Linux version 1.18.4 or greater at https://go.dev/doc/install. Make sure that you do **not** use `sudo apt install`,
because this command will install version 1.13 but the installation requires version 1.17 at the minimum.
3. Edit `config.yaml` to point to the [L3AFD repository](https://github.com/l3af-project/l3afd) on your host machine.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe this should be l3afd.cfg

3. Verify that you can send traffic to one of the test web servers running on the Azure VM with this command:
`hey -n 200 -c 20 http://<ip-address-of-your-azure-vm>:8080`. This command should return a latency distribution histogram that shows
most traffic clustered near the top of the graph at very low latency.<p align="center"><img src="https://user-images.githubusercontent.com/106849610/179866166-597bef0d-2f5f-4ae7-89ee-1acdda5fd060.png" width="400" height="200"/></p>
4. Load and run the ratelimiter eBPF program in the kernel with the following command: `curl -X POST http://<ip-address-of-your-azure-vm>:7080/l3af/configs/v1/update -d "@payload.json"`.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should supply a couple of different payload.json options that somebody can select.

  1. Can be simple with single program such as rate limiter
  2. Can be multiple programs chained together

most traffic clustered near the top of the graph at very low latency.<p align="center"><img src="https://user-images.githubusercontent.com/106849610/179866166-597bef0d-2f5f-4ae7-89ee-1acdda5fd060.png" width="400" height="200"/></p>
4. Load and run the ratelimiter eBPF program in the kernel with the following command: `curl -X POST http://<ip-address-of-your-azure-vm>:7080/l3af/configs/v1/update -d "@payload.json"`.
5. Query the L3AFD server again to ensure that the ratelimiter eBPF program was loaded into the kernel and is running: `curl http://<ip-address-of-your-vm>:8899/kfs/eth0`. This query should output a .json file similar to this: https://github.com/l3af-project/l3afd/tree/main/docs/api.
6. Generate traffic again: `hey -n 200 -c 20 http://<ip-address-of-your-vm>:8080`. This command should now output a latency distribution histogram that
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can probably set the rate limit low enough so some requests coming from "hey" load test will get blocked.
This might be a better way to show the rate limiter is working vs just a small latency distribution difference.

@dthaler
Copy link
Collaborator

dthaler commented Oct 12, 2022

@dahavey see PR #44. Will that PR obsolete this one or should this one be updated if 44 is merged?

@dahavey
Copy link

dahavey commented Oct 26, 2022

Incorporated into #44

@dthaler dthaler closed this Oct 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants