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 pro-
	  vides	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, addi-
	  tionally 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	sup-
	  ported by OSF/1.  The	default	sockaddr_ns structure is the
	  4.3BSD structure, which is as	follows:
	  struct sockaddr_ns {
	       u_short	      sns_family;
	       struct ns_addr sns_addr;
	       char	 sns_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_char	      sns_len;
	       u_char	      sns_family;
	       struct ns_addr sns_addr;
	       char	 sns_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_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(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 ker-
	  nel 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)








Acknowledgement and Disclaimer