# facebookincubator/katran

**Attribution required: if you use, quote, or summarise this content, you must credit and link back to [awesome-repositories.com](https://awesome-repositories.com/repository/facebookincubator-katran).**

_How this analysis was created: the description and tags below were written by an AI model that read this project's README and public documentation pages; stars, license and language come straight from the GitHub API. The model does not read the source code._

5,270 stars · 543 forks · C · GPL-2.0

## Links

- GitHub: https://github.com/facebookincubator/katran
- awesome-repositories: https://awesome-repositories.com/repository/facebookincubator-katran.md

## Description

Katran is an eBPF-based Layer 4 load balancer designed for high-performance network packet forwarding directly within the Linux kernel. It utilizes an XDP network packet processor to bypass the standard kernel network stack, minimizing latency and maximizing throughput for incoming traffic.

The system implements weighted consistent hashing to distribute network loads and maintain session persistence across backend servers. It further optimizes the return path through a direct server return gateway, which allows backends to respond directly to clients and removes the load balancer from the outbound traffic flow.

Its capabilities include lockless connection tracking for session stability and NUMA-aware core binding to eliminate cross-node latency. The project also supports backend traffic weighting, server draining, and XDP program chaining for executing firewall logic before load balancing.

The implementation provides observability tools for network traffic capture, healthcheck probe routing, and encapsulated traffic filtering.

## Tags

### Networking & Communication

- [Layer-4 Load Balancing](https://awesome-repositories.com/f/networking-communication/layer-4-load-balancing.md) — Provides a high-performance Layer 4 load balancer using eBPF to route traffic directly within the Linux kernel.
- [XDP Packet Forwarding](https://awesome-repositories.com/f/networking-communication/xdp-packet-forwarding.md) — Routes network packets immediately at the network interface using XDP to bypass kernel overhead. ([source](https://github.com/facebookincubator/katran#readme))
- [Lockless Session Tracking](https://awesome-repositories.com/f/networking-communication/connection-metadata-tracking/lockless-session-tracking.md) — Maintains session states in a shared memory cache using atomic operations to ensure consistent routing without thread contention.
- [Connection Tracking Tables](https://awesome-repositories.com/f/networking-communication/connection-tracking-tables.md) — Maintains a fixed-size connection tracking table with an eviction strategy to ensure session persistence. ([source](https://github.com/facebookincubator/katran/blob/main/README.md))
- [Weighted Hash Rings](https://awesome-repositories.com/f/networking-communication/consistent-hashing-distribution/weighted-hash-rings.md) — Implements a modified hashing algorithm with weighted backends to ensure session stability during server failures. ([source](https://github.com/facebookincubator/katran#readme))
- [Weighted Load Balancing](https://awesome-repositories.com/f/networking-communication/load-balancers/weighted-load-balancing.md) — Assigns relative weights to backend servers to control the proportion of traffic each receives. ([source](https://github.com/facebookincubator/katran/blob/main/USAGE.md))
- [Network Interrupt Optimizers](https://awesome-repositories.com/f/networking-communication/network-topology-extensions/topology-abstraction-layers/hardware-topology-optimizers/network-interrupt-optimizers.md) — Optimizes network efficiency by assigning network interrupts to specific processor cores based on hardware topology. ([source](https://github.com/facebookincubator/katran/tree/main/tools))
- [Kernel-Space Packet Processing](https://awesome-repositories.com/f/networking-communication/packet-engines/packet-processing-frameworks/kernel-space-packet-processing.md) — Processes network packets directly within the Linux kernel to minimize latency and bypass the standard network stack.
- [XDP Packet Processing](https://awesome-repositories.com/f/networking-communication/packet-engines/packet-processing-frameworks/xdp-packet-processing.md) — Executes programmable byte-code at the network interface driver level to route or drop packets before they reach the kernel.
- [Connection State Management](https://awesome-repositories.com/f/networking-communication/tcp-connection-lifecycles/connection-state-management.md) — Implements a lockless session table to track active network flows and maintain routing consistency. ([source](https://github.com/facebookincubator/katran/blob/main/EXAMPLE.md))
- [Virtual-to-Real Address Mapping](https://awesome-repositories.com/f/networking-communication/virtual-interface-addressing/virtual-to-real-address-mapping.md) — Maps virtual addresses and ports to a set of real backend server addresses to balance incoming traffic. ([source](https://github.com/facebookincubator/katran/blob/main/EXAMPLE.md))
- [XDP Packet Processors](https://awesome-repositories.com/f/networking-communication/xdp-packet-processors.md) — Utilizes Express Data Path to bypass the kernel network stack for ultra-low latency packet forwarding.
- [Direct Server Return](https://awesome-repositories.com/f/networking-communication/direct-server-return.md) — Implements a networking architecture where backend servers respond directly to clients to bypass the load balancer on return paths.
- [Network Traffic Management](https://awesome-repositories.com/f/networking-communication/network-infrastructure-routing/network-routing-traffic-management/network-traffic-management.md) — Manages data flows using weighted backends and connection tracking to optimize network throughput and stability.
- [Symmetric RSS Distribution](https://awesome-repositories.com/f/networking-communication/traffic-shaping/scaling/traffic-distribution/symmetric-rss-distribution.md) — Uses packet encapsulation with varying source addresses to distribute incoming flows across hardware receive queues.

### DevOps & Infrastructure

- [Virtual IP Balancing](https://awesome-repositories.com/f/devops-infrastructure/traffic-load-balancers/ingress-load-balancers/virtual-ip-balancing.md) — Maps virtual addresses and ports to backend servers using consistent hashing to balance network loads. ([source](https://github.com/facebookincubator/katran/blob/main/USAGE.md))

### Operating Systems & Systems Programming

- [In-Kernel Connection Trackers](https://awesome-repositories.com/f/operating-systems-systems-programming/in-kernel-connection-trackers.md) — Implements a lockless session table in-kernel to ensure subsequent packets in a flow reach the same backend server.
- [Process Affinity and Core Binding](https://awesome-repositories.com/f/operating-systems-systems-programming/kernel-core-internals/process-and-memory-management/process-affinity-and-core-binding.md) — Utilizes NUMA-aware core binding to pin processing tasks and minimize cross-node latency. ([source](https://github.com/facebookincubator/katran/blob/main/USAGE.md))

### Software Engineering & Architecture

- [Consistent Hashing](https://awesome-repositories.com/f/software-engineering-architecture/consistent-hashing.md) — Uses consistent hashing to map clients to backend servers, ensuring stable session persistence during scaling.
- [Load Balancing Ring Hashing](https://awesome-repositories.com/f/software-engineering-architecture/distributed-systems/distributed-data-management/consistent-hashing/load-balancing-ring-hashing.md) — Implements a load balancing system using weighted consistent hashing to distribute network loads while maintaining persistence.

### Programming Languages & Runtimes

- [BPF Program Chaining](https://awesome-repositories.com/f/programming-languages-runtimes/tail-call-optimizations/bpf-program-chaining.md) — Executes a sequence of eBPF programs via a root coordinator to apply firewall logic before load balancing.

### System Administration & Monitoring

- [Connection Draining](https://awesome-repositories.com/f/system-administration-monitoring/terminal-session-managers/graceful-session-draining/connection-draining.md) — Prevents new connections from reaching a server by setting its weight to zero while allowing existing sessions to complete. ([source](https://github.com/facebookincubator/katran/blob/main/USAGE.md))

### Part of an Awesome List

- [Load Balancing and Ingress](https://awesome-repositories.com/f/awesome-lists/devtools/load-balancing-and-ingress.md) — High-performance layer 4 load balancer.
