JavaScript is required to for searching.
Skip Navigation Links
Exit Print View
man pages section 7: Device and Network Interfaces     Oracle Solaris 11.1 Information Library
search filter icon
search icon

Document Information

Preface

Introduction

Device and Network Interfaces

1394(7D)

aac(7D)

adpu320(7D)

afe(7D)

agpgart_io(7I)

AH(7P)

ahci(7D)

allkmem(7D)

amd8111s(7D)

arcmsr(7D)

arn(7D)

ARP(7P)

arp(7P)

ast(7D)

asy(7D)

ata(7D)

atge(7D)

ath(7D)

atu(7D)

audio1575(7D)

audio(7D)

audio(7I)

audio810(7D)

audiocmi(7D)

audiocs(7D)

audioemu10k(7D)

audioens(7D)

audiohd(7D)

audioixp(7D)

audiols(7D)

audiop16x(7D)

audiopci(7D)

audiosolo(7D)

audiots(7D)

audiovia823x(7D)

av1394(7D)

balloon(7D)

bbc_beep(7D)

bcm_sata(7D)

bfe(7D)

bge(7D)

blkdev(7D)

bmc(7D)

bnx(7D)

bnxe(7D)

bpf(7D)

bscbus(7D)

bscv(7D)

bufmod(7M)

cdio(7I)

chxge(7D)

cmdk(7D)

connld(7M)

console(7D)

cpqary3(7D)

cpr(7)

cpuid(7D)

ctfs(7FS)

cxge(7D)

dad(7D)

daplt(7D)

dca(7D)

dcam1394(7D)

dcfs(7FS)

dev(7FS)

devchassis(7FS)

devfs(7FS)

devinfo(7D)

dkio(7I)

dlcosmk(7ipp)

dlpi(7P)

dm2s(7D)

dmfe(7D)

dnet(7D)

dr(7d)

drmach(7d)

dscpmk(7ipp)

dsp(7I)

dtrace(7D)

e1000(7D)

e1000g(7D)

ecpp(7D)

efb(7D)

ehci(7D)

eibnx(7D)

elxl(7D)

emlxs(7D)

eoib(7D)

eri(7D)

ESP(7P)

evb(7P)

fas(7D)

fasttrap(7D)

fbio(7I)

fbt(7D)

fcip(7D)

fcoe(7D)

fcoei(7D)

fcoet(7D)

fcp(7D)

fctl(7D)

fipe(7D)

firewire(7D)

flowacct(7ipp)

fp(7d)

FSS(7)

gld(7D)

glm(7D)

hci1394(7D)

hdio(7I)

heci(7D)

hermon(7D)

hid(7D)

hme(7D)

hsfs(7FS)

hubd(7D)

hwa1480_fw(7D)

hwahc(7D)

hwarc(7D)

hxge(7D)

i2bsc(7D)

i915(7d)

ib(7D)

ibcm(7D)

ibdm(7D)

ibdma(7D)

ibmf(7)

ibp(7D)

ibtl(7D)

icmp6(7P)

ICMP(7P)

icmp(7P)

iec61883(7I)

ieee1394(7D)

if(7P)

ifp(7D)

if_tcp(7P)

igb(7D)

igbvf(7D)

ii(7D)

imraid_sas(7D)

inet6(7P)

inet(7P)

ip6(7P)

IP(7P)

ip(7P)

ipgpc(7ipp)

ipmi(7D)

ipnat(7I)

ipnet(7D)

ipqos(7ipp)

iprb(7D)

ipsec(7P)

ipsecah(7P)

ipsecesp(7P)

ipw(7D)

iscsi(7D)

isdnio(7I)

iser(7D)

isp(7D)

iwh(7D)

iwi(7D)

iwk(7D)

iwp(7D)

ixgb(7d)

ixgbe(7D)

ixgbevf(7D)

kb(7M)

kdmouse(7D)

kmdb(7d)

kmem(7D)

kstat(7D)

ksyms(7D)

ldterm(7M)

llc1(7D)

llc2(7D)

lo0(7D)

lockstat(7D)

lofi(7D)

lofs(7FS)

log(7D)

lsc(7D)

marvell88sx(7D)

mc-opl(7D)

mcxe(7D)

md(7D)

mediator(7D)

mega_sas(7D)

mem(7D)

mga(7D)

mhd(7i)

mixer(7I)

mpt(7D)

mpt_sas(7D)

mr_sas(7D)

msglog(7D)

mt(7D)

mtio(7I)

mwl(7D)

mxfe(7D)

myri10ge(7D)

n2cp(7d)

n2rng(7d)

nca(7d)

ncp(7D)

ngdr(7d)

ngdrmach(7d)

nge(7D)

npe(7D)

ntwdt(7D)

ntxn(7D)

null(7D)

nulldriver(7D)

nv_sata(7D)

nxge(7D)

objfs(7FS)

oce(7D)

ohci(7D)

openprom(7D)

oplkmdrv(7D)

oplmsu(7D)

oplpanel(7D)

packet(7P)

pcan(7D)

pcata(7D)

pcfs(7FS)

pcic(7D)

pcicmu(7D)

pcie_pci(7D)

pckt(7M)

pcmcia(7D)

pcn(7D)

pcser(7D)

pcwl(7D)

pf_key(7P)

pfmod(7M)

PF_PACKET(7P)

physmem(7D)

pipemod(7M)

pm(7D)

poll(7d)

prnio(7I)

profile(7D)

ptem(7M)

ptm(7D)

pts(7D)

pty(7D)

qfe(7d)

qlc(7D)

qlcnic(7D)

qlge(7D)

quotactl(7I)

radeon(7d)

ral(7D)

ramdisk(7D)

random(7D)

RARP(7P)

rarp(7P)

rge(7D)

route(7P)

routing(7P)

rtls(7D)

rtw(7D)

rum(7D)

rwd(7D)

rwn(7D)

sad(7D)

sata(7D)

scfd(7D)

scsa1394(7D)

scsa2usb(7D)

scsi_vhci(7D)

SCTP(7P)

sctp(7P)

scu(7D)

sd(7D)

sda(7D)

SDC(7)

sdcard(7D)

sdhost(7D)

sdp(7D)

sdt(7D)

se(7D)

se_hdlc(7D)

ses(7D)

sesio(7I)

sf(7D)

sfe(7D)

sgen(7D)

sharefs(7FS)

si3124(7D)

sip(7P)

slp(7P)

smbfs(7FS)

smbios(7D)

smbus(7D)

smp(7D)

snca(7d)

socal(7D)

sockio(7I)

sol_ofs(7D)

sol_ucma(7D)

sol_umad(7D)

sol_uverbs(7D)

sppptun(7M)

srpt(7D)

ssd(7D)

st(7D)

streamio(7I)

su(7D)

sv(7D)

sxge(7D)

sysmsg(7D)

systrace(7D)

TCP(7P)

tcp(7P)

termio(7I)

termiox(7I)

ticlts(7D)

ticots(7D)

ticotsord(7D)

timod(7M)

tirdwr(7M)

tmpfs(7FS)

todopl(7D)

tokenmt(7ipp)

tsalarm(7D)

tswtclmt(7ipp)

ttcompat(7M)

tty(7D)

ttymux(7D)

tzmon(7d)

uata(7D)

uath(7D)

udfs(7FS)

UDP(7P)

udp(7P)

ufs(7FS)

ugen(7D)

uhci(7D)

ural(7D)

urandom(7D)

urtw(7D)

usb(7D)

usba(7D)

usb_ac(7D)

usb_ah(7M)

usb_as(7D)

usbecm(7D)

usbftdi(7D)

usb_ia(7D)

usbkbm(7M)

usb_mid(7D)

usbms(7M)

usbprn(7D)

usbsacm(7D)

usbser_edge(7D)

usbsksp(7D)

usbsprl(7D)

usbvc(7D)

usbwcm(7M)

uscsi(7I)

usmp(7I)

uvfs(7FS)

uwb(7D)

uwba(7D)

virtualkm(7D)

visual_io(7I)

vni(7d)

vr(7D)

vt(7I)

vuid2ps2(7M)

vuid3ps2(7M)

vuidm3p(7M)

vuidm4p(7M)

vuidm5p(7M)

vuidmice(7M)

vxge(7D)

wpi(7D)

wscons(7D)

wusb_ca(7D)

wusb_df(7D)

xge(7D)

xhci(7D)

yge(7D)

zcons(7D)

zero(7D)

zfs(7FS)

zs(7D)

zsh(7D)

zyd(7D)

ip6

- Internet Protocol Version 6

Synopsis

#include <sys/socket.h>
#include <netinet/in.h>
#include <netinet/ip6.h>
s = socket(AF_INET6, SOCK_RAW, proto);
t = t_open ("/dev/rawip6", O_RDWR);

Description

The IPv6 protocol is the next generation of the internetwork datagram delivery protocol of the Internet protocol family. Programs can use IPv6 through higher-level protocols such as the Transmission Control Protocol (TCP) or the User Datagram Protocol (UDP), or can interface directly to IPv6. See tcp(7P) and udp(7P). Direct access can be by means of the socket interface, using a “raw socket,” or by means of the Transport Level Interface (TLI). The protocol options and IPv6 extension headers defined in the IPv6 specification can be set in outgoing datagrams.

APPLICATION PROGRAMMING INTERFACE

The STREAMS driver /dev/rawip6 is the TLI transport provider that provides raw access to IPv6.

Raw IPv6 sockets are connectionless and are normally used with the sendto() and recvfrom() calls (see send(3SOCKET) and recv(3SOCKET)), although the connect(3SOCKET) call can also be used to fix the destination for future datagrams. In this case, the read(2) or recv(3SOCKET) and write(2) or send(3SOCKET) calls can be used. Ancillary data can also be sent or received over raw IPv6 sockets using the sendmsg(3SOCKET) and recvmsg(3SOCKET) system calls.

Unlike raw IP, IPv6 applications do not include a complete IPv6 header when sending; there is no IPv6 analog to the IP IP_HDRINCL socket option. IPv6 header values can be specified or received as ancillary data to a sendmsg(3SOCKET) or recvmsg(3SOCKET) system call, or can be specified as sticky options on a per-socket basis by using the setsockopt(3SOCKET) system call. Such sticky options are applied to all outbound packets unless overridden by ancillary data. If any ancillary data is specified in a sendmsg(3SOCKET) call, all sticky options not explicitly overridden revert to default values for that datagram only; the sticky options persist as set for subsequent datagrams.

Since sendmsg(3SOCKET) is not supported for SOCK_STREAM upper level protocols such as TCP, ancillary data is unsupported for TCP. Sticky options, however, are supported.

Since sendmsg(3SOCKET) is supported for SOCK_DGRAM upper level protocols, both ancillary data and sticky options are supported for UDP, ICMP6, and raw IPv6 sockets.

The socket options supported at the IPv6 level are:

IPV6_BOUND_IF

Limit reception and transmission of packets to this interface. Takes an integer as an argument; the integer is the selected interace index.

IPV6_UNSPEC_SRC

Boolean. Allow/disallow sending with a zero source address.

IPV6_UNICAST_HOPS

Default hop limit for unicast datagrams. This option takes an integer as an argument. Its value becomes the new default value for ip6_hops that IPv6 uses on outgoing unicast datagrams sent from that socket. The initial default is 60.

IPV6_CHECKSUM

Specify the integer offset in bytes into the user data of the checksum location. Does not apply to the ICMP6 protocol. Note: checksums are required for all IPv6 datagrams; this is different from IP, in which datagram checksums were optional. IPv6 computes the ULP checksum if the value in the checksum field is zero.

IPV6_SEC_OPT

Enable or obtain IPsec security settings for this socket. For more details on the protection services of IPsec, see ipsec(7P).

IPV6_DONTFRAG

Boolean. Control fragmentation.

IPV6_USE_MIN_MTU

Controls whether path MTU discovery is used. If set to 1, path MTU discovery is never used and IPv6 packets are sent with the IPv6 minimum MTU. If set to -1, path MTU discovery is not used for multicast and multicast packets are sent with the IPv6 minimum MTU. If set to 0, path MTU is always performed.

IPV6_V6ONLY

Boolean. If set, only V6 packets can be sent or received

IPV6_SRC_PREFERENCES

Enable or obtain Source Address Selection rule settings for this socket. For more details on the Source Address Selection rules, see inet6(7P).

The following options are boolean switches controlling the reception of ancillary data:

IPV6_RECVPKTINFO

Enable/disable receipt of the index of the interface the packet arrived on, and of the inbound packet's destination address.

IPV6_RECVHOPLIMIT

Enable/disable receipt of the inbound packet's current hoplimit.

IPV6_RECVHOPOPTS

Enable/disable receipt of the inbound packet's IPv6 hop-by-hop extension header.

IPV6_RECVDSTOPTS

Enable/disable receipt of the inbound packet's IPv6 destination options extension header.

IPV6_RECVRTHDR

Enable/disable receipt of the inbound packet's IPv6 routing header.

IPV6_RECVRTHDRDSTOPTS

Enable/disable receipt of the inbound packet's intermediate-hops options extension header. This option is obsolete. IPV6_RECVDSTOPTS turns on receipt of both destination option headers.

IPV6_RECVTCLASS

Enable/disable receipt of the traffic class of the inbound packet.

IPV6_RECVPATHMTU

Enable/disable receipt of the path mtu of the inbound packet.

The following options can be set as sticky options with setsockopt(3SOCKET) or as ancillary data to a sendmsg(3SOCKET) system call:

IPV6_PKTINFO

Set the source address and/or interface out which the packet(s) is sent. Takes a struct in6_pktinfo as the parameter.

IPV6_HOPLIMIT

Set the initial hoplimit for outbound datagrams. Takes an integer as the parameter. This option sets the hoplimit only for ancillary data or sticky options and does not change the default hoplimit for the socket; see IPV6_UNICAST_HOPS and IPV6_MULTICAST_HOPS to change the socket's default hoplimit.

IPV6_NEXTHOP

Specify the IPv6 address of the first hop, which must be a neighbor of the sending host. Takes a struct sockaddr_in6 as the parameter. When this option specifies the same address as the destination IPv6 address of the datagram, this is equivalent to the existing SO_DONTROUTE option.

IPV6_HOPOPTS

Specify one or more hop-by-hop options. Variable length. Takes a complete IPv6 hop-by-hop options extension header as the parameter.

IPV6_DSTOPTS

Specify one or more destination options. Variable length. Takes a complete IPv6 destination options extension header as the parameter.

IPV6_RTHDR

Specify the IPv6 routing header. Variable length. Takes a complete IPv6 routing header as the parameter. Currently, only type 0 routing headers are supported.

IPV6_RTHDRDSTOPTS

Specify one or more destination options for all intermediate hops. May be configured, but is not applied unless an IPv6 routing header is also configured. Variable length. Takes a complete IPv6 destination options extension header as the parameter.

IPV6_PATHMTU

Get the path MTU associated with a connected socket. Takes a ip6_mtuinfo as the parameter.

IPV6_TCLASS

Set the traffic class associated with outgoing packets. The parameter is an integer. If the parameter is less then -1 or greater then 256, EINVAL is returned. If the parameter is equal to -1, use the default. If the parameter is between 0 and 255 inclusive, use that value.

The following options affect the socket's multicast behavior:

IPV6_JOIN_GROUP

Join a multicast group. Takes a struct ipv6_mreq as the parameter; the structure contains a multicast address and an interface index.

IPV6_LEAVE_GROUP

Leave a multicast group. Takes a struct ipv6_mreq as the parameter; the structure contains a multicast address and an interface index.

MCAST_JOIN_GROUP

Functionally equivalent to IPV6_JOIN_GROUP. Takes a struct group_req as the parameter. The structure contains a multicast address and an interface index.

MCAST_BLOCK_SOURCE

Block multicast packets on a particular multicast group whose source address matches the given source address. The specified group must be joined previously using IPV6_JOIN_GROUP or MCAST_JOIN_GROUP. Takes a struct group_source_req as the parameter. The structure contains an interface index, a multicast address, and a source address.

MCAST_UNBLOCK_SOURCE

Unblock multicast packets which were previously blocked using MCAST_BLOCK_SOURCE. Takes a struct group_source_req as the parameter. The structure contains an interface index, a multicast address, and a source address.

MCAST_LEAVE_GROUP

Functionally equivalent to IPV6_LEAVE_GROUP. Takes a struct group_req as the parameter. The structure contains a multicast address and an interface index.

MCAST_JOIN_SOURCE_GROUP

Begin receiving packets for the given multicast group whose source address matches the specified address. Takes a struct group_source_req as the parameter. The structure contains an interface index, a multicast address, and a source address.

MCAST_LEAVE_SOURCE_GROUP

Stop receiving packets for the given multicast group whose source address matches the specified address. Takes a struct group_source_req as the parameter. The structure contains an interface index, a multicast address, and a source address.

IPV6_MULTICAST_IF

The outgoing interface for multicast packets. This option takes an integer as an argument; the integer is the interface index of the selected interface.

IPV6_MULTICAST_HOPS

Default hop limit for multicast datagrams. This option takes an integer as an argument. Its value becomes the new default value for ip6_hops that IPv6 uses on outgoing multicast datagrams sent from that socket. The initial default is 1.

IPV6_MULTICAST_LOOP

Loopback for multicast datagrams. Normally multicast datagrams are delivered to members on the sending host. Setting the unsigned character argument to 0 causes the opposite behavior.

The multicast socket options can be used with any datagram socket type in the IPv6 family.

At the socket level, the socket option SO_DONTROUTE can be applied. This option forces datagrams being sent to bypass routing and forwarding by forcing the IPv6 hoplimit field to 1, meaning that the packet is not forwarded by routers.

Raw IPv6 datagrams can also be sent and received using the TLI connectionless primitives.

Datagrams flow through the IPv6 layer in two directions: from the network up to user processes and from user processes down to the network. Using this orientation, IPv6 is layered above the network interface drivers and below the transport protocols such as UDP and TCP. The Internet Control Message Protocol (ICMPv6) for the Internet Protocol Version 6 (IPv6) is logically a part of IPv6. See icmp6(7P).

Unlike IP, IPv6 provides no checksum of the IPv6 header. Also unlike IP, upper level protocol checksums are required. IPv6 computes the ULP/data portion checksum if the checksum field contains a zero (see IPV6_CHECKSUM option above).

IPv6 extension headers in received datagrams are processed in the IPv6 layer according to the protocol specification. Currently recognized IPv6 extension headers include hop-by-hop options header, destination options header, routing header (currently, only type 0 routing headers are supported), and fragment header.

By default, the IPv6 layer does not forward IPv6 packets that are not addressed to it. This behavior can be overridden by using routeadm(1M) to enable the ipv6-forwarding option. IPv6 forwarding is configured at boot time based on the setting of routeadm's ipv6-forwarding option. ipadm(1M) can also be used to enable ipv6 forwarding on a global basis. The ipadm set-prop subcommand along with forwarding property is used to enable system-wide forwarding of packets. The protocol for which forwarding needs to be enabled is specified using the -m option. See ipadm(1M) for more details.

Additionally, finer-grained forwarding can be configured in IPv6. Each interface can be configured to forward IPv6 packets by setting the IFF_ROUTER interface flag. This flag can be set and cleared using the ifconfig(1M) router and -router options. If an interface's IFF_ROUTER flag is set, packets can be forwarded to or from the interface. If it is clear, packets is neither forwarded from this interface to others, nor forwarded to this interface. Setting the global ipv6 forwarding variable sets all of the IPv6 interfaces' IFF_ROUTER flags. Also, the ipadm set-ifprop subcommand can be used to enable/disable per-interface ipv6 forwarding. See ipadm(1M) for more details. The ipadm set-ifprop interfaces are preferred.

The IPv6 layer sends an ICMP6 message back to the source host in many cases when it receives a datagram that can not be handled. A time exceeded ICMP6 message is sent if the ip6_hops field in the IPv6 header drops to zero in the process of forwarding a datagram. A destination unreachable message is sent by a router or by the originating host if a datagram can not be sent on because there is no route to the final destination; it is sent by a router when it encounters a firewall prohibition; it is sent by a destination node when the transport protocol (that is, TCP) has no listener. A packet too big message is sent by a router if the packet is larger than the MTU of the outgoing link (this is used for Path MTU Discovery). A parameter problem message is sent if there is a problem with a field in the IPv6 header or any of the IPv6 extension headers such that the packet cannot be fully processed.

The IPv6 layer supports fragmentation and reassembly. Datagrams are fragmented on output if the datagram is larger than the maximum transmission unit (MTU) of the network interface. Fragments of received datagrams are dropped from the reassembly queues if the complete datagram is not reconstructed within a short time period.

Errors in sending discovered at the network interface driver layer are passed by IPv6 back up to the user process.

See Also

svcs(1), ifconfig(1M), ipadm(1M), ndd(1M), routeadm(1M), svcadm(1M), read(2), write(2), bind(3SOCKET), connect(3SOCKET), getsockopt(3SOCKET), recv(3SOCKET), recvmsg(3SOCKET), send(3SOCKET), sendmsg(3SOCKET), setsockopt(3SOCKET), defaultrouter(4), smf(5), icmp6(7P), if_tcp(7P), ipsec(7P), inet6(7P), routing(7P), tcp(7P), udp(7P)

Deering, S. and Hinden, B. RFC 2460, Internet Protocol, Version 6 (IPv6) Specification. The Internet Society. December, 1998.

Stevens, W., and Thomas, M. RFC 2292, Advanced Sockets API for IPv6. Network Working Group. February 1998.

Diagnostics

A socket operation can fail with one of the following errors returned:

EPROTONOSUPPORT

Unsupported protocol (for example, IPPROTO_RAW.)

EACCES

A bind() operation was attempted with a “reserved” port number and the effective user ID of the process was not the privileged user.

EADDRINUSE

A bind() operation was attempted on a socket with a network address/port pair that has already been bound to another socket.

EADDRNOTAVAIL

A bind() operation was attempted for an address that is not configured on this machine.

EINVAL

A sendmsg() operation with a non-NULL msg_accrights was attempted.

EINVAL

A getsockopt() or setsockopt() operation with an unknown socket option name was given.

EINVAL

A getsockopt() or setsockopt() operation was attempted with the IPv6 option field improperly formed; an option field was shorter than the minimum value or longer than the option buffer provided; the value in the option field was invalid.

EISCONN

A connect() operation was attempted on a socket on which a connect() operation had already been performed, and the socket could not be successfully disconnected before making the new connection.

EISCONN

A sendto() or sendmsg() operation specifying an address to which the message should be sent was attempted on a socket on which a connect() operation had already been performed.

EMSGSIZE

A send(), sendto(), or sendmsg() operation was attempted to send a datagram that was too large for an interface, but was not allowed to be fragmented (such as broadcasts).

ENETUNREACH

An attempt was made to establish a connection via connect(), or to send a datagram by means of sendto() or sendmsg(), where there was no matching entry in the routing table; or if an ICMP “destination unreachable” message was received.

ENOTCONN

A send() or write() operation, or a sendto() or sendmsg() operation not specifying an address to which the message should be sent, was attempted on a socket on which a connect() operation had not already been performed.

ENOBUFS

The system ran out of memory for fragmentation buffers or other internal data structures.

ENOMEM

The system was unable to allocate memory for an IPv6 socket option or other internal data structures.

ENOPROTOOPT

An IP socket option was attempted on an IPv6 socket, or an IPv6 socket option was attempted on an IP socket.

ENOPROTOOPT

Invalid socket type for the option.

Notes

Applications using the sockets API must use the Advanced Sockets API for IPv6 (RFC 2292) to see elements of the inbound packet's IPv6 header or extension headers.

The ip6 service is managed by the service management facility, smf(5), under the service identifier:

svc:/network/initial:default

Administrative actions on this service, such as enabling, disabling, or requesting restart, can be performed using svcadm(1M). The service's status can be queried using the svcs(1) command.