z/OS Communications Server: IPv6 Network and Application Design Guide
Previous topic | Next topic | Contents | Contact z/OS | Library | PDF


Options for specifying the outgoing interface

z/OS Communications Server: IPv6 Network and Application Design Guide
SC27-3663-00

A UDP or RAW application can influence the outgoing interface for a packet with the IPV6_PKTINFO option, the IPV6_NEXTHOP option, or the IPV6_MULTICAST_IF option. The scope ID field in the send operation's destination sockaddr can also affect the outgoing interface. The options field contains an interface index. The scope ID field contains a zone index.

When UDP and RAW applications respond to a peer, the applications use the sockaddr_in6 structure that they received, and they should not set the scope ID field to zero. When sending an unsolicited packet (for example, not responding to one that was received), the scope ID field should be zero. UDP and RAW applications should use the IPV6_PKTINFO, IPV6_NEXTHOP, or IPV6_MULTICAST_IF options to select the outgoing interfaces. Alternatively, if the sockaddr_in6 structure is created by the resolver using a getaddrinfo call, UDP and RAW applications can specify scope information in the getaddrinfo call; the scope ID field will be set appropriately by the resolver. See Scope information about getaddrinfo calls for further information.

The following precedence order is used to determine the outgoing interface for a packet:
  1. If the send operation specifies a destination sockaddr structure with a scope ID, then the scope ID is used if valid (note that a scope ID should be provided with a link-local address only).
  2. If IPV6_PKTINFO ancillary data is specified on sendmsg() with a nonzero interface index, use its value. If the IPV6_PKTINFO ancillary data is specified with a length of 0 or with an interface index of 0, then skip to rule 4.
  3. If the IPV6_PKTINFO socket option is set and contains a nonzero interface index, use its value.
  4. If this is a multicast packet and the IPV6_MULTICAST_IF socket option is set, use its value.
  5. If IPV6_NEXTHOP ancillary data is specified on sendmsg() with a nonzero value, use the stack routing table to determine the interface to the next hop address. If the IPV6_NEXTHOP ancillary data is specified with a length of 0, go to step 7.
  6. If the IPV6_NEXTHOP socket option is set and contains a nonzero value, use the stack routing table to determine the interface to the next hop address.
  7. The TCP/IP protocol stack uses the routing table to determine the interface to the destination IP address.

An application should provide outgoing interface information using only one method, or the application must ensure that the various specifications all indicate the same outgoing interface. If conflicting outgoing interface specifications are provided, the packet is discarded by the stack. For example, if scope information for the resolved destination host name specifies interface-1 and IPV6_PKTINFO ancillary data specifies interface-2, then the packet is discarded.

Go to the previous page Go to the next page




Copyright IBM Corporation 1990, 2014