Case Study: ByteDance Uses eBPF to Enhance Networking Performance
ebpf.foundation
ebpf.foundation
Netkit replaces that logic with a simple pairing of sending and receiving eBPF programs; it's an eBPF cut-through for packet-level networking between networks that share a host kernel. It's faster, and it's simpler to reason about; the netkit.c code is pretty easy to read straight through.
Is that true even for virtio-net? I guess I just assumed all these virtual devices worked like virtiofs and had low overhead fast paths for host and guest communication.
What additional overhead is cut out by the netkit approach?
The big win here as I understand it is that it gives you roughly the same efficient inter-device forwarding path that XDP gives you: you can bounce from one interface to another in eBPF without converting buffers back into skbuffs and snaking them through the stack again.
https://isovalent.com/blog/post/cilium-netkit-a-new-containe...
> Packets transmitted on one device in the pair are immediately received on the other device. When either device is down, the link state of the pair is down.
https://www.man7.org/linux/man-pages/man4/veth.4.html
That sure makes it sound like veth transmissions at least on the same link are instantaneous and bypass the networking stack. I would imagine in a containerized environment it should be something like:
Pod 1 tries to send a packet to Pod 2, both on the same node but in different network namespaces with different IPs. Pod 1 sends its packet to the bridge connected to the other end of its veth pair and that should be instantaneous. Then the bridge sends across its other veth pair to pod 2's namespace, which is also instantaneous.
Is the problem with processing overhead at the bridge?
https://isovalent.com/blog/post/cilium-netkit-a-new-containe...
Sounds like virtio but intra-host?
1. https://github.com/kubewharf/kubeadmiral
2. https://github.com/cilium/cilium/blob/main/USERS.md
3. https://www.anyscale.com/blog/how-bytedance-scales-offline-i...
> It is used to safely and efficiently extend the capabilities of the kernel at runtime without requiring changes to kernel source code or loading kernel modules. Safety is provided through an in-kernel verifier which performs static code analysis and rejects programs which crash, hang or otherwise interfere with the kernel negatively.
Whenever I see a problem solved with eBPFs I feel like it's also making things more opaque and difficult to troubleshoot but I'm guessing that's just because I don't know enough about it