Previous section.

Technical Standard: Networking Services (XNS), Issue 5.2 Draft 2.0
Copyright © 1999 The Open Group

Sockets Interfaces

Support for the Sockets interfaces as defined in this Part 2 of the XNS Technical Standard is mandatory.

This chapter gives an overview of the Sockets interfaces and includes functions, macros and external variables to support portability at the C-language source level.

Sockets Overview

All network protocols are associated with a specific protocol family. A protocol family provides basic services to the protocol implementation to allow it to function within a specific network environment. These services can include packet fragmentation and reassembly, routing, addressing, and basic transport. A protocol family can support multiple methods of addressing, though the current protocol implementations do not. A protocol family normally comprises a number of protocols, one per socket type. It is not required that a protocol family support all socket types. A protocol family can contain multiple protocols supporting the same socket abstraction.

A protocol supports one of the socket abstractions detailed in the manual page for the socket() function. A specific protocol can be accessed either by creating a socket of the appropriate type and protocol family, or by requesting the protocol explicitly when creating a socket. Protocols normally accept only one type of address format, usually determined by the addressing structure inherent in the design of the protocol family and network architecture. Certain semantics of the basic socket abstractions are protocol specific. All protocols are expected to support the basic model for their particular socket type, but can, in addition, provide nonstandard facilities or extensions to a mechanism. For example, a protocol supporting the SOCK_STREAM abstraction can allow more than one byte of out-of-band data to be transmitted per out-of-band message.

Addressing

Associated with each address family is an address format. All network addresses adhere to a general structure, called a sockaddr. The length of the structure varies according to the address family.

Routing

Sockets provides packet routing facilities. A routing information database is maintained, which is used in selecting the appropriate network interface when transmitting packets.

Interfaces

Each network interface in a system corresponds to a path through which messages can be sent and received. A network interface usually has a hardware device associated with it, though certain interfaces such as the loopback interface do not.

Use of Sockets for Local UNIX Connections, Use of Sockets over Internet Protocols based on IPv4, and Use of Sockets over Internet Protocols based on IPv6, respectively describe the use of sockets for local UNIX connections, for Internet protocols based on IPv4, and for Internet protocols based on IPv6.

Contents Next section Index