Important
Refer to this blog post for details on the background and motivation behind this experiment - https://www.israelo.io/blog/ebpf-net-viz/
Make
: To compile the eBPF code and run main.go./run_prom.sh
: To start Prometheus./create_tcp_chaos.sh
: To starttc
and generate TCP requests.
The diagram below depicts the solution.
Read the blog post for details https://www.israelo.io/blog/ebpf-net-viz/
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.
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:
-
Install Lima and launch it with the ebpf-vm.yaml file:
limactl start ebpf-vm.yaml limactl shell ebpf-vm
-
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.
-
After establishing the connection, clone the required repository:
git clone https://github.com/iogbole/ebpf-network-viz.git
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!