1 .\" Copyright (c) 1983, 1991, 1993
2 .\" The Regents of the University of California. All rights reserved.
4 .\" Redistribution and use in source and binary forms, with or without
5 .\" modification, are permitted provided that the following conditions
7 .\" 1. Redistributions of source code must retain the above copyright
8 .\" notice, this list of conditions and the following disclaimer.
9 .\" 2. Redistributions in binary form must reproduce the above copyright
10 .\" notice, this list of conditions and the following disclaimer in the
11 .\" documentation and/or other materials provided with the distribution.
12 .\" 3. All advertising materials mentioning features or use of this software
13 .\" must display the following acknowledgement:
14 .\" This product includes software developed by the University of
15 .\" California, Berkeley and its contributors.
16 .\" 4. Neither the name of the University nor the names of its contributors
17 .\" may be used to endorse or promote products derived from this software
18 .\" without specific prior written permission.
20 .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
21 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23 .\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
24 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
26 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
27 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
29 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
32 .\" From: @(#)inet.4 8.1 (Berkeley) 6/5/93
40 .Nd Internet protocol family
45 The Internet protocol family is a collection of protocols
49 transport layer, and utilizing the Internet address format.
50 The Internet family provides protocol support for the
51 .Dv SOCK_STREAM , SOCK_DGRAM ,
56 interface provides access to the
60 Internet addresses are four byte quantities, stored in
61 network standard format (on little endian machines, such as the
67 these are word and byte reversed).
71 as a discriminated union.
73 Sockets bound to the Internet protocol family utilize
74 the following addressing structure,
75 .Bd -literal -offset indent
78 sa_family_t sin_family;
80 struct in_addr sin_addr;
85 Sockets may be created with the local address
89 matching on incoming messages.
98 The distinguished address
100 is allowed as a shorthand for the broadcast address on the primary
101 network if the first network configured supports broadcast.
103 The Internet protocol family is comprised of
106 network protocol, Internet Control
109 Internet Group Management Protocol
114 and User Datagram Protocol
117 is used to support the
121 is used to support the
127 by creating an Internet socket of type
131 message protocol is accessible from a raw socket.
133 The 32-bit Internet address contains both network and host parts.
134 However, direct examination of addresses is discouraged.
136 programs which absolutely need to break addresses into their component
139 commands are provided for a datagram socket in the Internet domain;
140 they have the same form as the
145 .Bl -tag -width SIOCSIFNETMASK
146 .It Dv SIOCSIFNETMASK
147 Set interface network mask.
148 The network mask defines the network part of the address;
149 if it contains more of the address than the address type would indicate,
150 then subnets are in use.
151 .It Dv SIOCGIFNETMASK
152 Get interface network mask.
155 A number of variables are implemented in the net.inet branch of the
158 In addition to the variables supported by the transport protocols
159 (for which the respective manual pages may be consulted),
160 the following general variables are defined:
161 .Bl -tag -width IPCTL_FASTFORWARDING
162 .It Dv IPCTL_FORWARDING
164 Boolean: enable/disable forwarding of IP packets.
166 .It Dv IPCTL_FASTFORWARDING
167 .Pq ip.fastforwarding
168 Boolean: enable/disable the use of
169 .Tn fast IP forwarding
173 .Tn fast IP forwarding
174 is enabled, IP packets are forwarded directly to the appropriate network
175 interface with direct processing to completion, which greatly improves
177 All packets for local IP addresses, non-unicast, or with IP options are
178 handled by the normal IP input processing path.
179 All features of the normal (slow) IP forwarding path are supported
180 including firewall (through
182 hooks) checking, except
186 .Tn IP fastforwarding
187 path does not generate ICMP redirect or source quench messages.
188 .It Dv IPCTL_SENDREDIRECTS
190 Boolean: enable/disable sending of ICMP redirects in response to
192 packets for which a better, and for the sender directly reachable, route
193 and next hop is known.
197 Integer: default time-to-live
202 .It Dv IPCTL_ACCEPTSOURCEROUTE
203 .Pq ip.accept_sourceroute
204 Boolean: enable/disable accepting of source-routed IP packets (default false).
205 .It Dv IPCTL_SOURCEROUTE
207 Boolean: enable/disable forwarding of source-routed IP packets (default false).
208 .It Dv IPCTL_RTEXPIRE
210 Integer: lifetime in seconds of protocol-cloned
212 routes after the last reference drops (default one hour).
213 This value varies dynamically as described above.
214 .It Dv IPCTL_RTMINEXPIRE
216 Integer: minimum value of ip.rtexpire (default ten seconds).
217 This value has no effect on user modifications, but restricts the dynamic
218 adaptation described above.
219 .It Dv IPCTL_RTMAXCACHE
221 Integer: trigger level of cached, unreferenced, protocol-cloned routes
222 which initiates dynamic adaptation (default 128).
223 .It Va ip.process_options
224 Integer: control IP options processing.
225 By setting this variable to 0, all IP options in the incoming packets
226 will be ignored, and the packets will be passed unmodified.
227 By setting to 1, IP options in the incoming packets will be processed
231 .Dq "prohibited by filter"
232 message will be sent back in response to incoming packets with IP options.
236 variable affects packets destined for a local host as well as packets
237 forwarded to some other host.
239 Boolean: control IP IDs generation behaviour.
242 to non-zero causes the ID field in IP packets to be randomized instead of
243 incremented by 1 with each packet generated.
244 This closes a minor information leak which allows remote observers to
245 determine the rate of packet generation on the machine by watching the
247 In the same time, on high-speed links, it can decrease the ID reuse
249 Default is 0 (sequential IP IDs).
250 IPv6 flow IDs and fragment IDs are always random.
251 .It Va ip.maxfragpackets
252 Integer: maximum number of fragmented packets the host will accept and hold
253 in the reassembling queue simultaneously.
254 0 means that the host will not accept any fragmented packets.
255 \-1 means that the host will accept as many fragmented packets as it receives.
256 .It Va ip.maxfragsperpacket
257 Integer: maximum number of fragments the host will accept and hold
258 in the reassembling queue for a packet.
259 0 means that the host will not accept any fragmented packets.
274 .%T "An Introductory 4.3 BSD Interprocess Communication Tutorial"
279 .%T "An Advanced 4.3 BSD Interprocess Communication Tutorial"
284 The Internet protocol support is subject to change as
285 the Internet protocols develop.
286 Users should not depend
287 on details of the current implementation, but rather
288 the services exported.
292 protocol interface appeared in