9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: cinap_lenrek@felloff.net
To: 9fans@9fans.net
Subject: Re: [9fans] ipv6 and ndb/csquery
Date: Sat, 11 Jul 2015 17:37:20 +0200	[thread overview]
Message-ID: <03a4bcd9e6053108cc41cff5a379fc0f@felloff.net> (raw)
In-Reply-To: <A5BED428-0DFB-4DFC-A053-E5C9C91122BA@ar.aichi-u.ac.jp>

when you query /net/dns, it differentiates between ip (A) and ipv6
(AAAA) records. so querying for "ip" only yields ipv4 addresses and
querying for "ipv6" yields ipv6 addresses only. it shouldnt matter if
you use ip= or ipv6= attribute in ndb for this, as ndb/dns is smart
enogth to check the value of the attribute and figure out if its for
and A or AAAA record.

now ndb/cs is concerned about finding an addresses that is reachable
from your system. i think that is why it reorders the results
based on local ip interfaces. in any case, ndb/cs will query dns
for both ipv4 and ipv6 addresses unless you give it (v4 only flag -4).

when ndb/cs looks for an address in the network database, it only looks
for the ip= attribute and ignores ipv6= attributes (these are for dns only).

so if you have no ipv6 connectivity on the lan, but you want to put
ipv6 AAAA records in your dns server (to serve to the outside world?),
use the ipv6= attribute in ndb as network database lookups will
ignore the ipv6= stuff.

when you have both ipv4 and ipv6 connectivity, you can just use
ip= attribute for both v4 and v6 addresses, then network database
lookup will yield both.

when a domain has multiple ip addresses, dns will randomize the
list of results (for a specific record type). ndb/cs queries dns
for v4 addresses first and v6 addresses last, the (randomized)
v4 addresses appear before the (randomized) v6 addresses
(unless cs did reorder the list as it found the v6 address to be
reachable directly the by a local network interface).

the results from network database are not randomized (but can be
reordered) by ndb/cs:

sys=testa ip=89.186.156.12
	ip=2001:470:1f0a:a61::2

sys=testb ip=2001:470:1f0a:a61::2
	ip=89.186.156.12

> net!testa!*
/net.alt/il/clone 89.186.156.12!*!fasttimeout
/net.alt/il/clone 2001:470:1f0a:a61::2!*!fasttimeout
/net.alt/tcp/clone 89.186.156.12!*
/net.alt/tcp/clone 2001:470:1f0a:a61::2!*
/net.alt/il/clone 89.186.156.12!*
/net.alt/il/clone 2001:470:1f0a:a61::2!*
> net!testb!*
/net.alt/il/clone 2001:470:1f0a:a61::2!*!fasttimeout
/net.alt/il/clone 89.186.156.12!*!fasttimeout
/net.alt/tcp/clone 2001:470:1f0a:a61::2!*
/net.alt/tcp/clone 89.186.156.12!*
/net.alt/il/clone 2001:470:1f0a:a61::2!*
/net.alt/il/clone 89.186.156.12!*

dial() processes the list from cs in sequential order, unless
you use geoffs parallel dial implementation which connects to
some bounded number of addresses in parallel.

still the ordering of what cs returns is in most prefered first,
and it is up to cs to define that order. like it *could* decide to
always put ipv6 addresses first, but i think this was not done because
in the labs the v6 network was less reliable than the v4 network?

--
cinap



  reply	other threads:[~2015-07-11 15:37 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-04  5:30 arisawa
2015-07-06 17:01 ` cinap_lenrek
2015-07-11 13:01   ` arisawa
2015-07-11 15:37     ` cinap_lenrek [this message]
2015-07-15  4:41       ` arisawa

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=03a4bcd9e6053108cc41cff5a379fc0f@felloff.net \
    --to=cinap_lenrek@felloff.net \
    --cc=9fans@9fans.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).