/contrib/bind9/doc/misc/ipv6

https://bitbucket.org/freebsd/freebsd-head/ · #! · 113 lines · 80 code · 33 blank · 0 comment · 0 complexity · 992cf0202ec56907d6dbf38ce276b72e MD5 · raw file

  1. Copyright (C) 2004 Internet Systems Consortium, Inc. ("ISC")
  2. Copyright (C) 2000, 2001 Internet Software Consortium.
  3. See COPYRIGHT in the source root or http://isc.org/copyright.html for terms.
  4. Currently, there are multiple interesting problems with ipv6
  5. implementations on various platforms. These problems range from not
  6. being able to use ipv6 with bind9 (or in particular the ISC socket
  7. library, contained in libisc) to listen-on lists not being respected,
  8. to strange warnings but seemingly correct behavior of named.
  9. COMPILE-TIME ISSUES
  10. -------------------
  11. The socket library requires a certain level of support from the
  12. operating system. In particular, it must follow the advanced ipv6
  13. socket API to be usable. The systems which do not follow this will
  14. currently not get any warnings or errors, but ipv6 will simply not
  15. function on them.
  16. These systems currently include, but are not limited to:
  17. AIX 3.4 (with ipv6 patches)
  18. RUN-TIME ISSUES
  19. ---------------
  20. In the original drafts of the ipv6 RFC documents, binding an ipv6
  21. socket to the ipv6 wildcard address would also cause the socket to
  22. accept ipv4 connections and datagrams. When an ipv4 packet is
  23. received on these systems, it is mapped into an ipv6 address. For
  24. example, 1.2.3.4 would be mapped into ::ffff:1.2.3.4. The intent of
  25. this mapping was to make transition from an ipv4-only application into
  26. ipv6 easier, by only requiring one socket to be open on a given port.
  27. Later, it was discovered that this was generally a bad idea. For one,
  28. many firewalls will block connection to 1.2.3.4, but will let through
  29. ::ffff:1.2.3.4. This, of course, is bad. Also, access control lists
  30. written to accept only ipv4 addresses were suddenly ignored unless
  31. they were rewritten to handle the ipv6 mapped addresses as well.
  32. Partly because of these problems, the latest IPv6 API introduces an
  33. explicit knob (the "IPV6_V6ONLY" socket option ) to turn off the ipv6
  34. mapped address usage.
  35. In bind9, we first check if both the advanced API and the IPV6_V6ONLY
  36. socket option are available. If both of them are available, bind9
  37. named will bind to the ipv6 wildcard port for both TCP and UDP.
  38. Otherwise named will make a warning and try to bind to all available
  39. ipv6 addresses separately.
  40. In any case, bind9 named binds to specific addresses for ipv4 sockets.
  41. The followings are historical notes when we always bound to the ipv6
  42. wildcard port regardless of the availability of the API support.
  43. These problems should not happen with the closer checks above.
  44. IPV6 Sockets Accept IPV4, Specific IPV4 Addresses Bindings Fail
  45. ---------------------------------------------------------------
  46. The only OS which seems to do this is (some kernel versions of) linux.
  47. If an ipv6 socket is bound to the ipv6 wildcard socket, and a specific
  48. ipv4 socket is later bound (say, to 1.2.3.4 port 53) the ipv4 binding
  49. will fail.
  50. What this means to bind9 is that the application will log warnings
  51. about being unable to bind to a socket because the address is already
  52. in use. Since the ipv6 socket will accept ipv4 packets and map them,
  53. however, the ipv4 addresses continue to function.
  54. The effect is that the config file listen-on directive will not be
  55. respected on these systems.
  56. IPV6 Sockets Accept IPV4, Specific IPV4 Address Bindings Succeed
  57. ----------------------------------------------------------------
  58. In this case, the system allows opening an ipv6 wildcard address
  59. socket and then binding to a more specific ipv4 address later. An
  60. example of this type of system is Digital Unix with ipv6 patches
  61. applied.
  62. What this means to bind9 is that the application will respect
  63. listen-on in regards to ipv4 sockets, but it will use mapped ipv6
  64. addresses for any that do not match the listen-on list. This, in
  65. effect, makes listen-on useless for these machines as well.
  66. IPV6 Sockets Do Not Accept IPV4
  67. -------------------------------
  68. On these systems, opening an IPV6 socket does not implicitly open any
  69. ipv4 sockets. An example of these systems are NetBSD-current with the
  70. latest KAME patch, and other systems which use the latest KAME patches
  71. as their ipv6 implementation.
  72. On these systems, listen-on is fully functional, as the ipv6 socket
  73. only accepts ipv6 packets, and the ipv4 sockets will handle the ipv4
  74. packets.
  75. RELEVANT RFCs
  76. -------------
  77. 3513: Internet Protocol Version 6 (IPv6) Addressing Architecture
  78. 3493: Basic Socket Interface Extensions for IPv6
  79. 3542: Advanced Sockets Application Program Interface (API) for IPv6
  80. $Id: ipv6,v 1.9 2004/08/10 04:27:51 jinmei Exp $