Skip to content

iogbole/ebpf-network-viz

Repository files navigation

Getting Started with eBPF: Monitoring TCP Retransmissions with eBPF, Go and Prometheus

Important

Refer to this blog post for details on the background and motivation behind this experiment - https://www.israelo.io/blog/ebpf-net-viz/

Usage

  1. Make : To compile the eBPF code and run main.go
  2. ./run_prom.sh : To start Prometheus
  3. ./create_tcp_chaos.sh : To start tc and generate TCP requests.

How it works

The diagram below depicts the solution.

Read the blog post for details https://www.israelo.io/blog/ebpf-net-viz/

the solution

Observe

Head over to your Prometheus interface and type tcp_retransmissions_total into the query bar. Switch to the graph view and marvel at the results of your hard work.

Using Lima on MacOS

If you're a MacOS user like me, Lima is an excellent way to emulate a Linux environment. To kick things off with Lima, follow these steps:

  1. Install Lima and launch it with the ebpf-vm.yaml file:

    limactl start ebpf-vm.yaml
    limactl shell ebpf-vm
  2. If use use Visual Studio Code, you can connect to the Lima VM via SSH:

    limactl show-ssh ebpf-vm

    Subsequently, use the SSH command to link up with the remote server through Visual Studio Code.

  3. After establishing the connection, clone the required repository:

    git clone https://github.com/iogbole/ebpf-network-viz.git

Manual Setup on Linux

If you’re opting for a manual setup on Linux, refer to the script section in the ebpf-vm.yaml file.

With your environment now primed, you’re all set to delve into the fascinating world of eBPF!

Releases

No releases published

Packages

No packages published

Languages