BSD 4_3_Tahoe development
[unix-history] / usr / man / cat4 / inet.0
INET(4F) UNIX Programmer's Manual INET(4F)
N\bNA\bAM\bME\bE
inet - Internet protocol family
S\bSY\bYN\bNO\bOP\bPS\bSI\bIS\bS
#\b#i\bin\bnc\bcl\blu\bud\bde\be <\b<s\bsy\bys\bs/\b/t\bty\byp\bpe\bes\bs.\b.h\bh>\b>
#\b#i\bin\bnc\bcl\blu\bud\bde\be <\b<n\bne\bet\bti\bin\bne\bet\bt/\b/i\bin\bn.\b.h\bh>\b>
D\bDE\bES\bSC\bCR\bRI\bIP\bPT\bTI\bIO\bON\bN
The Internet protocol family is a collection of protocols
layered atop the _\bI_\bn_\bt_\be_\br_\bn_\be_\bt _\bP_\br_\bo_\bt_\bo_\bc_\bo_\bl (IP) transport layer, and
utilizing the Internet address format. The Internet family
provides protocol support for the SOCK_STREAM, SOCK_DGRAM,
and SOCK_RAW socket types; the SOCK_RAW interface provides
access to the IP protocol.
A\bAD\bDD\bDR\bRE\bES\bSS\bSI\bIN\bNG\bG
Internet addresses are four byte quantities, stored in net-
work standard format (on the VAX these are word and byte
reversed). The include file <_\bn_\be_\bt_\bi_\bn_\be_\bt/_\bi_\bn._\bh> defines this
address as a discriminated union.
Sockets bound to the Internet protocol family utilize the
following addressing structure,
struct sockaddr_in {
short sin_family;
u_short sin_port;
struct in_addr sin_addr;
char sin_zero[8];
};
Sockets may be created with the local address INADDR_ANY to
effect "wildcard" matching on incoming messages. The address
in a _\bc_\bo_\bn_\bn_\be_\bc_\bt(2) or _\bs_\be_\bn_\bd_\bt_\bo(2) call may be given as INADDR_ANY
to mean ``this host.'' The distinguished address
INADDR_BROADCAST is allowed as a shorthand for the broadcast
address on the primary network if the first network config-
ured supports broadcast.
P\bPR\bRO\bOT\bTO\bOC\bCO\bOL\bLS\bS
The Internet protocol family is comprised of the IP tran-
sport protocol, Internet Control Message Protocol (ICMP),
Transmission Control Protocol (TCP), and User Datagram Pro-
tocol (UDP). TCP is used to support the SOCK_STREAM
abstraction while UDP is used to support the SOCK_DGRAM
abstraction. A raw interface to IP is available by creating
an Internet socket of type SOCK_RAW. The ICMP message pro-
tocol is accessible from a raw socket.
The 32-bit Internet address contains both network and host
parts. It is frequency-encoded; the most-significant bit is
clear in Class A addresses, in which the high-order 8 bits
Printed 7/9/88 June 1, 1986 1
INET(4F) UNIX Programmer's Manual INET(4F)
are the network number. Class B addresses use the high-
order 16 bits as the network field, and Class C addresses
have a 24-bit network part. Sites with a cluster of local
networks and a connection to the DARPA Internet may chose to
use a single network number for the cluster; this is done by
using subnet addressing. The local (host) portion of the
address is further subdivided into subnet and host parts.
Within a subnet, each subnet appears to be an individual
network; externally, the entire cluster appears to be a sin-
gle, uniform network requiring only a single routing entry.
Subnet addressing is enabled and examined by the following
_\bi_\bo_\bc_\bt_\bl(2) commands on a datagram socket in the Internet
domain; they have the same form as the SIOCIFADDR command
(see _\bi_\bn_\bt_\br_\bo(4N)).
SIOCSIFNETMASK Set interface network mask. The network
mask defines the network part of the
address; if it contains more of the
address than the address type would
indicate, then subnets are in use.
SIOCGIFNETMASK Get interface network mask.
S\bSE\bEE\bE A\bAL\bLS\bSO\bO
ioctl(2), socket(2), intro(4N), tcp(4P), udp(4P), ip(4P),
icmp(4P)
An Introductory 4.3BSD Interprocess Communication Tutorial
(PS1:7).
An Advanced 4.3BSD Interprocess Communication Tutorial
(PS1:8).
C\bCA\bAV\bVE\bEA\bAT\bT
The Internet protocol support is subject to change as the
Internet protocols develop. Users should not depend on
details of the current implementation, but rather the ser-
vices exported.
Printed 7/9/88 June 1, 1986 2