Direct Server Return for UDP

Pen has supported Direct Server Return for TCP for some time. Support for UDP has now been added, suitable for load balancing e.g. DNS.

Here, debian2 is the DNS client and debian uses Pen in DSR mode to load balance between debian3 and debian4 running Bind.

Pen command line:

ulric@debian:~/Git/pen$ sudo ./pen -df -U -O poll -O “dsr_if eth1” -S 2 -r 192.168.100.1:0 192.168.100.3 192.168.100.4
As of 0.28.1 the server table is expanded dynamically,
making the -S option obsolete
2015-08-03 16:24:09: read_cfg((null))
2015-08-03 16:24:09: Before: conns = (nil), connections_max = 0, clients = (nil), clients_max = 0
2015-08-03 16:24:09: expand_conntable(500)
2015-08-03 16:24:09: After: conns = 0x1ac4600, connections_max = 500, clients = 0x7f6428d5c010, clients_max = 2048
2015-08-03 16:24:09: pen 0.29.0 starting
2015-08-03 16:24:09: servers:
2015-08-03 16:24:09: 0 192.168.100.3:0:0:0:0:0
2015-08-03 16:24:09: 1 192.168.100.4:0:0:0:0:0

As far as debian2 can see, the responses are coming from a single DNS server:

dsr-udp-client

But tcpdump on debian3 and debian4 shows requests and replies being load balanced across the hosts:

dsr-udp-server1

dsr-udp-server2

Facebooktwittergoogle_plusredditpinterestlinkedinmail

One thought on “Direct Server Return for UDP

  1. Hi, I try to configure pen to do DSR loadbalancing UDP (DNS) in freebsd but it seem not working

    My setting are bellow
    em0 (internet)
    Ip:119.81.66.18x

    em1 (intranet)
    Ip:192.168.0.20

    Server 1
    em0(internet)
    IP:119.81.66.18y
    em1(intranet)
    Ip:192.168.0.30
    lo1
    Ip:119.81.66.18x

    Server2
    em0(internet)
    Ip:119.81.66.18z
    em1(intranet)
    Ip:192.168.0.40
    lo1
    Ip:119.81.66.18x

    #pen -df -U -O poll -O “dsr_if em1” -S 2 -r 119.81.66.182:53 192.168.0.30 192.168.0.40

    Any help ?

Leave a Reply

Your email address will not be published. Required fields are marked *