xlb
所属分类:云原生工具
开发工具:C
文件大小:57KB
下载次数:0
上传日期:2021-01-12 09:00:44
上 传 者:
sh-1993
说明: 基于Linux XDP的负载平衡器
(A Linux XDP based load balancer)
文件列表:
Makefile (1173, 2021-01-12)
bpf (0, 2021-01-12)
bpf\lb_consts.h (338, 2021-01-12)
bpf\lb_kern.c (6815, 2021-01-12)
bpf\lb_maps.h (313, 2021-01-12)
bpf\lb_structs.h (299, 2021-01-12)
bpf\linux_header (0, 2021-01-12)
bpf\linux_header\bpf.h (163002, 2021-01-12)
bpf\linux_header\bpf_endian.h (2726, 2021-01-12)
bpf\linux_header\bpf_helpers.h (21696, 2021-01-12)
bpf\murmur_hash.h (1622, 2021-01-12)
libbpf (0, 2021-01-12)
user (0, 2021-01-12)
user\xlb.c (4236, 2021-01-12)
# XLB - XDP Load Balancer
A Linux XDP based load balancer, which currently supports only IPv4 traffic.
## Prerequisite
- Add VIP to the loopback device
E.g.:
```
$ ip addr add 10.10.0.5/8 dev lo
```
where `10.10.0.5` is the VIP.
- Configure ARP settings
Possible configuration would be:
```
$ sysctl net.ipv4.conf.all.arp_ignore=1
$ sysctl net.ipv4.conf.eth0.arp_ignore=1
$ sysctl net.ipv4.conf.all.arp_announce=2
$ sysctl net.ipv4.conf.eth0.arp_announce=2
```
With these adjustments, the LB can do DSR (Direct Server Return) properly with VIP as source address of the response.
## Build
Since we use [libbpf](https://github.com/libbpf/libbpf) as our eBPF library, we need pull it first:
```
$ git submodule update --init
```
Then simply run `make` to build both control plane and data plane sources.
## TODOs
- LRU for faster routing decision
- IPv6 support
- Better routing decision algorithm (we're using modulo devision currently)
近期下载者:
相关文件:
收藏者: