HP-UX Reference (11i v2 04/09) - 7 Device (Special) Files, 9 General Information, Index (vol 10)
i
IPv6(7P) IPv6(7P)
NAME
IPv6, ipv6, ip6 - Internet Protocol Version 6
SYNOPSIS
#include <sys/socket.h>
#include <netinet/in.h>
s = socket(AF_INET6, SOCK_DGRAM, 0);
s = socket(AF_INET6, SOCK_STREAM, 0);
DESCRIPTION
IPv6 is the next generation network-layer protocol designed to be the successor to the current Internet
Protocol version 4 (IPv4). It provides the packet delivery service for TCP, UDP and ICMPv6.
IPv6 has significant advantages over IPv4 in terms of increased address space, simplified header format,
integrated QoS support and mandatory security. IPv6 also allows optional internet-layer information to
be encoded in separate headers called extension headers which are placed between the IPv6 header and
upper layer headers. Extension headers currently supported are hop-by-hop option header, destination
option header, fragment header and routing (type 0) header. An IPv6 packet may carry zero, one, or
more extension headers, each identified by the next header field of the preceding header.
IPv6 has extended the address size from 32 bits to 128 bits and they are textually represented in hex-
colon notation as
x:x:x:x:x:x:x:x
, where the x’s are the hexadecimal values of the eight 16-bit
pieces of the address. For example
fedc:83ff:fef6:417a:210:83ff:fef6:3dc0
.
IPv6 has three types of addresses: unicast, anycast, and multicast.
• An unicast address is an identifier for a single interface. A packet sent to an unicast address is
delivered to the interface identified by that address.
• An anycast address is an identifier for a set of interfaces. A packet sent to an anycast address
is delivered to one of the interfaces identified by that address.
• A multicast address is an identifier for a set of interfaces. A packet sent to a multicast address
is delivered to all interfaces identified by that address.
There are no broadcast addresses in IPv6, their function is superseded by multicast addresses.
Every IPv6 address has a scope associated with it. A scope is a topological span within which the
address may be used as an unique identifier for an interface or set of interfaces.
An unicast address has three defined scopes: link-local, site-local and global.
• Link-local address uniquely identifies interfaces within a single link and it has a fixed prefix of
fe80::/10. For example, fe80::210:84c0:ef6f:cd30
.
• Site-local address uniquely identifies interfaces within a single site only and it has a fixed prefix
of
fec0::/10. For example, fec0::210:84c0:ef6f:cd30
.
• Global address uniquely identifies interfaces anywhere in the internet.
There are 2 special unicast addresses which hold an embedded IPv4 address in the low order 32-bits.
• The first type is termed as IPv4-compatible IPv6 address and is of the form
0:0:0:0:0:0:d.d.d.d. This type of address is used by dual stack (IPv4/IPv6) nodes to per-
form automatic IPv6-over-IPv4 tunneling where the IPv4 tunnel endpoint address is determined
from the IPv4 address embedded in the IPv4-compatible destination address of the IPv6 packet
being tunneled.
• The second type is termed as IPv4-mapped IPv6 address and is of the form
0:0:0:0:0:ffff:d.d.d.d. This address facilitates IPv6 applications to interoperate with
IPv4 applications. Applications can automatically generate this address using getad-
drinfo() (see getaddrinfo (3N)) when the specified host has only IPv4 address.
IPv6 Socket Options
New socket options are defined for IPv6 to send and receive extension headers and to exchange other
optional information between the kernel and application. The options are supported at the
IPPROTO_IPV6 protocol level. The type of the variable pointed to by the optval parameter is indicated
in parenthesis.
IPV6_UNICAST_HOPS (integer) Set or get the hop limit used in outgoing unicast packets.
When this option is set using setsockopt()(see setsockopt (2)), the
Section 7−−52 Hewlett-Packard Company − 1 − HP-UX 11i Version 2: September 2004