Author name: Anamika

How-to-run-the-program

sudo -s export BPF_CLANG=clang go build ip link is a command in Linux used to display and manage network interfaces. When used without any arguments, the ip link command displays a list of available network interfaces on the system along with their status, state, and hardware addresses Here is an example output of the ip link command: In this example, lo and wlp0s20f3 are …

How-to-run-the-program Read More »

ebpf library

Table of Contents Cilium is an open-source project that provides a networking and security solution for containerized applications that leverages eBPF technology. The Cilium eBPF library provides a Go interface to the eBPF subsystem, making it easier to write eBPF programs in Go. The Cilium eBPF library is a Go library that provides abstractions over eBPF programs …

ebpf library Read More »

Repository-Structure

Table of Contents $ebpf-network |==go.mod |==go.sum |==Readme.md |==headers |——–bpf_endian.h |——–bpf_helper_defs.h |——–bpf_helpers.h |——–bpf_tracing.h |——–common.h |——–update.sh |===xdp |——–bpf_bpfeb.go |——–bpf_bpfeb.o |——–bpf_bpfel.go |——–bpf_bpfel.o |——–main.go |________xdp.c go.mod and go.sum go.mod and go.sum are two files used by the Go programming language to manage dependencies of a project. go.mod file defines the module’s dependencies and metadata, including the module’s name, version, and requirements for other …

Repository-Structure Read More »

Userspace program

Major components you might find in this userspace eBPF program written using the Cilium eBPF library in Go are as follows: Loading pre-compiled eBPF programs into the kernel Attaching the eBPF program to a network interface using XDP (eXpress Data Path) Printing the contents of the BPF hash map (source IP address -> packet count) to stdout every …

Userspace program Read More »

Kernel Space eBPF program for XDP hook

//go:build ignore This is a build constraint for Go. It specifies that this file should be ignored by the Go build system. #include “bpf_endian.h” #include “common.h” Header files that provide some utility functions and macros that are used in the program defined in the Cilium eBPF library. bpf_endian.h: This header file defines macros for converting between …

Kernel Space eBPF program for XDP hook Read More »

What is XDP

eBPF (extended Berkeley Packet Filter) XDP (Express Data Path) programs are a type of eBPF program that are attached to a network interface using the XDP hook. The XDP hook is a low-level hook that allows eBPF programs to be executed early in the packet receive path, before the packet is passed up the network …

What is XDP Read More »

Scroll to Top