The Case of Ipv6 LLU Endpoint Address Support in DNS
Total Page:16
File Type:pdf, Size:1020Kb
The case of IPv6 LLU endpoint address support in DNS Erwin Hoffmann Frankfurt University of Applied Sciences Faculty of Computer Science and Engineering January 12, 2020 Abstract The fehQlibs and djbdnscurve6 provide a DNS library which support IPv6 LLU endpoint addresses. The inclusion of IPv6 LLU endpoint addresses for DNS services is discussed and shown to be beneficial for particular use cases. Applications linked with this library allow user-specific DNS settings. Apart from binding to IPv6 LLU addresses and dual-stack usage, additionally ’reverse IPv6 anycasting’ is an achieved goal welcomed for IoT devices. 1 IPv6 in DNS There is no question that IPv6 LLU ad- dresses never can be object of any DNS The support of IPv6 addresses within DNS lookup; but could they be the acting subject Resource Records (RR) has been settled with of DNS resolver and perhaps a DNS server? RFC 3596 [30] taking only the Quad-A format Could the DNS query and also the response AAAA into consideration. The inverse nibble facilitate IPv6 LLU endpoint addresses? format for IPv6 addresses is also well defined. This questions will be investigated here and However, there is a significant gap applying a solution will be outlined using the DNS IPv6 addresses within the DNS, though RFC implementation ’djbdnscurve6’[14] together 4472 [5] clearly expels IPv6 Link-Local Unicast with the separate DNS stub resolver library (LLU) addresses as AAAA RRs in a zone file: available with ’fehQlibs’[10]. Both solutions are based on D.J. Bernstein’s developments [2] 2.1. Limited-Scope Addresses and are particular tailored for IPv6 support, The IPv6 addressing architecture including all required functions to deal with [RFC4291] includes two kinds of local- parsing and representation of IPv6 addresses, use addresses: link-local (fe80::/10) and which are partially taken from Felix von Leit- site-local (fec0::/10). The site-local ad- ner’s patches [18]. dresses have been deprecated [RFC3879] but are discussed with unique local addresses in Appendix A. 1.1 IPv6 LLU support and the In- Link-local addresses should never be terface Index published in DNS (whether in forward or reverse tree), because they have only Unlike IPv4 addresses, IPv6 addresses are local (to the connected link) significance ’scoped’. [fig.1] gives an overview of this situ- [WIP-DC2005]. ation. 1 Global Globaler Unicast: 2000::/3 unique route-able Link Local Unicast: within the IPv6 Internet ULA solely useable in local fc00::/7 link segment; autonomous derived, not unique; LLU Unique Local Unicast: requires interface index fe80::/10 unique and route-able in local link-segments Unspecified address: Host used as sender address ::/128 for multicasts Figure 1: Overview of the IPv6 address hierarchy In the IPv4 world we consider ’public’ In IPv6 the interface index (aka the scope and ’private’ IP addresses (together with the index) is part of the socket definition. For loopback 127/8 network and the multicast route-able addresses it is simply ’0’, while for regime). Within IPv6, the situation is more LLU addresses it is derived from the interface. strictly structured using the high order bits of The kernel provides a translation between the the IPv6 address [8]. interface name (in Unix often eth0) and its IPv6 LLU addresses – like private IPv4 ad- numeric index, ie. 1. dresses – are not route-able and usable only on This matching is done either statically – the attached local link-segment. Unlike IPv4 upon the boot of the operating system – or dy- private addresses however, each link-segment namically, whenever a interface is added and has its own name space. In practice, this made available. An interface index may also means that the same IPv6 LLU address can be removed, upon disabling the interface. This be used on different links [31]. behaviour corresponds with the usage of mod- In order to facilitate a distinction, the kernel ern IT equipment – like smartphones – enter- needs to know to which link-segment an IPv6 ing and exiting a ’flight mode’. LLU address belongs to; thus the interface to However, we not only need to consider phys- which it is bound. In a typical case, one may ical interfaces here, but also taking care of consider a system having an Ethernet and a additional virtual interfaces: The Operating WiFi interface with the following addresses: System may create (or dismiss) a virtual or logical interface on demand: At first it be- § fe80::1%eth0 comes assigned an EUI-64 (MAC) address and § fe80::2%wifi0 as second step the corresponding IPv6 unique where the ’%’ is the usual delimiter to sepa- and multicast addresses are derived algorith- rate an IPv6 address from its interface identi- mically (SLAAC) [29][1]. fier. A well-known ’logical’ interface is the loop- The lower 64 bit part of the IPv6 address back interface, often named lo0. For IPv4, is typically build from the interface MAC ad- the loopback interface is assigned with the dress (or using the ’privacy extension’). Fixed 127/8 net (and not only the IPv4 address addresses independent from the hardware are 127.0.0.1). Rather, for IPv6 two differently common for Internet servers. Often, the none scoped loopback addresses exist: route-able part indicates a certain use, like 2001:1ab::fefe:53 for a DNS service. § Global scoped: ::1 2 § Local scoped: fe80::1%lo0 1.3 Use cases for DNS IPv6 LLU endpoint addresses The kernel sees those as different entities and allows binding to each of them. Applying djbdnscurve6 and applications based on fehQlibs with its stub resolver rou- 1.2 DNS in the IPv6 working model tines, we In IPv6 networks, the LLU addresses are used 1. can setup a DNS (content or cache) server to setup a network automatically employing listening on any interface with the provided the ICMPv6 protocol: IPv6 LLU address, § Stateless Address Autoconfiguration 2. can build network applications successfully (SLAAC) is used to determine the unique- querying DNS servers given their LLU ad- ness of the autonomous chosen and dresses while being attached to the same configured IPv6 address of the interface on local link-segment. a link-segment. § Neighbor Discovery Protocol (NDP) [22] is Advantage 1: the substitute for IPv4’s ARP (Address Res- On this link-segment DNS query/responses olution Protocol)[23]. can be operated (irrespectively of the con- § Neighbor Solicitation (NS) and Neighbor tent provided by the Resource Records RR) Advertisement (NA) [22] are used to provide by the usage of LLU addresses. The transmit- a cache for the neighbor’s link-addresses. ted IPv6 data packets are limited to the local link-segment only and are not visible outside § Router Advertisements (RA) and Router (except someone forwards these unsolicited to Solicitation (RS) together with Unsolicited an outside eavesdropper). Router Advertisements [22] are able to transmit IPv6 routing prefixes, the set of Advantage 2: default routers, the MTU size, and in partic- Within that link-segment we are under con- ular a list of IPv6 addresses of DNS servers trol of our DNS resources. DNS poisoning of to all nodes on the local link-segment [16]. the stub resolvers is impossible from sources outside this local net. Given the capabilities to provide DNS infor- Advantage 3: mation in an IPv6 network, DHCPv6 [21] can DNS allows to be setup in a ’split-horizon’ be used or – as explained – the RA protocol. manner. The DNS information (in particular In the last case, the messages are encapsulated hints to the authoritative name servers) can as ICMPv6 packages with the IPv6 LLU ad- be tailored to the local needs. dress of the sender and targeting either the link-local multicast address, or the LLU ad- Advantage 4: dress of a specific node on the link-segment. Location based services (LBS) [28][27] can be In short, within IPv6 networks packets with defined and be made authoritative in the local LLU addresses are used to transmit messages net only. containing network configuration information. Disadvantage: It would be a natural choice to setup a DNS A DNS Cache Resolver (like dnscache) solely service – either as server or as resolver – to use bound to the IPv6 LLU address can not share IPv6 LLU addresses as endpoints for both the its cached DNS information with potential query and the reply. DNS clients outside the link-segment. 3 We will discuss later, how this disadvan- As a side-effect, the DNS resolver routines tage can be compensated for and mitigated are capable of handling up to 32 name servers; by applying a socket binding technique called enough to cover the a-m.root-servers.net ’reverse IPv6 anycasting’. [15] supporting both their IPv4 and IPv6 ad- dresses. In summary, using the local link-segment Common to all servers – including for the communication and DNS message ex- tcpserver and sslserver – is the capability change between the DNS stub resolver and a to bind to any IPv6 address (and of course DNS server – in particular a caching Name IPv4 addresses too). server – is beneficial and provides anonymity for the stub resolvers while refraining them to use other public DNS caches like Google’s 2.1 Binding to IPv6 LLU addresses ’8.8.8.8’. Though IPv6 is now on the market since 25 years and Google has evaluated that its use 2 DNS server with IPv6 LLU is approaching now 30%1, applying IPv6 LLU addresses for DNS (unicast) services is not well support defined yet. Within djbdnscurve6 and the auxiliary Within djbdnscurve6 five DNS server dae- tools ucspi-tcp6 [13] and ucspi-ssl [12] two mons are provided: different ways to provide the required interface § tinydns is a UDP-only DNS content server.