A black computer tower sits on a table beside network hardware and coiled ethernet cables[cite: 1]
eBPF Use Cases
William  

eBPF for Windows: Network Filtering That Works Today

eBPF Windows support is real and usable today for network filtering and observability, but treat it as a different runtime, not Linux eBPF recompiled. Your bytecode runs through a Windows execution context with its own verifier and hooks. As a result, a program that loads on Linux can get rejected here for reasons unrelated to your logic. I use it for supported network jobs. I don’t treat it as a general Windows tracing layer.

Last updated: 2026-11-05

The project lets you extend selected kernel paths without owning a large custom driver. That’s useful, but the supported hook set decides everything. Check that first. Otherwise, you can lose a week porting code to an attachment point Windows does not expose.

How does eBPF Windows work?

The project combines familiar eBPF pieces with Windows-specific execution and attachment layers. You compile source into Berkeley Packet Filter bytecode, pass that bytecode through the PREVAIL verifier, and load it through the Windows runtime.

Verification happens in a protected user-mode process before execution. PREVAIL checks memory access, control flow, loop bounds, and termination. If it cannot prove the program safe, the load stops there.

After verification, the program can run through an interpreter, a just-in-time compiler, or a native driver path. The last option uses bpf2c to translate the bytecode into C before the Windows Driver Kit builds it.

The network hooks come from netebpfext.sys. That kernel driver uses the Windows Filtering Platform for several eBPF program types.

Here is the model to keep in your head:

  1. Clang compiles your program into eBPF bytecode.
  2. PREVAIL verifies the bytecode in user mode.
  3. The runtime loads the verified program.
  4. netebpfext.sys connects it to a supported Windows network hook.
  5. Event Tracing for Windows carries diagnostic and program output.

Linux tracepoints, kernel structures, and helper behavior do not appear because the bytecode format looks familiar. The Windows context layouts still win.

Your Linux toolchain carries over, but the target changes

Clang and LLVM remain useful. So do parts of the libbpf application programming interface. Generic packet parsing and map logic often need little work.

Code tied to Linux kernel internals needs a rewrite. That includes programs reading Linux context structures, expecting Linux helper semantics, or attaching to tracepoints and kprobes. A portability shim can handle small differences, but it cannot create a missing hook.

StageToolWhat it tells you or produces
CompileClang and LLVMEmits eBPF bytecode from your source
VerifyPREVAILRejects unsafe or unprovable control and memory access
Translatebpf2cConverts verified bytecode into C for a native build
BuildWindows Driver Kit and MSBuildProduces the portable executable driver package
LoadUser-mode libbpf APIsLoads programs, maps, and links through the Windows runtime

Keep development and deployment builds aligned. Match the project headers, runtime package, build settings, and signing setup. Mixing files from different release tags creates failures that look like verifier bugs.

If you are moving from Linux, read the project’s execution model before copying a build pipeline. My eBPF JIT verification guide explains the verification boundary from the Linux side, but Windows still has its own loader and driver rules.

The toolchain is familiar. The target remains Windows.

PREVAIL decides whether the program loads

Read the verifier rejection before changing code. PREVAIL is making a specific claim about an instruction, register state, branch, or memory range. That message is usually the shortest path to the fault.

For example, an out-of-bounds rejection means PREVAIL could not prove the access remains inside the object. Linux accepting the same bytecode does not settle the matter. The two runtimes use different verifiers, contexts, helpers, and proof rules.

I handle a verifier failure in this order:

  1. Save the complete loader output and exit code.
  2. Find the first verifier error, rather than the later cleanup errors.
  3. Identify the instruction and register named in the rejection.
  4. Reduce the branch or memory access until the bound is explicit.
  5. Load the smallest failing program again.

Small programs help here. PREVAIL has fewer paths to analyze, and you have fewer states to inspect. Splitting policy across tail calls or separate attachment points may also make a failure easier to isolate, if the Windows runtime supports what the design needs.

For build pipelines, preverify eBPF programs in continuous integration before packaging the driver. A verifier error belongs in the build log, not on a production host during an upgrade.

When to choose eBPF over a custom kernel driver

Choose eBPF when a supported hook already covers the job. Network filtering, socket policy, and connection telemetry fit the current design well. The verifier also blocks whole classes of unsafe memory access before the program reaches the kernel.

Development is faster because you can rebuild and reload bytecode during testing. You avoid a full driver edit-build-debug cycle for every policy change.

Write a conventional driver when any of these are true:

  • The project does not expose the hook you need.
  • Your design requires deep protocol state unavailable through current helpers.
  • You need device, filesystem, process, or system-call hooks outside the network surface.
  • You already maintain a Windows Filtering Platform callout, and another runtime would add no useful boundary.
  • Your deployment cannot accept the project’s runtime or packaging model.

A missing hook ends the eBPF discussion. No portability layer or loader flag can add an attachment point the runtime does not provide.

Hypervisor-enforced Code Integrity changes the deployment plan. Dynamic just-in-time code generation is blocked there, so production systems commonly need native code packaged as a signed driver through bpf2c.

The signing burden remains. What you gain is a verifier, constrained program model, and a shorter development loop.

How do you install eBPF on Windows?

Start with the operating system version. The eBPF for Windows project supports Windows 11 or later and Windows Server 2022 or later.

Older announcements described Windows 10 and Windows Server 2016 and later. Those statements explain the project’s original target, not the current support floor. Do not build a new deployment around an old announcement.

For a clean eBPF Windows setup:

  1. Open the project’s current release page.
  2. Download eBPF-for-Windows.x.x.x.msi.
  3. Run the installer with administrative rights.
  4. Keep Runtime Components selected.
  5. Install development components if you plan to compile programs.
  6. Confirm the drivers loaded before testing your own bytecode.

Runtime Components is mandatory. It installs the eBPF runtime and the core pieces required by the other MSI features.

For a command-line install, open an administrative Command Prompt and run:

C:\Windows\system32\msiexec.exe /i eBPF-for-Windows.x.x.x.msi /L*v ebpf-msi.log

The command installs the package and writes a verbose log to ebpf-msi.log. If installation fails, search that file for the first Return value 3 entry and read the lines above it. The useful error is usually there. Windows Installer prefers archaeology.

Next, open an elevated PowerShell window and check for the installed drivers:

Get-CimInstance Win32_SystemDriver |
 Where-Object { $_.Name -match 'ebpf|netebpfext' } |
 Select-Object Name, State, StartMode

The output tells you which matching drivers exist, whether they are running, and how they start. No output means you should fix the installation before touching program code.

Also check the Code Integrity log if a driver exists but will not start:

Get-WinEvent -LogName "Microsoft-Windows-CodeIntegrity/Operational" |
 Where-Object { $_.Message -match "ebpf|netebpfext" }

That output tells you whether Windows rejected a driver because of signing or integrity policy. A verifier change will not repair a blocked driver.

What you can build today

A desktop computer beside a small rack with network switches connected by colorful Ethernet cables

Network filtering is the strongest use case. The supported program and attachment families include bind, cgroup/connect4, cgroup/connect6, cgroup/recv_accept4, cgroup/recv_accept6, sockops, and xdp.

Pick the hook from the event you need to control or observe. Starting from a familiar Linux program name usually sends the design in the wrong direction.

Hook familyWhat it handlesGood use
xdpPackets early in the network pathEarly filtering, packet inspection, and dropping unwanted traffic
bindIPv4 and IPv6 socket bind operationsControlling which local addresses or ports an application may bind
cgroup/connect4 and cgroup/connect6Socket address processing during connection setupOutbound connection policy
cgroup/recv_accept4 and cgroup/recv_accept6Socket address processing around accepted connectionsInbound connection policy
sockopsConnection establishment and teardown notificationsConnection lifecycle telemetry

The sock_addr hook currently supports ingress and egress connection initialization. Meanwhile, sock_ops reports ingress and egress connection establishment and teardown.

That gives you enough surface for firewalls, connection policy, early packet filtering, and focused network telemetry. It does not give you Linux-style attach-anywhere tracing.

Choose the execution mode from the deployment policy first. A mode that runs in the lab but violates Code Integrity on the target host is not a deployment plan.

ModeUse it forLimitation
InterpreterInitial testing and diagnosisSlower execution
JITLab performance testingBlocked where dynamic code generation is prohibited
Native driverSigned deployment on locked-down systemsRequires a driver build and signing process

Observability uses Event Tracing for Windows rather than Linux tracepoints. Program diagnostics can flow into ETW, which lets you tie runtime output to the rest of the Windows event timeline.

If your actual goal is a full intrusion detection system with broad Linux kernel visibility, read the Linux eBPF IDS design before assuming the same hooks exist here. The policy logic may carry over. The attachment model will not.

Where to find the source and API documentation

Go to the official eBPF for Windows project before reading forum fixes. The repository contains the runtime, netebpfext.sys, headers, samples, build files, release packages, and issue history.

The API splits cleanly across two boundaries:

  • User-mode libbpf APIs manage objects, programs, maps, links, loading, and attachment.
  • Kernel-facing definitions describe program types, attach types, contexts, and helpers.

Keep both sides on the same release tag. Mixing them produces contract failures that often get blamed on the verifier.

Read the header and sample from the same release tag as your installed runtime. A sample from one tag and an MSI from another can disagree on program information or supported helpers.

You may also find old guides built around release v1.3.0. That is a historical tag. Check the live release page for the package you should install now, then keep the MSI, headers, samples, and documentation on that tag.

When an API behaves differently from Linux, read its implementation and tests. That settles the contract faster than a copied loader snippet.

Does Falco support eBPF on Windows?

Falco’s standard eBPF probes do not monitor the Windows kernel. Its kernel module, legacy eBPF probe, and modern eBPF probe are Linux data sources built around Linux system-call hooks and kernel interfaces.

Installing eBPF for Windows does not make those probes portable. The Windows project focuses on a defined network hook set and does not provide the Linux system-call attachment surface Falco expects.

Falco’s kernel driver is also a Linux kernel component. It is unrelated to netebpfext.sys, and replacing one with the other will not work.

For Windows host monitoring, collect Windows-native telemetry such as Event Tracing for Windows, Windows Filtering Platform events, and security logs. Falco plugins may process external event sources in a separate pipeline, but that is plugin ingestion rather than Falco gaining Windows eBPF kernel support.

Debug load failures from the bottom up

Technician connecting network cables to a switch inside a data center server rack

Most eBPF Windows load failures fall into one of four buckets: the runtime is missing, the driver is blocked, PREVAIL rejects the bytecode, or the requested hook is unavailable.

Work through them in that order:

  1. Confirm the installed runtime. Check the MSI log and enumerate the eBPF drivers.
  2. Check driver state. A stopped or blocked netebpfext.sys driver prevents network attachment.
  3. Read Code Integrity events. These expose signature and policy failures.
  4. Capture the loader exit code. Keep standard output and standard error from the first failed load.
  5. Read the first PREVAIL rejection. Later messages often describe cleanup after that failure.
  6. Confirm the program and attach types. A valid program still fails when the requested hook is unsupported.
  7. Inspect Windows Filtering Platform state. This shows whether the expected network integration exists.
  8. Reduce the program. Load the smallest version that still fails, then add code back one branch at a time.

Do not change compiler flags, signing settings, helper calls, and attachment types in one pass. You will get a different failure and learn nothing.

For verifier errors, keep the rejected bytecode and build metadata. For driver failures, keep the MSI log and Code Integrity event. For attachment failures, keep the requested program type, attach type, and runtime output. That makes the problem reproducible.

FAQ

Can Linux CO-RE programs run unchanged on Windows?

Usually no. Compile Once – Run Everywhere, or CO-RE, depends on Linux kernel type information and compatible context layouts. Windows gives the program different contexts, helpers, and program information, so unchanged loading is the exception.

Keep packet parsing and map logic portable. Put operating-system-specific context access behind small helper functions, or every context change will spread through the program.

Can I use eBPF inside a Windows container?

Start with the host. The host kernel owns the eBPF runtime and network hooks, so container behavior depends on the host installation and the container’s network mode. Install and validate the runtime there before debugging anything inside the container.

Also, do not assume Linux namespace behavior. Windows container isolation and networking have different boundaries, so test the exact host and container configuration you plan to ship. A passing test on a different network mode proves very little.

Can I write the user-mode loader in Rust or Go?

Yes, through bindings or a small native wrapper. However, the official interface is centered on C and libbpf-style APIs, so keep that wrapper thin enough to preserve error codes and verifier output.

If the wrapper turns every load failure into “operation failed,” it has hidden the evidence you need. Pass the original status and verifier text back to the caller.

Does eBPF for Windows replace Windows Filtering Platform?

No. netebpfext.sys uses Windows Filtering Platform to implement certain eBPF program types. The eBPF runtime adds a verified program model and familiar maps and APIs over those supported integration points.

If you need a Windows Filtering Platform layer the project does not expose, you still need a conventional callout driver. The runtime cannot attach to a layer it never wired up.