[ Previous | Next | Table of Contents | Index | Library Home | Legal | Search ]

Communications Programming Concepts

Network Systems Protocol Family

The Network Systems (NS) protocol family is a collection of protocols layered atop the Internet Datagram Protocol (IDP) transport layer, using the Xerox Network Systems (XNS) address formats. The NS family provides protocol support for the following socket types:

The SOCK_RAW interface is a debugging tool, allowing you to trace all packets entering (or, with a toggling kernel variable, leaving) the local host.

Usage Conventions

The following conventions apply when using the NS protocols:


NS addresses are 12-byte quantities consisting of a four-byte network number, a six-byte host number and a two-byte port number, all stored in standard network format. For VAX architecture, these are word- and byte-reversed; for Sun systems, they are not reversed. The netns/ns.h file defines the NS address as a structure containing unions (for quicker comparisons).

Sockets in the Internet Protocol (IP) family use the following addressing structure:

struct sockaddr_ns {
       short            sns-family;
       struct ns_addr   sns-addr;
       char             sns_zero[2];

where an ns_addr is composed as follows:

union ns_host {
       u_char           c_host[6];
       u_short          s_host[3];

union ns_net {
       u_char           c_net[4];
       u_short          s_net[2];

struct ns_addr {
       union ns_net     x_net;
       union ns_host    x_host;
       u_short x_port;

Sockets may be created with an address of all zeros to effect wildcard matching on incoming messages. The local port address specified in a bind subroutine is restricted to be greater than the NSPORT_RESERVED parameter (equals 3000, in the netns/ns.h file) unless the creating process is running as the root user, providing a space of protected port numbers.


The NS protocol family comprises the Internet Datagram Protocol (IDP), Error Protocol (available through IDP), and Sequenced Packet Protocol (SPP).

SPP is used to support the SOCK_STREAM and SOCK_SEQPACKET socket types, while IDP is used to support the SOCK_DGRAM socket type. If no user application is bound to the echo port, the kernel responds to the Error Protocol by handling and reporting errors in protocol processing.

[ Previous | Next | Table of Contents | Index | Library Home | Legal | Search ]