Git Product home page Git Product logo

edns's Introduction

eDNS - ebpf TC DNS

About

eDNS is an experimental DNS component written in BPF for high throughput, low latency DNS responses.
It uses TC ingress / egress to process packets early in the Linux networking path.
A user space application is provided to add DNS records to a BPF map which is read from K8S informer or load from static file.

Use Case and Concept

In Kubernetes, pods communicate by service name. So a DNS query is needed before every request. The CoreDNS deployed by default in the Kubernetes cluster may experience problems such as high DNS resolution delay, resolution timeout, and resolution failure in scenarios with high DNS QPS.
eDNS can be used to solve this problem. It watch any servcie change in kubernetes then add service name and IP to ebpf map. And it also can load domain config from static file.
eDNS use ebpf tc ingress / egress hook, and response the DNS request which the query domain is kubernetes serivce name.

Features & limitations

  • Currently supports A records
  • Only supports plain DNS over UDP (port 53)
  • Basic EDNS implementation
  • Only responds to single queries for now
  • No recursive lookups
  • Can't use in cilium network.

How to Choose tc Hook

In Kubernetes, it is better use tc ingress hook to veth interface in host.
config.yaml

ExtBTF: 
EnableK8S: true
IsInK8S: true
Ifname: veth5b0d81b
NetworkDirection: Ingress

In docker native, it is better use tc egress hook to physical network interface in host.
config.yaml

ExtBTF: 
EnableK8S: true
IsInK8S: true
Ifname: 
NetworkDirection: Egress

How to Run

You can clone this repository and build binary.
Please install package before building.

sudo apt-get update
sudo apt-get install golang-go
sudo apt-get install make clang llvm

Then use make to build binary file.

make
./edns

Also you can run from docker image.

docker run -d \
  --name=edns \
  --net=host \
  --privileged \
  -v /sys/kernel/debug:/sys/kernel/debug \
  jamesyyang/edns:0.0.2

Reference

edns's People

Contributors

jamesyyang avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.