1 .\" $KAME: inet6.4,v 1.21 2001/04/05 01:00:18 itojun Exp $
3 .\" Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
4 .\" All rights reserved.
6 .\" Redistribution and use in source and binary forms, with or without
7 .\" modification, are permitted provided that the following conditions
9 .\" 1. Redistributions of source code must retain the above copyright
10 .\" notice, this list of conditions and the following disclaimer.
11 .\" 2. Redistributions in binary form must reproduce the above copyright
12 .\" notice, this list of conditions and the following disclaimer in the
13 .\" documentation and/or other materials provided with the distribution.
14 .\" 3. Neither the name of the project nor the names of its contributors
15 .\" may be used to endorse or promote products derived from this software
16 .\" without specific prior written permission.
18 .\" THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND
19 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21 .\" ARE DISCLAIMED. IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE
22 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
24 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
25 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
26 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
27 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
37 .Nd Internet protocol version 6 family
44 family is an updated version of
49 implements Internet Protocol version 4,
51 implements Internet Protocol version 6.
54 is a collection of protocols layered atop the
55 .Em Internet Protocol version 6
57 transport layer, and utilizing the IPv6 address format.
60 family provides protocol support for the
61 .Dv SOCK_STREAM , SOCK_DGRAM ,
66 interface provides access to the
70 IPv6 addresses are 16 byte quantities, stored in network standard byteorder.
74 as a discriminated union.
78 family utilize the following addressing structure:
79 .Bd -literal -offset indent
82 sa_family_t sin6_family;
84 uint32_t sin6_flowinfo;
85 struct in6_addr sin6_addr;
86 uint32_t sin6_scope_id;
90 Sockets may be created with the local address
92 (which is equal to IPv6 address
96 matching on incoming messages.
98 The IPv6 specification defines scoped addresses,
99 like link-local or site-local addresses.
100 A scoped address is ambiguous to the kernel,
101 if it is specified without a scope identifier.
102 To manipulate scoped addresses properly from the userland,
103 programs must use the advanced API defined in RFC2292.
104 A compact description of the advanced API is available in
106 If a scoped address is specified without an explicit scope,
107 the kernel may raise an error.
108 Note that scoped addresses are not for daily use at this moment,
109 both from a specification and an implementation point of view.
111 The KAME implementation supports an extended numeric IPv6 address notation
112 for link-local addresses,
122 This notation is supported by
126 Some of normal userland programs, such as
130 are able to use this notation.
131 With special programs
134 you can specify the outgoing interface by an extra command line option
135 to disambiguate scoped addresses.
137 Scoped addresses are handled specially in the kernel.
138 In kernel structures like routing tables or interface structures,
139 a scoped address will have its interface index embedded into the address.
141 the address in some kernel structures is not the same as that on the wire.
142 The embedded index will become visible through a
144 socket, kernel memory accesses via
146 and on some other occasions.
147 HOWEVER, users should never use the embedded form.
148 For details please consult
150 supplied with KAME kit.
154 family is comprised of the
156 network protocol, Internet Control
157 Message Protocol version 6
159 Transmission Control Protocol
161 and User Datagram Protocol
164 is used to support the
168 is used to support the
182 by creating an Internet socket of type
186 message protocol is accessible from a raw socket.
188 A number of variables are implemented in the net.inet6 branch of the
191 In addition to the variables supported by the transport protocols
192 (for which the respective manual pages may be consulted),
193 the following general variables are defined:
194 .Bl -tag -width IPV6CTL_MAXFRAGPACKETS
195 .It Dv IPV6CTL_FORWARDING
197 Boolean: enable/disable forwarding of
200 Also, identify if the node is acting as a router.
202 .It Dv IPV6CTL_SENDREDIRECTS
204 Boolean: enable/disable sending of
206 redirects in response to unforwardable
209 This option is ignored unless the node is routing
212 and should normally be enabled on all systems.
214 .It Dv IPV6CTL_DEFHLIM
216 Integer: default hop limit value to use for outgoing
219 This value applies to all the transport protocols on top of
221 There are APIs to override the value.
222 .It Dv IPV6CTL_MAXFRAGS
224 Integer: maximum number of fragments the host will accept and simultaneously
225 hold across all reassembly queues in all VNETs.
226 If set to 0, fragment reassembly is disabled.
227 If set to -1, this limit is not applied.
228 This limit is recalculated when the number of mbuf clusters is changed.
229 This is a global limit.
230 .It Dv IPV6CTL_MAXFRAGPACKETS
231 .Pq ip6.maxfragpackets
232 Integer: maximum number of fragmented packets the node will accept and
233 simultaneously hold in the reassembly queue for a particular VNET.
234 0 means that the node will not accept any fragmented packets for that VNET.
235 -1 means that the node will not apply this limit for that VNET.
236 This limit is recalculated when the number of mbuf clusters is changed.
237 This is a per-VNET limit.
238 .It Dv IPV6CTL_MAXFRAGBUCKETSIZE
239 .Pq ip6.maxfragbucketsize
240 Integer: maximum number of reassembly queues per bucket.
241 Fragmented packets are hashed to buckets.
242 Each bucket has a list of reassembly queues.
243 The system must compare the incoming packets to the existing reassembly queues
244 in the bucket to find a matching reassembly queue.
245 To preserve system resources, the system limits the number of reassembly
246 queues allowed in each bucket.
247 This limit is recalculated when the number of mbuf clusters is changed or
249 .Va ip6.maxfragpackets
251 This is a per-VNET limit.
252 .It Dv IPV6CTL_MAXFRAGSPERPACKET
253 .Pq ip6.maxfragsperpacket
254 Integer: maximum number of fragments the host will accept and hold in the
255 ressembly queue for a packet.
256 This is a per-VNET limit.
257 .It Dv IPV6CTL_ACCEPT_RTADV
259 Boolean: the default value of a per-interface flag to
260 enable/disable receiving of
262 router advertisement packets,
263 and autoconfiguration of address prefixes and default routers.
264 The node must be a host
266 for the option to be meaningful.
268 .It Dv IPV6CTL_AUTO_LINKLOCAL
269 .Pq ip6.auto_linklocal
270 Boolean: the default value of a per-interface flag to
271 enable/disable performing automatic link-local address configuration.
273 .It Dv IPV6CTL_LOG_INTERVAL
275 Integer: default interval between
277 packet forwarding engine log output
279 .It Dv IPV6CTL_HDRNESTLIMIT
281 Integer: default number of the maximum
284 permitted on incoming
287 If set to 0, the node will accept as many extension headers as possible.
288 .It Dv IPV6CTL_DAD_COUNT
290 Integer: default number of
293 .Pq duplicated address detection
295 The packets will be generated when
297 interface addresses are configured.
298 .It Dv IPV6CTL_AUTO_FLOWLABEL
299 .Pq ip6.auto_flowlabel
300 Boolean: enable/disable automatic filling of
302 flowlabel field, for outstanding connected transport protocol packets.
303 The field might be used by intermediate routers to identify packet flows.
305 .It Dv IPV6CTL_DEFMCASTHLIM
307 Integer: default hop limit value for an
309 multicast packet sourced by the node.
310 This value applies to all the transport protocols on top of
312 There are APIs to override the value as documented in
314 .It Dv IPV6CTL_GIF_HLIM
316 Integer: default maximum hop limit value for an
321 .It Dv IPV6CTL_KAME_VERSION
323 String: identifies the version of KAME
325 stack implemented in the kernel.
326 .It Dv IPV6CTL_USE_DEPRECATED
327 .Pq ip6.use_deprecated
328 Boolean: enable/disable use of deprecated address,
329 specified in RFC2462 5.5.4.
331 .It Dv IPV6CTL_RR_PRUNE
333 Integer: default interval between
335 router renumbering prefix babysitting, in seconds.
336 .It Dv IPV6CTL_V6ONLY
338 Boolean: enable/disable the prohibited use of
345 .Ss Interaction between IPv4/v6 sockets
348 does not route IPv4 traffic to
351 The default behavior intentionally violates RFC2553 for security reasons.
352 Listen to two sockets if you want to accept both IPv4 and IPv6 traffic.
353 IPv4 traffic may be routed with certain
354 per-socket/per-node configuration, however, it is not recommended to do so.
361 TCP/UDP socket is documented in RFC2553.
362 Basically, it says this:
365 A specific bind on an
369 with an address specified)
370 should accept IPv6 traffic to that address only.
372 If you perform a wildcard bind
379 and there is no wildcard bind
381 socket on that TCP/UDP port, IPv6 traffic as well as IPv4 traffic
382 should be routed to that
385 IPv4 traffic should be seen as if it came from an IPv6 address like
386 .Li ::ffff:10.1.1.1 .
387 This is called an IPv4 mapped address.
389 If there are both a wildcard bind
391 socket and a wildcard bind
393 socket on one TCP/UDP port, they should behave separately.
394 IPv4 traffic should be routed to the
396 socket and IPv6 should be routed to the
401 However, RFC2553 does not define the ordering constraint between calls to
403 nor how IPv4 TCP/UDP port numbers and IPv6 TCP/UDP port numbers
405 (should they be integrated or separated).
406 Implemented behavior is very different from kernel to kernel.
407 Therefore, it is unwise to rely too much upon the behavior of
409 wildcard bind sockets.
410 It is recommended to listen to two sockets, one for
414 when you would like to accept both IPv4 and IPv6 traffic.
416 It should also be noted that
417 malicious parties can take advantage of the complexity presented above,
418 and are able to bypass access control,
419 if the target node routes IPv4 traffic to
422 Users are advised to take care handling connections
423 from IPv4 mapped address to
439 .%T "An Extension of Format for IPv6 Scoped Addresses"
442 .%N draft-ietf-ipngwg-scopedaddr-format-02.txt
443 .%O work in progress material
448 protocol interfaces are defined in RFC2553 and RFC2292.
449 The implementation described herein appeared in the WIDE/KAME project.
451 The IPv6 support is subject to change as the Internet protocols develop.
452 Users should not depend on details of the current implementation,
453 but rather the services exported.
455 Users are suggested to implement
456 .Dq version independent
457 code as much as possible, as you will need to support both