161599Sbostic.\" Copyright (c) 1985, 1991, 1993 261599Sbostic.\" The Regents of the University of California. All rights reserved. 324105Ssklower.\" 443581Strent.\" %sccs.include.redist.man% 524105Ssklower.\" 6*64994Smckusick.\" @(#)ns.4 8.2 (Berkeley) 11/30/93 736752Sbostic.\" 847675Scael.Dd 947675Scael.Dt NS 4 1047675Scael.Os BSD 4.3 1147675Scael.Sh NAME 1247675Scael.Nm ns 1347675Scael.Nd Xerox Network Systems(tm) protocol family 1447675Scael.Sh SYNOPSIS 1547675Scael.Nm options NS 1647675Scael.Nm options NSIP 1747675Scael.Nm pseudo-device ns 1847675Scael.Sh DESCRIPTION 1947675ScaelThe 2047675Scael.Tn NS 2147675Scaelprotocol family is a collection of protocols 2224105Ssklowerlayered atop the 2347675Scael.Em Internet Datagram Protocol 2447675Scael.Pq Tn IDP 2547675Scaeltransport layer, and using the Xerox 2647675Scael.Tn NS 2747675Scaeladdress formats. 2847675ScaelThe 2947675Scael.Tn NS 3047675Scaelfamily provides protocol support for the 3147675Scael.Dv SOCK_STREAM , SOCK_DGRAM , SOCK_SEQPACKET , 3247675Scaeland 3347675Scael.Dv SOCK_RAW 3447675Scaelsocket types; the 3547675Scael.Dv SOCK_RAW 3647675Scaelinterface is a debugging tool, allowing you to trace all packets 3724105Ssklowerentering, (or with toggling kernel variable, additionally leaving) the local 3824105Ssklowerhost. 3947675Scael.Sh ADDRESSING 4047675Scael.Tn NS 4147675Scaeladdresses 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. 4447675Scael(on the 4547675Scael.Tn VAX 4647675Scaelthese are word and byte reversed; on the 47*64994Smckusick.Tn SUN 4847675Scaelthey are not 4924105Ssklowerreversed). The include file 5047675Scael.Aq Pa netns/ns.h 5147675Scaeldefines the 5247675Scael.Tn NS 5347675Scaeladdress as a structure containing unions (for quicker 5424105Ssklowercomparisons). 5547675Scael.Pp 5624105SsklowerSockets in the Internet protocol family use the following 5724105Sskloweraddressing structure: 5847675Scael.Bd -literal -offset indent 5924105Ssklowerstruct sockaddr_ns { 6024105Ssklower short sns_family; 6124105Ssklower struct ns_addr sns_addr; 6224105Ssklower char sns_zero[2]; 6324105Ssklower}; 6447675Scael.Ed 6547675Scael.Pp 6647675Scaelwhere an 6747675Scael.Ar ns_addr 6847675Scaelis composed as follows: 6947675Scael.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}; 8547675Scael.Ed 8647675Scael.Pp 8724105SsklowerSockets may be created with an address of all zeroes to effect 8847675Scael.Dq wildcard 8947675Scaelmatching on incoming messages. 9024105SsklowerThe local port address specified in a 9147675Scael.Xr bind 2 9247675Scaelcall is restricted to be greater than 9347675Scael.Dv NSPORT_RESERVED 9447675Scael(=3000, in 9547675Scael.Aq Pa netns/ns.h ) 9647675Scaelunless the creating process is running 9724105Sskloweras the super-user, providing a space of protected port numbers. 9847675Scael.Sh PROTOCOLS 9947675ScaelThe 10047675Scael.Tn NS 10147675Scaelprotocol family supported by the operating system 10224105Sskloweris comprised of 10347675Scaelthe Internet Datagram Protocol 10447675Scael.Pq Tn IDP 10547675Scael.Xr idp 4 , 10647675ScaelError Protocol (available through 10747675Scael.Tn IDP ) , 10824105Ssklowerand 10947675ScaelSequenced Packet Protocol 11047675Scael.Pq Tn SPP 11147675Scael.Xr spp 4 . 11247675Scael.Pp 11347675Scael.Tn SPP 11447675Scaelis used to support the 11547675Scael.Dv SOCK_STREAM 11647675Scaeland 11747675Scael.Dv SOCK_SEQPACKET 11847675Scaelabstraction, 11947675Scaelwhile 12047675Scael.Tn IDP 12147675Scaelis used to support the 12247675Scael.Dv SOCK_DGRAM 12347675Scaelabstraction. 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. 12847675Scael.Sh SEE ALSO 12947675Scael.Xr intro 3 , 13047675Scael.Xr byteorder 3 , 13147675Scael.Xr gethostbyname 3 , 13247675Scael.Xr getnetent 3 , 13347675Scael.Xr getprotoent 3 , 13447675Scael.Xr getservent 3 , 13547675Scael.Xr ns 3 , 13647675Scael.Xr intro 4 , 13747675Scael.Xr spp 4 , 13847675Scael.Xr idp 4 , 13947675Scael.Xr nsip 4 14047675Scael.Rs 14147675Scael.%T "Internet Transport Protocols" 14247675Scael.%R Xerox Corporation document XSIS 14347675Scael.%N 028112 14447675Scael.Re 14547675Scael.Rs 14647675Scael.%T "An Advanced 4.3 BSD Interprocess Communication Tutorial" 14747675Scael.Re 14847675Scael.Sh HISTORY 14947675ScaelThe 15047675Scael.Nm 15147675Scaelprotocol family 15247675Scaelappeared in 15347675Scael.Bx 4.3 . 154