xref: /original-bsd/share/man/man4/ns.4 (revision c3e32dec)
1.\" Copyright (c) 1985, 1991, 1993
2.\"	The Regents of the University of California.  All rights reserved.
3.\"
4.\" %sccs.include.redist.man%
5.\"
6.\"     @(#)ns.4	8.1 (Berkeley) 06/05/93
7.\"
8.Dd
9.Dt NS 4
10.Os BSD 4.3
11.Sh NAME
12.Nm ns
13.Nd Xerox Network Systems(tm) protocol family
14.Sh SYNOPSIS
15.Nm options NS
16.Nm options NSIP
17.Nm pseudo-device ns
18.Sh DESCRIPTION
19The
20.Tn NS
21protocol family is a collection of protocols
22layered atop the
23.Em Internet  Datagram  Protocol
24.Pq Tn IDP
25transport layer, and using the Xerox
26.Tn NS
27address formats.
28The
29.Tn NS
30family provides protocol support for the
31.Dv SOCK_STREAM , SOCK_DGRAM , SOCK_SEQPACKET ,
32and
33.Dv SOCK_RAW
34socket types; the
35.Dv SOCK_RAW
36interface is a debugging tool, allowing you to trace all packets
37entering, (or with toggling kernel variable, additionally leaving) the local
38host.
39.Sh ADDRESSING
40.Tn NS
41addresses are 12 byte quantities, consisting of a
424 byte Network number, a 6 byte Host number and a 2 byte port number,
43all stored in network standard format.
44(on the
45.Tn VAX
46these are word and byte reversed; on the
47.Tn Sun
48they are not
49reversed).  The include file
50.Aq Pa netns/ns.h
51defines the
52.Tn NS
53address as a structure containing unions (for quicker
54comparisons).
55.Pp
56Sockets in the Internet protocol family use the following
57addressing structure:
58.Bd -literal -offset indent
59struct sockaddr_ns {
60	short		sns_family;
61	struct ns_addr	sns_addr;
62	char		sns_zero[2];
63};
64.Ed
65.Pp
66where an
67.Ar ns_addr
68is composed as follows:
69.Bd -literal -offset indent
70union ns_host {
71	u_char		c_host[6];
72	u_short		s_host[3];
73};
74
75union ns_net {
76	u_char		c_net[4];
77	u_short		s_net[2];
78};
79
80struct ns_addr {
81	union ns_net	x_net;
82	union ns_host	x_host;
83	u_short	x_port;
84};
85.Ed
86.Pp
87Sockets may be created with an address of all zeroes to effect
88.Dq wildcard
89matching on incoming messages.
90The local port address specified in a
91.Xr bind 2
92call is restricted to be greater than
93.Dv NSPORT_RESERVED
94(=3000, in
95.Aq Pa netns/ns.h )
96unless the creating process is running
97as the super-user, providing a space of protected port numbers.
98.Sh PROTOCOLS
99The
100.Tn NS
101protocol family supported by the operating system
102is comprised of
103the Internet Datagram Protocol
104.Pq Tn IDP
105.Xr idp 4 ,
106Error Protocol (available through
107.Tn IDP ) ,
108and
109Sequenced Packet Protocol
110.Pq Tn SPP
111.Xr spp 4 .
112.Pp
113.Tn SPP
114is used to support the
115.Dv SOCK_STREAM
116and
117.Dv SOCK_SEQPACKET
118abstraction,
119while
120.Tn IDP
121is used to support the
122.Dv SOCK_DGRAM
123abstraction.
124The Error protocol is responded to by the kernel
125to handle and report errors in protocol processing;
126it is, however,
127only accessible to user programs through heroic actions.
128.Sh SEE ALSO
129.Xr intro 3 ,
130.Xr byteorder 3 ,
131.Xr gethostbyname 3 ,
132.Xr getnetent 3 ,
133.Xr getprotoent 3 ,
134.Xr getservent 3 ,
135.Xr ns 3 ,
136.Xr intro 4 ,
137.Xr spp 4 ,
138.Xr idp 4 ,
139.Xr nsip 4
140.Rs
141.%T "Internet Transport Protocols"
142.%R Xerox Corporation document XSIS
143.%N 028112
144.Re
145.Rs
146.%T "An Advanced 4.3 BSD Interprocess Communication Tutorial"
147.Re
148.Sh HISTORY
149The
150.Nm
151protocol family
152appeared in
153.Bx 4.3 .
154