ns(7) — Special Files
OSF
NAME
ns − Xerox Network Systems protocol family
SYNOPSIS
options NS
options NSIP
pseudo-device ns
DESCRIPTION
The NS protocol family is a collection of protocols layered atop the Internet Datagram Protocol (IDP) transport layer, and using the Xerox NS address formats. The NS family provides protocol support for the SOCK_STREAM, SOCK_DGRAM, SOCK_SEQPACKET, and SOCK_RAW socket types. The SOCK_RAW interface is a debugging tool, allowing you to trace all packets entering (or with toggling kernel variable, additionally leaving) the local host.
Addressing
The NS addresses are 12-byte quantities, consisting of a 4-byte network number, a 6-byte host number and a 2-byte port number, all stored in network standard format. (On the VAX and other machines, these are word and byte reversed; on a Sun machine, they are not reversed). The netns/ns.h include file defines the NS address as a structure containing unions (for quicker comparisons).
Both the 4.3BSD and 4.4BSD sockaddr_ns structures are supported by OSF/1. The default sockaddr_ns structure is the 4.3BSD structure, which is as follows: struct sockaddr_ns {
u_shortsns_family;
struct ns_addrsns_addr;
charsns_zero[2];
};
If the compile-time option _SOCKADDR_LEN is defined before the netns/ns.h header file is included, however, the 4.4BSD sockaddr structure is defined, which is as follows: struct sockaddr_ns {
u_charsns_len;
u_charsns_family;
struct ns_addrsns_addr;
charsns_zero[2];
};
The 4.4BSD sockaddr_in structure provides for a sns_len field, which contains the total length of the structure.
The ns_addr field is composed as follows: union ns_host {
u_charc_host[6];
u_shorts_host[3];
};
union ns_net {
u_charc_net[4];
u_shorts_net[2]; };
struct ns_addr {
union ns_netx_net;
union ns_hostx_host;
u_shortx_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(2) call is restricted to be greater than NSPORT_RESERVED (=3000, in netns/ns.h ) unless the creating process is running as the superuser, providing a space of protected port numbers.
Protocols
The NS protocol family supported by the operating system is comprised of the Internet Datagram Protocol (IDP) idp(4), Error Protocol (available through IDP), and Sequenced Packet Protocol (SPP) spp(4).
SPP is used to support the SOCK_STREAM and SOCK_SEQPACKET abstraction, while IDP is used to support the SOCK_DGRAM abstraction. The error protocol is responded to by the kernel to handle and report errors in protocol processing; it is, however, not easily accessible to user programs.
RELATED INFORMATION
Functions: gethostbyname(3), getnetent(3), getprotoent(3), getservent(3), ns(3)
Files: netintro(7), spp(7), idp(7), nsip(7)