Subject: [xmpp] DNS SRV order

From: Kevin Smith <[email-masked]>
Date: Mon, 7 Jun 2010 10:00:47 +0100

3.2.1
   4.  The initiating entity resolves at least one of the returned
       hostnames, in order according to the returned SRV record weight.
       It resolves the hostname using a DNS "A" or "AAAA" lookup on the
       hostname, which will result in an IPv4 or IPv6 address.

Shouldn't priority be used primarily, and weight only used between
results of the same priority?

/K

---

From: Ben Schumacher <[email-masked]>
Date: Mon, 07 Jun 2010 10:51:41 -0600

> results of the same priority?

Wouldn't it be easier to just refer to RFC 2782? I agree the guidance 
should suggest using priority before weight (as is specified in the 
RFC), but I don't think it's useful to try to reproduce the full set of 
rules unless we're changing them for use with XMPP. If that is the case 
then we should call that out.

Ben

---

From: Jehan Pagès <[email-masked]>
Date: Tue, 8 Jun 2010 02:22:26 +0900

Hi,

> results of the same priority?

yes. The priority is used first (you try first lower priority), then
only in case of egality in priority, you use weight (but not the same
way, here weight means probability weight, so a higher weight does not
mean that you will try this record first, but that there is "more
chance" that you try this record first). This is all explained in RFC
2782, and the precise algorithm to "randomize" using weight is also
step-by-step described.

But basically, I guess this will typically not be coded in the XMPP
lib/client/server, but in the used DNS library (for instance I am for
my own currently working on a DNS library for Objective Caml, and this
priority part for instance is meant to be dealt inside the library, so
that the program using it does not have to care about this and just
pick the records in the order the library returned them).

So to conclude, I guess the quoted sentence from the XMPP rfc would
gain being rewritten in a more general way, something like this:

« The initiating entity resolves at least one of the returned
hostnames, in order according to the algorithm described in [SRV]. »
Bye.

Jehan

---

From: Kevin Smith <[email-masked]>
Date: Mon, 7 Jun 2010 18:48:36 +0100

On Mon, Jun 7, 2010 at 5:51 PM, Ben Schumacher <[email-masked]> wrote:
> Wouldn't it be easier to just refer to RFC 2782? I agree the guidance should
> suggest using priority before weight (as is specified in the RFC), but I
> don't think it's useful to try to reproduce the full set of rules unless
> we're changing them for use with XMPP. If that is the case then we should
> call that out.

I'm happy with either no rules and pointing to 2782, or full rules
(with a 2782 reference). Just not the current proposal of having
misleading rules.

/K

---

From: Peter Saint-Andre <[email-masked]>
Date: Mon, 07 Jun 2010 15:23:58 -0600

> (with a 2782 reference). Just not the current proposal of having

Agreed. I propose:

   3.  If a response is received, it will contain one or more
       combinations of a port and hostname, each of which is weighted
       and prioritized as described in [DNS-SRV].  However, if the
       result of the SRV lookup is a single resource record with a
       Target of ".", i.e. the root domain, then the initiating entity
       MUST abort SRV processing at this point (but SHOULD attempt the
       fallback process described in the next section).

   4.  The initiating entity chooses at least one of the returned
       hostnames to resolve (following the rules in [DNS-SRV]), which it
       does by using a DNS "A" or "AAAA" lookup on the hostname; this
       will result in an IPv4 or IPv6 address.

/psa

---

From: Kevin Smith <[email-masked]>
Date: Mon, 7 Jun 2010 22:40:31 +0100

>       will result in an IPv4 or IPv6 address.

WFM.

/K

---

From: Ben Schumacher <[email-masked]>
Date: Mon, 07 Jun 2010 16:58:33 -0600

On 6/7/10 3:23 PM, Peter Saint-Andre wrote:
>> On Mon, Jun 7, 2010 at 5:51 PM, Ben Schumacher<[email-masked]>  wrote:
>>      
+1

Ben