Subject: Re: DNS SRV Clarification sought

From: Greg Hudson <[email-masked]>
Date: Sat, 06 Mar 2004 10:31:55 -0500

On Sat, 2004-03-06 at 09:03, Barry Desborough wrote:
> From page 3 of rfc2782
>         Compute the sum of the weights of those RRs, and with each RR
>         associate the running sum in the selected order. Then choose a
>         uniform random number between 0 and the sum computed
>         (inclusive)

> Random number case 0 1 2 3
> 1st contact                 1 1 2 2
> 2nd contact                2 2 1 1

You appear to be computing a random integer, rather than a random real
number, as was intended.  If you choose a random real number, you'll get
the appropriate distribution (a server with weight 2 is chosen twice as
often with a server of weight 1).

I would have much preferred a statement which used random integers
(which is something you can actually do on a computer), but the working
group was having a little trouble coming up with an algorithm statement
that actually worked, so we decided to go with one which we strongly
believed was correct even if it wasn't very clear and which didn't
translate easily into code.

It's particularly galling to me that we didn't even state explicitly
what kind of number is to be chosen (integer, rational, computable,
real, complex...), and then we threw in this parenthetical note
"(inclusive)" which actually has no effect on the outcome if real
numbers are being chosen.

> If what is meant by 1st contact is the 1st successful attempt to 
> find a Target, from whereupon this target's service is always used 
> until it's TTL expiry or failure, then load sharing is only effected
> by different clients choosing different 1st contacts.

> On the other hand, if it means that a client which is a frequent, 
> heavy user of a service client works down a sequence of targets 
> to select which one provides the service next, all targets 
> are selected with equal frequency. 

Neither of these choices seems appropriate.  The TTL only applies to the
DNS data itself, not the processing of it, so it would be wrong to
choose a server once and then stick with it until the TTL expires.  It
would also be wrong to walk the list of choices when making multiple
successful contacts; the idea is to walk the list when making a single
contact until you are successful, then throw the list away.  The next
time you make a contact, you should start all over again and choose a
new contact order randomly according to the weights.

--
to unsubscribe send a message to [email-masked] with
the word 'unsubscribe' in a single line as the message text body.
archive: <http://ops.ietf.org/lists/namedroppers/>

---

From: Andras Salamon <[email-masked]>
Date: Sat, 6 Mar 2004 19:08:47 +0200

On Sat, Mar 06, 2004 at 03:03:22PM +0100, Barry Desborough wrote:
>    Here is the format of the SRV RR, whose DNS type code is 33:
>         _Service._Proto.Name TTL Class SRV Priority Weight Port Target"
> 
> But rfc1035 page 29 describes the generic RR header as being
>         NAME TYPE CLASS TTL RDLENGTH RDATA

RFC1035 deals with the on-the-wire encoding, while the SRV text
above seems to be related to the usual BIND-style zone file format.
The examples in RFC 2782 bear this out.  However, re-reading RFC 2782
and RFC 2052, I could not determine a definitive on-the-wire encoding
of SRV records -- this seems to be undefined.  Presumably, implementors
have just looked at how BIND returns SRV records and gone with that.

> According to 1035, and assuming that 'SRV' refers to TYPE,
> (not specified in 2782),

The section "Usage rules" mentions QTYPE=SRV, and there is further text
    the SRV RR, whose DNS type code is 33
and
    The IANA has assigned RR type value 33 to the SRV RR
which seems to tie SRV to TYPE, although perhaps not very directly.

> Q5) Does anyone have any DNS SRV sniffer trace they could send
> directly to me to throw more light on the message format?

I tried to find an online deployment of SRV records to feed to tcpdump,
but the closest I came was an SOA record for _tcp.microsoft.com (one of
the authors of RFC 2782 was at Microsoft).  Neither vix.com or troll.no
appear to have _tcp subdomains.  Does anyone actually have a deployment
of SRV outside pseudo-DNS dynamic zones tied to DHCP servers?

I also tried to find the IANA assignments for the Service tags, as
referred to in RFC 2782, and couldn't locate any.  Have any actually
been standardized?  If so, a pointer would be appreciated!

-- Andras Salamon                   [email-masked]
-- DNS Resources Directory          http://www.dns.net/dnsrd/

---

From: Greg Hudson <[email-masked]>
Date: Sat, 06 Mar 2004 12:29:42 -0500

> of SRV outside pseudo-DNS dynamic zones tied to DHCP servers?

We appear to have:

_sip._tcp.mit.edu
_sip._udp.mit.edu
_sip._tcp.sipxchange.mit.edu
_sip._udp.sipxchange.mit.edu
_kerberos._udp.athena.mit.edu
_kerberos-master._udp.athena.mit.edu
_kerberos-adm._tcp.athena.mit.edu

---

From: Jarle Greipsland <[email-masked]>
Date: Sat, 06 Mar 2004 20:01:52 +0100 (CET)

Andras Salamon <[email-masked]> writes:
> I tried to find an online deployment of SRV records to feed to
> tcpdump, but the closest I came was an SOA record for
> _tcp.microsoft.com (one of the authors of RFC 2782 was at
> Microsoft).  Neither vix.com or troll.no appear to have _tcp
> subdomains.  Does anyone actually have a deployment of SRV
> outside pseudo-DNS dynamic zones tied to DHCP servers?

_nicname._tcp.{at,de,dk,fr,is,lu,nl,no,si,uk}/IN/SRV

					-jarle

---

From: David Shaw <[email-masked]>
Date: Sat, 6 Mar 2004 15:13:42 -0500

On Sat, Mar 06, 2004 at 07:08:47PM +0200, Andras Salamon wrote:

> subdomains.  Does anyone actually have a deployment of SRV outside
> pseudo-DNS dynamic zones tied to DHCP servers?

_hkp._tcp.pgp.net to help find PGP keyservers.

David

---

From: Stephane Bortzmeyer <[email-masked]>
Date: Mon, 8 Mar 2004 10:11:02 +0100

On Sat, Mar 06, 2004 at 08:01:52PM +0100,
 Jarle Greipsland <[email-masked]> wrote 

> _nicname._tcp.{at,de,dk,fr,is,lu,nl,no,si,uk}/IN/SRV

Which is documented in:

http://mailbox.univie.ac.at/~gw/draft-sanz-whois-srv-00.txt

---

From: "Barry Desborough" <[email-masked]>
Date: Mon, 8 Mar 2004 11:10:08 +0100

Thanks for your help, Greg.

There's a note below about selection using random integers.

----- Original Message ----- 
From: "Greg Hudson" <[email-masked]>
To: "Barry Desborough" <[email-masked]>
Cc: <[email-masked]>
Sent: Saturday, 06 March, 2004 16:31 PM
Subject: Re: DNS SRV Clarification sought

> translate easily into code.

Demonstration of selection using random integers.
(Hope the fixed font is preserved and there's no line folding)

Item      Cumulative
(weight)  sum
----      ----- 
a         a
b         a+b
c         a+b+c
.         .
.         .
n         a+b+c+...+n  i.e.(sum(a...n))

Choosing a random integer between 1 and sum(a...n) inclusive and selecting
the first item greater than or equal to the random integer, we have -

Random integer range      1...a        a+1...a+b        a+b+1...a+b+c
Random integer frequency  a            (a+b)-(a+1)+1=b  (a+b+c)-(a+b+1)+1=c
Probability               a/sum(a...n) b/sum(a...n)     c/sum(a...n)

For any item say, i, h being the previous item,

Random integer range      sum(a...h)+1...sum(a...i)
Random integer frequency  sum(a...i)-(sum(a...h)+1)+1=i
Probability               i/sum(a...n)

Barry Desborough

---

From: "Olaf M. Kolkman" <[email-masked]>
Date: Tue, 9 Mar 2004 09:13:19 +0100

On Sat, 06 Mar 2004 12:29:42 -0500

> _sip._udp.sipxchange.mit.edu

Where the use of SRV for SIP is documented in RFC3263

-- Olaf

---------------------------------| Olaf M. Kolkman
---------------------------------| RIPE NCC

---

From: Greg Hudson <[email-masked]>
Date: Sat, 06 Mar 2004 10:31:55 -0500

---

From: Andras Salamon <[email-masked]>
Date: Sat, 6 Mar 2004 19:08:47 +0200

---

From: Greg Hudson <[email-masked]>
Date: Sat, 06 Mar 2004 12:29:42 -0500

We appear to have:

_sip._tcp.mit.edu
_sip._udp.mit.edu

---

From: Jarle Greipsland <[email-masked]>
Date: Sat, 06 Mar 2004 20:01:52 +0100 (CET)

-jarle

---

From: David Shaw <[email-masked]>
Date: Sat, 6 Mar 2004 15:13:42 -0500

David

---

From: Stephane Bortzmeyer <[email-masked]>
Date: Mon, 8 Mar 2004 10:11:02 +0100

Which is documented in:

---

From: "Barry Desborough" <[email-masked]>
Date: Mon, 8 Mar 2004 11:10:08 +0100

----- Original Message ----- 
From: "Greg Hudson" <[email-masked]>
To: "Barry Desborough" <[email-masked]>
Cc: <[email-masked]>
Sent: Saturday, 06 March, 2004 16:31 PM
Subject: Re: DNS SRV Clarification sought

Item      Cumulative
(weight)  sum
----      ----- 
a         a
b         a+b
c         a+b+c
.         .
.         .

Barry Desborough

---

From: "Olaf M. Kolkman" <[email-masked]>
Date: Tue, 9 Mar 2004 09:13:19 +0100

-- Olaf