1*47675Scael.\" Copyright (c) 1985, 1991 The Regents of the University of California. 236752Sbostic.\" All rights reserved. 324105Ssklower.\" 443581Strent.\" %sccs.include.redist.man% 524105Ssklower.\" 6*47675Scael.\" @(#)ns.4 1.6 (Berkeley) 03/28/91 736752Sbostic.\" 8*47675Scael.Dd 9*47675Scael.Dt NS 4 10*47675Scael.Os BSD 4.3 11*47675Scael.Sh NAME 12*47675Scael.Nm ns 13*47675Scael.Nd Xerox Network Systems(tm) protocol family 14*47675Scael.Sh SYNOPSIS 15*47675Scael.Nm options NS 16*47675Scael.Nm options NSIP 17*47675Scael.Nm pseudo-device ns 18*47675Scael.Sh DESCRIPTION 19*47675ScaelThe 20*47675Scael.Tn NS 21*47675Scaelprotocol family is a collection of protocols 2224105Ssklowerlayered atop the 23*47675Scael.Em Internet Datagram Protocol 24*47675Scael.Pq Tn IDP 25*47675Scaeltransport layer, and using the Xerox 26*47675Scael.Tn NS 27*47675Scaeladdress formats. 28*47675ScaelThe 29*47675Scael.Tn NS 30*47675Scaelfamily provides protocol support for the 31*47675Scael.Dv SOCK_STREAM , SOCK_DGRAM , SOCK_SEQPACKET , 32*47675Scaeland 33*47675Scael.Dv SOCK_RAW 34*47675Scaelsocket types; the 35*47675Scael.Dv SOCK_RAW 36*47675Scaelinterface is a debugging tool, allowing you to trace all packets 3724105Ssklowerentering, (or with toggling kernel variable, additionally leaving) the local 3824105Ssklowerhost. 39*47675Scael.Sh ADDRESSING 40*47675Scael.Tn NS 41*47675Scaeladdresses are 12 byte quantities, consisting of a 4224105Ssklower4 byte Network number, a 6 byte Host number and a 2 byte port number, 4324105Ssklowerall stored in network standard format. 44*47675Scael(on the 45*47675Scael.Tn VAX 46*47675Scaelthese are word and byte reversed; on the 47*47675Scael.Tn Sun 48*47675Scaelthey are not 4924105Ssklowerreversed). The include file 50*47675Scael.Aq Pa netns/ns.h 51*47675Scaeldefines the 52*47675Scael.Tn NS 53*47675Scaeladdress as a structure containing unions (for quicker 5424105Ssklowercomparisons). 55*47675Scael.Pp 5624105SsklowerSockets in the Internet protocol family use the following 5724105Sskloweraddressing structure: 58*47675Scael.Bd -literal -offset indent 5924105Ssklowerstruct sockaddr_ns { 6024105Ssklower short sns_family; 6124105Ssklower struct ns_addr sns_addr; 6224105Ssklower char sns_zero[2]; 6324105Ssklower}; 64*47675Scael.Ed 65*47675Scael.Pp 66*47675Scaelwhere an 67*47675Scael.Ar ns_addr 68*47675Scaelis composed as follows: 69*47675Scael.Bd -literal -offset indent 7024105Ssklowerunion ns_host { 7124105Ssklower u_char c_host[6]; 7224105Ssklower u_short s_host[3]; 7324105Ssklower}; 7424105Ssklower 7524105Ssklowerunion ns_net { 7624105Ssklower u_char c_net[4]; 7724105Ssklower u_short s_net[2]; 7824105Ssklower}; 7924105Ssklower 8024105Ssklowerstruct ns_addr { 8124105Ssklower union ns_net x_net; 8224105Ssklower union ns_host x_host; 8324105Ssklower u_short x_port; 8424105Ssklower}; 85*47675Scael.Ed 86*47675Scael.Pp 8724105SsklowerSockets may be created with an address of all zeroes to effect 88*47675Scael.Dq wildcard 89*47675Scaelmatching on incoming messages. 9024105SsklowerThe local port address specified in a 91*47675Scael.Xr bind 2 92*47675Scaelcall is restricted to be greater than 93*47675Scael.Dv NSPORT_RESERVED 94*47675Scael(=3000, in 95*47675Scael.Aq Pa netns/ns.h ) 96*47675Scaelunless the creating process is running 9724105Sskloweras the super-user, providing a space of protected port numbers. 98*47675Scael.Sh PROTOCOLS 99*47675ScaelThe 100*47675Scael.Tn NS 101*47675Scaelprotocol family supported by the operating system 10224105Sskloweris comprised of 103*47675Scaelthe Internet Datagram Protocol 104*47675Scael.Pq Tn IDP 105*47675Scael.Xr idp 4 , 106*47675ScaelError Protocol (available through 107*47675Scael.Tn IDP ) , 10824105Ssklowerand 109*47675ScaelSequenced Packet Protocol 110*47675Scael.Pq Tn SPP 111*47675Scael.Xr spp 4 . 112*47675Scael.Pp 113*47675Scael.Tn SPP 114*47675Scaelis used to support the 115*47675Scael.Dv SOCK_STREAM 116*47675Scaeland 117*47675Scael.Dv SOCK_SEQPACKET 118*47675Scaelabstraction, 119*47675Scaelwhile 120*47675Scael.Tn IDP 121*47675Scaelis used to support the 122*47675Scael.Dv SOCK_DGRAM 123*47675Scaelabstraction. 12424105SsklowerThe Error protocol is responded to by the kernel 12524105Ssklowerto handle and report errors in protocol processing; 12624105Ssklowerit is, however, 12724105Sskloweronly accessible to user programs through heroic actions. 128*47675Scael.Sh SEE ALSO 129*47675Scael.Xr intro 3 , 130*47675Scael.Xr byteorder 3 , 131*47675Scael.Xr gethostbyname 3 , 132*47675Scael.Xr getnetent 3 , 133*47675Scael.Xr getprotoent 3 , 134*47675Scael.Xr getservent 3 , 135*47675Scael.Xr ns 3 , 136*47675Scael.Xr intro 4 , 137*47675Scael.Xr spp 4 , 138*47675Scael.Xr idp 4 , 139*47675Scael.Xr nsip 4 140*47675Scael.Rs 141*47675Scael.%T "Internet Transport Protocols" 142*47675Scael.%R Xerox Corporation document XSIS 143*47675Scael.%N 028112 144*47675Scael.Re 145*47675Scael.Rs 146*47675Scael.%T "An Advanced 4.3 BSD Interprocess Communication Tutorial" 147*47675Scael.Re 148*47675Scael.Sh HISTORY 149*47675ScaelThe 150*47675Scael.Nm 151*47675Scaelprotocol family 152*47675Scaelappeared in 153*47675Scael.Bx 4.3 . 154